From: Daniel Arndt Date: Sun, 24 Feb 2019 10:28:20 +0000 (+0100) Subject: Fix vector_access X-Git-Tag: v9.1.0-rc1~323^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=daf8bbc987881f83d7d194224bef6077091a8fd6;p=dealii.git Fix vector_access --- diff --git a/include/deal.II/matrix_free/fe_evaluation.h b/include/deal.II/matrix_free/fe_evaluation.h index f8b4975bf9..7bdd4e15a6 100644 --- a/include/deal.II/matrix_free/fe_evaluation.h +++ b/include/deal.II/matrix_free/fe_evaluation.h @@ -3471,6 +3471,7 @@ namespace internal }; + // type trait for vector T and Number to see if // we can do vectorized load/save. // for VectorReader and VectorDistributorLocalToGlobal we assume that @@ -3487,7 +3488,21 @@ namespace internal - // access to generic vectors that have operator (). + // access to generic const vectors that have operator (). + // FIXME: this is wrong for Trilinos/Petsc MPI vectors + // where we should first do Partitioner::local_to_global() + template ::value, + VectorType>::type * = nullptr> + inline typename VectorType::value_type + vector_access(const VectorType &vec, const unsigned int entry) + { + return vec(entry); + } + + + + // access to generic non-const vectors that have operator (). // FIXME: this is wrong for Trilinos/Petsc MPI vectors // where we should first do Partitioner::local_to_global() template