libMesh
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
libMesh::QBase Class Referenceabstract

The QBase class provides the basic functionality from which various quadrature rules can be derived. More...

#include <quadrature.h>

Inheritance diagram for libMesh::QBase:
[legend]

Public Member Functions

 QBase (const QBase &)=default
 Copy/move ctor, copy/move assignment operator, and destructor are all explicitly defaulted for this simple class. More...
 
 QBase (QBase &&)=default
 
QBaseoperator= (const QBase &)=default
 
QBaseoperator= (QBase &&)=default
 
virtual ~QBase ()=default
 
virtual QuadratureType type () const =0
 
ElemType get_elem_type () const
 
unsigned int get_p_level () const
 
unsigned int n_points () const
 
unsigned int get_dim () const
 
const std::vector< Point > & get_points () const
 
std::vector< Point > & get_points ()
 
const std::vector< Real > & get_weights () const
 
std::vector< Real > & get_weights ()
 
Point qp (const unsigned int i) const
 
Real w (const unsigned int i) const
 
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. More...
 
virtual void init (const Elem &elem, const std::vector< Real > &vertex_distance_func, unsigned int p_level=0)
 Initializes the data structures for an element potentially "cut" by a signed distance function. More...
 
Order get_order () const
 
void print_info (std::ostream &os=libMesh::out) const
 Prints information relevant to the quadrature rule, by default to libMesh::out. More...
 
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_range" and scales the weights accordingly. More...
 
virtual bool shapes_need_reinit ()
 

Static Public Member Functions

static std::unique_ptr< QBasebuild (const std::string &name, const unsigned int dim, const Order order=INVALID_ORDER)
 Builds a specific quadrature rule based on the name string. More...
 
static std::unique_ptr< QBasebuild (const QuadratureType qt, const unsigned int dim, const Order order=INVALID_ORDER)
 Builds a specific quadrature rule based on the QuadratureType. More...
 
static std::string get_info ()
 Gets a string containing the reference information. More...
 
static void print_info (std::ostream &out=libMesh::out)
 Prints the reference information, by default to libMesh::out. More...
 
static unsigned int n_objects ()
 Prints the number of outstanding (created, but not yet destroyed) objects. More...
 
static void enable_print_counter_info ()
 Methods to enable/disable the reference counter output from print_info() More...
 
static void disable_print_counter_info ()
 

Public Attributes

bool allow_rules_with_negative_weights
 Flag (default true) controlling the use of quadrature rules with negative weights. More...
 

Protected Types

typedef std::map< std::string, std::pair< unsigned int, unsigned int > > Counts
 Data structure to log the information. More...
 

Protected Member Functions

 QBase (unsigned int dim, Order order=INVALID_ORDER)
 Constructor. More...
 
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 values. More...
 
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 values. More...
 
virtual void init_2D (const ElemType, unsigned int=0)
 Initializes the 2D quadrature rule by filling the points and weights vectors with the appropriate values. More...
 
virtual void init_3D (const ElemType, unsigned int=0)
 Initializes the 3D quadrature rule by filling the points and weights vectors with the appropriate values. More...
 
void tensor_product_quad (const QBase &q1D)
 Constructs a 2D rule from the tensor product of q1D with itself. More...
 
void tensor_product_hex (const QBase &q1D)
 Computes the tensor product quadrature rule [q1D x q1D x q1D] from the 1D rule q1D. More...
 
void tensor_product_prism (const QBase &q1D, const QBase &q2D)
 Computes the tensor product of a 1D quadrature rule and a 2D quadrature rule. More...
 
void increment_constructor_count (const std::string &name)
 Increments the construction counter. More...
 
void increment_destructor_count (const std::string &name)
 Increments the destruction counter. More...
 

Protected Attributes

unsigned int _dim
 The spatial dimension of the quadrature rule. More...
 
Order _order
 The polynomial order which the quadrature rule is capable of integrating exactly. More...
 
ElemType _type
 The type of element for which the current values have been computed. More...
 
unsigned int _p_level
 The p-level of the element for which the current values have been computed. More...
 
std::vector< Point_points
 The locations of the quadrature points in reference element space. More...
 
std::vector< Real_weights
 The quadrature weights. More...
 

Static Protected Attributes

static Counts _counts
 Actually holds the data. More...
 
static Threads::atomic< unsigned int > _n_objects
 The number of objects. More...
 
static Threads::spin_mutex _mutex
 Mutual exclusion object to enable thread-safe reference counting. More...
 
static bool _enable_print_counter
 Flag to control whether reference count information is printed when print_info is called. More...
 

Friends

std::ostream & operator<< (std::ostream &os, const QBase &q)
 Same as above, but allows you to use the stream syntax. More...
 

Detailed Description

The QBase class provides the basic functionality from which various quadrature rules can be derived.

It computes and stores the quadrature points (in reference element space) and associated weights.

Author
Benjamin S. Kirk
Date
2002 Base class for all quadrature families and orders.

Definition at line 62 of file quadrature.h.

Member Typedef Documentation

◆ Counts

typedef std::map<std::string, std::pair<unsigned int, unsigned int> > libMesh::ReferenceCounter::Counts
protectedinherited

Data structure to log the information.

The log is identified by the class name.

Definition at line 117 of file reference_counter.h.

Constructor & Destructor Documentation

◆ QBase() [1/3]

libMesh::QBase::QBase ( unsigned int  dim,
Order  order = INVALID_ORDER 
)
protected

Constructor.

Protected to prevent instantiation of this base class. Use the build() method instead.

Definition at line 364 of file quadrature.h.

365  :
367  _dim(d),
368  _order(o),
370  _p_level(0)
371 {
372 }
bool allow_rules_with_negative_weights
Flag (default true) controlling the use of quadrature rules with negative weights.
Definition: quadrature.h:246
ElemType _type
The type of element for which the current values have been computed.
Definition: quadrature.h:337
unsigned int _dim
The spatial dimension of the quadrature rule.
Definition: quadrature.h:325
unsigned int _p_level
The p-level of the element for which the current values have been computed.
Definition: quadrature.h:343
Order _order
The polynomial order which the quadrature rule is capable of integrating exactly. ...
Definition: quadrature.h:331

◆ QBase() [2/3]

libMesh::QBase::QBase ( const QBase )
default

Copy/move ctor, copy/move assignment operator, and destructor are all explicitly defaulted for this simple class.

◆ QBase() [3/3]

libMesh::QBase::QBase ( QBase &&  )
default

◆ ~QBase()

virtual libMesh::QBase::~QBase ( )
virtualdefault

Member Function Documentation

◆ build() [1/2]

static std::unique_ptr<QBase> libMesh::QBase::build ( const std::string &  name,
const unsigned int  dim,
const Order  order = INVALID_ORDER 
)
static

Builds a specific quadrature rule based on the name string.

This enables selection of the quadrature rule at run-time. The input parameter name must be mappable through the Utility::string_to_enum<>() function.

This function allocates memory, therefore a std::unique_ptr<QBase> is returned so that the user does not accidentally leak it.

◆ build() [2/2]

static std::unique_ptr<QBase> libMesh::QBase::build ( const QuadratureType  qt,
const unsigned int  dim,
const Order  order = INVALID_ORDER 
)
static

Builds a specific quadrature rule based on the QuadratureType.

This enables selection of the quadrature rule at run-time.

This function allocates memory, therefore a std::unique_ptr<QBase> is returned so that the user does not accidentally leak it.

◆ disable_print_counter_info()

static void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited

◆ enable_print_counter_info()

static void libMesh::ReferenceCounter::enable_print_counter_info ( )
staticinherited

Methods to enable/disable the reference counter output from print_info()

◆ get_dim()

unsigned int libMesh::QBase::get_dim ( ) const
Returns
The spatial dimension of the quadrature rule.

Definition at line 136 of file quadrature.h.

References _dim.

136 { return _dim; }
unsigned int _dim
The spatial dimension of the quadrature rule.
Definition: quadrature.h:325

◆ get_elem_type()

ElemType libMesh::QBase::get_elem_type ( ) const
Returns
The element type we're currently using.

Definition at line 117 of file quadrature.h.

References _type.

117 { return _type; }
ElemType _type
The type of element for which the current values have been computed.
Definition: quadrature.h:337

◆ get_info()

static std::string libMesh::ReferenceCounter::get_info ( )
staticinherited

Gets a string containing the reference information.

◆ get_order()

Order libMesh::QBase::get_order ( ) const
Returns
The order of the quadrature rule.

Definition at line 203 of file quadrature.h.

References _order, and _p_level.

203 { return static_cast<Order>(_order + _p_level); }
Order
defines an enum for polynomial orders.
Definition: enum_order.h:40
unsigned int _p_level
The p-level of the element for which the current values have been computed.
Definition: quadrature.h:343
Order _order
The polynomial order which the quadrature rule is capable of integrating exactly. ...
Definition: quadrature.h:331

◆ get_p_level()

unsigned int libMesh::QBase::get_p_level ( ) const
Returns
The p-refinement level we're currently using.

Definition at line 122 of file quadrature.h.

References _p_level.

122 { return _p_level; }
unsigned int _p_level
The p-level of the element for which the current values have been computed.
Definition: quadrature.h:343

◆ get_points() [1/2]

const std::vector<Point>& libMesh::QBase::get_points ( ) const
Returns
A std::vector containing the quadrature point locations in reference element space.

Definition at line 142 of file quadrature.h.

References _points.

142 { return _points; }
std::vector< Point > _points
The locations of the quadrature points in reference element space.
Definition: quadrature.h:349

◆ get_points() [2/2]

std::vector<Point>& libMesh::QBase::get_points ( )
Returns
A std::vector containing the quadrature point locations in reference element space as a writable reference.

Definition at line 148 of file quadrature.h.

References _points.

148 { return _points; }
std::vector< Point > _points
The locations of the quadrature points in reference element space.
Definition: quadrature.h:349

◆ get_weights() [1/2]

const std::vector<Real>& libMesh::QBase::get_weights ( ) const
Returns
A constant reference to a std::vector containing the quadrature weights.

Definition at line 154 of file quadrature.h.

References _weights.

154 { return _weights; }
std::vector< Real > _weights
The quadrature weights.
Definition: quadrature.h:355

◆ get_weights() [2/2]

std::vector<Real>& libMesh::QBase::get_weights ( )
Returns
A writable references to a std::vector containing the quadrature weights.

Definition at line 160 of file quadrature.h.

References _weights.

160 { return _weights; }
std::vector< Real > _weights
The quadrature weights.
Definition: quadrature.h:355

◆ increment_constructor_count()

void libMesh::ReferenceCounter::increment_constructor_count ( const std::string &  name)
protectedinherited

Increments the construction counter.

Should be called in the constructor of any derived class that will be reference counted.

Definition at line 181 of file reference_counter.h.

References libMesh::ReferenceCounter::_counts, libMesh::Quality::name(), and libMesh::Threads::spin_mtx.

Referenced by libMesh::ReferenceCountedObject< RBParametrized >::ReferenceCountedObject().

182 {
183  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
184  std::pair<unsigned int, unsigned int> & p = _counts[name];
185 
186  p.first++;
187 }
std::string name(const ElemQuality q)
static Counts _counts
Actually holds the data.
spin_mutex spin_mtx
A convenient spin mutex object which can be used for obtaining locks.

◆ increment_destructor_count()

void libMesh::ReferenceCounter::increment_destructor_count ( const std::string &  name)
protectedinherited

Increments the destruction counter.

Should be called in the destructor of any derived class that will be reference counted.

Definition at line 194 of file reference_counter.h.

References libMesh::ReferenceCounter::_counts, libMesh::Quality::name(), and libMesh::Threads::spin_mtx.

Referenced by libMesh::ReferenceCountedObject< RBParametrized >::~ReferenceCountedObject().

195 {
196  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
197  std::pair<unsigned int, unsigned int> & p = _counts[name];
198 
199  p.second++;
200 }
std::string name(const ElemQuality q)
static Counts _counts
Actually holds the data.
spin_mutex spin_mtx
A convenient spin mutex object which can be used for obtaining locks.

◆ init() [1/2]

virtual void libMesh::QBase::init ( const ElemType  type = INVALID_ELEM,
unsigned int  p_level = 0 
)
virtual

Initializes the data structures for a quadrature rule for an element of type type.

Referenced by libMesh::QGauss::QGauss(), libMesh::QJacobi::QJacobi(), libMesh::QSimpson::QSimpson(), and libMesh::QTrap::QTrap().

◆ init() [2/2]

virtual void libMesh::QBase::init ( const Elem elem,
const std::vector< Real > &  vertex_distance_func,
unsigned int  p_level = 0 
)
virtual

Initializes the data structures for an element potentially "cut" by a signed distance function.

The array vertex_distance_func contains vertex values of the signed distance function. If the signed distance function changes sign on the vertices, then the element is considered to be cut.) This interface can be extended by derived classes in order to subdivide the element and construct a composite quadrature rule.

◆ init_0D()

virtual void libMesh::QBase::init_0D ( const ElemType  type = INVALID_ELEM,
unsigned int  p_level = 0 
)
protectedvirtual

Initializes the 0D quadrature rule by filling the points and weights vectors with the appropriate values.

Generally this is just one point with weight 1.

◆ init_1D()

virtual void libMesh::QBase::init_1D ( const ElemType  type = INVALID_ELEM,
unsigned int  p_level = 0 
)
protectedpure virtual

Initializes the 1D quadrature rule by filling the points and weights vectors with the appropriate values.

The order of the rule will be defined by the implementing class. It is assumed that derived quadrature rules will at least define the init_1D function, therefore it is pure virtual.

Implemented in libMesh::QGrundmann_Moller, libMesh::QMonomial, libMesh::QJacobi, libMesh::QGauss, libMesh::QSimpson, libMesh::QGrid, libMesh::QTrap, libMesh::QConical, libMesh::QGaussLobatto, and libMesh::QClough.

◆ init_2D()

virtual void libMesh::QBase::init_2D ( const ElemType  ,
unsigned int  = 0 
)
protectedvirtual

Initializes the 2D quadrature rule by filling the points and weights vectors with the appropriate values.

The order of the rule will be defined by the implementing class. Should not be pure virtual since a derived quadrature rule may only be defined in 1D. If not redefined, gives an error (when DEBUG is defined) when called.

Reimplemented in libMesh::QGrundmann_Moller, libMesh::QMonomial, libMesh::QConical, libMesh::QGauss, libMesh::QSimpson, libMesh::QGrid, libMesh::QTrap, libMesh::QGaussLobatto, and libMesh::QClough.

Definition at line 277 of file quadrature.h.

279  {
280 #ifdef DEBUG
281  libmesh_error_msg("ERROR: Seems as if this quadrature rule \nis not implemented for 2D.");
282 #endif
283  }

◆ init_3D()

virtual void libMesh::QBase::init_3D ( const ElemType  ,
unsigned int  = 0 
)
protectedvirtual

Initializes the 3D quadrature rule by filling the points and weights vectors with the appropriate values.

The order of the rule will be defined by the implementing class. Should not be pure virtual since a derived quadrature rule may only be defined in 1D. If not redefined, gives an error (when DEBUG is defined) when called.

Reimplemented in libMesh::QGrundmann_Moller, libMesh::QMonomial, libMesh::QConical, libMesh::QGauss, libMesh::QSimpson, libMesh::QGrid, libMesh::QTrap, libMesh::QGaussLobatto, and libMesh::QClough.

Definition at line 293 of file quadrature.h.

295  {
296 #ifdef DEBUG
297  libmesh_error_msg("ERROR: Seems as if this quadrature rule \nis not implemented for 3D.");
298 #endif
299  }

◆ n_objects()

static unsigned int libMesh::ReferenceCounter::n_objects ( )
staticinherited

Prints the number of outstanding (created, but not yet destroyed) objects.

Definition at line 83 of file reference_counter.h.

References libMesh::ReferenceCounter::_n_objects.

84  { return _n_objects; }
static Threads::atomic< unsigned int > _n_objects
The number of objects.

◆ n_points()

unsigned int libMesh::QBase::n_points ( ) const
Returns
The number of points associated with the quadrature rule.

Definition at line 127 of file quadrature.h.

References _points.

Referenced by AssemblyA0::boundary_assembly(), AssemblyA1::boundary_assembly(), A2::boundary_assembly(), AssemblyA2::boundary_assembly(), A3::boundary_assembly(), F0::boundary_assembly(), Output0::boundary_assembly(), SecondOrderScalarSystemSecondOrderTimeSolverBase::damping_residual(), SecondOrderScalarSystemFirstOrderTimeSolverBase::damping_residual(), FirstOrderScalarSystemBase::element_time_derivative(), SecondOrderScalarSystemFirstOrderTimeSolverBase::element_time_derivative(), A0::interior_assembly(), B::interior_assembly(), M0::interior_assembly(), A1::interior_assembly(), EIM_IP_assembly::interior_assembly(), AcousticsInnerProduct::interior_assembly(), A2::interior_assembly(), EIM_F::interior_assembly(), F0::interior_assembly(), OutputAssembly::interior_assembly(), AssemblyEIM::interior_assembly(), AssemblyF0::interior_assembly(), AssemblyF1::interior_assembly(), Ex6InnerProduct::interior_assembly(), Ex6EIMInnerProduct::interior_assembly(), FirstOrderScalarSystemBase::mass_residual(), SecondOrderScalarSystemSecondOrderTimeSolverBase::mass_residual(), SecondOrderScalarSystemFirstOrderTimeSolverBase::mass_residual(), and print_info().

128  {
129  libmesh_assert (!_points.empty());
130  return cast_int<unsigned int>(_points.size());
131  }
std::vector< Point > _points
The locations of the quadrature points in reference element space.
Definition: quadrature.h:349

◆ operator=() [1/2]

QBase& libMesh::QBase::operator= ( const QBase )
default

◆ operator=() [2/2]

QBase& libMesh::QBase::operator= ( QBase &&  )
default

◆ print_info() [1/2]

static void libMesh::ReferenceCounter::print_info ( std::ostream &  out = libMesh::out)
staticinherited

Prints the reference information, by default to libMesh::out.

◆ print_info() [2/2]

void libMesh::QBase::print_info ( std::ostream &  os = libMesh::out) const

Prints information relevant to the quadrature rule, by default to libMesh::out.

Definition at line 378 of file quadrature.h.

References _points, _weights, n_points(), and libMesh::Real.

379 {
380  libmesh_assert(!_points.empty());
381  libmesh_assert(!_weights.empty());
382 
383  Real summed_weights=0;
384  os << "N_Q_Points=" << this->n_points() << std::endl << std::endl;
385  for (unsigned int qpoint=0; qpoint<this->n_points(); qpoint++)
386  {
387  os << " Point " << qpoint << ":\n"
388  << " "
389  << _points[qpoint]
390  << "\n Weight:\n "
391  << " w=" << _weights[qpoint] << "\n" << std::endl;
392 
393  summed_weights += _weights[qpoint];
394  }
395  os << "Summed Weights: " << summed_weights << std::endl;
396 }
std::vector< Point > _points
The locations of the quadrature points in reference element space.
Definition: quadrature.h:349
std::vector< Real > _weights
The quadrature weights.
Definition: quadrature.h:355
unsigned int n_points() const
Definition: quadrature.h:127
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ qp()

Point libMesh::QBase::qp ( const unsigned int  i) const
Returns
The $ i^{th} $ quadrature point in reference element space.

Definition at line 165 of file quadrature.h.

References _points.

166  {
167  libmesh_assert_less (i, _points.size());
168  return _points[i];
169  }
std::vector< Point > _points
The locations of the quadrature points in reference element space.
Definition: quadrature.h:349

◆ scale()

void libMesh::QBase::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_range" and scales the weights accordingly.

◆ shapes_need_reinit()

virtual bool libMesh::QBase::shapes_need_reinit ( )
virtual
Returns
true if the shape functions need to be recalculated, false otherwise.

This may be required if the number of quadrature points or their position changes.

Definition at line 231 of file quadrature.h.

231 { return false; }

◆ tensor_product_hex()

void libMesh::QBase::tensor_product_hex ( const QBase q1D)
protected

Computes the tensor product quadrature rule [q1D x q1D x q1D] from the 1D rule q1D.

Used in the init_3D routines for hexahedral element types.

◆ tensor_product_prism()

void libMesh::QBase::tensor_product_prism ( const QBase q1D,
const QBase q2D 
)
protected

Computes the tensor product of a 1D quadrature rule and a 2D quadrature rule.

Used in the init_3D routines for prismatic element types.

◆ tensor_product_quad()

void libMesh::QBase::tensor_product_quad ( const QBase q1D)
protected

Constructs a 2D rule from the tensor product of q1D with itself.

Used in the init_2D() routines for quadrilateral element types.

◆ type()

virtual QuadratureType libMesh::QBase::type ( ) const
pure virtual

◆ w()

Real libMesh::QBase::w ( const unsigned int  i) const
Returns
The $ i^{th} $ quadrature weight.

Definition at line 174 of file quadrature.h.

References _weights.

175  {
176  libmesh_assert_less (i, _weights.size());
177  return _weights[i];
178  }
std::vector< Real > _weights
The quadrature weights.
Definition: quadrature.h:355

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const QBase q 
)
friend

Same as above, but allows you to use the stream syntax.

Member Data Documentation

◆ _counts

Counts libMesh::ReferenceCounter::_counts
staticprotectedinherited

◆ _dim

unsigned int libMesh::QBase::_dim
protected

The spatial dimension of the quadrature rule.

Definition at line 325 of file quadrature.h.

Referenced by get_dim(), libMesh::QJacobi::QJacobi(), libMesh::QSimpson::QSimpson(), and libMesh::QTrap::QTrap().

◆ _enable_print_counter

bool libMesh::ReferenceCounter::_enable_print_counter
staticprotectedinherited

Flag to control whether reference count information is printed when print_info is called.

Definition at line 141 of file reference_counter.h.

◆ _mutex

Threads::spin_mutex libMesh::ReferenceCounter::_mutex
staticprotectedinherited

Mutual exclusion object to enable thread-safe reference counting.

Definition at line 135 of file reference_counter.h.

◆ _n_objects

Threads::atomic<unsigned int> libMesh::ReferenceCounter::_n_objects
staticprotectedinherited

The number of objects.

Print the reference count information when the number returns to 0.

Definition at line 130 of file reference_counter.h.

Referenced by libMesh::ReferenceCounter::n_objects(), libMesh::ReferenceCounter::ReferenceCounter(), and libMesh::ReferenceCounter::~ReferenceCounter().

◆ _order

Order libMesh::QBase::_order
protected

The polynomial order which the quadrature rule is capable of integrating exactly.

Definition at line 331 of file quadrature.h.

Referenced by get_order().

◆ _p_level

unsigned int libMesh::QBase::_p_level
protected

The p-level of the element for which the current values have been computed.

Definition at line 343 of file quadrature.h.

Referenced by get_order(), and get_p_level().

◆ _points

std::vector<Point> libMesh::QBase::_points
protected

The locations of the quadrature points in reference element space.

Definition at line 349 of file quadrature.h.

Referenced by get_points(), n_points(), print_info(), and qp().

◆ _type

ElemType libMesh::QBase::_type
protected

The type of element for which the current values have been computed.

Definition at line 337 of file quadrature.h.

Referenced by get_elem_type().

◆ _weights

std::vector<Real> libMesh::QBase::_weights
protected

The quadrature weights.

The order of the weights matches the ordering of the _points vector.

Definition at line 355 of file quadrature.h.

Referenced by get_weights(), print_info(), and w().

◆ allow_rules_with_negative_weights

bool libMesh::QBase::allow_rules_with_negative_weights

Flag (default true) controlling the use of quadrature rules with negative weights.

Set this to false to require rules with all positive weights.

Rules with negative weights can be unsuitable for some problems. For example, it is possible for a rule with negative weights to obtain a negative result when integrating a positive function.

A particular example: if rules with negative weights are not allowed, a request for TET,THIRD (5 points) will return the TET,FIFTH (14 points) rule instead, nearly tripling the computational effort required!

Definition at line 246 of file quadrature.h.


The documentation for this class was generated from the following file: