]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix vector_access 7744/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Sun, 24 Feb 2019 10:28:20 +0000 (11:28 +0100)
committerDenis Davydov <davydden@gmail.com>
Mon, 25 Feb 2019 15:52:26 +0000 (16:52 +0100)
include/deal.II/matrix_free/fe_evaluation.h

index f8b4975bf9c631b19e4e775411c768250a698dcf..7bdd4e15a6209c468a257ad6af4e969daaa0baf9 100644 (file)
@@ -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 <typename VectorType,
+            typename std::enable_if<!has_local_element<VectorType>::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 <typename VectorType,

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.