]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add MatrixFree::initialize_cell_data_vector() and ::initialize_face_data_vector() 13328/head
authorPeter Munch <peterrmuench@gmail.com>
Thu, 3 Feb 2022 10:22:16 +0000 (11:22 +0100)
committerPeter Munch <peterrmuench@gmail.com>
Thu, 3 Feb 2022 10:25:52 +0000 (11:25 +0100)
include/deal.II/matrix_free/matrix_free.h

index c51f2c190104e5578a5be3ab94583701adfa289a..c1b0474ff0bb9e12ae414b15395f29c791b1d7a6 100644 (file)
@@ -1505,6 +1505,24 @@ public:
    * @name 3: Initialization of vectors
    */
   //@{
+  /**
+   * Initialize function for a vector with each entry associated with a cell
+   * batch (cell data). For reading and writing the vector use:
+   * FEEvaluationBase::read_cell_data() and FEEvaluationBase::write_cell_data().
+   */
+  template <typename T>
+  void
+  initialize_cell_data_vector(AlignedVector<T> &vec) const;
+
+  /**
+   * Initialize function for a vector with each entry associated with a face
+   * batch (face data). For reading and writing the vector use:
+   * FEEvaluationBase::read_face_data() and FEEvaluationBase::write_face_data().
+   */
+  template <typename T>
+  void
+  initialize_face_data_vector(AlignedVector<T> &vec) const;
+
   /**
    * Initialize function for a general vector. The length of the vector is
    * equal to the total number of degrees in the DoFHandler. If the vector is
@@ -2204,6 +2222,29 @@ private:
 
 
 
+template <int dim, typename Number, typename VectorizedArrayType>
+template <typename T>
+inline void
+MatrixFree<dim, Number, VectorizedArrayType>::initialize_cell_data_vector(
+  AlignedVector<T> &vec) const
+{
+  vec.resize(this->n_cell_batches() + this->n_ghost_cell_batches());
+}
+
+
+
+template <int dim, typename Number, typename VectorizedArrayType>
+template <typename T>
+inline void
+MatrixFree<dim, Number, VectorizedArrayType>::initialize_face_data_vector(
+  AlignedVector<T> &vec) const
+{
+  vec.resize(this->n_inner_face_batches() + this->n_boundary_face_batches() +
+             this->n_ghost_inner_face_batches());
+}
+
+
+
 template <int dim, typename Number, typename VectorizedArrayType>
 template <typename VectorType>
 inline void

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.