Skip to content

Commit

Permalink
Merge pull request #13161 from jppelteret/scratch_data_05
Browse files Browse the repository at this point in the history
Extend ScratchData's public interface with getter methods to access private data
  • Loading branch information
bangerth committed Jan 1, 2022
2 parents bd89890 + a0c1fcd commit 7d7a097
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 0 deletions.
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

0 comments on commit 7d7a097

Please sign in to comment.