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" 42 #define LIBMESH_QBASE_INIT_ARGUMENTS_REMOVED 82 virtual ~QBase() =
default;
87 virtual std::unique_ptr<QBase>
clone()
const;
103 static std::unique_ptr<QBase>
build (std::string_view
name,
104 const unsigned int dim,
115 const unsigned int dim,
134 return cast_int<unsigned int>(
_points.size());
181 libmesh_assert_less (i,
_points.size());
190 libmesh_assert_less (i,
_weights.size());
215 unsigned int p_level=0,
216 bool simple_type_only=
false);
222 virtual void init (
const QBase & other_rule);
233 virtual void init (
const Elem & elem,
234 const std::vector<Real> & vertex_distance_func,
235 unsigned int p_level=0);
271 void scale(std::pair<Real, Real> old_range,
272 std::pair<Real, Real> new_range);
420 #endif // LIBMESH_QUADRATURE_H std::string name(const ElemQuality q)
This function returns a string containing some name for q.
virtual bool shapes_need_reinit()
ElemType
Defines an enum for geometric element types.
Order
defines an enum for polynomial orders.
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
QBase & operator=(const QBase &)=default
std::vector< Point > & get_points()
bool allow_rules_with_negative_weights
Flag (default true) controlling the use of quadrature rules with negative weights.
Point qp(const unsigned int i) const
virtual void init_2D()
Initializes the 2D quadrature rule by filling the points and weights vectors with the appropriate val...
ElemType get_elem_type() const
This is the base class from which all geometric element types are derived.
ElemType _type
The type of element for which the current values have been computed.
const std::vector< Real > & get_weights() const
QBase(unsigned int dim, Order order=INVALID_ORDER)
Constructor.
QuadratureType
Defines an enum for currently available quadrature rules.
unsigned int _dim
The spatial dimension of the quadrature rule.
const Elem * _elem
The element for which the current values were computed, or nullptr if values were computed without a ...
friend std::ostream & operator<<(std::ostream &os, const QBase &q)
Same as above, but allows you to use the stream syntax.
The libMesh namespace provides an interface to certain functionality in the library.
std::vector< Point > _points
The locations of the quadrature points in reference element space.
std::vector< Real > _weights
The quadrature weights.
virtual QuadratureType type() const =0
void tensor_product_prism(const QBase &q1D, const QBase &q2D)
Computes the tensor product of a 1D quadrature rule and a 2D quadrature rule.
unsigned int _p_level
The p-level of the element for which the current values have been computed.
Order get_base_order() const
virtual void init_0D()
Initializes the 0D quadrature rule by filling the points and weights vectors with the appropriate val...
void tensor_product_hex(const QBase &q1D)
Computes the tensor product quadrature rule [q1D x q1D x q1D] from the 1D rule q1D.
unsigned int get_p_level() const
unsigned int get_dim() const
unsigned int n_points() const
This class implements reference counting.
virtual void init_1D()=0
Initializes the 1D quadrature rule by filling the points and weights vectors with the appropriate val...
Order _order
The polynomial order which the quadrature rule is capable of integrating exactly. ...
void print_info(std::ostream &os=libMesh::out) const
Prints information relevant to the quadrature rule, by default to libMesh::out.
bool allow_nodal_pyramid_quadrature
The flag's value defaults to false so that one does not accidentally use a nodal quadrature rule on P...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual std::unique_ptr< QBase > clone() const
const std::vector< Point > & get_points() const
virtual void init_3D()
Initializes the 3D quadrature rule by filling the points and weights vectors with the appropriate val...
virtual void init(const Elem &e, unsigned int p_level=invalid_uint)
Initializes the data structures for a quadrature rule for the element e.
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...
unsigned int size() const
Alias for n_points() to enable use in index_range.
static std::unique_ptr< QBase > build(std::string_view name, const unsigned int dim, const Order order=INVALID_ORDER)
Builds a specific quadrature rule based on the name string.
void tensor_product_quad(const QBase &q1D)
Constructs a 2D rule from the tensor product of q1D with itself.
Real w(const unsigned int i) const
A Point defines a location in LIBMESH_DIM dimensional Real space.
The QBase class provides the basic functionality from which various quadrature rules can be derived...
void ErrorVector unsigned int
std::vector< Real > & get_weights()