From: Peter Munch Date: Thu, 3 Feb 2022 10:22:16 +0000 (+0100) Subject: Add MatrixFree::initialize_cell_data_vector() and ::initialize_face_data_vector() X-Git-Tag: v9.4.0-rc1~526^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F13328%2Fhead;p=dealii.git Add MatrixFree::initialize_cell_data_vector() and ::initialize_face_data_vector() --- diff --git a/include/deal.II/matrix_free/matrix_free.h b/include/deal.II/matrix_free/matrix_free.h index c51f2c1901..c1b0474ff0 100644 --- a/include/deal.II/matrix_free/matrix_free.h +++ b/include/deal.II/matrix_free/matrix_free.h @@ -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 + void + initialize_cell_data_vector(AlignedVector &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 + void + initialize_face_data_vector(AlignedVector &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 +template +inline void +MatrixFree::initialize_cell_data_vector( + AlignedVector &vec) const +{ + vec.resize(this->n_cell_batches() + this->n_ghost_cell_batches()); +} + + + +template +template +inline void +MatrixFree::initialize_face_data_vector( + AlignedVector &vec) const +{ + vec.resize(this->n_inner_face_batches() + this->n_boundary_face_batches() + + this->n_ghost_inner_face_batches()); +} + + + template template inline void