MercuryDPM  0.11
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
StatisticsPoint< T > Struct Template Reference

This class stores statistical values for a given spatial position; to be used in combination with StatisticsVector. More...

#include <StatisticsPoint.h>

Public Member Functions

 StatisticsPoint ()
 Constructor sets sensible values. More...
 
 StatisticsPoint (const StatisticsPoint &other)
 Copy constructor; simply copies everything. More...
 
void setCGShape (const char *CG_type)
 see StatisticsVector::setCGShape More...
 
CG getCGShape () const
 see StatisticsVector::getCGShape More...
 
void setCGWidth2 (Mdouble new_)
 see StatisticsVector::setCGWidth2 More...
 
Mdouble getCGWidthSquared () const
 see StatisticsVector::getCGWidthSquared More...
 
Mdouble getCGWidth () const
 see StatisticsVector::getCGWidth More...
 
Mdouble getCutoff ()
 see StatisticsVector::getCutoff More...
 
Mdouble getCutoff2 ()
 see StatisticsVector::getCutoff2 More...
 
Mdouble getXMaxStat ()
 see StatisticsVector::getXMaxStat More...
 
Mdouble getYMaxStat ()
 see StatisticsVector::getYMaxStat More...
 
Mdouble getZMaxStat ()
 see StatisticsVector::getZMaxStat More...
 
Mdouble getXMinStat ()
 see StatisticsVector::getXMinStat More...
 
Mdouble getYMinStat ()
 see StatisticsVector::getYMinStat More...
 
Mdouble getZMinStat ()
 see StatisticsVector::getZMinStat More...
 
void getN (int &nx_, int &ny_, int &nz_)
 see StatisticsVector::get_n More...
 
Mdouble evaluatePolynomial (Mdouble r)
 see StatisticsVector::evaluatePolynomial More...
 
Mdouble evaluatePolynomialGradient (Mdouble r)
 see StatisticsVector::evaluatePolynomialGradient More...
 
Mdouble evaluateIntegral (Mdouble n1, Mdouble n2, Mdouble t)
 see StatisticsVector::evaluateIntegral More...
 
void setCGInverseVolume ()
 sets CG_invvolume More...
 
int nonaveragedDim ()
 
double averagingVolume ()
 
Mdouble getCGInverseVolume ()
 returns CG_invvolume More...
 
void set_Gaussian_invvolume (int dim)
 sets CG_invvolume if CG_type=Gaussian More...
 
double compute_Gaussian_invvolume (int dim)
 computes CG_invvolume if CG_type=Gaussian More...
 
void set_Heaviside_invvolume ()
 sets CG_invvolume if CG_type=HeaviSideSphere More...
 
void set_Polynomial_invvolume (int dim)
 sets CG_invvolume if CG_type=Polynomial More...
 
void setPosition (Vec3D new_)
 sets Position More...
 
Vec3D getPosition () const
 returns Position More...
 
void set_zero ()
 Sets all statistical variables to zero. More...
 
StatisticsPoint< T > getSquared ()
 Squares all statistical variables; needed for variance. More...
 
StatisticsPoint< T > & operator= (const StatisticsPoint< T > &P)
 Defines a equal operator needed for copy constructor. More...
 
StatisticsPoint< T > & operator+= (const StatisticsPoint< T > &P)
 Defines a plus operator needed to average values ( $ \bar{v} = (\sum_{i=1}^n v_i)/n $ ) More...
 
StatisticsPoint< T > & operator-= (const StatisticsPoint< T > &P)
 Defines a plus operator needed to calculate variance. More...
 
StatisticsPoint< T > & operator/= (const Mdouble a)
 Defines a division operator needed to average values ( $ \bar{v} = (\sum_{i=1}^n v_i)/n $ ) More...
 
void firstTimeAverage (const int n)
 Defines a division operator needed to time-average values (because the displacement does not have a value at the first timestep, this is slightly different than /=) More...
 
Mdouble getDistanceSquaredNonAveraged (const Vec3D &P)
 returns the coarse graining distance in the coordinates that are not averaged about More...
 
Mdouble dotNonAveraged (const Vec3D &P, const Vec3D &Q)
 Returns the dot product of two vectors in the coordinates that are not averaged about. More...
 
Vec3D clearAveragedDirections (Vec3D P)
 Returns a vector where the averaged directions are zero. More...
 
Vec3D crossNonAveraged (Vec3D P, Vec3D &Q)
 Returns the cross product of two vectors in the coordinates that are not averaged about. More...
 
Matrix3D matrixCrossNonAveraged (Vec3D P, Matrix3D &Q)
 Returns the cross product of two vectors in the coordinates that are not averaged about. More...
 
Mdouble CG_function (const Vec3D &PI)
 Returns the value of the course graining function phi(P,PI) More...
 
Mdouble CG_function_2D (const Vec3D &PI)
 returns the value of the course graining function phi(P,PI) averaged along a line More...
 
Mdouble CG_function_1D (const Vec3D &PI)
 Returns the value of the course graining function phi(P,PI) averaged along a plane. More...
 
Vec3D CG_gradient (const Vec3D &P, const Mdouble phi)
 gradient of phi More...
 
Vec3D CG_integral_gradient (Vec3D &P1, Vec3D &P2, Vec3D &P1_P2_normal, Mdouble P1_P2_distance)
 gradient of phi More...
 
Mdouble CG_integral_gradient_1D (Vec3D &P1, Vec3D &P2, Vec3D &P1_P2_normal, Mdouble P1_P2_distance)
 
Mdouble CG_integral (Vec3D &P1, Vec3D &P2, Vec3D &P1_P2_normal, Mdouble P1_P2_distance, Vec3D &rpsi)
 Returns the value of the coarse graining integral $ \psi(P,PI,PJ) = \int_0^1 \phi(P - PI + s PJ) ds $. More...
 
Mdouble CG_integral_2D (Vec3D &P1, Vec3D &P2, Vec3D &P1_P2_normal, Mdouble P1_P2_distance, Mdouble &rpsi_scalar)
 Returns the value of the coarse graining integral $ \psi(P,PI,PJ) = \int_0^1 \phi(P - PI + s PJ) ds $ averaged along a line. More...
 
Mdouble CG_integral_1D (Vec3D &P1, Vec3D &P2, Vec3D &P1_P2_normal, Mdouble P1_P2_distance, Mdouble &rpsi_scalar)
 Returns the value of the coarse graining integral $ \psi(P,PI,PJ) = \int_0^1 \phi(P - PI + s PJ) ds $ averaged along a plane. More...
 
std::string print () const
 Outputs statistical variables in human-readable format. More...
 
std::string print_sqrt () const
 Outputs root of statistical variables in human-readable format. More...
 
std::string write_variable_names ()
 Outputs names of statistical variables in computer-readable format. More...
 
std::string write () const
 Outputs statistical variables in computer-readable format. More...
 
template<>
int nonaveragedDim ()
 
template<>
int nonaveragedDim ()
 
template<>
int nonaveragedDim ()
 
template<>
int nonaveragedDim ()
 
template<>
int nonaveragedDim ()
 
template<>
int nonaveragedDim ()
 
template<>
int nonaveragedDim ()
 
template<>
int nonaveragedDim ()
 
template<>
int nonaveragedDim ()
 
template<>
int nonaveragedDim ()
 
template<>
int nonaveragedDim ()
 
template<>
int nonaveragedDim ()
 
template<>
int nonaveragedDim ()
 
template<>
int nonaveragedDim ()
 
template<>
double averagingVolume ()
 
template<>
double averagingVolume ()
 
template<>
double averagingVolume ()
 
template<>
double averagingVolume ()
 
template<>
double averagingVolume ()
 
template<>
double averagingVolume ()
 
template<>
double averagingVolume ()
 
template<>
double averagingVolume ()
 
template<>
double averagingVolume ()
 
template<>
double averagingVolume ()
 
template<>
double averagingVolume ()
 
template<>
double averagingVolume ()
 
template<>
double averagingVolume ()
 
template<>
double averagingVolume ()
 
template<>
Mdouble CG_function (const Vec3D &PI)
 
template<>
Mdouble CG_function (const Vec3D &PI)
 
template<>
Mdouble CG_function (const Vec3D &)
 
template<>
Mdouble CG_function (const Vec3D &PI)
 
template<>
Mdouble CG_function (const Vec3D &)
 
template<>
Mdouble CG_function (const Vec3D &PI)
 
template<>
Mdouble CG_function (const Vec3D &PI)
 
template<>
Mdouble CG_function (const Vec3D &PI)
 
template<>
Mdouble CG_function (const Vec3D &PI)
 
template<>
Mdouble CG_function (const Vec3D &PI)
 
template<>
Mdouble CG_function (const Vec3D &PI)
 
template<>
Mdouble CG_function (const Vec3D &)
 
template<>
Vec3D CG_gradient (const Vec3D &P, const Mdouble phi)
 
template<>
Vec3D CG_gradient (const Vec3D &P, const Mdouble phi)
 
template<>
Vec3D CG_gradient (const Vec3D &P, const Mdouble phi)
 
template<>
Vec3D CG_gradient (const Vec3D &P, const Mdouble phi)
 
template<>
Vec3D CG_gradient (const Vec3D &P, const Mdouble phi)
 
template<>
Vec3D CG_gradient (const Vec3D &P, const Mdouble phi)
 
template<>
Vec3D CG_gradient (const Vec3D &, const Mdouble)
 
template<>
Mdouble CG_integral (Vec3D &P1, Vec3D &P2, Vec3D &P1_P2_normal, Mdouble P1_P2_distance, Vec3D &rpsi)
 
template<>
Mdouble CG_integral (Vec3D &P1, Vec3D &P2, Vec3D &, Mdouble, Vec3D &rpsi UNUSED)
 
template<>
Mdouble CG_integral (Vec3D &, Vec3D &, Vec3D &, Mdouble, Vec3D &rpsi UNUSED)
 
template<>
Mdouble CG_integral (Vec3D &P1, Vec3D &P2, Vec3D &, Mdouble, Vec3D &rpsi UNUSED)
 
template<>
Mdouble CG_integral (Vec3D &, Vec3D &, Vec3D &, Mdouble, Vec3D &rpsi UNUSED)
 
template<>
Mdouble CG_integral (Vec3D &P1, Vec3D &P2, Vec3D &P1_P2_normal, Mdouble P1_P2_distance, Vec3D &rpsi)
 
template<>
Mdouble CG_integral (Vec3D &P1, Vec3D &P2, Vec3D &P1_P2_normal, Mdouble P1_P2_distance, Vec3D &rpsi)
 
template<>
Mdouble CG_integral (Vec3D &P1, Vec3D &P2, Vec3D &P1_P2_normal, Mdouble P1_P2_distance, Vec3D &rpsi)
 
template<>
Mdouble CG_integral (Vec3D &P1, Vec3D &P2, Vec3D &P1_P2_normal, Mdouble P1_P2_distance, Vec3D &rpsi)
 
template<>
Mdouble CG_integral (Vec3D &P1, Vec3D &P2, Vec3D &P1_P2_normal, Mdouble P1_P2_distance, Vec3D &rpsi)
 
template<>
Mdouble CG_integral (Vec3D &P1, Vec3D &P2, Vec3D &P1_P2_normal, Mdouble P1_P2_distance, Vec3D &rpsi)
 
template<>
Mdouble CG_integral (Vec3D &P1, Vec3D &P2 UNUSED, Vec3D &P1_P2_normal UNUSED, Mdouble P1_P2_distance UNUSED, Vec3D &rpsi)
 
template<>
Vec3D CG_integral_gradient (Vec3D &P1, Vec3D &P2, Vec3D &P1_P2_normal, Mdouble P1_P2_distance)
 
template<>
Mdouble getDistanceSquaredNonAveraged (const Vec3D &P)
 
template<>
Mdouble getDistanceSquaredNonAveraged (const Vec3D &P)
 
template<>
Mdouble getDistanceSquaredNonAveraged (const Vec3D &P)
 
template<>
Mdouble getDistanceSquaredNonAveraged (const Vec3D &P)
 
template<>
Mdouble getDistanceSquaredNonAveraged (const Vec3D &P)
 
template<>
Mdouble getDistanceSquaredNonAveraged (const Vec3D &P)
 
template<>
Mdouble getDistanceSquaredNonAveraged (const Vec3D &)
 
template<>
Mdouble dotNonAveraged (const Vec3D &P, const Vec3D &Q)
 
template<>
Mdouble dotNonAveraged (const Vec3D &P, const Vec3D &Q)
 
template<>
Mdouble dotNonAveraged (const Vec3D &P, const Vec3D &Q)
 
template<>
Mdouble dotNonAveraged (const Vec3D &P, const Vec3D &Q)
 
template<>
Mdouble dotNonAveraged (const Vec3D &P, const Vec3D &Q)
 
template<>
Mdouble dotNonAveraged (const Vec3D &P, const Vec3D &Q)
 
template<>
Mdouble dotNonAveraged (const Vec3D &, const Vec3D &)
 
template<>
Vec3D clearAveragedDirections (Vec3D P)
 
template<>
Vec3D clearAveragedDirections (Vec3D P)
 
template<>
Vec3D clearAveragedDirections (Vec3D P)
 
template<>
Vec3D clearAveragedDirections (Vec3D P)
 
template<>
Vec3D clearAveragedDirections (Vec3D P)
 
template<>
Vec3D clearAveragedDirections (Vec3D P)
 
template<>
Vec3D clearAveragedDirections (Vec3D P UNUSED)
 
template<>
Vec3D crossNonAveraged (Vec3D P, Vec3D &Q)
 
template<>
Vec3D crossNonAveraged (Vec3D P, Vec3D &Q)
 
template<>
Vec3D crossNonAveraged (Vec3D P, Vec3D &Q)
 
template<>
Vec3D crossNonAveraged (Vec3D P UNUSED, Vec3D &Q UNUSED)
 
template<>
Vec3D crossNonAveraged (Vec3D P UNUSED, Vec3D &Q UNUSED)
 
template<>
Vec3D crossNonAveraged (Vec3D P UNUSED, Vec3D &Q UNUSED)
 
template<>
Vec3D crossNonAveraged (Vec3D P UNUSED, Vec3D &Q UNUSED)
 
template<>
Matrix3D matrixCrossNonAveraged (Vec3D P, Matrix3D &Q)
 
template<>
Matrix3D matrixCrossNonAveraged (Vec3D P, Matrix3D &Q)
 
template<>
Matrix3D matrixCrossNonAveraged (Vec3D P, Matrix3D &Q)
 
template<>
Matrix3D matrixCrossNonAveraged (Vec3D P UNUSED, Matrix3D &Q UNUSED)
 
template<>
Matrix3D matrixCrossNonAveraged (Vec3D P UNUSED, Matrix3D &Q UNUSED)
 
template<>
Matrix3D matrixCrossNonAveraged (Vec3D P UNUSED, Matrix3D &Q UNUSED)
 
template<>
Matrix3D matrixCrossNonAveraged (Vec3D P UNUSED, Matrix3D &Q UNUSED)
 

Static Public Member Functions

static void set_gb (StatisticsVector< T > *new_gb)
 see StatisticsVector::setCGShape More...
 

Public Attributes

Mdouble Nu
 Particle volume fraction, $\sum_i m_i/\rho_i \phi_i$. More...
 
Mdouble Density
 Density, $\sum_i m_i \phi_i$. More...
 
Vec3D Momentum
 Momentum, $\sum_i m_i v_{ia} \phi_i$. More...
 
Vec3D DisplacementMomentum
 Momentum from linear displacement, $\sum_i m_i u_{ia} \phi_i$, where $\vec{u}_i=(\vec{r}_i(t)-\vec{r}_i(t-\tau))/\tau$, with $\tau=savecount \Delta t$ the time intervall between outputs. More...
 
MatrixSymmetric3D Displacement
 Linear displacement, $2/(2 \rho_i^2) \sum_{ij} m_i m_j \phi_j (v_{ija} \partial_b \phi_i + v_{ijb} \partial_a \phi_i) $. More...
 
MatrixSymmetric3D MomentumFlux
 Momentum flux, $\sum_i m_i v_{ia} v_{ib} \phi_i$. More...
 
MatrixSymmetric3D DisplacementMomentumFlux
 Momentum flux from linear displacement, $\sum_i m_i u_{ia} u_{ib} \phi_i$. More...
 
Vec3D EnergyFlux
 Energy flux, $2/2 \sum_i m_i v_{ia} v_{ia} v_{ib} \phi_i$. More...
 
Matrix3D NormalStress
 Stress from normal forces, $\sum_{ij} f^n_{ija} l_{ijb} \psi_{ij}$. More...
 
Matrix3D TangentialStress
 Stress from tangential forces, $\sum_{ij} f^t_{ija} l_{ijb} \psi_{ij}$. More...
 
Vec3D NormalTraction
 Traction from normal forces, $\sum_{ij} f^n_{ija} l_{ijb} \phi_i$. More...
 
Vec3D TangentialTraction
 Traction from tangential forces, $\sum_{ij} f^t_{ija} l_{ijb} \phi_i$. More...
 
MatrixSymmetric3D Fabric
 Fabric tensor, $\sum_{ij} m_i/\rho_i n_{ija} n_{ijb} \psi_{ij}$. More...
 
Vec3D CollisionalHeatFlux
 Heat flux from collisions, $\sum_{ij} (v_{ia}+v_ja)/2 f_{ija} l_{ijb} \psi_i$. More...
 
Mdouble Dissipation
 Dissipation form collisions, $\sum_{ij} (v_{ia}+v_ja)/2 f_{ija} \psi_i$. More...
 
Mdouble Potential
 Elastic energy $2/4 \sum_{ij} (k \delta_{ij}^2 +k^t {\delta^t_{ij}}^2) \phi_i$. More...
 
Vec3D LocalAngularMomentum
 
Matrix3D LocalAngularMomentumFlux
 
Matrix3D ContactCoupleStress
 
Mdouble CG_invvolume
 Prefactor of CG function which depends on $w. More...
 
int mirrorParticle
 indicates that a position is a (fake) particles used for periodic walls More...
 

Private Attributes

Vec3D Position
 Position at which evaluation occurs. More...
 

Static Private Attributes

static StatisticsVector< T > * gb
 Pointer to StatisticsVector (to obtain global parameters) More...
 

Friends

std::ostream & operator (std::ostream &os, const StatisticsPoint< T > &stat)
 Outputs statistical variables to ostream. More...
 

Detailed Description

template<StatType T>
struct StatisticsPoint< T >

This class stores statistical values for a given spatial position; to be used in combination with StatisticsVector.

Definition at line 39 of file StatisticsPoint.h.

Constructor & Destructor Documentation

template<StatType T>
StatisticsPoint< T >::StatisticsPoint ( )
inline

Constructor sets sensible values.

Definition at line 53 of file StatisticsPoint.h.

References StatisticsPoint< T >::mirrorParticle, StatisticsPoint< T >::Position, and Vec3D::setZero().

54  {
55  this->Position.setZero();
56  mirrorParticle = -1;
57  //~ this->set_zero();
58  }
void setZero()
Sets all elements to zero.
Definition: Vector.cc:52
int mirrorParticle
indicates that a position is a (fake) particles used for periodic walls
Vec3D Position
Position at which evaluation occurs.
template<StatType T>
StatisticsPoint< T >::StatisticsPoint ( const StatisticsPoint< T > &  other)
inline

Copy constructor; simply copies everything.

Definition at line 61 of file StatisticsPoint.h.

References StatisticsPoint< T >::mirrorParticle.

62  {
63  *this = other;
64  mirrorParticle = -1;
65  }
int mirrorParticle
indicates that a position is a (fake) particles used for periodic walls

Member Function Documentation

template<>
double StatisticsPoint< XYZ >::averagingVolume ( )

Definition at line 1036 of file StatisticsPoint.hcc.

1037 {
1038  return 1.0;
1039 }
template<>
double StatisticsPoint< XY >::averagingVolume ( )

Definition at line 1040 of file StatisticsPoint.hcc.

1041 {
1042  return ((gb->getSystemDimensions() != 3) ? (1.0) : (getZMaxStat() - getZMinStat()));
1043 }
Mdouble getZMinStat()
see StatisticsVector::getZMinStat
Mdouble getZMaxStat()
see StatisticsVector::getZMaxStat
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
template<>
double StatisticsPoint< XZ >::averagingVolume ( )

Definition at line 1044 of file StatisticsPoint.hcc.

1045 {
1046  return (getYMaxStat() - getYMinStat());
1047 }
Mdouble getYMaxStat()
see StatisticsVector::getYMaxStat
Mdouble getYMinStat()
see StatisticsVector::getYMinStat
template<>
double StatisticsPoint< YZ >::averagingVolume ( )

Definition at line 1048 of file StatisticsPoint.hcc.

1049 {
1050  return (getXMaxStat() - getXMinStat());
1051 }
Mdouble getXMinStat()
see StatisticsVector::getXMinStat
Mdouble getXMaxStat()
see StatisticsVector::getXMaxStat
template<>
double StatisticsPoint< X >::averagingVolume ( )

Definition at line 1052 of file StatisticsPoint.hcc.

1053 {
1054  return (getYMaxStat() - getYMinStat())
1055  * ((gb->getSystemDimensions() != 3) ? (1.0) : (getZMaxStat() - getZMinStat()));
1056 }
Mdouble getZMinStat()
see StatisticsVector::getZMinStat
Mdouble getYMaxStat()
see StatisticsVector::getYMaxStat
Mdouble getZMaxStat()
see StatisticsVector::getZMaxStat
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
Mdouble getYMinStat()
see StatisticsVector::getYMinStat
template<>
double StatisticsPoint< Y >::averagingVolume ( )

Definition at line 1057 of file StatisticsPoint.hcc.

1058 {
1059  return (getXMaxStat() - getXMinStat())
1060  * ((gb->getSystemDimensions() != 3) ? (1.0) : (getZMaxStat() - getZMinStat()));
1061 }
Mdouble getZMinStat()
see StatisticsVector::getZMinStat
Mdouble getXMinStat()
see StatisticsVector::getXMinStat
Mdouble getZMaxStat()
see StatisticsVector::getZMaxStat
Mdouble getXMaxStat()
see StatisticsVector::getXMaxStat
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
template<>
double StatisticsPoint< Z >::averagingVolume ( )

Definition at line 1062 of file StatisticsPoint.hcc.

1063 {
1064  return (getXMaxStat() - getXMinStat())
1065  * (getYMaxStat() - getYMinStat());
1066 }
Mdouble getYMaxStat()
see StatisticsVector::getYMaxStat
Mdouble getXMinStat()
see StatisticsVector::getXMinStat
Mdouble getXMaxStat()
see StatisticsVector::getXMaxStat
Mdouble getYMinStat()
see StatisticsVector::getYMinStat
template<>
double StatisticsPoint< O >::averagingVolume ( )

Definition at line 1067 of file StatisticsPoint.hcc.

1068 {
1069  return (getXMaxStat() - getXMinStat())
1070  * (getYMaxStat() - getYMinStat())
1071  * ((gb->getSystemDimensions() != 3) ? (1.0) : (getZMaxStat() - getZMinStat()));
1072 }
Mdouble getZMinStat()
see StatisticsVector::getZMinStat
Mdouble getYMaxStat()
see StatisticsVector::getYMaxStat
Mdouble getXMinStat()
see StatisticsVector::getXMinStat
Mdouble getZMaxStat()
see StatisticsVector::getZMaxStat
Mdouble getXMaxStat()
see StatisticsVector::getXMaxStat
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
Mdouble getYMinStat()
see StatisticsVector::getYMinStat
template<>
double StatisticsPoint< RAZ >::averagingVolume ( )

Definition at line 1073 of file StatisticsPoint.hcc.

1074 {
1075  exit(-1);
1076 }
template<>
double StatisticsPoint< AZ >::averagingVolume ( )

Definition at line 1077 of file StatisticsPoint.hcc.

1078 {
1079  exit(-1);
1080 }
template<>
double StatisticsPoint< RZ >::averagingVolume ( )

Definition at line 1081 of file StatisticsPoint.hcc.

1082 {
1083  exit(-1);
1084 }
template<>
double StatisticsPoint< RA >::averagingVolume ( )

Definition at line 1085 of file StatisticsPoint.hcc.

1086 {
1087  exit(-1);
1088 }
template<>
double StatisticsPoint< R >::averagingVolume ( )

Definition at line 1089 of file StatisticsPoint.hcc.

1090 {
1091  exit(-1);
1092 }
template<>
double StatisticsPoint< A >::averagingVolume ( )

Definition at line 1093 of file StatisticsPoint.hcc.

1094 {
1095  exit(-1);
1096 }
template<StatType T>
Mdouble StatisticsPoint< T >::CG_function ( const Vec3D PI)

Returns the value of the course graining function phi(P,PI)

Definition at line 252 of file StatisticsPoint.hcc.

References StatisticsPoint< T >::evaluatePolynomial(), Gaussian, StatisticsPoint< T >::getCGInverseVolume(), StatisticsPoint< T >::getCGShape(), StatisticsPoint< T >::getCGWidthSquared(), StatisticsPoint< T >::getCutoff(), StatisticsPoint< T >::getCutoff2(), StatisticsPoint< T >::getDistanceSquaredNonAveraged(), HeavisideSphere, and Polynomial.

253 {
255  if (getCGShape() == HeavisideSphere)
256  {
257  return (getCGWidthSquared() < dist2) ? 0.0 : getCGInverseVolume();
258  }
259  else if (getCGShape() == Gaussian)
260  {
261  return (getCutoff2() < dist2) ? 0.0 : getCGInverseVolume() * exp(-dist2 / (2.0 * getCGWidthSquared()));
262  }
263  else if (getCGShape() == Polynomial)
264  {
265  return (getCutoff2() < dist2) ? 0.0 : getCGInverseVolume() * evaluatePolynomial(sqrt(dist2) / getCutoff());
266  }
267  else
268  {
269  std::cerr << "error in CG_function" << std::endl;
270  exit(-1);
271  }
272 }
Mdouble evaluatePolynomial(Mdouble r)
see StatisticsVector::evaluatePolynomial
double Mdouble
Mdouble getCutoff()
see StatisticsVector::getCutoff
Mdouble getCutoff2()
see StatisticsVector::getCutoff2
Mdouble getCGWidthSquared() const
see StatisticsVector::getCGWidthSquared
Mdouble getCGInverseVolume()
returns CG_invvolume
CG getCGShape() const
see StatisticsVector::getCGShape
Mdouble getDistanceSquaredNonAveraged(const Vec3D &P)
returns the coarse graining distance in the coordinates that are not averaged about ...
template<>
Mdouble StatisticsPoint< RA >::CG_function ( const Vec3D PI)

Definition at line 1098 of file StatisticsPoint.hcc.

1099 {
1100  return CG_function_2D(PI);
1101 }
Mdouble CG_function_2D(const Vec3D &PI)
returns the value of the course graining function phi(P,PI) averaged along a line ...
template<>
Mdouble StatisticsPoint< RZ >::CG_function ( const Vec3D PI)

Definition at line 1102 of file StatisticsPoint.hcc.

References Gaussian, besselFunc::I0(), mathsFunc::square(), Vec3D::X, Vec3D::Y, and Vec3D::Z.

1103 {
1107  Mdouble Z2 = mathsFunc::square(PI.Z - Position.Z);
1108  if (getCGShape() == Gaussian)
1109  {
1110  return (getCutoff2() < dist2) ? 0.0 : getCGInverseVolume()
1111  * exp(-(R2 + RI2 + Z2) / (2.0 * getCGWidthSquared())) * besselFunc::I0(sqrt(R2 * RI2) / getCGWidthSquared());
1112  }
1113  else
1114  {
1115  std::cerr << "error in CG_function<RZ>" << std::endl;
1116  exit(-1);
1117  }
1118 }
Mdouble X
the vector components
Definition: Vector.h:52
double Mdouble
T square(T val)
squares a number
Definition: ExtendedMath.h:91
Mdouble getCutoff2()
see StatisticsVector::getCutoff2
Mdouble getCGWidthSquared() const
see StatisticsVector::getCGWidthSquared
Mdouble Y
Definition: Vector.h:52
Mdouble getCGInverseVolume()
returns CG_invvolume
Mdouble I0(Mdouble x)
Vec3D Position
Position at which evaluation occurs.
Mdouble Z
Definition: Vector.h:52
CG getCGShape() const
see StatisticsVector::getCGShape
Mdouble getDistanceSquaredNonAveraged(const Vec3D &P)
returns the coarse graining distance in the coordinates that are not averaged about ...
template<>
Mdouble StatisticsPoint< AZ >::CG_function ( const Vec3D )

Definition at line 1119 of file StatisticsPoint.hcc.

1120 {
1121  std::cerr << "error in CG_function<AZ>" << std::endl;
1122  exit(-1);
1123 }
template<>
Mdouble StatisticsPoint< R >::CG_function ( const Vec3D PI)

Definition at line 1124 of file StatisticsPoint.hcc.

References Gaussian, besselFunc::I0(), mathsFunc::square(), Vec3D::X, and Vec3D::Y.

1125 {
1129  if (getCGShape() == Gaussian)
1130  {
1131  return (getCutoff2() < dist2) ? 0.0 : getCGInverseVolume()
1132  * exp(-(R2 + RI2) / (2.0 * getCGWidthSquared())) * besselFunc::I0(sqrt(R2 * RI2) / getCGWidthSquared());
1133  }
1134  else
1135  {
1136  std::cerr << "error in CG_function<R>" << std::endl;
1137  exit(-1);
1138  }
1139 }
Mdouble X
the vector components
Definition: Vector.h:52
double Mdouble
T square(T val)
squares a number
Definition: ExtendedMath.h:91
Mdouble getCutoff2()
see StatisticsVector::getCutoff2
Mdouble getCGWidthSquared() const
see StatisticsVector::getCGWidthSquared
Mdouble Y
Definition: Vector.h:52
Mdouble getCGInverseVolume()
returns CG_invvolume
Mdouble I0(Mdouble x)
Vec3D Position
Position at which evaluation occurs.
CG getCGShape() const
see StatisticsVector::getCGShape
Mdouble getDistanceSquaredNonAveraged(const Vec3D &P)
returns the coarse graining distance in the coordinates that are not averaged about ...
template<>
Mdouble StatisticsPoint< A >::CG_function ( const Vec3D )

Definition at line 1140 of file StatisticsPoint.hcc.

1141 {
1142  std::cerr << "error in CG_function<A>" << std::endl;
1143  exit(-1);
1144 }
template<>
Mdouble StatisticsPoint< XY >::CG_function ( const Vec3D PI)

Definition at line 1146 of file StatisticsPoint.hcc.

1147 {
1148  return CG_function_2D(PI);
1149 }
Mdouble CG_function_2D(const Vec3D &PI)
returns the value of the course graining function phi(P,PI) averaged along a line ...
template<>
Mdouble StatisticsPoint< XZ >::CG_function ( const Vec3D PI)

Definition at line 1150 of file StatisticsPoint.hcc.

1151 {
1152  return CG_function_2D(PI);
1153 }
Mdouble CG_function_2D(const Vec3D &PI)
returns the value of the course graining function phi(P,PI) averaged along a line ...
template<>
Mdouble StatisticsPoint< YZ >::CG_function ( const Vec3D PI)

Definition at line 1154 of file StatisticsPoint.hcc.

1155 {
1156  return CG_function_2D(PI);
1157 }
Mdouble CG_function_2D(const Vec3D &PI)
returns the value of the course graining function phi(P,PI) averaged along a line ...
template<>
Mdouble StatisticsPoint< X >::CG_function ( const Vec3D PI)

Definition at line 1158 of file StatisticsPoint.hcc.

1159 {
1160  return CG_function_1D(PI);
1161 }
Mdouble CG_function_1D(const Vec3D &PI)
Returns the value of the course graining function phi(P,PI) averaged along a plane.
template<>
Mdouble StatisticsPoint< Y >::CG_function ( const Vec3D PI)

Definition at line 1162 of file StatisticsPoint.hcc.

1163 {
1164  return CG_function_1D(PI);
1165 }
Mdouble CG_function_1D(const Vec3D &PI)
Returns the value of the course graining function phi(P,PI) averaged along a plane.
template<>
Mdouble StatisticsPoint< Z >::CG_function ( const Vec3D PI)

Definition at line 1166 of file StatisticsPoint.hcc.

1167 {
1168  return CG_function_1D(PI);
1169 }
Mdouble CG_function_1D(const Vec3D &PI)
Returns the value of the course graining function phi(P,PI) averaged along a plane.
template<>
Mdouble StatisticsPoint< O >::CG_function ( const Vec3D )

Definition at line 1170 of file StatisticsPoint.hcc.

1171 {
1172  return getCGInverseVolume();
1173 }
Mdouble getCGInverseVolume()
returns CG_invvolume
template<StatType T>
Mdouble StatisticsPoint< T >::CG_function_1D ( const Vec3D PI)

Returns the value of the course graining function phi(P,PI) averaged along a plane.

Definition at line 306 of file StatisticsPoint.hcc.

References StatisticsPoint< T >::evaluatePolynomial(), Gaussian, StatisticsPoint< T >::getCGInverseVolume(), StatisticsPoint< T >::getCGShape(), StatisticsPoint< T >::getCGWidthSquared(), StatisticsPoint< T >::getCutoff(), StatisticsPoint< T >::getCutoff2(), StatisticsPoint< T >::getDistanceSquaredNonAveraged(), HeavisideSphere, constants::pi, and Polynomial.

Referenced by StatisticsPoint< T >::CG_integral_1D(), and StatisticsPoint< T >::CG_integral_2D().

307 {
309  if (getCGShape() == HeavisideSphere)
310  {
311  return (getCGWidthSquared() < dist2) ? 0.0 : (getCGInverseVolume() * constants::pi * (getCGWidthSquared() - dist2));
312  }
313  else if (getCGShape() == Gaussian)
314  {
315  return (getCutoff2() < dist2) ? 0.0 : getCGInverseVolume() * exp(-dist2 / (2.0 * getCGWidthSquared()));
316  }
317  else if (getCGShape() == Polynomial)
318  {
319  return (getCutoff2() < dist2) ? 0.0 : getCGInverseVolume() * evaluatePolynomial(sqrt(dist2) / getCutoff());
320  }
321  else
322  {
323  std::cerr << "error in CG_function_1D" << std::endl;
324  exit(-1);
325  }
326 }
Mdouble evaluatePolynomial(Mdouble r)
see StatisticsVector::evaluatePolynomial
double Mdouble
Mdouble getCutoff()
see StatisticsVector::getCutoff
const Mdouble pi
Definition: ExtendedMath.h:42
Mdouble getCutoff2()
see StatisticsVector::getCutoff2
Mdouble getCGWidthSquared() const
see StatisticsVector::getCGWidthSquared
Mdouble getCGInverseVolume()
returns CG_invvolume
CG getCGShape() const
see StatisticsVector::getCGShape
Mdouble getDistanceSquaredNonAveraged(const Vec3D &P)
returns the coarse graining distance in the coordinates that are not averaged about ...
template<StatType T>
Mdouble StatisticsPoint< T >::CG_function_2D ( const Vec3D PI)

returns the value of the course graining function phi(P,PI) averaged along a line

Todo:
the volume should be calculated in setCGInverseVolume

Definition at line 275 of file StatisticsPoint.hcc.

References StatisticsPoint< T >::evaluatePolynomial(), Gaussian, StatisticsPoint< T >::getCGInverseVolume(), StatisticsPoint< T >::getCGShape(), StatisticsPoint< T >::getCGWidthSquared(), StatisticsPoint< T >::getCutoff(), StatisticsPoint< T >::getCutoff2(), StatisticsPoint< T >::getDistanceSquaredNonAveraged(), HeavisideSphere, and Polynomial.

276 {
278  if (getCGShape() == HeavisideSphere)
279  {
280  if (getCGWidthSquared() < dist2)
281  return 0.0;
282  else
283  {
284  Mdouble wn = sqrt(getCGWidthSquared() - dist2);
285  return getCGInverseVolume() * 2.0 * wn;
287  //return getCGInverseVolume()*(std::min(wn,gb->getObjectDistanceLeft()) +std::min(wn,gb->getObjectDistanceRight()));
288  }
289  }
290  else if (getCGShape() == Gaussian)
291  {
292  return (getCutoff2() < dist2) ? 0.0 : getCGInverseVolume() * exp(-dist2 / (2.0 * getCGWidthSquared()));
293  }
294  else if (getCGShape() == Polynomial)
295  {
296  return (getCutoff2() < dist2) ? 0.0 : getCGInverseVolume() * evaluatePolynomial(sqrt(dist2) / getCutoff());
297  }
298  else
299  {
300  std::cerr << "error in CG_function_2D" << std::endl;
301  exit(-1);
302  }
303 }
Mdouble evaluatePolynomial(Mdouble r)
see StatisticsVector::evaluatePolynomial
double Mdouble
Mdouble getCutoff()
see StatisticsVector::getCutoff
Mdouble getCutoff2()
see StatisticsVector::getCutoff2
Mdouble getCGWidthSquared() const
see StatisticsVector::getCGWidthSquared
Mdouble getCGInverseVolume()
returns CG_invvolume
CG getCGShape() const
see StatisticsVector::getCGShape
Mdouble getDistanceSquaredNonAveraged(const Vec3D &P)
returns the coarse graining distance in the coordinates that are not averaged about ...
template<StatType T>
Vec3D StatisticsPoint< T >::CG_gradient ( const Vec3D P,
const Mdouble  phi 
)

gradient of phi

Todo:
{Only implemented for Gaussian}

Definition at line 329 of file StatisticsPoint.hcc.

References StatisticsPoint< T >::evaluatePolynomialGradient(), Gaussian, StatisticsPoint< T >::getCGInverseVolume(), StatisticsPoint< T >::getCGShape(), StatisticsPoint< T >::getCGWidth(), StatisticsPoint< T >::getCGWidthSquared(), Vec3D::getLength(), Polynomial, and StatisticsPoint< T >::Position.

330 {
331  //CG_type_todo
332  if (getCGShape() == Gaussian)
333  {
334  return (P - Position) * (phi / getCGWidthSquared());
335  }
336  else if (getCGShape() == Polynomial)
337  {
340  }
341  else
342  {
343  std::cerr << "error in CG_gradient" << std::endl;
344  exit(-1);
345  }
346 }
double Mdouble
Mdouble getCGWidth() const
see StatisticsVector::getCGWidth
Mdouble getCGWidthSquared() const
see StatisticsVector::getCGWidthSquared
Mdouble getLength() const
Calculates the length of this Vec3D: .
Definition: Vector.cc:416
Mdouble getCGInverseVolume()
returns CG_invvolume
Vec3D Position
Position at which evaluation occurs.
Mdouble evaluatePolynomialGradient(Mdouble r)
see StatisticsVector::evaluatePolynomialGradient
CG getCGShape() const
see StatisticsVector::getCGShape
template<>
Vec3D StatisticsPoint< YZ >::CG_gradient ( const Vec3D P,
const Mdouble  phi 
)

Definition at line 1175 of file StatisticsPoint.hcc.

References Gaussian, Vec3D::Y, and Vec3D::Z.

1176 {
1177  //CG_type_todo
1178  if (getCGShape() == Gaussian)
1179  {
1180  return Vec3D(0.0, P.Y - Position.Y, P.Z - Position.Z) * (phi / getCGWidthSquared());
1181  }
1182  else
1183  {
1184  std::cerr << "error in CG_gradient<YZ>" << std::endl;
1185  exit(-1);
1186  }
1187 }
Mdouble getCGWidthSquared() const
see StatisticsVector::getCGWidthSquared
Mdouble Y
Definition: Vector.h:52
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
Vec3D Position
Position at which evaluation occurs.
Mdouble Z
Definition: Vector.h:52
CG getCGShape() const
see StatisticsVector::getCGShape
template<>
Vec3D StatisticsPoint< XZ >::CG_gradient ( const Vec3D P,
const Mdouble  phi 
)

Definition at line 1188 of file StatisticsPoint.hcc.

References Gaussian, Vec3D::X, and Vec3D::Z.

1189 {
1190  //CG_type_todo
1191  if (getCGShape() == Gaussian)
1192  {
1193  return Vec3D(P.X - Position.X, 0.0, P.Z - Position.Z) * (phi / getCGWidthSquared());
1194  }
1195  else
1196  {
1197  std::cerr << "error in CG_gradient<XZ>" << std::endl;
1198  exit(-1);
1199  }
1200 }
Mdouble X
the vector components
Definition: Vector.h:52
Mdouble getCGWidthSquared() const
see StatisticsVector::getCGWidthSquared
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
Vec3D Position
Position at which evaluation occurs.
Mdouble Z
Definition: Vector.h:52
CG getCGShape() const
see StatisticsVector::getCGShape
template<>
Vec3D StatisticsPoint< XY >::CG_gradient ( const Vec3D P,
const Mdouble  phi 
)

Definition at line 1201 of file StatisticsPoint.hcc.

References Gaussian, Vec3D::X, and Vec3D::Y.

1202 {
1203  //CG_type_todo
1204  if (getCGShape() == Gaussian)
1205  {
1206  return Vec3D(P.X - Position.X, P.Y - Position.Y, 0.0) * (phi / getCGWidthSquared());
1207  }
1208  else
1209  {
1210  std::cerr << "error in CG_gradient<XY>" << std::endl;
1211  exit(-1);
1212  }
1213 }
Mdouble X
the vector components
Definition: Vector.h:52
Mdouble getCGWidthSquared() const
see StatisticsVector::getCGWidthSquared
Mdouble Y
Definition: Vector.h:52
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
Vec3D Position
Position at which evaluation occurs.
CG getCGShape() const
see StatisticsVector::getCGShape
template<>
Vec3D StatisticsPoint< X >::CG_gradient ( const Vec3D P,
const Mdouble  phi 
)

Definition at line 1215 of file StatisticsPoint.hcc.

References Gaussian, Polynomial, and Vec3D::X.

1216 {
1217  //CG_type_todo
1218  if (getCGShape() == Gaussian)
1219  {
1220  return Vec3D((P.X - Position.X) * (phi / getCGWidthSquared()), 0.0, 0.0);
1221  }
1222  else if (getCGShape() == Polynomial)
1223  {
1224  Mdouble r = fabs(Position.X - P.X) / getCGWidth();
1225  return Vec3D(getCGInverseVolume() * evaluatePolynomialGradient(r) / r / getCGWidthSquared() * (Position.X - P.X), 0, 0);
1226  }
1227  else
1228  {
1229  std::cerr << "error in CG_gradient<X>" << std::endl;
1230  exit(-1);
1231  }
1232 }
Mdouble X
the vector components
Definition: Vector.h:52
double Mdouble
Mdouble getCGWidth() const
see StatisticsVector::getCGWidth
Mdouble getCGWidthSquared() const
see StatisticsVector::getCGWidthSquared
Mdouble getCGInverseVolume()
returns CG_invvolume
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
Vec3D Position
Position at which evaluation occurs.
Mdouble evaluatePolynomialGradient(Mdouble r)
see StatisticsVector::evaluatePolynomialGradient
CG getCGShape() const
see StatisticsVector::getCGShape
template<>
Vec3D StatisticsPoint< Y >::CG_gradient ( const Vec3D P,
const Mdouble  phi 
)

Definition at line 1233 of file StatisticsPoint.hcc.

References Gaussian, Polynomial, and Vec3D::Y.

1234 {
1235  //CG_type_todo
1236  if (getCGShape() == Gaussian)
1237  {
1238  return Vec3D(0.0, (P.Y - Position.Y) * (phi / getCGWidthSquared()), 0.0);
1239  }
1240  else if (getCGShape() == Polynomial)
1241  {
1242  Mdouble r = fabs(Position.Y - P.Y) / getCGWidth();
1243  return Vec3D(0, getCGInverseVolume() * evaluatePolynomialGradient(r) / r / getCGWidthSquared() * (Position.Y - P.Y), 0);
1244  }
1245  else
1246  {
1247  std::cerr << "error in CG_gradient<Y>" << std::endl;
1248  exit(-1);
1249  }
1250 }
double Mdouble
Mdouble getCGWidth() const
see StatisticsVector::getCGWidth
Mdouble getCGWidthSquared() const
see StatisticsVector::getCGWidthSquared
Mdouble Y
Definition: Vector.h:52
Mdouble getCGInverseVolume()
returns CG_invvolume
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
Vec3D Position
Position at which evaluation occurs.
Mdouble evaluatePolynomialGradient(Mdouble r)
see StatisticsVector::evaluatePolynomialGradient
CG getCGShape() const
see StatisticsVector::getCGShape
template<>
Vec3D StatisticsPoint< Z >::CG_gradient ( const Vec3D P,
const Mdouble  phi 
)

Definition at line 1251 of file StatisticsPoint.hcc.

References Gaussian, Polynomial, and Vec3D::Z.

1252 {
1253  //CG_type_todo
1254  if (getCGShape() == Gaussian)
1255  {
1256  return Vec3D(0.0, 0.0, (P.Z - Position.Z) * (phi / getCGWidthSquared()));
1257  }
1258  else if (getCGShape() == Polynomial)
1259  {
1260  Mdouble r = fabs(Position.Z - P.Z) / getCGWidth();
1261  return Vec3D(0, 0, getCGInverseVolume() * evaluatePolynomialGradient(r) / r / getCGWidthSquared() * (Position.Z - P.Z));
1262  }
1263  else
1264  {
1265  std::cerr << "error in CG_gradient<Z>" << std::endl;
1266  exit(-1);
1267  }
1268 }
double Mdouble
Mdouble getCGWidth() const
see StatisticsVector::getCGWidth
Mdouble getCGWidthSquared() const
see StatisticsVector::getCGWidthSquared
Mdouble getCGInverseVolume()
returns CG_invvolume
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
Vec3D Position
Position at which evaluation occurs.
Mdouble Z
Definition: Vector.h:52
Mdouble evaluatePolynomialGradient(Mdouble r)
see StatisticsVector::evaluatePolynomialGradient
CG getCGShape() const
see StatisticsVector::getCGShape
template<>
Vec3D StatisticsPoint< O >::CG_gradient ( const Vec3D ,
const Mdouble   
)

Definition at line 1270 of file StatisticsPoint.hcc.

1271 {
1272  return Vec3D(0.0, 0.0, 0.0);
1273 }
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
template<StatType T>
Mdouble StatisticsPoint< T >::CG_integral ( Vec3D P1,
Vec3D P2,
Vec3D P1_P2_normal,
Mdouble  P1_P2_distance,
Vec3D rpsi 
)

Returns the value of the coarse graining integral $ \psi(P,PI,PJ) = \int_0^1 \phi(P - PI + s PJ) ds $.

/todo{Thomas: rpsi_scalar is not always set}

Todo:
.fstat/.restart/.data/.stat should be by default in binary, with text output as option.

we need a converter tool binary->text / text->binary text version of .fstat and the particle data in .restart should have a header should .fstat report every p-p collision twice?

Definition at line 479 of file StatisticsPoint.hcc.

References StatisticsPoint< T >::compute_Gaussian_invvolume(), StatisticsPoint< T >::dotNonAveraged(), StatisticsPoint< T >::evaluateIntegral(), Gaussian, StatisticsPoint< T >::gb, StatisticsPoint< T >::getCGInverseVolume(), StatisticsPoint< T >::getCGShape(), StatisticsPoint< T >::getCGWidth(), StatisticsPoint< T >::getCGWidthSquared(), StatisticsPoint< T >::getCutoff(), StatisticsPoint< T >::getCutoff2(), Vec3D::getLength(), HeavisideSphere, Polynomial, StatisticsPoint< T >::Position, constants::sqrt_2, and constants::sqrt_pi.

480 {
481  //apply the cutoff in normal direction:
482  Vec3D P_P1 = Position - P1;
483  Mdouble a = dotNonAveraged(P_P1,P1_P2_normal);
484  if ( a > getCutoff() ) return 0.0;
485  Vec3D P_P2 = Position - P2;
486  Mdouble b = dotNonAveraged(P_P2,P1_P2_normal);
487  if ( -b > getCutoff() ) return 0.0;
488  //apply the cutoff in tangential direction:
489  Vec3D tangential = P_P1 - a * P1_P2_normal;
490  if (dotNonAveraged(tangential,tangential)>getCutoff2()) return 0.0;
491  //evaluate:
493  {
494  Mdouble wn2 = getCGWidthSquared() - dotNonAveraged(tangential,tangential);
495  if ((wn2<=0) | (a*fabs(a)>=wn2) | (b*fabs(b)<=-wn2))
496  {
497  return 0;
498  }
499  else
500  {
501  Mdouble wn = sqrt(wn2);
502  return getCGInverseVolume()*( std::min(b,wn)-std::max(a,-wn) ) / P1_P2_distance;
503  }
504  }
505  else if (getCGShape()==Gaussian)
506  { //Gaussian
507  static Mdouble InvVolumeExp = compute_Gaussian_invvolume(gb->getSystemDimensions()-1);
508  static Mdouble w_sqrt_2 = constants::sqrt_2*getCGWidth();
509  static Mdouble P1_P2_distance_for_cutoff=-1, InvVolumeErf=-1;
510  if (P1_P2_distance_for_cutoff!=P1_P2_distance)
511  {
512  P1_P2_distance_for_cutoff = P1_P2_distance;
513  Mdouble amax = -getCutoff();
514  Mdouble bmax = getCutoff()+P1_P2_distance;
515  InvVolumeErf = P1_P2_distance/(
516  erf(bmax/w_sqrt_2)*bmax+w_sqrt_2/constants::sqrt_pi*exp(-bmax*bmax/(w_sqrt_2*w_sqrt_2))
517  -erf(amax/w_sqrt_2)*amax-w_sqrt_2/constants::sqrt_pi*exp(-amax*amax/(w_sqrt_2*w_sqrt_2)));
518  // std::cout << "InvVolumeErf" << InvVolumeErf << " InvVolumeExp" << InvVolumeExp << " f" << getCGInverseVolume() * sqrt(2*constants::pi*getCGWidthSquared()) << std::endl;
519  }
520  Mdouble psi=exp(-dotNonAveraged(tangential,tangential)/(2.0*getCGWidthSquared())) * InvVolumeExp
521  * ( erf(b/w_sqrt_2) - erf(a/w_sqrt_2) ) * InvVolumeErf /2./P1_P2_distance;
522  rpsi=Position*psi;
523  return psi;
524  }
525  else if (getCGShape()==Polynomial)
526  {
527  double wn2 = getCGWidthSquared() - dotNonAveraged(tangential,tangential);
528  if ((wn2<=0) | (a*fabs(a)>=wn2) | (b*fabs(b)<=-wn2))
529  {
530  return 0;
531  }
532  else
533  {
534  double wn = sqrt(wn2);
535  double w = getCGWidth();
536  return getCGInverseVolume()*evaluateIntegral(std::max(a,-wn)/w,std::min(b,wn)/w,tangential.getLength()/w)*w / P1_P2_distance;
537  }
538  //CG_type_todo
539  }
540  else
541  { std::cerr << "error in CG_integral" << std::endl; exit(-1);}
542 }
const Mdouble sqrt_pi
Definition: ExtendedMath.h:43
double Mdouble
Mdouble evaluateIntegral(Mdouble n1, Mdouble n2, Mdouble t)
see StatisticsVector::evaluateIntegral
Mdouble getCGWidth() const
see StatisticsVector::getCGWidth
static Mdouble getLength(const Vec3D &a)
Calculates the length of a Vec3D: .
Definition: Vector.cc:427
Mdouble getCutoff()
see StatisticsVector::getCutoff
Mdouble getCutoff2()
see StatisticsVector::getCutoff2
const Mdouble sqrt_2
Definition: ExtendedMath.h:45
Mdouble getCGWidthSquared() const
see StatisticsVector::getCGWidthSquared
Mdouble dotNonAveraged(const Vec3D &P, const Vec3D &Q)
Returns the dot product of two vectors in the coordinates that are not averaged about.
Mdouble getCGInverseVolume()
returns CG_invvolume
double compute_Gaussian_invvolume(int dim)
computes CG_invvolume if CG_type=Gaussian
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
Vec3D Position
Position at which evaluation occurs.
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
CG getCGShape() const
see StatisticsVector::getCGShape
template<>
Mdouble StatisticsPoint< RA >::CG_integral ( Vec3D P1,
Vec3D P2,
Vec3D P1_P2_normal,
Mdouble  P1_P2_distance,
Vec3D rpsi 
)

Definition at line 1288 of file StatisticsPoint.hcc.

1289 {
1290  Mdouble rpsi_scalar;
1291  Mdouble psi = CG_integral_2D(P1, P2, P1_P2_normal, P1_P2_distance, rpsi_scalar);
1292  rpsi = Position * psi;
1293  return psi;
1294 }
double Mdouble
Mdouble CG_integral_2D(Vec3D &P1, Vec3D &P2, Vec3D &P1_P2_normal, Mdouble P1_P2_distance, Mdouble &rpsi_scalar)
Returns the value of the coarse graining integral averaged along a line.
Vec3D Position
Position at which evaluation occurs.
template<>
Mdouble StatisticsPoint< RZ >::CG_integral ( Vec3D P1,
Vec3D P2,
Vec3D ,
Mdouble  ,
Vec3D &rpsi  UNUSED 
)

Definition at line 1295 of file StatisticsPoint.hcc.

1296 {
1297  Vec3D P=(P1+P2)/2; return CG_function(P);
1298 }
Mdouble CG_function(const Vec3D &PI)
Returns the value of the course graining function phi(P,PI)
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
template<>
Mdouble StatisticsPoint< AZ >::CG_integral ( Vec3D ,
Vec3D ,
Vec3D ,
Mdouble  ,
Vec3D &rpsi  UNUSED 
)

Definition at line 1299 of file StatisticsPoint.hcc.

1300 {
1301  std::cerr << "error in CG_function<AZ>" << std::endl; exit(-1);
1302 }
template<>
Mdouble StatisticsPoint< R >::CG_integral ( Vec3D P1,
Vec3D P2,
Vec3D ,
Mdouble  ,
Vec3D &rpsi  UNUSED 
)

Definition at line 1303 of file StatisticsPoint.hcc.

1304 {
1305  Vec3D P=(P1+P2)/2; return CG_function(P);
1306 }
Mdouble CG_function(const Vec3D &PI)
Returns the value of the course graining function phi(P,PI)
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
template<>
Mdouble StatisticsPoint< A >::CG_integral ( Vec3D ,
Vec3D ,
Vec3D ,
Mdouble  ,
Vec3D &rpsi  UNUSED 
)

Definition at line 1307 of file StatisticsPoint.hcc.

1308 {
1309  std::cerr << "error in CG_function<A>" << std::endl; exit(-1);
1310 }
template<>
Mdouble StatisticsPoint< XY >::CG_integral ( Vec3D P1,
Vec3D P2,
Vec3D P1_P2_normal,
Mdouble  P1_P2_distance,
Vec3D rpsi 
)

Definition at line 1312 of file StatisticsPoint.hcc.

References Vec3D::Z.

1313 {
1314  Mdouble rpsi_scalar = 0;
1315  Mdouble psi = CG_integral_2D(P1, P2, P1_P2_normal, P1_P2_distance, rpsi_scalar);
1316  rpsi = Vec3D(Position.X * psi, Position.Y * psi, P1.Z * psi - (P1.Z - P2.Z) * rpsi_scalar);
1317  return psi;
1318 }
Mdouble X
the vector components
Definition: Vector.h:52
double Mdouble
Mdouble CG_integral_2D(Vec3D &P1, Vec3D &P2, Vec3D &P1_P2_normal, Mdouble P1_P2_distance, Mdouble &rpsi_scalar)
Returns the value of the coarse graining integral averaged along a line.
Mdouble Y
Definition: Vector.h:52
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
Vec3D Position
Position at which evaluation occurs.
Mdouble Z
Definition: Vector.h:52
template<>
Mdouble StatisticsPoint< XZ >::CG_integral ( Vec3D P1,
Vec3D P2,
Vec3D P1_P2_normal,
Mdouble  P1_P2_distance,
Vec3D rpsi 
)

Definition at line 1319 of file StatisticsPoint.hcc.

References Vec3D::Y.

1320 {
1321  Mdouble rpsi_scalar = 0;
1322  Mdouble psi = CG_integral_2D(P1, P2, P1_P2_normal, P1_P2_distance, rpsi_scalar);
1323  rpsi = Vec3D(Position.X * psi, P1.Y * psi - (P1.Y - P2.Y) * rpsi_scalar, Position.Z * psi);
1324  return psi;
1325 }
Mdouble X
the vector components
Definition: Vector.h:52
double Mdouble
Mdouble CG_integral_2D(Vec3D &P1, Vec3D &P2, Vec3D &P1_P2_normal, Mdouble P1_P2_distance, Mdouble &rpsi_scalar)
Returns the value of the coarse graining integral averaged along a line.
Mdouble Y
Definition: Vector.h:52
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
Vec3D Position
Position at which evaluation occurs.
Mdouble Z
Definition: Vector.h:52
template<>
Mdouble StatisticsPoint< YZ >::CG_integral ( Vec3D P1,
Vec3D P2,
Vec3D P1_P2_normal,
Mdouble  P1_P2_distance,
Vec3D rpsi 
)

Definition at line 1326 of file StatisticsPoint.hcc.

References Vec3D::X.

1327 {
1328  Mdouble rpsi_scalar = 0;
1329  Mdouble psi = CG_integral_2D(P1, P2, P1_P2_normal, P1_P2_distance, rpsi_scalar);
1330  rpsi = Vec3D(P1.X * psi - (P1.X - P2.X) * rpsi_scalar, Position.Y * psi, Position.Z * psi);
1331  return psi;
1332 }
Mdouble X
the vector components
Definition: Vector.h:52
double Mdouble
Mdouble CG_integral_2D(Vec3D &P1, Vec3D &P2, Vec3D &P1_P2_normal, Mdouble P1_P2_distance, Mdouble &rpsi_scalar)
Returns the value of the coarse graining integral averaged along a line.
Mdouble Y
Definition: Vector.h:52
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
Vec3D Position
Position at which evaluation occurs.
Mdouble Z
Definition: Vector.h:52
template<>
Mdouble StatisticsPoint< X >::CG_integral ( Vec3D P1,
Vec3D P2,
Vec3D P1_P2_normal,
Mdouble  P1_P2_distance,
Vec3D rpsi 
)

Definition at line 1333 of file StatisticsPoint.hcc.

References Vec3D::Y, and Vec3D::Z.

1334 {
1335  Mdouble rpsi_scalar = 0;
1336  Mdouble psi = CG_integral_1D(P1, P2, P1_P2_normal, P1_P2_distance, rpsi_scalar);
1337  rpsi = Vec3D(Position.X * psi, P1.Y * psi - (P1.Y - P2.Y) * rpsi_scalar, P1.Z * psi - (P1.Z - P2.Z) * rpsi_scalar);
1338  return psi;
1339 }
Mdouble X
the vector components
Definition: Vector.h:52
double Mdouble
Mdouble Y
Definition: Vector.h:52
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
Vec3D Position
Position at which evaluation occurs.
Mdouble Z
Definition: Vector.h:52
Mdouble CG_integral_1D(Vec3D &P1, Vec3D &P2, Vec3D &P1_P2_normal, Mdouble P1_P2_distance, Mdouble &rpsi_scalar)
Returns the value of the coarse graining integral averaged along a plane.
template<>
Mdouble StatisticsPoint< Y >::CG_integral ( Vec3D P1,
Vec3D P2,
Vec3D P1_P2_normal,
Mdouble  P1_P2_distance,
Vec3D rpsi 
)

Definition at line 1340 of file StatisticsPoint.hcc.

References Vec3D::X, and Vec3D::Z.

1341 {
1342  Mdouble rpsi_scalar = 0;
1343  Mdouble psi = CG_integral_1D(P1, P2, P1_P2_normal, P1_P2_distance, rpsi_scalar);
1344  rpsi = Vec3D(P1.X * psi - (P1.X - P2.X) * rpsi_scalar, Position.Y * psi, P1.Z * psi - (P1.Z - P2.Z) * rpsi_scalar);
1345  return psi;
1346 }
Mdouble X
the vector components
Definition: Vector.h:52
double Mdouble
Mdouble Y
Definition: Vector.h:52
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
Vec3D Position
Position at which evaluation occurs.
Mdouble Z
Definition: Vector.h:52
Mdouble CG_integral_1D(Vec3D &P1, Vec3D &P2, Vec3D &P1_P2_normal, Mdouble P1_P2_distance, Mdouble &rpsi_scalar)
Returns the value of the coarse graining integral averaged along a plane.
template<>
Mdouble StatisticsPoint< Z >::CG_integral ( Vec3D P1,
Vec3D P2,
Vec3D P1_P2_normal,
Mdouble  P1_P2_distance,
Vec3D rpsi 
)

Definition at line 1347 of file StatisticsPoint.hcc.

References Vec3D::X, and Vec3D::Y.

1348 {
1349  Mdouble rpsi_scalar = 0;
1350  Mdouble psi = CG_integral_1D(P1, P2, P1_P2_normal, P1_P2_distance, rpsi_scalar);
1351  rpsi = Vec3D(P1.X * psi - (P1.X - P2.X) * rpsi_scalar, P1.Y * psi - (P1.Y - P2.Y) * rpsi_scalar, Position.Z * psi);
1352  return psi;
1353 }
Mdouble X
the vector components
Definition: Vector.h:52
double Mdouble
Mdouble Y
Definition: Vector.h:52
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
Vec3D Position
Position at which evaluation occurs.
Mdouble Z
Definition: Vector.h:52
Mdouble CG_integral_1D(Vec3D &P1, Vec3D &P2, Vec3D &P1_P2_normal, Mdouble P1_P2_distance, Mdouble &rpsi_scalar)
Returns the value of the coarse graining integral averaged along a plane.
template<>
Mdouble StatisticsPoint< O >::CG_integral ( Vec3D P1,
Vec3D &P2  UNUSED,
Vec3D &P1_P2_normal  UNUSED,
Mdouble P1_P2_distance  UNUSED,
Vec3D rpsi 
)
Todo:
Is that right?

Definition at line 1354 of file StatisticsPoint.hcc.

1355 {
1356  Mdouble psi = getCGInverseVolume();
1357  rpsi=P1*psi;
1358  return psi;
1359 }
double Mdouble
Mdouble getCGInverseVolume()
returns CG_invvolume
template<StatType T>
Mdouble StatisticsPoint< T >::CG_integral_1D ( Vec3D P1,
Vec3D P2,
Vec3D P1_P2_normal,
Mdouble  P1_P2_distance,
Mdouble rpsi_scalar 
)

Returns the value of the coarse graining integral $ \psi(P,PI,PJ) = \int_0^1 \phi(P - PI + s PJ) ds $ averaged along a plane.

/todo{Thomas: rpsi_scalar is not always set}

Definition at line 641 of file StatisticsPoint.hcc.

References StatisticsPoint< T >::averagingVolume(), StatisticsPoint< T >::CG_function_1D(), StatisticsPoint< T >::dotNonAveraged(), StatisticsPoint< T >::evaluateIntegral(), Gaussian, StatisticsPoint< T >::getCGInverseVolume(), StatisticsPoint< T >::getCGShape(), StatisticsPoint< T >::getCGWidth(), StatisticsPoint< T >::getCGWidthSquared(), StatisticsPoint< T >::getCutoff(), StatisticsPoint< T >::getCutoff2(), Vec3D::getLengthSquared(), HeavisideSphere, constants::pi, Polynomial, StatisticsPoint< T >::Position, constants::sqrt_2, constants::sqrt_pi, and mathsFunc::square().

642 {
643  //apply the cutoff in normal direction:
644  Vec3D P_P1 = Position - P1;
645  Mdouble a = dotNonAveraged(P_P1, P1_P2_normal);
646  if (a > getCutoff())
647  return 0.0;
648  Vec3D P_P2 = Position - P2;
649  Mdouble b = dotNonAveraged(P_P2, P1_P2_normal);
650  if (-b > getCutoff())
651  return 0.0;
652  //apply the cutoff in tangential direction:
653  Vec3D tangential = P_P1 - a * P1_P2_normal;
654  if (dotNonAveraged(tangential, tangential) > getCutoff2())
655  return 0.0;
656  if (getCGShape() == HeavisideSphere)
657  {
658  Mdouble wn2 = getCGWidthSquared() - dotNonAveraged(tangential, tangential);
659  if ((wn2 <= 0) | (a * fabs(a) >= wn2) | (b * fabs(b) <= -wn2))
660  {
661  return 0;
662  }
663  else
664  {
665  //if the normal is parallel to the averaging direction
666  if (std::max(fabs(a), fabs(b)) < 1e-20)
667  {
668  return getCGInverseVolume() * constants::pi * wn2;
669  }
670  Mdouble wn = sqrt(wn2);
671  return getCGInverseVolume() / P1_P2_distance
672  * (((b >= wn) ? (2.0 / 3.0 * constants::pi * wn2 * wn) : (b * constants::pi * (wn2 - mathsFunc::square(b) / 3.0)))
673  - ((a <= -wn) ? (-2.0 / 3.0 * constants::pi * wn2 * wn) : (a * constants::pi * (wn2 - mathsFunc::square(a) / 3.0))));
674  }
675  }
676  else if (getCGShape() == Gaussian)
677  { //Gaussian
678  if (fabs(b - a) < 1e-20)
679  {
680  return getCGInverseVolume() * exp(-dotNonAveraged(P_P1, P_P1) / (2.0 * getCGWidthSquared()));
681  }
682  static Mdouble w_sqrt_2 = constants::sqrt_2 * getCGWidth();
683  static Mdouble P1_P2_distance_for_cutoff = -1, InvVolumeErf = -1;
684  if (P1_P2_distance_for_cutoff != P1_P2_distance)
685  {
686  P1_P2_distance_for_cutoff = P1_P2_distance;
687  Mdouble amax = -getCutoff();
688  Mdouble bmax = getCutoff() + P1_P2_distance;
689  InvVolumeErf = P1_P2_distance / (
690  erf(bmax / w_sqrt_2) * bmax + w_sqrt_2 / constants::sqrt_pi * exp(-bmax * bmax / (w_sqrt_2 * w_sqrt_2))
691  - erf(amax / w_sqrt_2) * amax - w_sqrt_2 / constants::sqrt_pi * exp(-amax * amax / (w_sqrt_2 * w_sqrt_2))
692  ) / averagingVolume();
693  //std::cout << "InvVolumeErf" << InvVolumeErf << " InvVolumeExp" << InvVolumeExp << " f" << getCGInverseVolume() * sqrt(2*constants::pi*getCGWidthSquared()) << std::endl;
694  }
695  //Note: use dot(t,t), GetLength2(t), as dot only works on non-averaged directions
696  Mdouble psi = (erf(b / w_sqrt_2) - erf(a / w_sqrt_2)) * InvVolumeErf / 2. / P1_P2_distance;
697  Mdouble phi1 = getCGInverseVolume() * exp(-dotNonAveraged(P_P1, P_P1) / (2.0 * getCGWidthSquared()));
698  Mdouble phi2 = getCGInverseVolume() * exp(-dotNonAveraged(P_P2, P_P2) / (2.0 * getCGWidthSquared()));
699  rpsi_scalar = -a / P1_P2_distance * psi + getCGWidthSquared() / P1_P2_distance / P1_P2_distance * (phi1 - phi2);
700  return psi;
701  }
702  else if (getCGShape() == Polynomial)
703  {
704  //~ std::cout << setprecision(12) << P1_P2_normal << std::endl;
705  double wn2 = getCGWidthSquared() - dotNonAveraged(tangential, tangential);
706  if ((wn2 <= 0) | (a * fabs(a) >= wn2) | (b * fabs(b) <= -wn2))
707  {
708  return 0;
709  }
710  else if ((P1_P2_distance < 1e-12) | (Vec3D::getLengthSquared(tangential) < 1e-24))
711  {
712  //~ } else if (fabs(b-a)<1e-12) {
713  //if the normal is parallel to the averaging direction
714  //~ std::cout << "normal is parallel to the averaging direction: "
715  //~ << " P_P1 " << P1_P2_distance
716  //~ << " psi= " << CG_function_1D(P1) << std::endl;
717  return CG_function_1D(P1);
718  }
719  else
720  {
721  double wn = sqrt(wn2);
722  double w = getCGWidth();
723  return getCGInverseVolume() * evaluateIntegral(std::max(a, -wn) / w, std::min(b, wn) / w, dotNonAveraged(tangential, tangential) / w) * w / P1_P2_distance;
724  }
725  }
726  else
727  {
728  std::cerr << "error in CG_integral_1D" << std::endl;
729  exit(-1);
730  }
731  std::cout << "eind testje" << rpsi_scalar << std::endl;
732 }
Mdouble CG_function_1D(const Vec3D &PI)
Returns the value of the course graining function phi(P,PI) averaged along a plane.
const Mdouble sqrt_pi
Definition: ExtendedMath.h:43
double Mdouble
Mdouble evaluateIntegral(Mdouble n1, Mdouble n2, Mdouble t)
see StatisticsVector::evaluateIntegral
Mdouble getCGWidth() const
see StatisticsVector::getCGWidth
T square(T val)
squares a number
Definition: ExtendedMath.h:91
Mdouble getLengthSquared() const
Calculates the squared length of this Vec3D: .
Definition: Vector.cc:313
Mdouble getCutoff()
see StatisticsVector::getCutoff
double averagingVolume()
const Mdouble pi
Definition: ExtendedMath.h:42
Mdouble getCutoff2()
see StatisticsVector::getCutoff2
const Mdouble sqrt_2
Definition: ExtendedMath.h:45
Mdouble getCGWidthSquared() const
see StatisticsVector::getCGWidthSquared
Mdouble dotNonAveraged(const Vec3D &P, const Vec3D &Q)
Returns the dot product of two vectors in the coordinates that are not averaged about.
Mdouble getCGInverseVolume()
returns CG_invvolume
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
Vec3D Position
Position at which evaluation occurs.
CG getCGShape() const
see StatisticsVector::getCGShape
template<StatType T>
Mdouble StatisticsPoint< T >::CG_integral_2D ( Vec3D P1,
Vec3D P2,
Vec3D P1_P2_normal,
Mdouble  P1_P2_distance,
Mdouble rpsi_scalar 
)

Returns the value of the coarse graining integral $ \psi(P,PI,PJ) = \int_0^1 \phi(P - PI + s PJ) ds $ averaged along a line.

/todo{Thomas: rpsi_scalar is not always set}

Todo:
add rpsi

Definition at line 546 of file StatisticsPoint.hcc.

References StatisticsPoint< T >::averagingVolume(), StatisticsPoint< T >::CG_function_1D(), StatisticsPoint< T >::compute_Gaussian_invvolume(), StatisticsPoint< T >::dotNonAveraged(), StatisticsPoint< T >::evaluateIntegral(), Gaussian, StatisticsPoint< T >::gb, StatisticsPoint< T >::getCGInverseVolume(), StatisticsPoint< T >::getCGShape(), StatisticsPoint< T >::getCGWidth(), StatisticsPoint< T >::getCGWidthSquared(), StatisticsPoint< T >::getCutoff(), StatisticsPoint< T >::getCutoff2(), Vec3D::getLength(), HeavisideSphere, constants::pi, Polynomial, StatisticsPoint< T >::Position, constants::sqrt_2, constants::sqrt_pi, and mathsFunc::square().

547 {
548  //apply the cutoff in normal direction:
549  Vec3D P_P1 = Position - P1;
550  Mdouble a = dotNonAveraged(P_P1, P1_P2_normal);
551  if (a > getCutoff())
552  return 0.0;
553  Vec3D P_P2 = Position - P2;
554  Mdouble b = dotNonAveraged(P_P2, P1_P2_normal);
555  if (-b > getCutoff())
556  return 0.0;
557  //apply the cutoff in tangential direction:
558  Vec3D tangential = P_P1 - a * P1_P2_normal;
559  if (dotNonAveraged(tangential, tangential) > getCutoff2())
560  return 0.0;
561  if (getCGShape() == HeavisideSphere)
562  {
563  Mdouble wn2 = getCGWidthSquared() - dotNonAveraged(tangential, tangential);
564  if ((wn2 <= 0) || (a * fabs(a) >= wn2) || (b * fabs(b) <= -wn2))
565  {
566  return 0;
567  }
568  else
569  {
570  Mdouble wn = sqrt(wn2);
571  //if the normal is parallel to the averaging direction
572  if (std::max(fabs(a), fabs(b)) < 1e-20)
573  {
574  return getCGInverseVolume() * 2 * wn;
575  }
576  return getCGInverseVolume() / P1_P2_distance
577  * (((b >= wn) ? (constants::pi * wn2 / 2.0) : (b * sqrt(wn2 - mathsFunc::square(b)) + wn2 * asin(b / wn)))
578  + ((a <= -wn) ? (constants::pi * wn2 / 2.0) : (-a * sqrt(wn2 - mathsFunc::square(a)) - wn2 * asin(a / wn))));
579  }
580  }
581  else if (getCGShape() == Gaussian)
582  { //Gaussian
583  if (dotNonAveraged(P1_P2_normal, P1_P2_normal) < 1e-20)
584  {
585  //since we average parallel to the force line, the CG integral is shaped like the CG function
587  return getCGInverseVolume() * exp(-dotNonAveraged(P_P1, P_P1) / (2.0 * getCGWidthSquared()));
588  }
589  static Mdouble InvVolumeExp = compute_Gaussian_invvolume(gb->getSystemDimensions() - 2);
590  static Mdouble w_sqrt_2 = constants::sqrt_2 * getCGWidth();
591  static Mdouble P1_P2_distance_for_cutoff = -1, InvVolumeErf = -1;
592  if (P1_P2_distance_for_cutoff != P1_P2_distance)
593  {
594  P1_P2_distance_for_cutoff = P1_P2_distance;
595  Mdouble amax = -getCutoff();
596  Mdouble bmax = getCutoff() + P1_P2_distance;
597  InvVolumeErf = P1_P2_distance / (
598  erf(bmax / w_sqrt_2) * bmax + w_sqrt_2 / constants::sqrt_pi * exp(-bmax * bmax / (w_sqrt_2 * w_sqrt_2))
599  - erf(amax / w_sqrt_2) * amax - w_sqrt_2 / constants::sqrt_pi * exp(-amax * amax / (w_sqrt_2 * w_sqrt_2))
600  ) / averagingVolume();
601  //std::cout << "InvVolumeErf" << InvVolumeErf << " InvVolumeExp" << InvVolumeExp << " f" << getCGInverseVolume() * sqrt(2*constants::pi*getCGWidthSquared()) << std::endl;
602  }
603  //Note: use dot(t,t), GetLength2(t), as dot only works on non-averaged directions
604  //we also define rpsi
605  Mdouble psi = exp(-dotNonAveraged(tangential, tangential) / (2.0 * getCGWidthSquared())) * InvVolumeExp
606  * (erf(b / w_sqrt_2) - erf(a / w_sqrt_2)) * InvVolumeErf / 2. / P1_P2_distance;
607  Mdouble phi1 = getCGInverseVolume() * exp(-dotNonAveraged(P_P1, P_P1) / (2.0 * getCGWidthSquared()));
608  Mdouble phi2 = getCGInverseVolume() * exp(-dotNonAveraged(P_P2, P_P2) / (2.0 * getCGWidthSquared()));
609  rpsi_scalar = -a / P1_P2_distance * psi + getCGWidthSquared() / P1_P2_distance / P1_P2_distance * (phi1 - phi2);
610  return psi;
611  }
612  else if (getCGShape() == Polynomial)
613  {
614  double wn2 = getCGWidthSquared() - dotNonAveraged(tangential, tangential);
615  if ((wn2 <= 0) | (a * fabs(a) >= wn2) | (b * fabs(b) <= -wn2))
616  {
617  return 0;
618  }
619  else if (P1_P2_distance < 1e-20)
620  {
621  //if the normal is parallel to the averaging direction
622  return CG_function_1D(P_P1);
623  }
624  else
625  {
626  double wn = sqrt(wn2);
627  double w = getCGWidth();
628  return getCGInverseVolume() * evaluateIntegral(std::max(a, -wn) / w, std::min(b, wn) / w, tangential.getLength() / w) * w / P1_P2_distance;
629  }
630  //CG_type_todo
631  }
632  else
633  {
634  std::cerr << "error in CG_integral_2D" << std::endl;
635  exit(-1);
636  }
637 }
Mdouble CG_function_1D(const Vec3D &PI)
Returns the value of the course graining function phi(P,PI) averaged along a plane.
const Mdouble sqrt_pi
Definition: ExtendedMath.h:43
double Mdouble
Mdouble evaluateIntegral(Mdouble n1, Mdouble n2, Mdouble t)
see StatisticsVector::evaluateIntegral
Mdouble getCGWidth() const
see StatisticsVector::getCGWidth
T square(T val)
squares a number
Definition: ExtendedMath.h:91
static Mdouble getLength(const Vec3D &a)
Calculates the length of a Vec3D: .
Definition: Vector.cc:427
Mdouble getCutoff()
see StatisticsVector::getCutoff
double averagingVolume()
const Mdouble pi
Definition: ExtendedMath.h:42
Mdouble getCutoff2()
see StatisticsVector::getCutoff2
const Mdouble sqrt_2
Definition: ExtendedMath.h:45
Mdouble getCGWidthSquared() const
see StatisticsVector::getCGWidthSquared
Mdouble dotNonAveraged(const Vec3D &P, const Vec3D &Q)
Returns the dot product of two vectors in the coordinates that are not averaged about.
Mdouble getCGInverseVolume()
returns CG_invvolume
double compute_Gaussian_invvolume(int dim)
computes CG_invvolume if CG_type=Gaussian
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
Vec3D Position
Position at which evaluation occurs.
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
CG getCGShape() const
see StatisticsVector::getCGShape
template<StatType T>
Vec3D StatisticsPoint< T >::CG_integral_gradient ( Vec3D P1,
Vec3D P2,
Vec3D P1_P2_normal,
Mdouble  P1_P2_distance 
)

gradient of phi

Todo:
{Only implemented for Gaussian and statavg Z}
Todo:
{some gradients are not computed}
Todo:
The gradient is not centered; thus there is a bias; follow the corrections in CG_integral_gradient_1D

Definition at line 350 of file StatisticsPoint.hcc.

References StatisticsPoint< T >::dotNonAveraged(), StatisticsPoint< T >::evaluateIntegral(), Gaussian, StatisticsPoint< T >::getCGInverseVolume(), StatisticsPoint< T >::getCGShape(), StatisticsPoint< T >::getCGWidth(), StatisticsPoint< T >::getCGWidthSquared(), Vec3D::getLength(), constants::pi, Polynomial, StatisticsPoint< T >::Position, and mathsFunc::square().

351 {
352  Vec3D P_P1 = Position - P1;
353  Vec3D P_P2 = Position - P2;
354  Mdouble a = dotNonAveraged(P_P1, P1_P2_normal);
355  Mdouble b = dotNonAveraged(P_P2, P1_P2_normal);
356  Vec3D tangential = P_P1 - a * P1_P2_normal;
357  //CG_type_todo
358  if (getCGShape() == Gaussian)
359  {
360  Mdouble wsq2 = sqrt(2 * getCGWidthSquared());
361  Mdouble f = sqrt(2 * constants::pi * getCGWidthSquared());
362  return Vec3D(0.0, 0.0, (exp(-mathsFunc::square(a / wsq2)) - exp(-mathsFunc::square(b / wsq2))) / f / (P2.Z - P1.Z));
363  }
364  else if (getCGShape() == Polynomial)
365  {
366  double wn2 = getCGWidthSquared() - dotNonAveraged(tangential, tangential);
367  if ((wn2 <= 0) | (a * fabs(a) >= wn2) | (b * fabs(b) <= -wn2))
368  {
369  return Vec3D(0, 0, 0);
370  }
371  else
372  {
374  double wn = std::sqrt(wn2);
375  double w = getCGWidth();
376  double delta = w * 1e-3;
377  double I = getCGInverseVolume() * evaluateIntegral(std::max(a, -wn) / w, std::min(b, wn) / w, tangential.getLength() / w) * w / P1_P2_distance;
378  Vec3D delta_P_P1 = P_P1 + Vec3D(delta, 0, 0);
379  Vec3D delta_P_P2 = P_P2 + Vec3D(delta, 0, 0);
380  a = dotNonAveraged(delta_P_P1, P1_P2_normal);
381  b = dotNonAveraged(delta_P_P2, P1_P2_normal);
382  tangential = delta_P_P1 - a * P1_P2_normal;
383  wn = std::sqrt(getCGWidthSquared() - dotNonAveraged(tangential, tangential));
384  double Ix = getCGInverseVolume() * evaluateIntegral(std::max(a, -wn) / w, std::min(b, wn) / w, tangential.getLength() / w) * w / P1_P2_distance;
385  delta_P_P1 = P_P1 + Vec3D(0, delta, 0);
386  delta_P_P2 = P_P2 + Vec3D(0, delta, 0);
387  a = dotNonAveraged(delta_P_P1, P1_P2_normal);
388  b = dotNonAveraged(delta_P_P2, P1_P2_normal);
389  tangential = delta_P_P1 - a * P1_P2_normal;
390  wn = std::sqrt(getCGWidthSquared() - dotNonAveraged(tangential, tangential));
391  double Iy = getCGInverseVolume() * evaluateIntegral(std::max(a, -wn) / w, std::min(b, wn) / w, tangential.getLength() / w) * w / P1_P2_distance;
392  delta_P_P1 = P_P1 + Vec3D(0, 0, delta);
393  delta_P_P2 = P_P2 + Vec3D(0, 0, delta);
394  a = dotNonAveraged(delta_P_P1, P1_P2_normal);
395  b = dotNonAveraged(delta_P_P2, P1_P2_normal);
396  tangential = delta_P_P1 - a * P1_P2_normal;
397  wn = std::sqrt(getCGWidthSquared() - dotNonAveraged(tangential, tangential));
398  double Iz = getCGInverseVolume() * evaluateIntegral(std::max(a, -wn) / w, std::min(b, wn) / w, tangential.getLength() / w) * w / P1_P2_distance;
399  return Vec3D(Ix - I, Iy - I, Iz - I) / delta;
400  }
401  }
402  else
403  {
404  return Vec3D(0, 0, 0);
405  }
406  //~ if (getCGShape()==Gaussian) return Vec3D(0.0,0.0,0.0);
407  //~ else { std::cerr << "error in CG_function" << std::endl; exit(-1); }
408 }
double Mdouble
Mdouble evaluateIntegral(Mdouble n1, Mdouble n2, Mdouble t)
see StatisticsVector::evaluateIntegral
Mdouble getCGWidth() const
see StatisticsVector::getCGWidth
T square(T val)
squares a number
Definition: ExtendedMath.h:91
static Mdouble getLength(const Vec3D &a)
Calculates the length of a Vec3D: .
Definition: Vector.cc:427
const Mdouble pi
Definition: ExtendedMath.h:42
Mdouble getCGWidthSquared() const
see StatisticsVector::getCGWidthSquared
Mdouble dotNonAveraged(const Vec3D &P, const Vec3D &Q)
Returns the dot product of two vectors in the coordinates that are not averaged about.
Mdouble getCGInverseVolume()
returns CG_invvolume
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
Vec3D Position
Position at which evaluation occurs.
CG getCGShape() const
see StatisticsVector::getCGShape
template<>
Vec3D StatisticsPoint< Z >::CG_integral_gradient ( Vec3D P1,
Vec3D P2,
Vec3D P1_P2_normal,
Mdouble  P1_P2_distance 
)

Definition at line 1361 of file StatisticsPoint.hcc.

1362 {
1363  return Vec3D(0, 0, CG_integral_gradient_1D(P1, P2, P1_P2_normal, P1_P2_distance));
1364 }
Mdouble CG_integral_gradient_1D(Vec3D &P1, Vec3D &P2, Vec3D &P1_P2_normal, Mdouble P1_P2_distance)
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
template<StatType T>
Mdouble StatisticsPoint< T >::CG_integral_gradient_1D ( Vec3D P1,
Vec3D P2,
Vec3D P1_P2_normal,
Mdouble  P1_P2_distance 
)
Todo:
{debug this code}
Todo:
Thomas: whats the best delta? Somewhere between 1e-7 and 1e-4

Definition at line 411 of file StatisticsPoint.hcc.

References StatisticsPoint< T >::dotNonAveraged(), StatisticsPoint< T >::evaluateIntegral(), Gaussian, StatisticsPoint< T >::getCGInverseVolume(), StatisticsPoint< T >::getCGShape(), StatisticsPoint< T >::getCGWidth(), StatisticsPoint< T >::getCGWidthSquared(), Vec3D::getLengthSquared(), constants::pi, Polynomial, StatisticsPoint< T >::Position, and mathsFunc::square().

412 {
413  Vec3D P_P1 = Position - P1;
414  Vec3D P_P2 = Position - P2;
415  Mdouble a = dotNonAveraged(P_P1, P1_P2_normal);
416  Mdouble b = dotNonAveraged(P_P2, P1_P2_normal);
417  Vec3D tangential = P_P1 - a * P1_P2_normal;
418  //CG_type_todo
419  if (getCGShape() == Gaussian)
420  {
421  Mdouble wsq2 = sqrt(2 * getCGWidthSquared());
422  Mdouble f = sqrt(2 * constants::pi * getCGWidthSquared());
423  return (exp(-mathsFunc::square(a / wsq2)) - exp(-mathsFunc::square(b / wsq2))) / f / (P2.Z - P1.Z);
424  }
425  else if (getCGShape() == Polynomial)
426  {
427  double wn2 = getCGWidthSquared() - dotNonAveraged(tangential, tangential);
428  if ((wn2 <= 0) | (a * fabs(a) >= wn2) | (b * fabs(b) <= -wn2))
429  {
430  return 0;
431  }
432  else if ((P1_P2_distance < 1e-12) | (Vec3D::getLengthSquared(tangential) < 1e-24))
433  {
434  //if the normal is parallel to the averaging direction
435  std::cout << "normal is parallel to the averaging direction: "
436  << " P1_P2_distance " << P1_P2_distance
437  << " tangential " << tangential << std::endl;
439  return 0; //CG_gradient_1D(P1,CG_function(P1));
440  }
441  else
442  {
443  double wn = sqrt(wn2);
444  double w = getCGWidth();
446  double delta = w * 3e-6;
447  //double I = getCGInverseVolume()*evaluateIntegral(std::max(a,-wn)/w,std::min(b,wn)/w,dot(tangential,tangential)/w)*w / P1_P2_distance;
448  Vec3D delta_P_P1 = P_P1 + Vec3D(delta, delta, delta);
449  Vec3D delta_P_P2 = P_P2 + Vec3D(delta, delta, delta);
450  a = dotNonAveraged(delta_P_P1, P1_P2_normal);
451  b = dotNonAveraged(delta_P_P2, P1_P2_normal);
452  tangential = delta_P_P1 - a * P1_P2_normal;
453  wn = sqrt(getCGWidthSquared() - dotNonAveraged(tangential, tangential));
454  double I2 = getCGInverseVolume() * evaluateIntegral(std::max(a, -wn) / w, std::min(b, wn) / w, dotNonAveraged(tangential, tangential) / w) * w / P1_P2_distance;
455 
456  delta_P_P1 = P_P1 - Vec3D(delta, delta, delta);
457  delta_P_P2 = P_P2 - Vec3D(delta, delta, delta);
458  a = dotNonAveraged(delta_P_P1, P1_P2_normal);
459  b = dotNonAveraged(delta_P_P2, P1_P2_normal);
460  tangential = delta_P_P1 - a * P1_P2_normal;
461  wn = sqrt(getCGWidthSquared() - dotNonAveraged(tangential, tangential));
462  double I1 = getCGInverseVolume() * evaluateIntegral(std::max(a, -wn) / w, std::min(b, wn) / w, dotNonAveraged(tangential, tangential) / w) * w / P1_P2_distance;
463 
464  return (I2 - I1) / (2. * delta);
465  }
466  }
467  else
468  return 0;
469 }
double Mdouble
Mdouble evaluateIntegral(Mdouble n1, Mdouble n2, Mdouble t)
see StatisticsVector::evaluateIntegral
Mdouble getCGWidth() const
see StatisticsVector::getCGWidth
T square(T val)
squares a number
Definition: ExtendedMath.h:91
Mdouble getLengthSquared() const
Calculates the squared length of this Vec3D: .
Definition: Vector.cc:313
const Mdouble pi
Definition: ExtendedMath.h:42
Mdouble getCGWidthSquared() const
see StatisticsVector::getCGWidthSquared
Mdouble dotNonAveraged(const Vec3D &P, const Vec3D &Q)
Returns the dot product of two vectors in the coordinates that are not averaged about.
Mdouble getCGInverseVolume()
returns CG_invvolume
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
Vec3D Position
Position at which evaluation occurs.
CG getCGShape() const
see StatisticsVector::getCGShape
template<StatType T>
Vec3D StatisticsPoint< T >::clearAveragedDirections ( Vec3D  P)

Returns a vector where the averaged directions are zero.

Definition at line 1479 of file StatisticsPoint.hcc.

1480 {
1481  return P;
1482 }
template<>
Vec3D StatisticsPoint< XY >::clearAveragedDirections ( Vec3D  P)

Definition at line 1483 of file StatisticsPoint.hcc.

References Vec3D::X, and Vec3D::Y.

1484 {
1485  return Vec3D(P.X, P.Y, 0);
1486 }
Mdouble X
the vector components
Definition: Vector.h:52
Mdouble Y
Definition: Vector.h:52
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
template<>
Vec3D StatisticsPoint< XZ >::clearAveragedDirections ( Vec3D  P)

Definition at line 1487 of file StatisticsPoint.hcc.

References Vec3D::X, and Vec3D::Z.

1488 {
1489  return Vec3D(P.X, 0, P.Z);
1490 }
Mdouble X
the vector components
Definition: Vector.h:52
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
Mdouble Z
Definition: Vector.h:52
template<>
Vec3D StatisticsPoint< YZ >::clearAveragedDirections ( Vec3D  P)

Definition at line 1491 of file StatisticsPoint.hcc.

References Vec3D::Y, and Vec3D::Z.

1492 {
1493  return Vec3D(0, P.Y, P.Z);
1494 }
Mdouble Y
Definition: Vector.h:52
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
Mdouble Z
Definition: Vector.h:52
template<>
Vec3D StatisticsPoint< X >::clearAveragedDirections ( Vec3D  P)

Definition at line 1495 of file StatisticsPoint.hcc.

References Vec3D::X.

1496 {
1497  return Vec3D(P.X, 0, 0);
1498 }
Mdouble X
the vector components
Definition: Vector.h:52
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
template<>
Vec3D StatisticsPoint< Y >::clearAveragedDirections ( Vec3D  P)

Definition at line 1499 of file StatisticsPoint.hcc.

References Vec3D::Y.

1500 {
1501  return Vec3D(0, P.Y, 0);
1502 }
Mdouble Y
Definition: Vector.h:52
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
template<>
Vec3D StatisticsPoint< Z >::clearAveragedDirections ( Vec3D  P)

Definition at line 1503 of file StatisticsPoint.hcc.

References Vec3D::Z.

1504 {
1505  return Vec3D(0, 0, P.Z);
1506 }
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
Mdouble Z
Definition: Vector.h:52
template<>
Vec3D StatisticsPoint< O >::clearAveragedDirections ( Vec3D UNUSED)

Definition at line 1507 of file StatisticsPoint.hcc.

1508 {
1509  return Vec3D(0, 0, 0);
1510 }
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
template<StatType T>
double StatisticsPoint< T >::compute_Gaussian_invvolume ( int  dim)

computes CG_invvolume if CG_type=Gaussian

Definition at line 913 of file StatisticsPoint.hcc.

References mathsFunc::cubic(), StatisticsPoint< T >::getCGWidth(), StatisticsPoint< T >::getCGWidthSquared(), StatisticsPoint< T >::getCutoff(), StatisticsPoint< T >::getCutoff2(), constants::sqrt_2, constants::sqrt_pi, and mathsFunc::square().

Referenced by StatisticsPoint< T >::CG_integral(), StatisticsPoint< T >::CG_integral_2D(), and StatisticsPoint< T >::set_Gaussian_invvolume().

914 {
915  if (dim == 0)
916  {
917  return 1.;
918  }
919 
920  //this is the prefactor 1/V of phi(r)=1/V*exp(-|r|^2/w^2) for dim=1
921  double CG_invvolume_computed = 1. / (constants::sqrt_2 * constants::sqrt_pi * getCGWidth());
922  //take into account the cutoff radius and the dimension of the problem
923  if (dim == 3)
924  {
925  CG_invvolume_computed = mathsFunc::cubic(CG_invvolume_computed);
926  //Wolfram alpha: erf(c/(sqrt(2) w))-(sqrt(2/pi) c e^(-c^2/(2 w^2)))/w
927  CG_invvolume_computed /= erf(getCutoff() / (constants::sqrt_2 * getCGWidth()))
929  }
930  else if (dim == 2)
931  {
932  CG_invvolume_computed = mathsFunc::square(CG_invvolume_computed);
933  //Wolfram alpha: integrate(x*exp(-x^2/(2w^2)),{x,0,c})/integrate(x*exp(-x^2/(2w^2)),{x,0,inf})=1-e^(-c^2/(2 w^2))
934  CG_invvolume_computed /= 1 - exp(-getCutoff2() / (2 * getCGWidthSquared()));
935  }
936  else
937  {
938  CG_invvolume_computed /= erf(getCutoff() / (constants::sqrt_2 * getCGWidth()));
939  }
940  return CG_invvolume_computed;
941 }
const Mdouble sqrt_pi
Definition: ExtendedMath.h:43
Mdouble getCGWidth() const
see StatisticsVector::getCGWidth
T square(T val)
squares a number
Definition: ExtendedMath.h:91
Mdouble getCutoff()
see StatisticsVector::getCutoff
Mdouble getCutoff2()
see StatisticsVector::getCutoff2
T cubic(T val)
calculates the cube of a number
Definition: ExtendedMath.h:99
const Mdouble sqrt_2
Definition: ExtendedMath.h:45
Mdouble getCGWidthSquared() const
see StatisticsVector::getCGWidthSquared
template<StatType T>
Vec3D StatisticsPoint< T >::crossNonAveraged ( Vec3D  P,
Vec3D Q 
)

Returns the cross product of two vectors in the coordinates that are not averaged about.

Definition at line 232 of file StatisticsPoint.hcc.

References Vec3D::X, Vec3D::Y, and Vec3D::Z.

233 {
234  return Vec3D(P.Y * Q.Z - P.Z * Q.Y, P.Z * Q.X - P.X * Q.Z, P.X * Q.Y - P.Y * Q.X);
235 }
Mdouble X
the vector components
Definition: Vector.h:52
Mdouble Y
Definition: Vector.h:52
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
Mdouble Z
Definition: Vector.h:52
template<>
Vec3D StatisticsPoint< XY >::crossNonAveraged ( Vec3D  P,
Vec3D Q 
)

Definition at line 1512 of file StatisticsPoint.hcc.

References Vec3D::X, and Vec3D::Y.

1513 {
1514  return Vec3D(0, 0, P.X * Q.Y - P.Y * Q.X);
1515 }
Mdouble X
the vector components
Definition: Vector.h:52
Mdouble Y
Definition: Vector.h:52
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
template<>
Vec3D StatisticsPoint< XZ >::crossNonAveraged ( Vec3D  P,
Vec3D Q 
)

Definition at line 1516 of file StatisticsPoint.hcc.

References Vec3D::X, and Vec3D::Z.

1517 {
1518  return Vec3D(0, P.Z * Q.X - P.X * Q.Z, 0);
1519 }
Mdouble X
the vector components
Definition: Vector.h:52
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
Mdouble Z
Definition: Vector.h:52
template<>
Vec3D StatisticsPoint< YZ >::crossNonAveraged ( Vec3D  P,
Vec3D Q 
)

Definition at line 1520 of file StatisticsPoint.hcc.

References Vec3D::Y, and Vec3D::Z.

1521 {
1522  return Vec3D(P.Y * Q.Z - P.Z * Q.Y, 0, 0);
1523 }
Mdouble Y
Definition: Vector.h:52
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
Mdouble Z
Definition: Vector.h:52
template<>
Vec3D StatisticsPoint< X >::crossNonAveraged ( Vec3D UNUSED,
Vec3D &Q  UNUSED 
)

Definition at line 1524 of file StatisticsPoint.hcc.

1525 { return Vec3D(0,0,0);}
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
template<>
Vec3D StatisticsPoint< Y >::crossNonAveraged ( Vec3D UNUSED,
Vec3D &Q  UNUSED 
)

Definition at line 1526 of file StatisticsPoint.hcc.

1527 { return Vec3D(0,0,0);}
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
template<>
Vec3D StatisticsPoint< Z >::crossNonAveraged ( Vec3D UNUSED,
Vec3D &Q  UNUSED 
)

Definition at line 1528 of file StatisticsPoint.hcc.

1529 { return Vec3D(0,0,0);}
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
template<>
Vec3D StatisticsPoint< O >::crossNonAveraged ( Vec3D UNUSED,
Vec3D &Q  UNUSED 
)

Definition at line 1530 of file StatisticsPoint.hcc.

1531 { return Vec3D(0,0,0);}
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
template<StatType T>
Mdouble StatisticsPoint< T >::dotNonAveraged ( const Vec3D P,
const Vec3D Q 
)

Returns the dot product of two vectors in the coordinates that are not averaged about.

Definition at line 246 of file StatisticsPoint.hcc.

References Vec3D::X, Vec3D::Y, and Vec3D::Z.

Referenced by StatisticsPoint< T >::CG_integral(), StatisticsPoint< T >::CG_integral_1D(), StatisticsPoint< T >::CG_integral_2D(), StatisticsPoint< T >::CG_integral_gradient(), and StatisticsPoint< T >::CG_integral_gradient_1D().

247 {
248  return P.X * Q.X + P.Y * Q.Y + P.Z * Q.Z;
249 }
Mdouble X
the vector components
Definition: Vector.h:52
Mdouble Y
Definition: Vector.h:52
Mdouble Z
Definition: Vector.h:52
template<>
Mdouble StatisticsPoint< XY >::dotNonAveraged ( const Vec3D P,
const Vec3D Q 
)

Definition at line 1450 of file StatisticsPoint.hcc.

References Vec3D::X, and Vec3D::Y.

1451 {
1452  return P.X * Q.X + P.Y * Q.Y;
1453 }
Mdouble X
the vector components
Definition: Vector.h:52
Mdouble Y
Definition: Vector.h:52
template<>
Mdouble StatisticsPoint< XZ >::dotNonAveraged ( const Vec3D P,
const Vec3D Q 
)

Definition at line 1454 of file StatisticsPoint.hcc.

References Vec3D::X, and Vec3D::Z.

1455 {
1456  return P.X * Q.X + P.Z * Q.Z;
1457 }
Mdouble X
the vector components
Definition: Vector.h:52
Mdouble Z
Definition: Vector.h:52
template<>
Mdouble StatisticsPoint< YZ >::dotNonAveraged ( const Vec3D P,
const Vec3D Q 
)

Definition at line 1458 of file StatisticsPoint.hcc.

References Vec3D::Y, and Vec3D::Z.

1459 {
1460  return P.Y * Q.Y + P.Z * Q.Z;
1461 }
Mdouble Y
Definition: Vector.h:52
Mdouble Z
Definition: Vector.h:52
template<>
Mdouble StatisticsPoint< X >::dotNonAveraged ( const Vec3D P,
const Vec3D Q 
)

Definition at line 1462 of file StatisticsPoint.hcc.

References Vec3D::X.

1463 {
1464  return P.X * Q.X;
1465 }
Mdouble X
the vector components
Definition: Vector.h:52
template<>
Mdouble StatisticsPoint< Y >::dotNonAveraged ( const Vec3D P,
const Vec3D Q 
)

Definition at line 1466 of file StatisticsPoint.hcc.

References Vec3D::Y.

1467 {
1468  return P.Y * Q.Y;
1469 }
Mdouble Y
Definition: Vector.h:52
template<>
Mdouble StatisticsPoint< Z >::dotNonAveraged ( const Vec3D P,
const Vec3D Q 
)

Definition at line 1470 of file StatisticsPoint.hcc.

References Vec3D::Z.

1471 {
1472  return P.Z * Q.Z;
1473 }
Mdouble Z
Definition: Vector.h:52
template<>
Mdouble StatisticsPoint< O >::dotNonAveraged ( const Vec3D ,
const Vec3D  
)

Definition at line 1474 of file StatisticsPoint.hcc.

1475 {
1476  return 0;
1477 }
template<StatType T>
Mdouble StatisticsPoint< T >::evaluateIntegral ( Mdouble  n1,
Mdouble  n2,
Mdouble  t 
)
inline

see StatisticsVector::evaluateIntegral

Definition at line 154 of file StatisticsPoint.h.

References StatisticsPoint< T >::gb.

Referenced by StatisticsPoint< T >::CG_integral(), StatisticsPoint< T >::CG_integral_1D(), StatisticsPoint< T >::CG_integral_2D(), StatisticsPoint< T >::CG_integral_gradient(), and StatisticsPoint< T >::CG_integral_gradient_1D().

155  {
156  return gb->evaluateIntegral(n1, n2, t);
157  }
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
template<StatType T>
Mdouble StatisticsPoint< T >::evaluatePolynomial ( Mdouble  r)
inline

see StatisticsVector::evaluatePolynomial

Definition at line 144 of file StatisticsPoint.h.

References StatisticsPoint< T >::gb.

Referenced by StatisticsPoint< T >::CG_function(), StatisticsPoint< T >::CG_function_1D(), and StatisticsPoint< T >::CG_function_2D().

145  {
146  return gb->evaluatePolynomial(r);
147  }
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
template<StatType T>
Mdouble StatisticsPoint< T >::evaluatePolynomialGradient ( Mdouble  r)
inline

see StatisticsVector::evaluatePolynomialGradient

Definition at line 149 of file StatisticsPoint.h.

References StatisticsPoint< T >::gb.

Referenced by StatisticsPoint< T >::CG_gradient().

150  {
151  return gb->evaluatePolynomialGradient(r);
152  }
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
template<StatType T>
void StatisticsPoint< T >::firstTimeAverage ( const int  n)
inline

Defines a division operator needed to time-average values (because the displacement does not have a value at the first timestep, this is slightly different than /=)

Definition at line 193 of file StatisticsPoint.hcc.

References StatisticsPoint< T >::CollisionalHeatFlux, StatisticsPoint< T >::ContactCoupleStress, StatisticsPoint< T >::Density, StatisticsPoint< T >::Displacement, StatisticsPoint< T >::DisplacementMomentum, StatisticsPoint< T >::DisplacementMomentumFlux, StatisticsPoint< T >::Dissipation, StatisticsPoint< T >::EnergyFlux, StatisticsPoint< T >::Fabric, StatisticsPoint< T >::LocalAngularMomentum, StatisticsPoint< T >::LocalAngularMomentumFlux, StatisticsPoint< T >::Momentum, StatisticsPoint< T >::MomentumFlux, StatisticsPoint< T >::NormalStress, StatisticsPoint< T >::NormalTraction, StatisticsPoint< T >::Nu, StatisticsPoint< T >::Potential, MatrixSymmetric3D::setZero(), Vec3D::setZero(), StatisticsPoint< T >::TangentialStress, and StatisticsPoint< T >::TangentialTraction.

194 {
195  Nu /= n;
196  Density /= n;
197  Momentum /= n;
198  if (n == 1)
199  {
203  }
204  else
205  {
206  DisplacementMomentum /= n - 1;
207  Displacement /= n - 1;
208  DisplacementMomentumFlux /= n - 1;
209  }
210  MomentumFlux /= n;
211  EnergyFlux /= n;
212  NormalStress /= n;
213  TangentialStress /= n;
214  NormalTraction /= n;
215  TangentialTraction /= n;
216  Fabric /= n;
217  CollisionalHeatFlux /= n;
218  Dissipation /= n;
219  Potential /= n;
222  ContactCoupleStress /= n;
223 }
MatrixSymmetric3D DisplacementMomentumFlux
Momentum flux from linear displacement, .
Matrix3D ContactCoupleStress
Mdouble Dissipation
Dissipation form collisions, .
void setZero()
Sets all elements to zero.
Definition: Vector.cc:52
Matrix3D NormalStress
Stress from normal forces, .
Vec3D CollisionalHeatFlux
Heat flux from collisions, .
Mdouble Nu
Particle volume fraction, .
Vec3D NormalTraction
Traction from normal forces, .
Vec3D DisplacementMomentum
Momentum from linear displacement, , where , with the time intervall between outputs.
MatrixSymmetric3D Fabric
Fabric tensor, .
Vec3D EnergyFlux
Energy flux, .
Mdouble Density
Density, .
MatrixSymmetric3D Displacement
Linear displacement, .
void setZero()
Sets all elements to zero.
Vec3D TangentialTraction
Traction from tangential forces, .
Matrix3D LocalAngularMomentumFlux
Mdouble Potential
Elastic energy .
MatrixSymmetric3D MomentumFlux
Momentum flux, .
Vec3D Momentum
Momentum, .
Matrix3D TangentialStress
Stress from tangential forces, .
template<StatType T>
Mdouble StatisticsPoint< T >::getCGWidth ( ) const
inline
template<StatType T>
Mdouble StatisticsPoint< T >::getCutoff ( )
inline
template<StatType T>
Mdouble StatisticsPoint< T >::getCutoff2 ( )
inline
template<StatType T>
Mdouble StatisticsPoint< T >::getDistanceSquaredNonAveraged ( const Vec3D P)

returns the coarse graining distance in the coordinates that are not averaged about

Definition at line 226 of file StatisticsPoint.hcc.

References StatisticsPoint< T >::Position, mathsFunc::square(), Vec3D::X, Vec3D::Y, and Vec3D::Z.

Referenced by StatisticsPoint< T >::CG_function(), StatisticsPoint< T >::CG_function_1D(), and StatisticsPoint< T >::CG_function_2D().

227 {
229 }
Mdouble X
the vector components
Definition: Vector.h:52
T square(T val)
squares a number
Definition: ExtendedMath.h:91
Mdouble Y
Definition: Vector.h:52
Vec3D Position
Position at which evaluation occurs.
Mdouble Z
Definition: Vector.h:52
template<>
Mdouble StatisticsPoint< XY >::getDistanceSquaredNonAveraged ( const Vec3D P)

Definition at line 1421 of file StatisticsPoint.hcc.

References mathsFunc::square(), Vec3D::X, and Vec3D::Y.

1422 {
1424 }
Mdouble X
the vector components
Definition: Vector.h:52
T square(T val)
squares a number
Definition: ExtendedMath.h:91
Mdouble Y
Definition: Vector.h:52
Vec3D Position
Position at which evaluation occurs.
template<>
Mdouble StatisticsPoint< XZ >::getDistanceSquaredNonAveraged ( const Vec3D P)

Definition at line 1425 of file StatisticsPoint.hcc.

References mathsFunc::square(), Vec3D::X, and Vec3D::Z.

1426 {
1428 }
Mdouble X
the vector components
Definition: Vector.h:52
T square(T val)
squares a number
Definition: ExtendedMath.h:91
Vec3D Position
Position at which evaluation occurs.
Mdouble Z
Definition: Vector.h:52
template<>
Mdouble StatisticsPoint< YZ >::getDistanceSquaredNonAveraged ( const Vec3D P)

Definition at line 1429 of file StatisticsPoint.hcc.

References mathsFunc::square(), Vec3D::Y, and Vec3D::Z.

1430 {
1432 }
T square(T val)
squares a number
Definition: ExtendedMath.h:91
Mdouble Y
Definition: Vector.h:52
Vec3D Position
Position at which evaluation occurs.
Mdouble Z
Definition: Vector.h:52
template<>
Mdouble StatisticsPoint< X >::getDistanceSquaredNonAveraged ( const Vec3D P)

Definition at line 1433 of file StatisticsPoint.hcc.

References mathsFunc::square(), and Vec3D::X.

1434 {
1435  return mathsFunc::square(P.X - Position.X);
1436 }
Mdouble X
the vector components
Definition: Vector.h:52
T square(T val)
squares a number
Definition: ExtendedMath.h:91
Vec3D Position
Position at which evaluation occurs.
template<>
Mdouble StatisticsPoint< Y >::getDistanceSquaredNonAveraged ( const Vec3D P)

Definition at line 1437 of file StatisticsPoint.hcc.

References mathsFunc::square(), and Vec3D::Y.

1438 {
1439  return mathsFunc::square(P.Y - Position.Y);
1440 }
T square(T val)
squares a number
Definition: ExtendedMath.h:91
Mdouble Y
Definition: Vector.h:52
Vec3D Position
Position at which evaluation occurs.
template<>
Mdouble StatisticsPoint< Z >::getDistanceSquaredNonAveraged ( const Vec3D P)

Definition at line 1441 of file StatisticsPoint.hcc.

References mathsFunc::square(), and Vec3D::Z.

1442 {
1443  return mathsFunc::square(P.Z - Position.Z);
1444 }
T square(T val)
squares a number
Definition: ExtendedMath.h:91
Vec3D Position
Position at which evaluation occurs.
Mdouble Z
Definition: Vector.h:52
template<>
Mdouble StatisticsPoint< O >::getDistanceSquaredNonAveraged ( const Vec3D )

Definition at line 1445 of file StatisticsPoint.hcc.

1446 {
1447  return 0;
1448 }
template<StatType T>
void StatisticsPoint< T >::getN ( int nx_,
int ny_,
int nz_ 
)
inline

see StatisticsVector::get_n

Definition at line 139 of file StatisticsPoint.h.

References StatisticsPoint< T >::gb.

140  {
141  this->gb->getN(nx_, ny_, nz_);
142  }
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
template<StatType T>
Vec3D StatisticsPoint< T >::getPosition ( ) const
inline

returns Position

Definition at line 184 of file StatisticsPoint.h.

References StatisticsPoint< T >::Position.

185  {
186  return this->Position;
187  }
Vec3D Position
Position at which evaluation occurs.
template<StatType T>
StatisticsPoint< T > StatisticsPoint< T >::getSquared ( )

Squares all statistical variables; needed for variance.

Definition at line 66 of file StatisticsPoint.hcc.

References StatisticsPoint< T >::CollisionalHeatFlux, StatisticsPoint< T >::ContactCoupleStress, StatisticsPoint< T >::Density, StatisticsPoint< T >::Displacement, StatisticsPoint< T >::DisplacementMomentum, StatisticsPoint< T >::DisplacementMomentumFlux, StatisticsPoint< T >::Dissipation, StatisticsPoint< T >::EnergyFlux, StatisticsPoint< T >::Fabric, StatisticsPoint< T >::LocalAngularMomentum, StatisticsPoint< T >::LocalAngularMomentumFlux, StatisticsPoint< T >::Momentum, StatisticsPoint< T >::MomentumFlux, StatisticsPoint< T >::NormalStress, StatisticsPoint< T >::NormalTraction, StatisticsPoint< T >::Nu, StatisticsPoint< T >::Potential, mathsFunc::square(), MatrixSymmetric3D::square(), Matrix3D::square(), Vec3D::square(), StatisticsPoint< T >::TangentialStress, and StatisticsPoint< T >::TangentialTraction.

67 {
69  P.Nu = mathsFunc::square(Nu);
70  P.Density = mathsFunc::square(Density);
71  P.Momentum = Vec3D::square(Momentum);
72  P.DisplacementMomentum = Vec3D::square(DisplacementMomentum);
73  P.Displacement = MatrixSymmetric3D::square(Displacement);
74  P.MomentumFlux = MatrixSymmetric3D::square(MomentumFlux);
75  P.DisplacementMomentumFlux = MatrixSymmetric3D::square(DisplacementMomentumFlux);
76  P.EnergyFlux = Vec3D::square(EnergyFlux);
77  P.NormalStress = Matrix3D::square(NormalStress);
78  P.TangentialStress = Matrix3D::square(TangentialStress);
79  P.NormalTraction = Vec3D::square(NormalTraction);
80  P.TangentialTraction = Vec3D::square(TangentialTraction);
82  P.CollisionalHeatFlux = Vec3D::square(CollisionalHeatFlux);
83  P.Dissipation = mathsFunc::square(Dissipation);
84  P.Potential = mathsFunc::square(Potential);
85  P.LocalAngularMomentum = Vec3D::square(LocalAngularMomentum);
86  P.LocalAngularMomentumFlux = Matrix3D::square(LocalAngularMomentumFlux);
87  P.ContactCoupleStress = Matrix3D::square(ContactCoupleStress);
88  return P;
89 }
static MatrixSymmetric3D square(const MatrixSymmetric3D &A)
Calculates the pointwise square.
MatrixSymmetric3D DisplacementMomentumFlux
Momentum flux from linear displacement, .
Matrix3D ContactCoupleStress
Mdouble Dissipation
Dissipation form collisions, .
Matrix3D NormalStress
Stress from normal forces, .
static Vec3D square(const Vec3D &a)
Calculates the pointwise square of a Vec3D.
Definition: Vector.cc:225
T square(T val)
squares a number
Definition: ExtendedMath.h:91
Vec3D CollisionalHeatFlux
Heat flux from collisions, .
Mdouble Nu
Particle volume fraction, .
Vec3D NormalTraction
Traction from normal forces, .
Vec3D DisplacementMomentum
Momentum from linear displacement, , where , with the time intervall between outputs.
MatrixSymmetric3D Fabric
Fabric tensor, .
Vec3D EnergyFlux
Energy flux, .
Mdouble Density
Density, .
MatrixSymmetric3D Displacement
Linear displacement, .
Vec3D TangentialTraction
Traction from tangential forces, .
Matrix3D LocalAngularMomentumFlux
Mdouble Potential
Elastic energy .
MatrixSymmetric3D MomentumFlux
Momentum flux, .
Vec3D Momentum
Momentum, .
static Matrix3D square(const Matrix3D &A)
Calculates the pointwise square.
Definition: Matrix.cc:260
Matrix3D TangentialStress
Stress from tangential forces, .
template<StatType T>
Mdouble StatisticsPoint< T >::getXMaxStat ( )
inline

see StatisticsVector::getXMaxStat

Definition at line 109 of file StatisticsPoint.h.

References StatisticsPoint< T >::gb.

110  {
111  return this->gb->getXMaxStat();
112  }
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
template<StatType T>
Mdouble StatisticsPoint< T >::getXMinStat ( )
inline

see StatisticsVector::getXMinStat

Definition at line 124 of file StatisticsPoint.h.

References StatisticsPoint< T >::gb.

125  {
126  return this->gb->getXMinStat();
127  }
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
template<StatType T>
Mdouble StatisticsPoint< T >::getYMaxStat ( )
inline

see StatisticsVector::getYMaxStat

Definition at line 114 of file StatisticsPoint.h.

References StatisticsPoint< T >::gb.

115  {
116  return this->gb->getYMaxStat();
117  }
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
template<StatType T>
Mdouble StatisticsPoint< T >::getYMinStat ( )
inline

see StatisticsVector::getYMinStat

Definition at line 129 of file StatisticsPoint.h.

References StatisticsPoint< T >::gb.

130  {
131  return this->gb->getYMinStat();
132  }
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
template<StatType T>
Mdouble StatisticsPoint< T >::getZMaxStat ( )
inline

see StatisticsVector::getZMaxStat

Definition at line 119 of file StatisticsPoint.h.

References StatisticsPoint< T >::gb.

120  {
121  return this->gb->getZMaxStat();
122  }
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
template<StatType T>
Mdouble StatisticsPoint< T >::getZMinStat ( )
inline

see StatisticsVector::getZMinStat

Definition at line 134 of file StatisticsPoint.h.

References StatisticsPoint< T >::gb.

135  {
136  return this->gb->getZMinStat();
137  }
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
template<StatType T>
Matrix3D StatisticsPoint< T >::matrixCrossNonAveraged ( Vec3D  P,
Matrix3D Q 
)

Returns the cross product of two vectors in the coordinates that are not averaged about.

Definition at line 237 of file StatisticsPoint.hcc.

References Vec3D::X, Matrix3D::XX, Matrix3D::XY, Matrix3D::XZ, Vec3D::Y, Matrix3D::YX, Matrix3D::YY, Matrix3D::YZ, Vec3D::Z, Matrix3D::ZX, Matrix3D::ZY, and Matrix3D::ZZ.

238 {
239  return Matrix3D(
240  P.Y * Q.ZX - P.Z * Q.YX, P.Z * Q.XX - P.X * Q.ZX, P.X * Q.YX - P.Y * Q.XX,
241  P.Y * Q.ZY - P.Z * Q.YY, P.Z * Q.XY - P.X * Q.ZY, P.X * Q.YY - P.Y * Q.XY,
242  P.Y * Q.ZZ - P.Z * Q.YZ, P.Z * Q.XZ - P.X * Q.ZZ, P.X * Q.YZ - P.Y * Q.XZ);
243 }
Mdouble XY
Definition: Matrix.h:42
Mdouble X
the vector components
Definition: Vector.h:52
Mdouble ZY
Definition: Matrix.h:42
Mdouble XZ
Definition: Matrix.h:42
Mdouble ZX
Definition: Matrix.h:42
Mdouble ZZ
Definition: Matrix.h:42
Mdouble YZ
Definition: Matrix.h:42
Mdouble YX
Definition: Matrix.h:42
Mdouble Y
Definition: Vector.h:52
Mdouble XX
all nine matrix elements
Definition: Matrix.h:42
Mdouble YY
Definition: Matrix.h:42
Implementation of a 3D matrix.
Definition: Matrix.h:36
Mdouble Z
Definition: Vector.h:52
template<>
Matrix3D StatisticsPoint< XY >::matrixCrossNonAveraged ( Vec3D  P,
Matrix3D Q 
)

Definition at line 1533 of file StatisticsPoint.hcc.

References Vec3D::X, Matrix3D::XX, Matrix3D::XY, Matrix3D::XZ, Vec3D::Y, Matrix3D::YX, Matrix3D::YY, and Matrix3D::YZ.

1534 {
1535  return Matrix3D(
1536  0, 0, P.X * Q.YX - P.Y * Q.XX,
1537  0, 0, P.X * Q.YY - P.Y * Q.XY,
1538  0, 0, P.X * Q.YZ - P.Y * Q.XZ);
1539 }
Mdouble XY
Definition: Matrix.h:42
Mdouble X
the vector components
Definition: Vector.h:52
Mdouble XZ
Definition: Matrix.h:42
Mdouble YZ
Definition: Matrix.h:42
Mdouble YX
Definition: Matrix.h:42
Mdouble Y
Definition: Vector.h:52
Mdouble XX
all nine matrix elements
Definition: Matrix.h:42
Mdouble YY
Definition: Matrix.h:42
Implementation of a 3D matrix.
Definition: Matrix.h:36
template<>
Matrix3D StatisticsPoint< XZ >::matrixCrossNonAveraged ( Vec3D  P,
Matrix3D Q 
)

Definition at line 1540 of file StatisticsPoint.hcc.

References Vec3D::X, Matrix3D::XX, Matrix3D::XY, Matrix3D::XZ, Vec3D::Z, Matrix3D::ZX, Matrix3D::ZY, and Matrix3D::ZZ.

1541 {
1542  return Matrix3D(
1543  0, P.Z * Q.XX - P.X * Q.ZX, 0,
1544  0, P.Z * Q.XY - P.X * Q.ZY, 0,
1545  0, P.Z * Q.XZ - P.X * Q.ZZ, 0);
1546 }
Mdouble XY
Definition: Matrix.h:42
Mdouble X
the vector components
Definition: Vector.h:52
Mdouble ZY
Definition: Matrix.h:42
Mdouble XZ
Definition: Matrix.h:42
Mdouble ZX
Definition: Matrix.h:42
Mdouble ZZ
Definition: Matrix.h:42
Mdouble XX
all nine matrix elements
Definition: Matrix.h:42
Implementation of a 3D matrix.
Definition: Matrix.h:36
Mdouble Z
Definition: Vector.h:52
template<>
Matrix3D StatisticsPoint< YZ >::matrixCrossNonAveraged ( Vec3D  P,
Matrix3D Q 
)

Definition at line 1547 of file StatisticsPoint.hcc.

References Vec3D::Y, Matrix3D::YX, Matrix3D::YY, Matrix3D::YZ, Vec3D::Z, Matrix3D::ZX, Matrix3D::ZY, and Matrix3D::ZZ.

1548 {
1549  return Matrix3D(
1550  P.Y * Q.ZX - P.Z * Q.YX, 0, 0,
1551  P.Y * Q.ZY - P.Z * Q.YY, 0, 0,
1552  P.Y * Q.ZZ - P.Z * Q.YZ, 0, 0);
1553 }
Mdouble ZY
Definition: Matrix.h:42
Mdouble ZX
Definition: Matrix.h:42
Mdouble ZZ
Definition: Matrix.h:42
Mdouble YZ
Definition: Matrix.h:42
Mdouble YX
Definition: Matrix.h:42
Mdouble Y
Definition: Vector.h:52
Mdouble YY
Definition: Matrix.h:42
Implementation of a 3D matrix.
Definition: Matrix.h:36
Mdouble Z
Definition: Vector.h:52
template<>
Matrix3D StatisticsPoint< X >::matrixCrossNonAveraged ( Vec3D UNUSED,
Matrix3D &Q  UNUSED 
)

Definition at line 1554 of file StatisticsPoint.hcc.

1555 {
1556  return Matrix3D(0,0,0,0,0,0,0,0,0);
1557 }
Implementation of a 3D matrix.
Definition: Matrix.h:36
template<>
Matrix3D StatisticsPoint< Y >::matrixCrossNonAveraged ( Vec3D UNUSED,
Matrix3D &Q  UNUSED 
)

Definition at line 1558 of file StatisticsPoint.hcc.

1559 {
1560  return Matrix3D(0,0,0,0,0,0,0,0,0);
1561 }
Implementation of a 3D matrix.
Definition: Matrix.h:36
template<>
Matrix3D StatisticsPoint< Z >::matrixCrossNonAveraged ( Vec3D UNUSED,
Matrix3D &Q  UNUSED 
)

Definition at line 1562 of file StatisticsPoint.hcc.

1563 {
1564  return Matrix3D(0,0,0,0,0,0,0,0,0);
1565 }
Implementation of a 3D matrix.
Definition: Matrix.h:36
template<>
Matrix3D StatisticsPoint< O >::matrixCrossNonAveraged ( Vec3D UNUSED,
Matrix3D &Q  UNUSED 
)

Definition at line 1566 of file StatisticsPoint.hcc.

1567 {
1568  return Matrix3D(0,0,0,0,0,0,0,0,0);
1569 }
Implementation of a 3D matrix.
Definition: Matrix.h:36
template<StatType T>
int StatisticsPoint< T >::nonaveragedDim ( )
template<>
int StatisticsPoint< XYZ >::nonaveragedDim ( )

Definition at line 979 of file StatisticsPoint.hcc.

980 {
981  return gb->getSystemDimensions();
982 }
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
template<>
int StatisticsPoint< YZ >::nonaveragedDim ( )

Definition at line 983 of file StatisticsPoint.hcc.

984 {
985  return gb->getSystemDimensions() - 1;
986 }
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
template<>
int StatisticsPoint< XZ >::nonaveragedDim ( )

Definition at line 987 of file StatisticsPoint.hcc.

988 {
989  return gb->getSystemDimensions() - 1;
990 }
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
template<>
int StatisticsPoint< XY >::nonaveragedDim ( )

Definition at line 991 of file StatisticsPoint.hcc.

992 {
993  return 2;
994 }
template<>
int StatisticsPoint< X >::nonaveragedDim ( )

Definition at line 995 of file StatisticsPoint.hcc.

996 {
997  return 1;
998 }
template<>
int StatisticsPoint< Y >::nonaveragedDim ( )

Definition at line 999 of file StatisticsPoint.hcc.

1000 {
1001  return 1;
1002 }
template<>
int StatisticsPoint< Z >::nonaveragedDim ( )

Definition at line 1003 of file StatisticsPoint.hcc.

1004 {
1005  return gb->getSystemDimensions() - 2;
1006 }
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
template<>
int StatisticsPoint< O >::nonaveragedDim ( )

Definition at line 1007 of file StatisticsPoint.hcc.

1008 {
1009  return 0;
1010 }
template<>
int StatisticsPoint< RAZ >::nonaveragedDim ( )

Definition at line 1011 of file StatisticsPoint.hcc.

1012 {
1013  exit(-1);
1014 }
template<>
int StatisticsPoint< AZ >::nonaveragedDim ( )

Definition at line 1015 of file StatisticsPoint.hcc.

1016 {
1017  exit(-1);
1018 }
template<>
int StatisticsPoint< RZ >::nonaveragedDim ( )

Definition at line 1019 of file StatisticsPoint.hcc.

1020 {
1021  exit(-1);
1022 }
template<>
int StatisticsPoint< RA >::nonaveragedDim ( )

Definition at line 1023 of file StatisticsPoint.hcc.

1024 {
1025  exit(-1);
1026 }
template<>
int StatisticsPoint< R >::nonaveragedDim ( )

Definition at line 1027 of file StatisticsPoint.hcc.

1028 {
1029  exit(-1);
1030 }
template<>
int StatisticsPoint< A >::nonaveragedDim ( )

Definition at line 1031 of file StatisticsPoint.hcc.

1032 {
1033  exit(-1);
1034 }
template<StatType T>
StatisticsPoint< T > & StatisticsPoint< T >::operator+= ( const StatisticsPoint< T > &  P)
inline

Defines a plus operator needed to average values ( $ \bar{v} = (\sum_{i=1}^n v_i)/n $ )

Definition at line 117 of file StatisticsPoint.hcc.

References StatisticsPoint< T >::CollisionalHeatFlux, StatisticsPoint< T >::ContactCoupleStress, StatisticsPoint< T >::Density, StatisticsPoint< T >::Displacement, StatisticsPoint< T >::DisplacementMomentum, StatisticsPoint< T >::DisplacementMomentumFlux, StatisticsPoint< T >::Dissipation, StatisticsPoint< T >::EnergyFlux, StatisticsPoint< T >::Fabric, StatisticsPoint< T >::LocalAngularMomentum, StatisticsPoint< T >::LocalAngularMomentumFlux, StatisticsPoint< T >::Momentum, StatisticsPoint< T >::MomentumFlux, StatisticsPoint< T >::NormalStress, StatisticsPoint< T >::NormalTraction, StatisticsPoint< T >::Nu, StatisticsPoint< T >::Potential, StatisticsPoint< T >::TangentialStress, and StatisticsPoint< T >::TangentialTraction.

118 {
119  Nu += P.Nu;
120  Density += P.Density;
121  Momentum += P.Momentum;
122  DisplacementMomentum += P.DisplacementMomentum;
123  Displacement += P.Displacement;
124  MomentumFlux += P.MomentumFlux;
125  DisplacementMomentumFlux += P.DisplacementMomentumFlux;
126  EnergyFlux += P.EnergyFlux;
127  NormalStress += P.NormalStress;
128  TangentialStress += P.TangentialStress;
129  NormalTraction += P.NormalTraction;
130  TangentialTraction += P.TangentialTraction;
131  Fabric += P.Fabric;
132  CollisionalHeatFlux += P.CollisionalHeatFlux;
133  Dissipation += P.Dissipation;
134  Potential += P.Potential;
135  LocalAngularMomentum += P.LocalAngularMomentum;
136  LocalAngularMomentumFlux += P.LocalAngularMomentumFlux;
137  ContactCoupleStress += P.ContactCoupleStress;
138  return *this;
139 }
MatrixSymmetric3D DisplacementMomentumFlux
Momentum flux from linear displacement, .
Matrix3D ContactCoupleStress
Mdouble Dissipation
Dissipation form collisions, .
Matrix3D NormalStress
Stress from normal forces, .
Vec3D CollisionalHeatFlux
Heat flux from collisions, .
Mdouble Nu
Particle volume fraction, .
Vec3D NormalTraction
Traction from normal forces, .
Vec3D DisplacementMomentum
Momentum from linear displacement, , where , with the time intervall between outputs.
MatrixSymmetric3D Fabric
Fabric tensor, .
Vec3D EnergyFlux
Energy flux, .
Mdouble Density
Density, .
MatrixSymmetric3D Displacement
Linear displacement, .
Vec3D TangentialTraction
Traction from tangential forces, .
Matrix3D LocalAngularMomentumFlux
Mdouble Potential
Elastic energy .
MatrixSymmetric3D MomentumFlux
Momentum flux, .
Vec3D Momentum
Momentum, .
Matrix3D TangentialStress
Stress from tangential forces, .
template<StatType T>
StatisticsPoint< T > & StatisticsPoint< T >::operator-= ( const StatisticsPoint< T > &  P)
inline

Defines a plus operator needed to calculate variance.

Definition at line 142 of file StatisticsPoint.hcc.

References StatisticsPoint< T >::CollisionalHeatFlux, StatisticsPoint< T >::ContactCoupleStress, StatisticsPoint< T >::Density, StatisticsPoint< T >::Displacement, StatisticsPoint< T >::DisplacementMomentum, StatisticsPoint< T >::DisplacementMomentumFlux, StatisticsPoint< T >::Dissipation, StatisticsPoint< T >::EnergyFlux, StatisticsPoint< T >::Fabric, StatisticsPoint< T >::LocalAngularMomentum, StatisticsPoint< T >::LocalAngularMomentumFlux, StatisticsPoint< T >::Momentum, StatisticsPoint< T >::MomentumFlux, StatisticsPoint< T >::NormalStress, StatisticsPoint< T >::NormalTraction, StatisticsPoint< T >::Nu, StatisticsPoint< T >::Potential, StatisticsPoint< T >::TangentialStress, and StatisticsPoint< T >::TangentialTraction.

143 {
144  Nu -= P.Nu;
145  Density -= P.Density;
146  Momentum -= P.Momentum;
147  DisplacementMomentum -= P.DisplacementMomentum;
148  Displacement -= P.Displacement;
149  MomentumFlux -= P.MomentumFlux;
150  DisplacementMomentumFlux -= P.DisplacementMomentumFlux;
151  EnergyFlux -= P.EnergyFlux;
152  NormalStress -= P.NormalStress;
153  TangentialStress -= P.TangentialStress;
154  NormalTraction -= P.NormalTraction;
155  TangentialTraction -= P.TangentialTraction;
156  Fabric -= P.Fabric;
157  CollisionalHeatFlux -= P.CollisionalHeatFlux;
158  Dissipation -= P.Dissipation;
159  Potential -= P.Potential;
160  LocalAngularMomentum -= P.LocalAngularMomentum;
161  LocalAngularMomentumFlux -= P.LocalAngularMomentumFlux;
162  ContactCoupleStress -= P.ContactCoupleStress;
163  return *this;
164 }
MatrixSymmetric3D DisplacementMomentumFlux
Momentum flux from linear displacement, .
Matrix3D ContactCoupleStress
Mdouble Dissipation
Dissipation form collisions, .
Matrix3D NormalStress
Stress from normal forces, .
Vec3D CollisionalHeatFlux
Heat flux from collisions, .
Mdouble Nu
Particle volume fraction, .
Vec3D NormalTraction
Traction from normal forces, .
Vec3D DisplacementMomentum
Momentum from linear displacement, , where , with the time intervall between outputs.
MatrixSymmetric3D Fabric
Fabric tensor, .
Vec3D EnergyFlux
Energy flux, .
Mdouble Density
Density, .
MatrixSymmetric3D Displacement
Linear displacement, .
Vec3D TangentialTraction
Traction from tangential forces, .
Matrix3D LocalAngularMomentumFlux
Mdouble Potential
Elastic energy .
MatrixSymmetric3D MomentumFlux
Momentum flux, .
Vec3D Momentum
Momentum, .
Matrix3D TangentialStress
Stress from tangential forces, .
template<StatType T>
StatisticsPoint< T > & StatisticsPoint< T >::operator/= ( const Mdouble  a)
inline

Defines a division operator needed to average values ( $ \bar{v} = (\sum_{i=1}^n v_i)/n $ )

Definition at line 167 of file StatisticsPoint.hcc.

References StatisticsPoint< T >::CollisionalHeatFlux, StatisticsPoint< T >::ContactCoupleStress, StatisticsPoint< T >::Density, StatisticsPoint< T >::Displacement, StatisticsPoint< T >::DisplacementMomentum, StatisticsPoint< T >::DisplacementMomentumFlux, StatisticsPoint< T >::Dissipation, StatisticsPoint< T >::EnergyFlux, StatisticsPoint< T >::Fabric, StatisticsPoint< T >::LocalAngularMomentum, StatisticsPoint< T >::LocalAngularMomentumFlux, StatisticsPoint< T >::Momentum, StatisticsPoint< T >::MomentumFlux, StatisticsPoint< T >::NormalStress, StatisticsPoint< T >::NormalTraction, StatisticsPoint< T >::Nu, StatisticsPoint< T >::Potential, StatisticsPoint< T >::TangentialStress, and StatisticsPoint< T >::TangentialTraction.

168 {
169  Nu /= a;
170  Density /= a;
171  Momentum /= a;
173  Displacement /= a;
174  MomentumFlux /= a;
176  EnergyFlux /= a;
177  NormalStress /= a;
178  TangentialStress /= a;
179  NormalTraction /= a;
180  TangentialTraction /= a;
181  Fabric /= a;
182  CollisionalHeatFlux /= a;
183  Dissipation /= a;
184  Potential /= a;
187  ContactCoupleStress /= a;
188  return *this;
189 }
MatrixSymmetric3D DisplacementMomentumFlux
Momentum flux from linear displacement, .
Matrix3D ContactCoupleStress
Mdouble Dissipation
Dissipation form collisions, .
Matrix3D NormalStress
Stress from normal forces, .
Vec3D CollisionalHeatFlux
Heat flux from collisions, .
Mdouble Nu
Particle volume fraction, .
Vec3D NormalTraction
Traction from normal forces, .
Vec3D DisplacementMomentum
Momentum from linear displacement, , where , with the time intervall between outputs.
MatrixSymmetric3D Fabric
Fabric tensor, .
Vec3D EnergyFlux
Energy flux, .
Mdouble Density
Density, .
MatrixSymmetric3D Displacement
Linear displacement, .
Vec3D TangentialTraction
Traction from tangential forces, .
Matrix3D LocalAngularMomentumFlux
Mdouble Potential
Elastic energy .
MatrixSymmetric3D MomentumFlux
Momentum flux, .
Vec3D Momentum
Momentum, .
Matrix3D TangentialStress
Stress from tangential forces, .
template<StatType T>
StatisticsPoint< T > & StatisticsPoint< T >::operator= ( const StatisticsPoint< T > &  P)
inline

Defines a equal operator needed for copy constructor.

Definition at line 92 of file StatisticsPoint.hcc.

References StatisticsPoint< T >::CollisionalHeatFlux, StatisticsPoint< T >::ContactCoupleStress, StatisticsPoint< T >::Density, StatisticsPoint< T >::Displacement, StatisticsPoint< T >::DisplacementMomentum, StatisticsPoint< T >::DisplacementMomentumFlux, StatisticsPoint< T >::Dissipation, StatisticsPoint< T >::EnergyFlux, StatisticsPoint< T >::Fabric, StatisticsPoint< T >::LocalAngularMomentum, StatisticsPoint< T >::LocalAngularMomentumFlux, StatisticsPoint< T >::Momentum, StatisticsPoint< T >::MomentumFlux, StatisticsPoint< T >::NormalStress, StatisticsPoint< T >::NormalTraction, StatisticsPoint< T >::Nu, StatisticsPoint< T >::Potential, StatisticsPoint< T >::TangentialStress, and StatisticsPoint< T >::TangentialTraction.

93 {
94  Nu = P.Nu;
95  Density = P.Density;
96  Momentum = P.Momentum;
97  DisplacementMomentum = P.DisplacementMomentum;
98  Displacement = P.Displacement;
99  MomentumFlux = P.MomentumFlux;
100  DisplacementMomentumFlux = P.DisplacementMomentumFlux;
101  EnergyFlux = P.EnergyFlux;
102  NormalStress = P.NormalStress;
103  TangentialStress = P.TangentialStress;
104  NormalTraction = P.NormalTraction;
105  TangentialTraction = P.TangentialTraction;
106  Fabric = P.Fabric;
107  CollisionalHeatFlux = P.CollisionalHeatFlux;
108  Dissipation = P.Dissipation;
109  Potential = P.Potential;
110  LocalAngularMomentum = P.LocalAngularMomentum;
111  LocalAngularMomentumFlux = P.LocalAngularMomentumFlux;
112  ContactCoupleStress = P.ContactCoupleStress;
113  return *this;
114 }
MatrixSymmetric3D DisplacementMomentumFlux
Momentum flux from linear displacement, .
Matrix3D ContactCoupleStress
Mdouble Dissipation
Dissipation form collisions, .
Matrix3D NormalStress
Stress from normal forces, .
Vec3D CollisionalHeatFlux
Heat flux from collisions, .
Mdouble Nu
Particle volume fraction, .
Vec3D NormalTraction
Traction from normal forces, .
Vec3D DisplacementMomentum
Momentum from linear displacement, , where , with the time intervall between outputs.
MatrixSymmetric3D Fabric
Fabric tensor, .
Vec3D EnergyFlux
Energy flux, .
Mdouble Density
Density, .
MatrixSymmetric3D Displacement
Linear displacement, .
Vec3D TangentialTraction
Traction from tangential forces, .
Matrix3D LocalAngularMomentumFlux
Mdouble Potential
Elastic energy .
MatrixSymmetric3D MomentumFlux
Momentum flux, .
Vec3D Momentum
Momentum, .
Matrix3D TangentialStress
Stress from tangential forces, .
template<StatType T>
std::string StatisticsPoint< T >::print ( ) const

Outputs statistical variables in human-readable format.

Definition at line 827 of file StatisticsPoint.hcc.

References StatisticsPoint< T >::CollisionalHeatFlux, StatisticsPoint< T >::ContactCoupleStress, StatisticsPoint< T >::Density, StatisticsPoint< T >::Displacement, StatisticsPoint< T >::DisplacementMomentum, StatisticsPoint< T >::DisplacementMomentumFlux, StatisticsPoint< T >::Dissipation, StatisticsPoint< T >::EnergyFlux, StatisticsPoint< T >::Fabric, StatisticsPoint< T >::LocalAngularMomentum, StatisticsPoint< T >::LocalAngularMomentumFlux, StatisticsPoint< T >::Momentum, StatisticsPoint< T >::MomentumFlux, StatisticsPoint< T >::NormalStress, StatisticsPoint< T >::NormalTraction, StatisticsPoint< T >::Nu, StatisticsPoint< T >::Potential, StatisticsPoint< T >::TangentialStress, and StatisticsPoint< T >::TangentialTraction.

828 {
829  std::stringstream ss;
830  ss << "Nu " << Nu
831  << ", Density " << Density
832  << ",\n Momentum " << Momentum
833  << ",\n DisplacementMomentum " << DisplacementMomentum
834  << ",\n Displacement " << Displacement
835  << ",\n MomentumFlux " << MomentumFlux
836  << ",\n DisplacementMomentumFlux " << DisplacementMomentumFlux
837  << ",\n EnergyFlux " << EnergyFlux
838  << ",\n NormalStress " << NormalStress
839  << ",\n TangentialStress " << TangentialStress
840  << ",\n NormalTraction " << NormalTraction
841  << ",\n TangentialTraction " << TangentialTraction
842  << ",\n Fabric " << Fabric
843  << ",\n CollisionalHeatFlux " << CollisionalHeatFlux
844  << ",\n Dissipation " << Dissipation
845  << ",\n Potential " << Potential
846  << ",\n LocalAngularMomentum " << LocalAngularMomentum
847  << ",\n LocalAngularMomentumFlux " << LocalAngularMomentumFlux
848  << ",\n ContactCoupleStress " << ContactCoupleStress;
849  return ss.str();
850 }
MatrixSymmetric3D DisplacementMomentumFlux
Momentum flux from linear displacement, .
Matrix3D ContactCoupleStress
Mdouble Dissipation
Dissipation form collisions, .
Matrix3D NormalStress
Stress from normal forces, .
Vec3D CollisionalHeatFlux
Heat flux from collisions, .
Mdouble Nu
Particle volume fraction, .
Vec3D NormalTraction
Traction from normal forces, .
Vec3D DisplacementMomentum
Momentum from linear displacement, , where , with the time intervall between outputs.
MatrixSymmetric3D Fabric
Fabric tensor, .
Vec3D EnergyFlux
Energy flux, .
Mdouble Density
Density, .
MatrixSymmetric3D Displacement
Linear displacement, .
Vec3D TangentialTraction
Traction from tangential forces, .
Matrix3D LocalAngularMomentumFlux
Mdouble Potential
Elastic energy .
MatrixSymmetric3D MomentumFlux
Momentum flux, .
Vec3D Momentum
Momentum, .
Matrix3D TangentialStress
Stress from tangential forces, .
template<StatType T>
std::string StatisticsPoint< T >::print_sqrt ( ) const

Outputs root of statistical variables in human-readable format.

Definition at line 853 of file StatisticsPoint.hcc.

References StatisticsPoint< T >::CollisionalHeatFlux, StatisticsPoint< T >::ContactCoupleStress, StatisticsPoint< T >::Density, StatisticsPoint< T >::Displacement, StatisticsPoint< T >::DisplacementMomentum, StatisticsPoint< T >::DisplacementMomentumFlux, StatisticsPoint< T >::Dissipation, StatisticsPoint< T >::EnergyFlux, StatisticsPoint< T >::Fabric, StatisticsPoint< T >::LocalAngularMomentum, StatisticsPoint< T >::LocalAngularMomentumFlux, StatisticsPoint< T >::Momentum, StatisticsPoint< T >::MomentumFlux, StatisticsPoint< T >::NormalStress, StatisticsPoint< T >::NormalTraction, StatisticsPoint< T >::Nu, StatisticsPoint< T >::Potential, Matrix3D::sqrt(), MatrixSymmetric3D::sqrt(), Vec3D::sqrt(), StatisticsPoint< T >::TangentialStress, and StatisticsPoint< T >::TangentialTraction.

854 {
855  std::stringstream ss;
856  ss << "Nu " << std::sqrt(Nu)
857  << ", Density " << std::sqrt(Density)
858  << ", Momentum " << Vec3D::sqrt(Momentum)
859  << ", DisplacementMomentum " << Vec3D::sqrt(DisplacementMomentum)
860  << ", Displacement " << MatrixSymmetric3D::sqrt(Displacement)
861  << ", MomentumFlux " << MatrixSymmetric3D::sqrt(MomentumFlux)
862  << ", DisplacementMomentumFlux " << MatrixSymmetric3D::sqrt(DisplacementMomentumFlux)
863  << ", EnergyFlux " << Vec3D::sqrt(EnergyFlux)
864  << ", NormalStress " << Matrix3D::sqrt(NormalStress)
865  << ", TangentialStress " << Matrix3D::sqrt(TangentialStress)
866  << ", NormalTraction " << Vec3D::sqrt(NormalTraction)
867  << ", TangentialTraction " << Vec3D::sqrt(TangentialTraction)
868  << ", Fabric " << MatrixSymmetric3D::sqrt(Fabric)
869  << ", CollisionalHeatFlux " << Vec3D::sqrt(CollisionalHeatFlux)
870  << ", Dissipation " << std::sqrt(Dissipation)
871  << ", Potential " << std::sqrt(Potential)
872  << ", LocalAngularMomentum " << Vec3D::sqrt(LocalAngularMomentum)
873  << ", LocalAngularMomentumFlux " << Matrix3D::sqrt(LocalAngularMomentumFlux)
874  << ", ContactCoupleStress " << Matrix3D::sqrt(ContactCoupleStress);
875 
876  return ss.str();
877 }
MatrixSymmetric3D DisplacementMomentumFlux
Momentum flux from linear displacement, .
Matrix3D ContactCoupleStress
Mdouble Dissipation
Dissipation form collisions, .
static Vec3D sqrt(const Vec3D &a)
Calculates the pointwise square root of a Vec3D.
Definition: Vector.cc:256
Matrix3D NormalStress
Stress from normal forces, .
Vec3D CollisionalHeatFlux
Heat flux from collisions, .
Mdouble Nu
Particle volume fraction, .
Vec3D NormalTraction
Traction from normal forces, .
Vec3D DisplacementMomentum
Momentum from linear displacement, , where , with the time intervall between outputs.
MatrixSymmetric3D Fabric
Fabric tensor, .
Vec3D EnergyFlux
Energy flux, .
Mdouble Density
Density, .
MatrixSymmetric3D Displacement
Linear displacement, .
Vec3D TangentialTraction
Traction from tangential forces, .
Matrix3D LocalAngularMomentumFlux
static Matrix3D sqrt(const Matrix3D &A)
Calculates the pointwise square root.
Definition: Matrix.cc:272
Mdouble Potential
Elastic energy .
MatrixSymmetric3D MomentumFlux
Momentum flux, .
Vec3D Momentum
Momentum, .
static MatrixSymmetric3D sqrt(const MatrixSymmetric3D &A)
Calculates the pointwise square root.
Matrix3D TangentialStress
Stress from tangential forces, .
template<StatType T>
void StatisticsPoint< T >::set_Gaussian_invvolume ( int  dim)

sets CG_invvolume if CG_type=Gaussian

Definition at line 907 of file StatisticsPoint.hcc.

References StatisticsPoint< T >::CG_invvolume, and StatisticsPoint< T >::compute_Gaussian_invvolume().

Referenced by StatisticsPoint< T >::setCGInverseVolume().

908 {
910 }
Mdouble CG_invvolume
Prefactor of CG function which depends on $w.
double compute_Gaussian_invvolume(int dim)
computes CG_invvolume if CG_type=Gaussian
template<StatType T>
static void StatisticsPoint< T >::set_gb ( StatisticsVector< T > *  new_gb)
inlinestatic

see StatisticsVector::setCGShape

Definition at line 69 of file StatisticsPoint.h.

References StatisticsPoint< T >::gb.

Referenced by StatisticsVector< T >::constructor().

70  {
71  gb = new_gb;
72  }
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
template<StatType T>
void StatisticsPoint< T >::set_Heaviside_invvolume ( )

sets CG_invvolume if CG_type=HeaviSideSphere

Todo:
{Thomas: check 2d case}

Definition at line 944 of file StatisticsPoint.hcc.

References StatisticsPoint< T >::CG_invvolume, StatisticsPoint< T >::getCGWidthSquared(), and constants::pi.

Referenced by StatisticsPoint< T >::setCGInverseVolume().

945 {
947  CG_invvolume = 1.0 / (4.0 / 3.0 * constants::pi * sqrt(getCGWidthSquared()) * getCGWidthSquared());
948 }
Mdouble CG_invvolume
Prefactor of CG function which depends on $w.
const Mdouble pi
Definition: ExtendedMath.h:42
Mdouble getCGWidthSquared() const
see StatisticsVector::getCGWidthSquared
template<StatType T>
void StatisticsPoint< T >::set_Polynomial_invvolume ( int  dim)

sets CG_invvolume if CG_type=Polynomial

Definition at line 951 of file StatisticsPoint.hcc.

References StatisticsPoint< T >::CG_invvolume, and StatisticsPoint< T >::getCGWidthSquared().

Referenced by StatisticsPoint< T >::setCGInverseVolume().

952 {
953  if (dim == 3)
954  CG_invvolume = 1.0 / (sqrt(getCGWidthSquared()) * getCGWidthSquared());
955  else if (dim == 2)
957  else
958  CG_invvolume = 1.0 / sqrt(getCGWidthSquared());
959 }
Mdouble CG_invvolume
Prefactor of CG function which depends on $w.
Mdouble getCGWidthSquared() const
see StatisticsVector::getCGWidthSquared
template<StatType T>
void StatisticsPoint< T >::set_zero ( )

Sets all statistical variables to zero.

Definition at line 41 of file StatisticsPoint.hcc.

References StatisticsPoint< T >::CollisionalHeatFlux, StatisticsPoint< T >::ContactCoupleStress, StatisticsPoint< T >::Density, StatisticsPoint< T >::Displacement, StatisticsPoint< T >::DisplacementMomentum, StatisticsPoint< T >::DisplacementMomentumFlux, StatisticsPoint< T >::Dissipation, StatisticsPoint< T >::EnergyFlux, StatisticsPoint< T >::Fabric, StatisticsPoint< T >::LocalAngularMomentum, StatisticsPoint< T >::LocalAngularMomentumFlux, StatisticsPoint< T >::Momentum, StatisticsPoint< T >::MomentumFlux, StatisticsPoint< T >::NormalStress, StatisticsPoint< T >::NormalTraction, StatisticsPoint< T >::Nu, StatisticsPoint< T >::Potential, Matrix3D::setZero(), MatrixSymmetric3D::setZero(), Vec3D::setZero(), StatisticsPoint< T >::TangentialStress, and StatisticsPoint< T >::TangentialTraction.

42 {
43  Nu = 0.0;
44  Density = 0.0;
45  Momentum.setZero();
56  Fabric.setZero();
58  Dissipation = 0.0;
59  Potential = 0.0;
63 }
MatrixSymmetric3D DisplacementMomentumFlux
Momentum flux from linear displacement, .
Matrix3D ContactCoupleStress
Mdouble Dissipation
Dissipation form collisions, .
void setZero()
Sets all elements to zero.
Definition: Vector.cc:52
Matrix3D NormalStress
Stress from normal forces, .
Vec3D CollisionalHeatFlux
Heat flux from collisions, .
Mdouble Nu
Particle volume fraction, .
Vec3D NormalTraction
Traction from normal forces, .
Vec3D DisplacementMomentum
Momentum from linear displacement, , where , with the time intervall between outputs.
MatrixSymmetric3D Fabric
Fabric tensor, .
Vec3D EnergyFlux
Energy flux, .
Mdouble Density
Density, .
MatrixSymmetric3D Displacement
Linear displacement, .
void setZero()
Sets all elements to zero.
Vec3D TangentialTraction
Traction from tangential forces, .
Matrix3D LocalAngularMomentumFlux
Mdouble Potential
Elastic energy .
MatrixSymmetric3D MomentumFlux
Momentum flux, .
void setZero()
Sets all elements to zero.
Definition: Matrix.cc:58
Vec3D Momentum
Momentum, .
Matrix3D TangentialStress
Stress from tangential forces, .
template<StatType T>
void StatisticsPoint< T >::setCGInverseVolume ( )

sets CG_invvolume

Definition at line 961 of file StatisticsPoint.hcc.

References StatisticsPoint< T >::averagingVolume(), StatisticsPoint< T >::CG_invvolume, Gaussian, StatisticsPoint< T >::getCGShape(), HeavisideSphere, StatisticsPoint< T >::nonaveragedDim(), Polynomial, StatisticsPoint< T >::set_Gaussian_invvolume(), StatisticsPoint< T >::set_Heaviside_invvolume(), and StatisticsPoint< T >::set_Polynomial_invvolume().

962 {
963  if (getCGShape() == HeavisideSphere)
964  {
966  }
967  else if (getCGShape() == Gaussian)
968  {
970  } else if (getCGShape()==Polynomial)
971  {
973  }
974  else
975  { std::cerr << "error in CG_function" << std::endl; exit(-1);}
977  }
Mdouble CG_invvolume
Prefactor of CG function which depends on $w.
void set_Gaussian_invvolume(int dim)
sets CG_invvolume if CG_type=Gaussian
void set_Heaviside_invvolume()
sets CG_invvolume if CG_type=HeaviSideSphere
double averagingVolume()
void set_Polynomial_invvolume(int dim)
sets CG_invvolume if CG_type=Polynomial
CG getCGShape() const
see StatisticsVector::getCGShape
template<StatType T>
void StatisticsPoint< T >::setCGShape ( const char *  CG_type)
inline

see StatisticsVector::setCGShape

Definition at line 74 of file StatisticsPoint.h.

References StatisticsPoint< T >::gb.

75  {
76  this->gb->setCGShape(CG_type);
77  }
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
template<StatType T>
void StatisticsPoint< T >::setCGWidth2 ( Mdouble  new_)
inline

see StatisticsVector::setCGWidth2

Definition at line 84 of file StatisticsPoint.h.

References StatisticsPoint< T >::gb.

85  {
86  this->gb->setCGWidth2(new_);
87  }
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
template<StatType T>
void StatisticsPoint< T >::setPosition ( Vec3D  new_)
inline

sets Position

Definition at line 179 of file StatisticsPoint.h.

References StatisticsPoint< T >::Position.

180  {
181  this->Position = new_;
182  }
Vec3D Position
Position at which evaluation occurs.
template<StatType T>
std::string StatisticsPoint< T >::write ( ) const

Outputs statistical variables in computer-readable format.

Definition at line 880 of file StatisticsPoint.hcc.

References StatisticsPoint< T >::CollisionalHeatFlux, StatisticsPoint< T >::ContactCoupleStress, StatisticsPoint< T >::Density, StatisticsPoint< T >::Displacement, StatisticsPoint< T >::DisplacementMomentum, StatisticsPoint< T >::DisplacementMomentumFlux, StatisticsPoint< T >::Dissipation, StatisticsPoint< T >::EnergyFlux, StatisticsPoint< T >::Fabric, StatisticsPoint< T >::LocalAngularMomentum, StatisticsPoint< T >::LocalAngularMomentumFlux, StatisticsPoint< T >::Momentum, StatisticsPoint< T >::MomentumFlux, StatisticsPoint< T >::NormalStress, StatisticsPoint< T >::NormalTraction, StatisticsPoint< T >::Nu, StatisticsPoint< T >::Potential, StatisticsPoint< T >::TangentialStress, and StatisticsPoint< T >::TangentialTraction.

881 {
882  std::stringstream ss;
883  ss.precision(16);
884  ss << Nu
885  << " " << Density
886  << " " << Momentum
887  << " " << DisplacementMomentum
888  << " " << Displacement
889  << " " << MomentumFlux
890  << " " << DisplacementMomentumFlux
891  << " " << EnergyFlux
892  << " " << NormalStress
893  << " " << TangentialStress
894  << " " << NormalTraction
895  << " " << TangentialTraction
896  << " " << Fabric
897  << " " << CollisionalHeatFlux
898  << " " << Dissipation
899  << " " << Potential
900  << " " << LocalAngularMomentum
901  << " " << LocalAngularMomentumFlux
902  << " " << ContactCoupleStress;
903  return ss.str();
904 }
MatrixSymmetric3D DisplacementMomentumFlux
Momentum flux from linear displacement, .
Matrix3D ContactCoupleStress
Mdouble Dissipation
Dissipation form collisions, .
Matrix3D NormalStress
Stress from normal forces, .
Vec3D CollisionalHeatFlux
Heat flux from collisions, .
Mdouble Nu
Particle volume fraction, .
Vec3D NormalTraction
Traction from normal forces, .
Vec3D DisplacementMomentum
Momentum from linear displacement, , where , with the time intervall between outputs.
MatrixSymmetric3D Fabric
Fabric tensor, .
Vec3D EnergyFlux
Energy flux, .
Mdouble Density
Density, .
MatrixSymmetric3D Displacement
Linear displacement, .
Vec3D TangentialTraction
Traction from tangential forces, .
Matrix3D LocalAngularMomentumFlux
Mdouble Potential
Elastic energy .
MatrixSymmetric3D MomentumFlux
Momentum flux, .
Vec3D Momentum
Momentum, .
Matrix3D TangentialStress
Stress from tangential forces, .
template<StatType T>
std::string StatisticsPoint< T >::write_variable_names ( )

Outputs names of statistical variables in computer-readable format.

Definition at line 735 of file StatisticsPoint.hcc.

736 {
737  std::stringstream ss;
738  ss << "Nu "
739  << "Density "
740  << "MomentumX "
741  << "MomentumY "
742  << "MomentumZ "
743  << "DisplacementMomentumX "
744  << "DisplacementMomentumY "
745  << "DisplacementMomentumZ "
746  << "DisplacementXX "
747  << "DisplacementXY "
748  << "DisplacementXZ "
749  << "DisplacementYY "
750  << "DisplacementYZ "
751  << "DisplacementZZ "
752  << "MomentumFluxXX "
753  << "MomentumFluxXY "
754  << "MomentumFluxXZ "
755  << "MomentumFluxYY "
756  << "MomentumFluxYZ "
757  << "MomentumFluxZZ "
758  << "DisplacementMomentumFluxXX "
759  << "DisplacementMomentumFluxXY "
760  << "DisplacementMomentumFluxXZ "
761  << "DisplacementMomentumFluxYY "
762  << "DisplacementMomentumFluxYZ "
763  << "DisplacementMomentumFluxZZ "
764  << "EnergyFluxX "
765  << "EnergyFluxY "
766  << "EnergyFluxZ "
767  << "NormalStressXX "
768  << "NormalStressXY "
769  << "NormalStressXZ "
770  << "NormalStressYX "
771  << "NormalStressYY "
772  << "NormalStressYZ "
773  << "NormalStressZX "
774  << "NormalStressZY "
775  << "NormalStressZZ "
776  << "TangentialStressXX "
777  << "TangentialStressXY "
778  << "TangentialStressXZ "
779  << "TangentialStressYX "
780  << "TangentialStressYY "
781  << "TangentialStressYZ "
782  << "TangentialStressZX "
783  << "TangentialStressZY "
784  << "TangentialStressZZ "
785  << "NormalTractionX "
786  << "NormalTractionY "
787  << "NormalTractionZ "
788  << "TangentialTractionX "
789  << "TangentialTractionY "
790  << "TangentialTractionZ "
791  << "FabricXX "
792  << "FabricXY "
793  << "FabricXZ "
794  << "FabricYY "
795  << "FabricYZ "
796  << "FabricZZ "
797  << "CollisionalHeatFluxX "
798  << "CollisionalHeatFluxY "
799  << "CollisionalHeatFluxZ "
800  << "Dissipation "
801  << "Potential "
802  << "LocalAngularMomentumX "
803  << "LocalAngularMomentumY "
804  << "LocalAngularMomentumZ "
805  << "LocalAngularMomentumFluxXX "
806  << "LocalAngularMomentumFluxXY "
807  << "LocalAngularMomentumFluxXZ "
808  << "LocalAngularMomentumFluxYX "
809  << "LocalAngularMomentumFluxYY "
810  << "LocalAngularMomentumFluxYZ "
811  << "LocalAngularMomentumFluxZX "
812  << "LocalAngularMomentumFluxZY "
813  << "LocalAngularMomentumFluxZZ "
814  << "ContactCoupleStressXX "
815  << "ContactCoupleStressXY "
816  << "ContactCoupleStressXZ "
817  << "ContactCoupleStressYX "
818  << "ContactCoupleStressYY "
819  << "ContactCoupleStressYZ "
820  << "ContactCoupleStressZX "
821  << "ContactCoupleStressZY "
822  << "ContactCoupleStressZZ ";
823  return ss.str();
824 }

Friends And Related Function Documentation

template<StatType T>
std::ostream& operator ( std::ostream &  os,
const StatisticsPoint< T > &  stat 
)
friend

Outputs statistical variables to ostream.

Member Data Documentation

template<StatType T>
int StatisticsPoint< T >::mirrorParticle

indicates that a position is a (fake) particles used for periodic walls

Definition at line 314 of file StatisticsPoint.h.

Referenced by StatisticsPoint< T >::StatisticsPoint().

template<StatType T>
Mdouble StatisticsPoint< T >::Potential

Elastic energy $2/4 \sum_{ij} (k \delta_{ij}^2 +k^t {\delta^t_{ij}}^2) \phi_i$.

Todo:
{Potential calculations have not been checked, only implemented; fstat file does not include the torsional and rolling spring and hence cannot account for their potential}

Definition at line 304 of file StatisticsPoint.h.

Referenced by StatisticsPoint< T >::firstTimeAverage(), StatisticsPoint< T >::getSquared(), StatisticsPoint< T >::operator+=(), StatisticsPoint< T >::operator-=(), StatisticsPoint< T >::operator/=(), StatisticsPoint< T >::operator=(), StatisticsPoint< T >::print(), StatisticsPoint< T >::print_sqrt(), StatisticsPoint< T >::set_zero(), and StatisticsPoint< T >::write().


The documentation for this struct was generated from the following files: