|
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>
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< Mdouble > | getCoefficients () |
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< Mdouble > | coefficients_ |
PolynomialType | polynomialType_ |
Mdouble | normalLength_ |
Vec3D | normal_ |
unsigned | currentInteraction_ |
Mdouble | cutoff_ |
Mdouble | eps_ |
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.
typedef Coordinates CGFunctions::Polynomial< Coordinates >::CoordinatesType |
CGFunctions::Polynomial< Coordinates >::Polynomial | ( | ) |
Default constructor, sets all parameters to zero.
|
default |
Copy constructor. It copies all objects the class contains.
[in] | p | the class that has to be copied |
|
default |
Destructor, it simply destructs the PolynomialCoordinates and all the objects it contains.
void CGFunctions::Polynomial< Coordinates >::computeCoefficients | ( | ) |
Mdouble CGFunctions::Polynomial< Coordinates >::evaluateCGFunction | ( | const Vec3D & | position, |
const Coordinates & | r | ||
) |
Evaluates the coarse-graining function.
Referenced by VolumeCoupling::getProjectionMatrix().
Vec3D CGFunctions::Polynomial< Coordinates >::evaluateCGFunctionDerivatives | ( | const Vec3D & | position, |
const Coordinates & | r | ||
) |
Mdouble CGFunctions::Polynomial< Coordinates >::evaluateCGFunctionDerivativeWithFD | ( | const Vec3D & | position, |
const Coordinates & | r, | ||
const int | i | ||
) |
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.
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.
std::vector<Mdouble> CGFunctions::Polynomial< Coordinates >::getCoefficients | ( | ) |
Mdouble CGFunctions::Polynomial< Coordinates >::getCutoff | ( | ) | const |
Mdouble CGFunctions::Polynomial< Coordinates >::getEps | ( | ) | const |
Returns the finite difference step size used to evaluate derivatives of the CG function.
Mdouble CGFunctions::Polynomial< Coordinates >::getWidth | ( | ) | const |
Referenced by BaseCoupling< M, O >::getCGWidth().
void CGFunctions::Polynomial< Coordinates >::setCutoff | ( | Mdouble | cutoff | ) |
void CGFunctions::Polynomial< Coordinates >::setEps | ( | Mdouble | eps | ) |
Sets the finite difference step size used to evaluate derivatives of the CG function.
void CGFunctions::Polynomial< Coordinates >::setPolynomialType | ( | PolynomialType | polynomialType | ) |
void CGFunctions::Polynomial< Coordinates >::setStandardDeviation | ( | Mdouble | std | ) |
Set the standard deviation.
void CGFunctions::Polynomial< Coordinates >::setWidth | ( | Mdouble | width | ) |
Set the cutoff radius.
Referenced by BaseCoupling< M, O >::setCGWidth().
void CGFunctions::Polynomial< Coordinates >::write | ( | std::ostream & | os | ) | const |
Writes class content into an output stream, usually a stat file.
[out] | os | output stream |
|
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.
|
protected |
|
protected |
cutoff radius of the polynomial cg function, beyond which the function is zero.
|
protected |
Finite Difference step size, used to compute the derivative of the CG function
|
protected |
|
protected |
|
protected |
The polynomial type. The user should choose the Polynomial type by choosing one of the classes derived from Polynomial: Heaviside, Linear, or Lucy