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

Extend ScratchData's public interface with getter methods to access private data #13161

Merged
merged 1 commit into from
Jan 1, 2022
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions doc/news/changes/minor/20211231Jean-PaulPelteret
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
New: More "getter" functions have been added to MeshWorker::ScratchData,
facilitating the construction of other FEValues-type objects with some of
the same objects as those used in a ScratchData instance.
<br>
(Jean-Paul Pelteret, 2021/12/31)
42 changes: 42 additions & 0 deletions include/deal.II/meshworker/scratch_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,48 @@ namespace MeshWorker
const Mapping<dim, spacedim> &
get_mapping() const;

/**
* Return a reference to the selected finite element object.
*/
const FiniteElement<dim, spacedim> &
get_fe() const;

/**
* Return a reference to the cell quadrature object in use.
*/
const Quadrature<dim> &
get_cell_quadrature() const;

/**
* Return a reference to the face quadrature object in use.
*/
const Quadrature<dim - 1> &
get_face_quadrature() const;

/**
* Return the cell update flags set.
*/
UpdateFlags
get_cell_update_flags() const;

/**
* Return the neighbor cell update flags set.
*/
UpdateFlags
get_neighbor_cell_update_flags() const;

/**
* Return the face update flags set.
*/
UpdateFlags
get_face_update_flags() const;

/**
* Return the neighbor face update flags set.
*/
UpdateFlags
get_neighbor_face_update_flags() const;

/**
* @name Evaluation of finite element fields and their derivatives on the current cell
*/
Expand Down
63 changes: 63 additions & 0 deletions source/meshworker/scratch_data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,69 @@ namespace MeshWorker
return *mapping;
}



template <int dim, int spacedim>
const FiniteElement<dim, spacedim> &
ScratchData<dim, spacedim>::get_fe() const
{
return *fe;
}



template <int dim, int spacedim>
const Quadrature<dim> &
ScratchData<dim, spacedim>::get_cell_quadrature() const
{
return cell_quadrature;
}



template <int dim, int spacedim>
const Quadrature<dim - 1> &
ScratchData<dim, spacedim>::get_face_quadrature() const
{
return face_quadrature;
}



template <int dim, int spacedim>
UpdateFlags
ScratchData<dim, spacedim>::get_cell_update_flags() const
{
return cell_update_flags;
}



template <int dim, int spacedim>
UpdateFlags
ScratchData<dim, spacedim>::get_neighbor_cell_update_flags() const
{
return neighbor_cell_update_flags;
}



template <int dim, int spacedim>
UpdateFlags
ScratchData<dim, spacedim>::get_face_update_flags() const
{
return face_update_flags;
}



template <int dim, int spacedim>
UpdateFlags
ScratchData<dim, spacedim>::get_neighbor_face_update_flags() const
{
return neighbor_face_update_flags;
}

} // namespace MeshWorker
DEAL_II_NAMESPACE_CLOSE

Expand Down