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" 74 virtual ~QBase() =
default;
79 virtual std::unique_ptr<QBase>
clone()
const;
95 static std::unique_ptr<QBase>
build (std::string_view
name,
96 const unsigned int dim,
107 const unsigned int dim,
126 return cast_int<unsigned int>(
_points.size());
173 libmesh_assert_less (i,
_points.size());
182 libmesh_assert_less (i,
_weights.size());
191 unsigned int p_level=0);
202 virtual void init (
const Elem & elem,
203 const std::vector<Real> & vertex_distance_func,
204 unsigned int p_level=0);
231 void scale(std::pair<Real, Real> old_range,
232 std::pair<Real, Real> new_range);
289 unsigned int p_level=0);
303 unsigned int p_level=0) = 0;
318 unsigned int p_level=0);
333 unsigned int p_level=0);
394 #endif // LIBMESH_QUADRATURE_H std::string name(const ElemQuality q)
This function returns a string containing some name for q.
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.
virtual bool shapes_need_reinit()
ElemType
Defines an enum for geometric element types.
Order
defines an enum for polynomial orders.
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...
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
ElemType get_elem_type() const
This is the base class from which all geometric element types are derived.
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...
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.
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.
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...
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
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 get_dim() const
unsigned int n_points() const
This class implements reference counting.
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
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()