From: Jean-Paul Pelteret Date: Fri, 31 Dec 2021 20:38:48 +0000 (+0100) Subject: Extend ScratchData's public interface with getter methods to access private data X-Git-Tag: v9.4.0-rc1~682^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F13161%2Fhead;p=dealii.git Extend ScratchData's public interface with getter methods to access private data --- diff --git a/doc/news/changes/minor/20211231Jean-PaulPelteret b/doc/news/changes/minor/20211231Jean-PaulPelteret new file mode 100644 index 0000000000..d514710d56 --- /dev/null +++ b/doc/news/changes/minor/20211231Jean-PaulPelteret @@ -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. +
+(Jean-Paul Pelteret, 2021/12/31) diff --git a/include/deal.II/meshworker/scratch_data.h b/include/deal.II/meshworker/scratch_data.h index 43a1726b75..261c4df13b 100644 --- a/include/deal.II/meshworker/scratch_data.h +++ b/include/deal.II/meshworker/scratch_data.h @@ -532,6 +532,48 @@ namespace MeshWorker const Mapping & get_mapping() const; + /** + * Return a reference to the selected finite element object. + */ + const FiniteElement & + get_fe() const; + + /** + * Return a reference to the cell quadrature object in use. + */ + const Quadrature & + get_cell_quadrature() const; + + /** + * Return a reference to the face quadrature object in use. + */ + const Quadrature & + 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 */ diff --git a/source/meshworker/scratch_data.cc b/source/meshworker/scratch_data.cc index b5cf1e7ed2..d8844ad2b8 100644 --- a/source/meshworker/scratch_data.cc +++ b/source/meshworker/scratch_data.cc @@ -403,6 +403,69 @@ namespace MeshWorker return *mapping; } + + + template + const FiniteElement & + ScratchData::get_fe() const + { + return *fe; + } + + + + template + const Quadrature & + ScratchData::get_cell_quadrature() const + { + return cell_quadrature; + } + + + + template + const Quadrature & + ScratchData::get_face_quadrature() const + { + return face_quadrature; + } + + + + template + UpdateFlags + ScratchData::get_cell_update_flags() const + { + return cell_update_flags; + } + + + + template + UpdateFlags + ScratchData::get_neighbor_cell_update_flags() const + { + return neighbor_cell_update_flags; + } + + + + template + UpdateFlags + ScratchData::get_face_update_flags() const + { + return face_update_flags; + } + + + + template + UpdateFlags + ScratchData::get_neighbor_face_update_flags() const + { + return neighbor_face_update_flags; + } + } // namespace MeshWorker DEAL_II_NAMESPACE_CLOSE