libMesh
Loading...
Searching...
No Matches
quadrature_composite.h
Go to the documentation of this file.
1// The libMesh Finite Element Library.
2// Copyright (C) 2002-2026 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3
4// This library is free software; you can redistribute it and/or
5// modify it under the terms of the GNU Lesser General Public
6// License as published by the Free Software Foundation; either
7// version 2.1 of the License, or (at your option) any later version.
8
9// This library is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12// Lesser General Public License for more details.
13
14// You should have received a copy of the GNU Lesser General Public
15// License along with this library; if not, write to the Free Software
16// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
18
19
20#ifndef LIBMESH_QUADRATURE_COMPOSITE_H
21#define LIBMESH_QUADRATURE_COMPOSITE_H
22
23#include "libmesh/libmesh_config.h"
24
25#if defined(LIBMESH_HAVE_TRIANGLE) && defined(LIBMESH_HAVE_TETGEN)
26
27// Local includes
28#include "libmesh/quadrature.h"
29#include "libmesh/elem_cutter.h"
30#include "libmesh/fe_base.h"
31
32// C++ includes
33#include <memory>
34
35namespace libMesh
36{
37
50template <class QSubCell>
51class QComposite final : public QSubCell
52{
53public:
54
58 using QSubCell::_dim;
59 using QSubCell::_points;
60 using QSubCell::_weights;
61 using QSubCell::init;
62
66 QComposite (unsigned int dim,
67 Order order=INVALID_ORDER);
68
73 QComposite (const QComposite &) = delete;
74 QComposite & operator= (const QComposite &) = delete;
75
80 QComposite (QComposite &&) = default;
82 virtual ~QComposite() = default;
83
87 virtual QuadratureType type() const override;
88
93 virtual void init (const Elem & elem,
94 const std::vector<Real> & vertex_distance_func,
95 unsigned int p_level=0) override;
96
97private:
98
103 void add_subelem_values (const std::vector<Elem const *> & subelem);
104
108 QSubCell _q_subcell;
109
114
118 std::unique_ptr<FEBase> _lagrange_fe;
119};
120
121} // namespace libMesh
122
123#endif // LIBMESH_HAVE_TRIANGLE && LIBMESH_HAVE_TETGEN
124#endif // LIBMESH_QUADRATURE_COMPOSITE_H
unsigned int dim
This class implements cutting a single element into a collection of subelements.
Definition elem_cutter.h:62
This is the base class from which all geometric element types are derived.
Definition elem.h:96
This class implements generic composite quadrature rules.
QSubCell _q_subcell
Subcell quadrature object.
QComposite(QComposite &&)=default
Copy/move ctor, copy/move assignment operator, and destructor are all explicitly defaulted for this s...
virtual ~QComposite()=default
ElemCutter _elem_cutter
ElemCutter object.
virtual QuadratureType type() const override
void add_subelem_values(const std::vector< Elem const * > &subelem)
Helper function called from init() to collect all the points and weights of the subelement quadrature...
QComposite & operator=(const QComposite &)=delete
std::unique_ptr< FEBase > _lagrange_fe
Lagrange FE to use for subcell mapping.
virtual void init(const Elem &elem, const std::vector< Real > &vertex_distance_func, unsigned int p_level=0) override
Overrides the base class init() function, and uses the ElemCutter to subdivide the element into "insi...
QComposite(const QComposite &)=delete
This class contains a unique_ptr member, so it can't be default copy constructed or assigned.
The libMesh namespace provides an interface to certain functionality in the library.
QuadratureType
Defines an enum for currently available quadrature rules.
@ INVALID_ORDER
Definition enum_order.h:88