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
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);
void ErrorVector unsigned int
This is the base class from which all geometric element types are derived.
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.
unsigned int get_p_level() const
std::vector< Point > _points
The locations of the quadrature points in reference element space.
ElemType _type
The type of element for which the current values have been computed.
unsigned int size() const
Alias for n_points() to enable use in index_range.
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...
unsigned int _p_level
The p-level of the element for which the current values have been computed.
ElemType get_elem_type() const
unsigned int _dim
The spatial dimension of the quadrature rule.
const std::vector< Point > & get_points() const
unsigned int n_points() const
void print_info(std::ostream &os=libMesh::out) const
Prints information relevant to the quadrature rule, by default to libMesh::out.
virtual bool shapes_need_reinit()
virtual void init_2D()
Initializes the 2D quadrature rule by filling the points and weights vectors with the appropriate val...
virtual QuadratureType type() const =0
QBase & operator=(const QBase &)=default
Order get_base_order() const
void tensor_product_quad(const QBase &q1D)
Constructs a 2D rule from the tensor product of q1D with itself.
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_0D()
Initializes the 0D quadrature rule by filling the points and weights vectors with the appropriate val...
std::vector< Point > & get_points()
unsigned int get_dim() const
std::vector< Real > & get_weights()
virtual void init_1D()=0
Initializes the 1D quadrature rule by filling the points and weights vectors with the appropriate val...
const std::vector< Real > & get_weights() const
Real w(const unsigned int i) const
const Elem * _elem
The element for which the current values were computed, or nullptr if values were computed without a ...
std::vector< Real > _weights
The quadrature weights.
virtual void init(const Elem &e, unsigned int p_level=invalid_uint)
Initializes the data structures for a quadrature rule for the element e.
QBase(const QBase &)=default
Copy/move ctor, copy/move assignment operator, and destructor are all explicitly defaulted for this s...
void tensor_product_prism(const QBase &q1D, const QBase &q2D)
Computes the tensor product of a 1D quadrature rule and a 2D quadrature rule.
virtual void init_3D()
Initializes the 3D quadrature rule by filling the points and weights vectors with the appropriate val...
friend std::ostream & operator<<(std::ostream &os, const QBase &q)
Same as above, but allows you to use the stream syntax.
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.
virtual std::unique_ptr< QBase > clone() const
void tensor_product_hex(const QBase &q1D)
Computes the tensor product quadrature rule [q1D x q1D x q1D] from the 1D rule q1D.
Order _order
The polynomial order which the quadrature rule is capable of integrating exactly.
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...
This class implements reference counting.
The libMesh namespace provides an interface to certain functionality in the library.
ElemType
Defines an enum for geometric element types.
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
QuadratureType
Defines an enum for currently available quadrature rules.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real