Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MatrixFree::initialize_cell_data_vector() #13328

Merged
merged 1 commit into from
Feb 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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