Go to the documentation of this file.
20 #ifndef LIBMESH_QUADRATURE_H
21 #define LIBMESH_QUADRATURE_H
24 #include "libmesh/libmesh_common.h"
25 #include "libmesh/reference_counted_object.h"
26 #include "libmesh/point.h"
27 #include "libmesh/enum_elem_type.h"
28 #include "libmesh/enum_order.h"
30 #ifdef LIBMESH_FORWARD_DECLARE_ENUMS
36 #include "libmesh/enum_quadrature_type.h"
82 virtual ~QBase() =
default;
98 static std::unique_ptr<QBase>
build (
const std::string &
name,
99 const unsigned int dim,
110 const unsigned int dim,
129 return cast_int<unsigned int>(
_points.size());
166 libmesh_assert_less (i,
_points.size());
175 libmesh_assert_less (i,
_weights.size());
184 unsigned int p_level=0);
195 virtual void init (
const Elem & elem,
196 const std::vector<Real> & vertex_distance_func,
197 unsigned int p_level=0);
224 void scale(std::pair<Real, Real> old_range,
225 std::pair<Real, Real> new_range);
269 unsigned int p_level=0);
283 unsigned int p_level=0) = 0;
298 unsigned int p_level=0);
313 unsigned int p_level=0);
374 #endif // LIBMESH_QUADRATURE_H
The QBase class provides the basic functionality from which various quadrature rules can be derived.
unsigned int _p_level
The p-level of the element for which the current values have been computed.
void tensor_product_hex(const QBase &q1D)
Computes the tensor product quadrature rule [q1D x q1D x q1D] from the 1D rule q1D.
std::vector< Real > & get_weights()
unsigned int n_points() const
unsigned int get_dim() const
This class implements reference counting.
The libMesh namespace provides an interface to certain functionality in the library.
QuadratureType
Defines an enum for currently available quadrature rules.
virtual void init_1D(const ElemType type=INVALID_ELEM, unsigned int p_level=0)=0
Initializes the 1D quadrature rule by filling the points and weights vectors with the appropriate val...
unsigned int get_p_level() const
Real w(const unsigned int i) const
virtual void init_3D(const ElemType type=INVALID_ELEM, unsigned int p_level=0)
Initializes the 3D quadrature rule by filling the points and weights vectors with the appropriate val...
virtual void init(const ElemType type=INVALID_ELEM, unsigned int p_level=0)
Initializes the data structures for a quadrature rule for an element of type type.
static std::unique_ptr< QBase > build(const std::string &name, const unsigned int dim, const Order order=INVALID_ORDER)
Builds a specific quadrature rule based on the name string.
Order _order
The polynomial order which the quadrature rule is capable of integrating exactly.
QBase & operator=(const QBase &)=default
const std::vector< Point > & get_points() const
QBase(unsigned int dim, Order order=INVALID_ORDER)
Constructor.
A Point defines a location in LIBMESH_DIM dimensional Real space.
ElemType _type
The type of element for which the current values have been computed.
ElemType get_elem_type() const
void scale(std::pair< Real, Real > old_range, std::pair< Real, Real > new_range)
Maps the points of a 1D quadrature rule defined by "old_range" to another 1D interval defined by "new...
void tensor_product_prism(const QBase &q1D, const QBase &q2D)
Computes the tensor product of a 1D quadrature rule and a 2D quadrature rule.
const std::vector< Real > & get_weights() const
std::vector< Real > _weights
The quadrature weights.
void tensor_product_quad(const QBase &q1D)
Constructs a 2D rule from the tensor product of q1D with itself.
virtual QuadratureType type() const =0
std::vector< Point > & get_points()
virtual bool shapes_need_reinit()
This is the base class from which all geometric element types are derived.
bool allow_rules_with_negative_weights
Flag (default true) controlling the use of quadrature rules with negative weights.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual void init_0D(const ElemType type=INVALID_ELEM, unsigned int p_level=0)
Initializes the 0D quadrature rule by filling the points and weights vectors with the appropriate val...
unsigned int _dim
The spatial dimension of the quadrature rule.
Point qp(const unsigned int i) const
std::vector< Point > _points
The locations of the quadrature points in reference element space.
friend std::ostream & operator<<(std::ostream &os, const QBase &q)
Same as above, but allows you to use the stream syntax.
void print_info(std::ostream &os=libMesh::out) const
Prints information relevant to the quadrature rule, by default to libMesh::out.
void ErrorVector unsigned int
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
ElemType
Defines an enum for geometric element types.
virtual void init_2D(const ElemType type=INVALID_ELEM, unsigned int p_level=0)
Initializes the 2D quadrature rule by filling the points and weights vectors with the appropriate val...