From daf8bbc987881f83d7d194224bef6077091a8fd6 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Sun, 24 Feb 2019 11:28:20 +0100 Subject: [PATCH] Fix vector_access --- include/deal.II/matrix_free/fe_evaluation.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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