quadrature_composite.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2012 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 #include "libmesh/auto_ptr.h" // deprecated
32 
33 // C++ includes
34 #include <memory>
35 
36 namespace libMesh
37 {
38 
51 template <class QSubCell>
52 class QComposite final : public QSubCell
53 {
54 public:
55 
59  using QSubCell::_dim;
60  using QSubCell::_points;
61  using QSubCell::_weights;
62  using QSubCell::init;
63 
67  QComposite (unsigned int dim,
68  Order order=INVALID_ORDER);
69 
74  QComposite (const QComposite &) = delete;
75  QComposite & operator= (const QComposite &) = delete;
76 
81  QComposite (QComposite &&) = default;
82  QComposite & operator= (QComposite &&) = default;
83  virtual ~QComposite() = default;
84 
88  virtual QuadratureType type() const override;
89 
94  virtual void init (const Elem & elem,
95  const std::vector<Real> & vertex_distance_func,
96  unsigned int p_level=0) override;
97 
98 private:
99 
104  void add_subelem_values (const std::vector<Elem const *> & subelem);
105 
109  QSubCell _q_subcell;
110 
115 
119  std::unique_ptr<FEBase> _lagrange_fe;
120 };
121 
122 } // namespace libMesh
123 
124 #endif // LIBMESH_HAVE_TRIANGLE && LIBMESH_HAVE_TETGEN
125 #endif // LIBMESH_QUADRATURE_COMPOSITE_H
The base class for all geometric element types.
Definition: elem.h:100
QComposite(unsigned int dim, Order order=INVALID_ORDER)
virtual void init(const Elem &elem, const std::vector< Real > &vertex_distance_func, unsigned int p_level=0) override
virtual ~QComposite()=default
Subdivides a single element using a mesh generator.
Definition: elem_cutter.h:60
QComposite & operator=(const QComposite &)=delete
void init(triangulateio &t)
A quadrature rule for subdivided elements.
std::unique_ptr< FEBase > _lagrange_fe
virtual QuadratureType type() const override
void add_subelem_values(const std::vector< Elem const *> &subelem)