From ab77df0cd5e8112349f3c0d2fe2d273ef520d80b Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 5 Dec 2019 13:05:15 -0700 Subject: [PATCH] Add to FEInterfaceValues what we already have in FEValues. --- include/deal.II/fe/fe_interface_values.h | 37 ++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/include/deal.II/fe/fe_interface_values.h b/include/deal.II/fe/fe_interface_values.h index 6a7cbd524b..f7a7b31225 100644 --- a/include/deal.II/fe/fe_interface_values.h +++ b/include/deal.II/fe/fe_interface_values.h @@ -51,6 +51,12 @@ template class FEInterfaceValues { public: + /** + * Number of quadrature points. + */ + const unsigned int n_quadrature_points; + + /** * Construct the FEInterfaceValues with a single FiniteElement (same on both * sides of the facet). The FEFaceValues objects will be initialized with @@ -162,6 +168,20 @@ public: bool at_boundary() const; + /** + * Mapped quadrature weight. This value equals the + * mapped surface element times the weight of the quadrature + * point. + * + * You can think of the quantity returned by this function as the + * surface element $ds$ in the integral that we implement here by + * quadrature. + * + * @dealiiRequiresUpdateFlags{update_JxW_values} + */ + double + JxW(const unsigned int quadrature_point) const; + /** * Return the vector of JxW values for each quadrature point. * @@ -412,7 +432,8 @@ FEInterfaceValues::FEInterfaceValues( const FiniteElement &fe, const Quadrature & quadrature, const UpdateFlags update_flags) - : internal_fe_face_values(mapping, fe, quadrature, update_flags) + : n_quadrature_points(quadrature.size()) + , internal_fe_face_values(mapping, fe, quadrature, update_flags) , internal_fe_subface_values(mapping, fe, quadrature, update_flags) , internal_fe_face_values_neighbor(mapping, fe, quadrature, update_flags) , internal_fe_subface_values_neighbor(mapping, fe, quadrature, update_flags) @@ -427,7 +448,8 @@ FEInterfaceValues::FEInterfaceValues( const FiniteElement &fe, const Quadrature & quadrature, const UpdateFlags update_flags) - : internal_fe_face_values(StaticMappingQ1::mapping, + : n_quadrature_points(quadrature.size()) + , internal_fe_face_values(StaticMappingQ1::mapping, fe, quadrature, update_flags) @@ -553,6 +575,17 @@ FEInterfaceValues::reinit(const CellIteratorType &cell, +template +inline double +FEInterfaceValues::JxW(const unsigned int q) const +{ + Assert(fe_face_values != nullptr, + ExcMessage("This call requires a call to reinit() first.")); + return fe_face_values->JxW(q); +} + + + template const std::vector & FEInterfaceValues::get_JxW_values() const -- 2.39.5