PARTONS/NumA++  
Numerical Analysis C++ routines
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
NumA::QuadratureIntegrator1D Class Referenceabstract

Abstract quadrature class (for fixed quadrature rules). More...

Inheritance diagram for NumA::QuadratureIntegrator1D:
NumA::Integrator1D NumA::ChebyshevAIntegrator1D NumA::ChebyshevBIntegrator1D NumA::GaussLegendreIntegrator1D NumA::GaussLegendreSeStIntegrator1D NumA::TrapezoidalIntegrator1D NumA::TrapezoidalLogIntegrator1D

Public Member Functions

 QuadratureIntegrator1D (unsigned int N=0)
 Constructor. More...
 
virtual ~QuadratureIntegrator1D ()
 Default destructor. More...
 
virtual QuadratureIntegrator1Dclone () const =0
 
virtual double integrate (FunctionType1D *pFunction, double a, double b, std::vector< double > &parameters)
 Integration routine. More...
 
virtual void configure (const ElemUtils::Parameters &parameters)
 Provides a generic method to configure all types of integrations by passing a Parameters object. More...
 
unsigned int getN () const
 
virtual void setN (unsigned int n)=0
 
const std::vector< double > & getNodes () const
 
const std::vector< double > & getWeights () const
 
- Public Member Functions inherited from NumA::Integrator1D
 Integrator1D ()
 Default constructor. More...
 
virtual ~Integrator1D ()
 Default destructor. More...
 
const TolerancesgetTolerances () const
 
void setTolerances (const Tolerances &tolerances)
 
const ErrorsgetErrors () const
 
void setErrors (const Errors &errors)
 

Static Public Attributes

static const std::string PARAM_NAME_N = "numberOfNodes"
 Parameter used in the configure() to set the order of the quadrature. More...
 
- Static Public Attributes inherited from NumA::Integrator1D
static const std::string PARAM_NAME_ABSOLUTE_TOLERANCE
 Parameter used in the configure() to set the absolute tolerance. More...
 
static const std::string PARAM_NAME_RELATIVE_TOLERANCE
 Parameter used in the configure() to set the relative tolerance. More...
 

Protected Member Functions

 QuadratureIntegrator1D (const QuadratureIntegrator1D &other)
 Copy constructor. More...
 
- Protected Member Functions inherited from NumA::Integrator1D
 Integrator1D (const Integrator1D &other)
 Copy constructor. More...
 

Protected Attributes

unsigned int m_N
 Order of the quadrature (number of nodes). More...
 
std::vector< double > m_nodes
 Nodes of the quadrature. More...
 
std::vector< double > m_weights
 Weights of the quadrature. More...
 
- Protected Attributes inherited from NumA::Integrator1D
Tolerances m_tolerances
 Absolute and relative tolerances. More...
 
Errors m_errors
 Absolute and relative errors estimations. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from NumA::Integrator1D
template<typename PointerToObj , typename PointerToMemFn >
static Functor1D< PointerToObj, PointerToMemFn > * newIntegrationFunctor (PointerToObj *object, PointerToMemFn function)
 Use FunctorUtils::newFunctor1D instead. More...
 
static Integrator1DnewIntegrator (const IntegratorType1D::Type &oneDimIntegratorType)
 Instantiates an Integrator object. More...
 

Detailed Description

Abstract quadrature class (for fixed quadrature rules).

Child classes must define a way to compute the nodes \( x_i \) and weights \( w_i \).
The integration itself is done by this abstract class: \( \displaystyle \int_a^b f\left(x\right) \mathrm{d}x = \sum_{i=0}^{N-1} w_i f\left(x_i\right) \), through the integrate() routine.

See Integrator1D documentation for an example.

Constructor & Destructor Documentation

◆ QuadratureIntegrator1D() [1/2]

NumA::QuadratureIntegrator1D::QuadratureIntegrator1D ( unsigned int  N = 0)

Constructor.

Parameters
NOrder of the quadrature (number of nodes).

◆ ~QuadratureIntegrator1D()

NumA::QuadratureIntegrator1D::~QuadratureIntegrator1D ( )
virtual

Default destructor.

◆ QuadratureIntegrator1D() [2/2]

NumA::QuadratureIntegrator1D::QuadratureIntegrator1D ( const QuadratureIntegrator1D other)
protected

Copy constructor.

Called by clone().

Parameters
otherQuadratureIntegrator1D object to copy.

Member Function Documentation

◆ clone()

virtual QuadratureIntegrator1D* NumA::QuadratureIntegrator1D::clone ( ) const
pure virtual

◆ configure()

void NumA::QuadratureIntegrator1D::configure ( const ElemUtils::Parameters &  parameters)
virtual

Provides a generic method to configure all types of integrations by passing a Parameters object.

Parameters class represents a list of couples key/value (see Parameters class documentation for more info).

Parameters
parametersElemUtils::Parameters object.

Reimplemented from NumA::Integrator1D.

Reimplemented in NumA::TrapezoidalLogIntegrator1D.

◆ getN()

unsigned int NumA::QuadratureIntegrator1D::getN ( ) const
Returns
Order of the quadrature (number of nodes).

◆ getNodes()

const std::vector< double > & NumA::QuadratureIntegrator1D::getNodes ( ) const
Returns
Nodes of the quadrature.

◆ getWeights()

const std::vector< double > & NumA::QuadratureIntegrator1D::getWeights ( ) const
Returns
Weights of the quadrature.

◆ integrate()

double NumA::QuadratureIntegrator1D::integrate ( FunctionType1D pFunction,
double  a,
double  b,
std::vector< double > &  parameters 
)
virtual

Integration routine.

Parameters
pFunctionFunctor representing the one-dimensional function to integrate.
aLower bound.
bUpper bound.
parametersParameters that can be passed to the function.
Returns
Integral.

Implements NumA::Integrator1D.

Reimplemented in NumA::TrapezoidalLogIntegrator1D.

◆ setN()

virtual void NumA::QuadratureIntegrator1D::setN ( unsigned int  n)
pure virtual

Member Data Documentation

◆ m_N

unsigned int NumA::QuadratureIntegrator1D::m_N
protected

Order of the quadrature (number of nodes).

◆ m_nodes

std::vector<double> NumA::QuadratureIntegrator1D::m_nodes
protected

Nodes of the quadrature.

◆ m_weights

std::vector<double> NumA::QuadratureIntegrator1D::m_weights
protected

Weights of the quadrature.

◆ PARAM_NAME_N

const std::string NumA::QuadratureIntegrator1D::PARAM_NAME_N = "numberOfNodes"
static

Parameter used in the configure() to set the order of the quadrature.


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