LifeV
QuadratureRuleProvider Class Reference

QuadratureRuleProvider - This class is used to generate quadrature rules. More...

#include <QuadratureRuleProvider.hpp>

+ Collaboration diagram for QuadratureRuleProvider:

Static Private Attributes

static NoPreciseExactness S_BehaviorNoPreciseExactness = QuadratureRuleProvider::ReturnSup
 
static TooHighExactness S_BehaviorTooHighExactness = QuadratureRuleProvider::ErrorTooHigh
 
static NegativeWeight S_BehaviorNegativeWeight = QuadratureRuleProvider::Accept
 

Public Types

enum  NoPreciseExactness { ErrorNoPrecise, WarningAndReturnSup, ReturnSup }
 
enum  TooHighExactness { ErrorTooHigh, WarningAndReturnMax, ReturnMax }
 
enum  NegativeWeight { Accept, WarningAndAccept, Reject }
 

Methods

static QuadratureRule provideExactness (const ReferenceShapes &shape, const UInt &exactness)
 Provide a quadrature rule with the given exactness. More...
 
static QuadratureRule provideMaximal (const ReferenceShapes &shape)
 Provide the quadrature rule with the highest exactness available. More...
 

Set Methods

static void setBehaviorNoPreciseExactness (const NoPreciseExactness &behavior)
 
static void setBehaviorTooHighExactness (const TooHighExactness &behavior)
 
static void setBehaviorNegativeWeight (const NegativeWeight &behavior)
 

Private Methods

 QuadratureRuleProvider ()
 Empty Constructor. More...
 
 QuadratureRuleProvider (const QuadratureRuleProvider &)
 Copy Constructor. More...
 
virtual ~QuadratureRuleProvider ()
 Destructor. More...
 
static QuadratureRule provideExactnessTetra (const UInt &exactness)
 Method for the differentShapes. More...
 
static QuadratureRule provideExactnessPrism (const UInt &exactness)
 
static QuadratureRule provideExactnessHexa (const UInt &exactness)
 
static QuadratureRule provideExactnessQuad (const UInt &exactness)
 
static QuadratureRule provideExactnessTriangle (const UInt &exactness)
 
static QuadratureRule provideExactnessLine (const UInt &exactness)
 
static QuadratureRule provideExactnessPoint (const UInt &exactness)
 
static QuadratureRule provideExactnessTetraNoNeg (const UInt &exactness)
 
static QuadratureRule provideExactnessTriangleNoNeg (const UInt &exactness)
 
static void manageNoPreciseExactnessCase ()
 
static void manageTooHighExactnessCase ()
 
static void manageWarningNegativeWeight ()
 

Detailed Description

QuadratureRuleProvider - This class is used to generate quadrature rules.

Author
Samuel Quinodoz

Thanks to this class, it is possible to adopt the best suitable quadrature rule for each case, depending on the degree of the expression to be integrated.

Two important methods are provided:

  • provideExactness that attempts to give, for a given shape and exactness the best suitable quadrature rule (i.e. with the lowest possible number of points)
  • provideMaximal that returns the highest order quadrature available for the given shape.

These two methods are influenced by the 3 behaviors available, which give the way to handle special situations:

  • NoPreciseExactness: if the exactness required is not available, but more precise quadrature rule exist. There are 3 possible behaviors:
    1. ErrorNoPrecise: display an error and abort.
    2. WarningAndReturnSup: display a warning and return a more precise quadrature.
    3. ReturnSup: (default) return a more precise quadrature.
  • TooHighExactness: if there is no quadrature precise enough available. 3 behaviors are possible:
    1. ErrorTooHigh: (default) display an error and abort.
    2. WarningAndReturnMax: display a warning and return the best quadrature available.
    3. ReturnMax: return the best quadrature available.
  • NegativeWeight: sometimes, the quadrature with the least number of points contains negative weights. 3 possible choices are available in that case:
    1. Accept: (default) return the quadrature with negative weight.
    2. WarningAndAccept: issue a warning and return the quadrature with negative weight.
    3. Reject: search the quadrature only among the ones with positive weights only.

These 3 behaviors can be changed via the ad-hoc setter.

Remark When running in parallel, it is a good practice to issue warning only with the leader process. Do not "Reject" negative quadratures with only one process (different processes would have different quadratures!).

Definition at line 100 of file QuadratureRuleProvider.hpp.

Member Enumeration Documentation

◆ NoPreciseExactness

Enumerator
ErrorNoPrecise 
WarningAndReturnSup 
ReturnSup 

Definition at line 107 of file QuadratureRuleProvider.hpp.

◆ TooHighExactness

Enumerator
ErrorTooHigh 
WarningAndReturnMax 
ReturnMax 

Definition at line 108 of file QuadratureRuleProvider.hpp.

◆ NegativeWeight

Enumerator
Accept 
WarningAndAccept 
Reject 

Definition at line 109 of file QuadratureRuleProvider.hpp.

Constructor & Destructor Documentation

◆ QuadratureRuleProvider() [1/2]

Empty Constructor.

◆ QuadratureRuleProvider() [2/2]

Copy Constructor.

◆ ~QuadratureRuleProvider()

virtual ~QuadratureRuleProvider ( )
privatevirtual

Destructor.

Member Function Documentation

◆ provideExactness()

QuadratureRule provideExactness ( const ReferenceShapes shape,
const UInt exactness 
)
static

Provide a quadrature rule with the given exactness.

Given a shape, this method will try to return a quadrature rule that has the given exactness. If such a quadrature rule is not defined, the program will abort.

Definition at line 52 of file QuadratureRuleProvider.cpp.

◆ provideMaximal()

QuadratureRule provideMaximal ( const ReferenceShapes shape)
static

Provide the quadrature rule with the highest exactness available.

Definition at line 107 of file QuadratureRuleProvider.cpp.

◆ setBehaviorNoPreciseExactness()

static void setBehaviorNoPreciseExactness ( const NoPreciseExactness behavior)
inlinestatic

Setter for the behavior in case a quadrature rule with the precise exactness required could not be found.

Definition at line 146 of file QuadratureRuleProvider.hpp.

◆ setBehaviorTooHighExactness()

static void setBehaviorTooHighExactness ( const TooHighExactness behavior)
inlinestatic

Setter for the behavior in case the exactness required cannot be achieved by a known quadrature rule.

Definition at line 155 of file QuadratureRuleProvider.hpp.

◆ setBehaviorNegativeWeight()

static void setBehaviorNegativeWeight ( const NegativeWeight behavior)
inlinestatic

Setter for the behavior in case the quadrature rule asked for has negative weights for some quadrature nodes.

Definition at line 164 of file QuadratureRuleProvider.hpp.

◆ provideExactnessTetra()

QuadratureRule provideExactnessTetra ( const UInt exactness)
staticprivate

Method for the differentShapes.

Definition at line 161 of file QuadratureRuleProvider.cpp.

+ Here is the caller graph for this function:

◆ provideExactnessPrism()

QuadratureRule provideExactnessPrism ( const UInt exactness)
staticprivate

Definition at line 217 of file QuadratureRuleProvider.cpp.

+ Here is the caller graph for this function:

◆ provideExactnessHexa()

QuadratureRule provideExactnessHexa ( const UInt exactness)
staticprivate

Definition at line 235 of file QuadratureRuleProvider.cpp.

+ Here is the caller graph for this function:

◆ provideExactnessQuad()

QuadratureRule provideExactnessQuad ( const UInt exactness)
staticprivate

Definition at line 265 of file QuadratureRuleProvider.cpp.

+ Here is the caller graph for this function:

◆ provideExactnessTriangle()

QuadratureRule provideExactnessTriangle ( const UInt exactness)
staticprivate

Definition at line 302 of file QuadratureRuleProvider.cpp.

+ Here is the caller graph for this function:

◆ provideExactnessLine()

QuadratureRule provideExactnessLine ( const UInt exactness)
staticprivate

Definition at line 340 of file QuadratureRuleProvider.cpp.

+ Here is the caller graph for this function:

◆ provideExactnessPoint()

QuadratureRule provideExactnessPoint ( const UInt exactness)
staticprivate

Definition at line 369 of file QuadratureRuleProvider.cpp.

+ Here is the caller graph for this function:

◆ provideExactnessTetraNoNeg()

QuadratureRule provideExactnessTetraNoNeg ( const UInt exactness)
staticprivate

Definition at line 380 of file QuadratureRuleProvider.cpp.

+ Here is the caller graph for this function:

◆ provideExactnessTriangleNoNeg()

QuadratureRule provideExactnessTriangleNoNeg ( const UInt exactness)
staticprivate

Definition at line 423 of file QuadratureRuleProvider.cpp.

+ Here is the caller graph for this function:

◆ manageNoPreciseExactnessCase()

void manageNoPreciseExactnessCase ( )
staticprivate

Definition at line 462 of file QuadratureRuleProvider.cpp.

+ Here is the caller graph for this function:

◆ manageTooHighExactnessCase()

void manageTooHighExactnessCase ( )
staticprivate

Definition at line 479 of file QuadratureRuleProvider.cpp.

+ Here is the caller graph for this function:

◆ manageWarningNegativeWeight()

void manageWarningNegativeWeight ( )
staticprivate

Definition at line 495 of file QuadratureRuleProvider.cpp.

+ Here is the caller graph for this function:

Field Documentation

◆ S_BehaviorNoPreciseExactness

Definition at line 206 of file QuadratureRuleProvider.hpp.

◆ S_BehaviorTooHighExactness

Definition at line 207 of file QuadratureRuleProvider.hpp.

◆ S_BehaviorNegativeWeight

Definition at line 208 of file QuadratureRuleProvider.hpp.


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