CGFunctions::Polynomial< Coordinates > Class Template Reference

Defines the position of the CGPoint (e.g. x, y, z) and the parameters of a polynomial coarse-graining function (width and cutoff). More...

#include <Polynomial.h>

+ Inheritance diagram for CGFunctions::Polynomial< Coordinates >:

Public Types

typedef Coordinates CoordinatesType
 

Public Member Functions

 Polynomial ()
 Default constructor, sets all parameters to zero. More...
 
 Polynomial (const Polynomial &p)=default
 Copy constructor. It copies all objects the class contains. More...
 
 ~Polynomial ()=default
 Destructor, it simply destructs the PolynomialCoordinates and all the objects it contains. More...
 
void write (std::ostream &os) const
 Writes class content into an output stream, usually a stat file. More...
 
void setPolynomialType (PolynomialType polynomialType)
 
void setWidth (Mdouble width)
 Set the cutoff radius. More...
 
Mdouble getWidth () const
 
void setStandardDeviation (Mdouble std)
 Set the standard deviation. More...
 
void setCutoff (Mdouble cutoff)
 
Mdouble getCutoff () const
 
void computeCoefficients ()
 
Mdouble evaluateCGFunction (const Vec3D &position, const Coordinates &r)
 Evaluates the coarse-graining function. More...
 
Mdouble evaluateCGIntegral (const BaseInteraction &i, const Coordinates &r, IntegralType type=IntegralType::I_TO_P)
 Evaluates the line integral needed for the calculation of stresses. More...
 
Mdouble evaluateCGIntegral1D (const BaseInteraction &i, const Coordinates &r, IntegralType type=IntegralType::I_TO_P)
 Evaluates the line integral needed for the calculation of stresses for 1D CGCoordinates. More...
 
std::vector< MdoublegetCoefficients ()
 
Vec3D evaluateCGFunctionDerivatives (const Vec3D &position, const Coordinates &r)
 
Mdouble evaluateCGFunctionDerivativeWithFD (const Vec3D &position, const Coordinates &r, const int i)
 
Mdouble getEps () const
 Returns the finite difference step size used to evaluate derivatives of the CG function. More...
 
void setEps (Mdouble eps)
 Sets the finite difference step size used to evaluate derivatives of the CG function. More...
 

Protected Attributes

std::vector< Mdoublecoefficients_
 
PolynomialType polynomialType_
 
Mdouble normalLength_
 
Vec3D normal_
 
unsigned currentInteraction_
 
Mdouble cutoff_
 
Mdouble eps_
 

Detailed Description

template<class Coordinates>
class CGFunctions::Polynomial< Coordinates >

Defines the position of the CGPoint (e.g. x, y, z) and the parameters of a polynomial coarse-graining function (width and cutoff).

The class is derived from a CGCoordinates class, thus it contains the position of the CGPoint in the non-averaged directions. It further contains the parameters of a polynomial coarse-graining function (coefficients and cutoff), as well as internal variables (not user-defined, but set by the code), like the integralPrefactor. It also contains all functions that only depend on the coordinate and function type; e.g. evaluateCGFunction and evaluateCGIntegral.

The polynomialType_ is used to define what polynomial is actually used; currently only Heaviside, linear and Lucy polynomials are possible.

To simplify notation, the Heaviside, Linear and Lucy classed are derived from Polynomial, which set the polynomial type explicitly. Thus, the Polynomial class should not be used directly.

See CGFunctions and Gauss for more details.

Member Typedef Documentation

◆ CoordinatesType

template<class Coordinates >
typedef Coordinates CGFunctions::Polynomial< Coordinates >::CoordinatesType

Constructor & Destructor Documentation

◆ Polynomial() [1/2]

template<class Coordinates >
CGFunctions::Polynomial< Coordinates >::Polynomial ( )

Default constructor, sets all parameters to zero.

◆ Polynomial() [2/2]

template<class Coordinates >
CGFunctions::Polynomial< Coordinates >::Polynomial ( const Polynomial< Coordinates > &  p)
default

Copy constructor. It copies all objects the class contains.

Parameters
[in]pthe class that has to be copied

◆ ~Polynomial()

template<class Coordinates >
CGFunctions::Polynomial< Coordinates >::~Polynomial ( )
default

Destructor, it simply destructs the PolynomialCoordinates and all the objects it contains.

Member Function Documentation

◆ computeCoefficients()

template<class Coordinates >
void CGFunctions::Polynomial< Coordinates >::computeCoefficients ( )

◆ evaluateCGFunction()

template<class Coordinates >
Mdouble CGFunctions::Polynomial< Coordinates >::evaluateCGFunction ( const Vec3D position,
const Coordinates r 
)

Evaluates the coarse-graining function.

Referenced by VolumeCoupling::getProjectionMatrix().

◆ evaluateCGFunctionDerivatives()

template<class Coordinates >
Vec3D CGFunctions::Polynomial< Coordinates >::evaluateCGFunctionDerivatives ( const Vec3D position,
const Coordinates r 
)

◆ evaluateCGFunctionDerivativeWithFD()

template<class Coordinates >
Mdouble CGFunctions::Polynomial< Coordinates >::evaluateCGFunctionDerivativeWithFD ( const Vec3D position,
const Coordinates r,
const int  i 
)

◆ evaluateCGIntegral()

template<class Coordinates >
Mdouble CGFunctions::Polynomial< Coordinates >::evaluateCGIntegral ( const BaseInteraction i,
const Coordinates r,
IntegralType  type = IntegralType::I_TO_P 
)

Evaluates the line integral needed for the calculation of stresses.

◆ evaluateCGIntegral1D()

template<class Coordinates >
Mdouble CGFunctions::Polynomial< Coordinates >::evaluateCGIntegral1D ( const BaseInteraction i,
const Coordinates r,
IntegralType  type = IntegralType::I_TO_P 
)

Evaluates the line integral needed for the calculation of stresses for 1D CGCoordinates.

◆ getCoefficients()

template<class Coordinates >
std::vector<Mdouble> CGFunctions::Polynomial< Coordinates >::getCoefficients ( )

◆ getCutoff()

template<class Coordinates >
Mdouble CGFunctions::Polynomial< Coordinates >::getCutoff ( ) const

◆ getEps()

template<class Coordinates >
Mdouble CGFunctions::Polynomial< Coordinates >::getEps ( ) const

Returns the finite difference step size used to evaluate derivatives of the CG function.

◆ getWidth()

template<class Coordinates >
Mdouble CGFunctions::Polynomial< Coordinates >::getWidth ( ) const

◆ setCutoff()

template<class Coordinates >
void CGFunctions::Polynomial< Coordinates >::setCutoff ( Mdouble  cutoff)

◆ setEps()

template<class Coordinates >
void CGFunctions::Polynomial< Coordinates >::setEps ( Mdouble  eps)

Sets the finite difference step size used to evaluate derivatives of the CG function.

◆ setPolynomialType()

◆ setStandardDeviation()

template<class Coordinates >
void CGFunctions::Polynomial< Coordinates >::setStandardDeviation ( Mdouble  std)

Set the standard deviation.

◆ setWidth()

template<class Coordinates >
void CGFunctions::Polynomial< Coordinates >::setWidth ( Mdouble  width)

Set the cutoff radius.

Referenced by BaseCoupling< M, O >::setCGWidth().

◆ write()

template<class Coordinates >
void CGFunctions::Polynomial< Coordinates >::write ( std::ostream &  os) const

Writes class content into an output stream, usually a stat file.

Parameters
[out]osoutput stream

Member Data Documentation

◆ coefficients_

template<class Coordinates >
std::vector<Mdouble> CGFunctions::Polynomial< Coordinates >::coefficients_
protected

Stores the polynomial coefficients,starting with the highest order \(c_i\) of \(\sum_i c_i (|pos|/c)^(n-i)\). The coefficients are normalised such that \(\int \phi(\vec r,\vec r_i) d\vec r = 1\); see Polynomial<Coordinates>::evaluateCGFunction for details.

Internal variables that should not be set by the user.

Todo:
Make variables internal.

◆ currentInteraction_

template<class Coordinates >
unsigned CGFunctions::Polynomial< Coordinates >::currentInteraction_
protected

◆ cutoff_

template<class Coordinates >
Mdouble CGFunctions::Polynomial< Coordinates >::cutoff_
protected

cutoff radius of the polynomial cg function, beyond which the function is zero.

◆ eps_

template<class Coordinates >
Mdouble CGFunctions::Polynomial< Coordinates >::eps_
protected

Finite Difference step size, used to compute the derivative of the CG function

◆ normal_

template<class Coordinates >
Vec3D CGFunctions::Polynomial< Coordinates >::normal_
protected

◆ normalLength_

template<class Coordinates >
Mdouble CGFunctions::Polynomial< Coordinates >::normalLength_
protected

◆ polynomialType_

template<class Coordinates >
PolynomialType CGFunctions::Polynomial< Coordinates >::polynomialType_
protected

The polynomial type. The user should choose the Polynomial type by choosing one of the classes derived from Polynomial: Heaviside, Linear, or Lucy


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