Dune-Fufem 2.11-git
Loading...
Searching...
No Matches
subentityquadraturerule.hh
Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3
4// SPDX-FileCopyrightText: Copyright © DUNE-FUFEM Project contributors, see file AUTHORS.md
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
6
7#ifndef DUNE_FUFEM_QUADRATURERULES_SUBENTITYQUADRATURERULE_HH
8#define DUNE_FUFEM_QUADRATURERULES_SUBENTITYQUADRATURERULE_HH
9
10#include <dune/geometry/type.hh>
13
14namespace Dune::Fufem {
15
28template <class ct, int dim, int codim>
30 public Dune::QuadratureRule<ct,dim>
31{
33
34public:
35
36 using Base::type;
37
46 : Base(gt),
47 subEntityRule_(&rule)
48 {
49 [[maybe_unused]] auto subEntityGeometryType = Dune::referenceElement<ct,dim>(type()).type(subEntityIndex, codim);
50 assert(subEntityGeometryType == subEntityRule().type());
51 auto subEntityGeometry = Dune::referenceElement<ct,dim>(type()).template geometry<codim>(subEntityIndex);
52 for(auto qp : subEntityRule())
53 this->emplace_back(subEntityGeometry.global(qp.position()), qp.weight());
55 }
56
58 {
59 return *subEntityRule_;
60 }
61
62protected:
64};
65
66
67} // namespace Dune::Fufem
68
69#endif // DUNE_FUFEM_QUADRATURERULES_SUBENTITYQUADRATURERULE_HH
size_type dim() const
Definition dunefunctionsboundaryfunctionalassembler.hh:29
virtual GeometryType type() const
virtual int order() const
Quadrature rule for a subentity of some given geometry type.
Definition subentityquadraturerule.hh:31
const Dune::QuadratureRule< ct, dim-1 > & subEntityRule() const
Definition subentityquadraturerule.hh:57
const Dune::QuadratureRule< ct, dim-1 > * subEntityRule_
Definition subentityquadraturerule.hh:63
SubEntityQuadratureRule(Dune::GeometryType gt, std::size_t subEntityIndex, const Dune::QuadratureRule< ct, dim-codim > &rule)
Create SubEntityQuadratureRule for entity of given GeometryType.
Definition subentityquadraturerule.hh:45