|
Defines the position of the CGPoint, in the non-averaged directions, i.e. all directions on which spatial coarse-graining is applied (all directions for XYZ); all other directions are averaged over homogeneously. More...
#include <XYZ.h>
Public Member Functions | |
void | write (std::ostream &os) const |
Writes the coordinates in human-readable form to an ostream. More... | |
Mdouble | getDistanceSquared (const Vec3D &p) const |
Returns the square of the distance between the particle p and the current CGPoint, in the non-averaged directions. More... | |
void | setXYZ (Vec3D p) |
Returns the position of the current CGPoint, in the non-averaged directions. More... | |
Mdouble | getINormal (const BaseInteraction &c, const Vec3D &normal) const |
For the Interaction between particles/walls P and I, this function returns the dot product between the normal vector of the interaction and the branch vector from the current CGPoint towards I. More... | |
Mdouble | getPNormal (const BaseInteraction &c, const Vec3D &normal) const |
For the Interaction between particles/walls P and I, this function returns the dot product between the normal vector of the interaction and the branch vector from the current CGPoint towards P. More... | |
Mdouble | getCNormal (const BaseInteraction &c, const Vec3D &normal) const |
For the Interaction between particles/walls P and I, this function returns the dot product between the normal vector of the interaction and the branch vector from the current CGPoint towards the contact point. More... | |
Mdouble | getTangentialSquared (const BaseInteraction &c, Mdouble pNormal) const |
For the Interaction between particles/walls P and I, this function returns the square of the minimum distance between the the current CGPoint and the branch vector between P and I. More... | |
Public Member Functions inherited from CGCoordinates::BaseCoordinates | |
virtual Mdouble | getWeight () |
Static Public Member Functions | |
static void | writeNames (std::ostream &os) |
Writes the coordinate names in human-readable form to an ostream. More... | |
static Mdouble | getVolumeOfAveragedDimensions (const Vec3D &min, const Vec3D &max) |
returns the factor the CGFunction has to be divided by, due to integrating the variables over the averaged dimensions, 1.0 for XYZ. More... | |
static Mdouble | getLength (const Vec3D &p) |
Returns the length of the input vector in the non-averaged directions. More... | |
static Mdouble | getGaussPrefactor (Mdouble width, Mdouble cutoff) |
Computes the prefactor of the Gauss CGFunction, which is dependent on the number of non-averaged dimensions. More... | |
static Mdouble | getGaussIntegralPrefactor (Mdouble distance, Mdouble width, Mdouble cutoff) |
Computes the prefactor of the Gauss line integral, which is dependent on the number of non-averaged dimensions. More... | |
static void | normalisePolynomialCoefficients (std::vector< Mdouble > &coefficients, Mdouble cutoff) |
Normalises the coefficients of Polynomial CGFunction such that the integral over all non-averaged dimensions is unity. More... | |
static const unsigned | countVariables () |
static bool | isResolvedIn (unsigned i) |
static std::string | getName () |
Static Public Member Functions inherited from CGCoordinates::BaseCoordinates | |
static Mdouble | getDomainVolume (const Vec3D &min, const Vec3D &max) |
Protected Attributes | |
Vec3D | p_ |
Defines the position of the CGPoint, in the non-averaged directions, i.e. all directions on which spatial coarse-graining is applied (all directions for XYZ); all other directions are averaged over homogeneously.
In addition to defining the spatial variable, the classes in CGCoordinates contain all functions that only depend on how many coordinate directions are locally resolved (i.e. not averaged over); e.g. getDistanceSquared and getVolumeOfAveragedDimensions.
The CGCoordinates class should be chosen such that the system in homogeneous (symmetric) in the averaged directions. E.g., periodic chutes are homogeneous in x, y and t, but varying in z, so Z should be used.
See member CGCoordinates for more details.
|
static |
Mdouble XYZ::getCNormal | ( | const BaseInteraction & | c, |
const Vec3D & | normal | ||
) | const |
For the Interaction between particles/walls P and I, this function returns the dot product between the normal vector of the interaction and the branch vector from the current CGPoint towards the contact point.
[in] | c | the Interaction object from which iNormal is computed |
Returns the square of the distance between the particle p and the current CGPoint, in the non-averaged directions.
This function is needed to evaluate the CGFunction, as this function has the distance between the CGPoint and the Particle as an argument. To properly account for the averaging, the distance is only computed in the non-averaged directions.
[in] | p | the position of a particle for which the distance is computed. |
References Vec3D::getLengthSquared(), and p_.
Computes the prefactor of the Gauss line integral, which is dependent on the number of non-averaged dimensions.
The prefactor of the Gauss line integral is set such that the integral over the non-averaged dimensions is unity.
[in] | distance | length of the branch vector along which the line integral is evaluated. |
[in] | width | width (equals the standard deviation in 1D) of the Gauss CGFunction. |
[in] | cutoff | cutoff of the Gauss CGFunction |
References mathsFunc::exp(), constants::sqrt_2, constants::sqrt_pi, and mathsFunc::square().
Computes the prefactor of the Gauss CGFunction, which is dependent on the number of non-averaged dimensions.
The prefactor of the Gauss CGFunction is set such that the integral over the non-averaged dimensions is unity.
[in] | width | width (equals the standard deviation in 1D) of the Gauss CGFunction. |
[in] | cutoff | cutoff of the Gauss CGFunction |
References mathsFunc::cubic(), mathsFunc::exp(), constants::sqrt_2, constants::sqrt_pi, and mathsFunc::square().
Mdouble XYZ::getINormal | ( | const BaseInteraction & | c, |
const Vec3D & | normal | ||
) | const |
For the Interaction between particles/walls P and I, this function returns the dot product between the normal vector of the interaction and the branch vector from the current CGPoint towards I.
[in] | c | the Interaction object from which iNormal is computed |
References Vec3D::dot(), BaseInteraction::getI(), BaseInteraction::getNormal(), BaseInteractable::getPosition(), and p_.
Returns the length of the input vector in the non-averaged directions.
[in] | p | vector whose length should be determined |
Mdouble XYZ::getPNormal | ( | const BaseInteraction & | c, |
const Vec3D & | normal | ||
) | const |
For the Interaction between particles/walls P and I, this function returns the dot product between the normal vector of the interaction and the branch vector from the current CGPoint towards P.
[in] | c | the Interaction object from which iNormal is computed |
Mdouble XYZ::getTangentialSquared | ( | const BaseInteraction & | c, |
Mdouble | pNormal | ||
) | const |
For the Interaction between particles/walls P and I, this function returns the square of the minimum distance between the the current CGPoint and the branch vector between P and I.
[in] | c | the Interaction object from which iNormal is computed |
[in] | pNormal | the output of getPNormal needed for the computation. |
References Vec3D::getLengthSquared(), BaseInteraction::getP(), BaseInteractable::getPosition(), p_, and mathsFunc::square().
returns the factor the CGFunction has to be divided by, due to integrating the variables over the averaged dimensions, 1.0 for XYZ.
If averaged dimensions are present (i.e. for all Coordinates except XYZ), the CGFunction has to be divided by a factor (here called volume) due to integrating the variables over the averaged dimensions.
[in] | min | the lower limits of the mesh domain (xMin, yMin, zMin) |
[in] | max | the upper limits of the mesh domain (xMax, yMax, zMax) |
|
inlinestatic |
|
static |
Normalises the coefficients of Polynomial CGFunction such that the integral over all non-averaged dimensions is unity.
The volume is computed as
\[volume= \int_0^1\sum_{i=1}^n c_i r/c^i 4 pi r^2 dr = 4 pi \sum_{i=1}^n c_i/(i+3) \]
with 4 pi r^2 the surface area of a sphere.
[in,out] | coefficients | the coefficients of Polynomial CGFunctions. |
[in] | cutoff | cutoff of the Gauss CGFunction |
References mathsFunc::cubic(), constants::i, and constants::pi.
void XYZ::setXYZ | ( | Vec3D | p | ) |
Returns the position of the current CGPoint, in the non-averaged directions.
[in] | p | the position that is to be set. |
References p_.
Referenced by VolumeCoupling::getProjectionMatrix().
void XYZ::write | ( | std::ostream & | os | ) | const |
|
static |
|
protected |
The position of the current CGPoint.
Referenced by getDistanceSquared(), getINormal(), getTangentialSquared(), setXYZ(), and write().