MercuryDPM  Trunk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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.

Definition at line 80 of file Polynomial.h.

Member Typedef Documentation

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

Definition at line 84 of file Polynomial.h.

Constructor & Destructor Documentation

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

Default constructor, sets all parameters to zero.

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
template<class Coordinates >
CGFunctions::Polynomial< Coordinates >::~Polynomial ( )
default

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

Member Function Documentation

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

Evaluates the coarse-graining function.

template<class Coordinates >
Vec3D CGFunctions::Polynomial< Coordinates >::evaluateCGFunctionDerivatives ( const Vec3D position,
const Coordinates r 
)
template<class Coordinates >
Mdouble CGFunctions::Polynomial< Coordinates >::evaluateCGFunctionDerivativeWithFD ( const Vec3D position,
const Coordinates r,
const int  i 
)
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.

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.

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

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

template<class Coordinates >
Mdouble CGFunctions::Polynomial< Coordinates >::getWidth ( ) const
template<class Coordinates >
void CGFunctions::Polynomial< Coordinates >::setCutoff ( Mdouble  cutoff)
template<class Coordinates >
void CGFunctions::Polynomial< Coordinates >::setEps ( Mdouble  eps)

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

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

Set the standard deviation.

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

Set the cutoff radius.

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

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.

Definition at line 188 of file Polynomial.h.

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

Definition at line 201 of file Polynomial.h.

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

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

Definition at line 207 of file Polynomial.h.

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

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

Definition at line 212 of file Polynomial.h.

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

Definition at line 199 of file Polynomial.h.

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

Definition at line 197 of file Polynomial.h.

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

Definition at line 195 of file Polynomial.h.


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