QuadratureBase

class QuadratureBase

Subclassed by QDummy, QGaussChebyshev1D, QGaussLegendre1D, QGaussLegendreTensorized, QLookupQuadrature, QMidpoint1D, QMidpointTensorized, QMidpointTensorized2D, QMonteCarlo, QProduct, QRectangular, QRectangular1D, QRectangular2D, QSphericalTessalation

Public Functions

QuadratureBase(Config *settings)

Constructor using settings class. This is the recommended constructor.

Parameters:

settings – Settings class storing all important options.

QuadratureBase(unsigned order)

Constructor using directly the order of the quadrature. Not applicable for GaussLegendre, that need additional options. It sets member _settings = nulltpr.

void PrintWeights()

prints: Weight vector

void PrintPoints()

prints: Point vectorVector

void PrintPointsAndWeights()

prints: Point vectorVector with corresponding weight vector

double SumUpWeights()

sums up all entries of the weight vector.

Returns:

sum of all weights

virtual double Integrate(double (*f)(double, double, double))

Integrates f(x,y,z) with the quadrature.

Parameters:

f – density function that depends on a three spatial dimensions.

Returns:

result of the quadrature rule

virtual double IntegrateSpherical(double (*f)(double, double))

Integrates f(x,y,z) with the quadrature.

Parameters:

f – density function that depends on a spherical coordinates.

Returns:

result of the quadrature rule

virtual std::vector<double> Integrate(std::vector<double> (*f)(double, double, double), unsigned len)

Integrates vector valued f(x,y,z) with the quadrature. Each dimension is integrated by itself.

Parameters:
  • f – density function that depends on a three spatial dimensions.

  • len – lenght of vector

Returns:

result of the quadrature rule (vector valued)

inline unsigned GetOrder() const
Returns:

std::string _name: name of the quadrature

inline unsigned GetNq() const
Returns:

unsigned _order: order of the quadrature

inline const VectorVector &GetPoints() const
Returns:

unsigned _nq: number of gridpoints of the quadrature

inline const VectorVector &GetPointsSphere() const
Returns:

VectorVector _points: coordinates of the quad pts

inline const Vector &GetWeights() const
Returns:

VectorVector _pointsSphere: “—- “ in spherical coordinates (my, phi)

inline const VectorVectorU &GetConnectivity() const

Returns approved Dimensions for this quadrature.

Returns:

Vector _weights: weights of gridpoints of the quadrature

Returns:

VectorVectorU _connectivity: connectivity of gridpoints of the quadrature

inline const std::vector<unsigned short> GetSupportedDims() const

Scales the quadrature weights according to the intervall [-velocityScaling , velocityScaling] in 1D Scales the radius of the velocity sphere by velocityScaling in 2D and 3D.

Public Static Functions

static QuadratureBase *Create(Config *settings)

Creates a quadrature rule with a given name and a given order.

Parameters:

settings – Settings to handle quadrature options

Returns:

Quadrature* quadrature: returns pointer to instance of the given derived quadrature class

static QuadratureBase *Create(QUAD_NAME name, unsigned quadOrder)

Creates a quadrature rule with a given name and a given order.

Parameters:
  • name – name of quadrature as enum

  • quadOrder – order of quadrature

Returns:

pointer to instance of the given derived quadrature class

Protected Functions

virtual void SetName() = 0

sets: order of the quadrature

Sets: name of the quadrature

virtual void SetNq() = 0

sets: number of gridpoints of the quadrature

virtual void SetConnectivity() = 0

sets: Connectivity Adjacency Matrix as VektorVektor

virtual void SetPointsAndWeights() = 0

Computes the a vector (length: nq) of (coordinates of) gridpoints used for the quadrature rule. Computes the a vector (length: nq) of weights for the gridpoints. The indices match the gridpoints VectorVector. Sets computed values for _points and _weights.

Protected Attributes

Config *_settings

pointer to settings class that manages the solver

std::string _name

name of the quadrature

unsigned _order

order of the quadrature

unsigned _nq

number of gridpoints of the quadrature

VectorVector _pointsKarth

gridpoints of the quadrature

VectorVector _pointsSphere

(my,phi,r)gridpoints of the quadrature in spherical cordinates

Vector _weights

weights of the gridpoints of the quadrature

VectorVectorU _connectivity

connectivity of the gripoints of the quadrature

std::vector<unsigned short> _supportedDimensions

number of spatial dimensions, for which the quadrature is build