Skip to content

Commit

Permalink
Merge pull request #13328 from peterrum/initialize_cell_data_vector
Browse files Browse the repository at this point in the history
Add MatrixFree::initialize_cell_data_vector()
  • Loading branch information
kronbichler committed Feb 4, 2022
2 parents 633ccd8 + d45808e commit 1fe7920
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions include/deal.II/matrix_free/matrix_free.h
Original file line number Diff line number Diff line change
Expand Up @@ -1505,6 +1505,24 @@ class MatrixFree : public Subscriptor
* @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
Expand Down Expand Up @@ -2204,6 +2222,29 @@ class MatrixFree : public Subscriptor



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
Expand Down

0 comments on commit 1fe7920

Please sign in to comment.