20 #include "libmesh/elem.h" 21 #include "libmesh/quadrature.h" 22 #include "libmesh/int_range.h" 29 allow_rules_with_negative_weights(true),
30 allow_nodal_pyramid_quadrature(false),
48 Real summed_weights=0;
49 os <<
"N_Q_Points=" << this->
n_points() << std::endl << std::endl;
52 os <<
" Point " << qpoint <<
":\n" 56 <<
" w=" <<
_weights[qpoint] <<
"\n" << std::endl;
60 os <<
"Summed Weights: " << summed_weights << std::endl;
68 libmesh_assert_equal_to(elem.
dim(),
_dim);
115 libmesh_error_msg(
"Invalid dimension _dim = " <<
_dim);
123 bool simple_type_only)
128 libmesh_error_msg(
"Code (see stack trace) used an outdated quadrature function overload.\n" 129 "Quadrature rules on a C0Polygon are not defined by its ElemType alone.");
135 if (t !=
EDGE2 && !simple_type_only)
136 libmesh_deprecated();
172 libmesh_error_msg(
"Invalid dimension _dim = " <<
_dim);
180 if (other_rule.
_elem)
189 const std::vector<Real> & ,
190 unsigned int p_level)
210 libmesh_not_implemented();
217 libmesh_not_implemented();
223 std::pair<Real, Real> new_range)
226 libmesh_assert_equal_to (
_dim, 1);
229 h_new = new_range.second - new_range.first,
230 h_old = old_range.second - old_range.first;
233 libmesh_assert_greater (h_new, 0.);
234 libmesh_assert_greater (h_old, 0.);
237 libmesh_assert_greater (
_points.size(), 0);
240 Real scfact = h_new/h_old;
245 _points[i](0) = new_range.first +
246 (
_points[i](0) - old_range.first) * scfact;
259 const unsigned int np = q1D.
n_points();
267 for (
unsigned int j=0; j<np; j++)
268 for (
unsigned int i=0; i<np; i++)
285 const unsigned int np = q1D.
n_points();
293 for (
unsigned int k=0; k<np; k++)
294 for (
unsigned int j=0; j<np; j++)
295 for (
unsigned int i=0; i<np; i++)
312 const unsigned int n_points1D = q1D.
n_points();
313 const unsigned int n_points2D = q2D.
n_points();
315 _points.resize (n_points1D * n_points2D);
316 _weights.resize (n_points1D * n_points2D);
320 for (
unsigned int j=0; j<n_points1D; j++)
321 for (
unsigned int i=0; i<n_points2D; i++)
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...
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...
virtual bool runtime_topology() 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.
std::ostream & operator<<(std::ostream &os, const OrderWrapper &order)
Overload stream operators.
QBase(unsigned int dim, Order order=INVALID_ORDER)
Constructor.
unsigned int p_level() const
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 ...
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_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_dim() const
unsigned int n_points() const
virtual void init_1D()=0
Initializes the 1D quadrature rule by filling the points and weights vectors with the appropriate val...
void print_info(std::ostream &os=libMesh::out) const
Prints information relevant to the quadrature rule, by default to libMesh::out.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual std::unique_ptr< QBase > clone() const
virtual unsigned short dim() const =0
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...
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
virtual ElemType type() const =0
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...
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...