MercuryDPM  0.10
 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 set_CG_type (const char *CG_type)
 see StatisticsVector::set_CG_type More...
 
CG get_CG_type () const
 see StatisticsVector::get_CG_type More...
 
void set_w2 (Mdouble new_)
 see StatisticsVector::set_w2 More...
 
Mdouble get_w2 () const
 see StatisticsVector::get_w2 More...
 
Mdouble get_w () const
 see StatisticsVector::get_w More...
 
Mdouble get_cutoff ()
 see StatisticsVector::get_cutoff More...
 
Mdouble get_cutoff2 ()
 see StatisticsVector::get_cutoff2 More...
 
Mdouble get_xmaxStat ()
 see StatisticsVector::get_xmaxStat More...
 
Mdouble get_ymaxStat ()
 see StatisticsVector::get_ymaxStat More...
 
Mdouble get_zmaxStat ()
 see StatisticsVector::get_zmaxStat More...
 
Mdouble get_xminStat ()
 see StatisticsVector::get_xminStat More...
 
Mdouble get_yminStat ()
 see StatisticsVector::get_yminStat More...
 
Mdouble get_zminStat ()
 see StatisticsVector::get_zminStat More...
 
void get_n (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 set_CG_invvolume ()
 sets CG_invvolume More...
 
int nonaveragedDim ()
 
double averagingVolume ()
 
Mdouble get_CG_invvolume ()
 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 set_Position (Vec3D new_)
 sets Position More...
 
Vec3D get_Position () 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 get_distance2 (const Vec3D &P)
 returns the coarse graining distance in the coordinates that are not averaged about More...
 
Mdouble dot (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 cross (Vec3D P, Vec3D &Q)
 Returns the cross product of two vectors in the coordinates that are not averaged about. More...
 
Matrix3D MatrixCross (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 UNUSED, 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 get_distance2 (const Vec3D &P)
 
template<>
Mdouble get_distance2 (const Vec3D &P)
 
template<>
Mdouble get_distance2 (const Vec3D &P)
 
template<>
Mdouble get_distance2 (const Vec3D &P)
 
template<>
Mdouble get_distance2 (const Vec3D &P)
 
template<>
Mdouble get_distance2 (const Vec3D &P)
 
template<>
Mdouble get_distance2 (const Vec3D &)
 
template<>
Mdouble dot (const Vec3D &P, const Vec3D &Q)
 
template<>
Mdouble dot (const Vec3D &P, const Vec3D &Q)
 
template<>
Mdouble dot (const Vec3D &P, const Vec3D &Q)
 
template<>
Mdouble dot (const Vec3D &P, const Vec3D &Q)
 
template<>
Mdouble dot (const Vec3D &P, const Vec3D &Q)
 
template<>
Mdouble dot (const Vec3D &P, const Vec3D &Q)
 
template<>
Mdouble dot (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 cross (Vec3D P, Vec3D &Q)
 
template<>
Vec3D cross (Vec3D P, Vec3D &Q)
 
template<>
Vec3D cross (Vec3D P, Vec3D &Q)
 
template<>
Vec3D cross (Vec3D P UNUSED, Vec3D &Q UNUSED)
 
template<>
Vec3D cross (Vec3D P UNUSED, Vec3D &Q UNUSED)
 
template<>
Vec3D cross (Vec3D P UNUSED, Vec3D &Q UNUSED)
 
template<>
Vec3D cross (Vec3D P UNUSED, Vec3D &Q UNUSED)
 
template<>
Matrix3D MatrixCross (Vec3D P, Matrix3D &Q)
 
template<>
Matrix3D MatrixCross (Vec3D P, Matrix3D &Q)
 
template<>
Matrix3D MatrixCross (Vec3D P, Matrix3D &Q)
 
template<>
Matrix3D MatrixCross (Vec3D P UNUSED, Matrix3D &Q UNUSED)
 
template<>
Matrix3D MatrixCross (Vec3D P UNUSED, Matrix3D &Q UNUSED)
 
template<>
Matrix3D MatrixCross (Vec3D P UNUSED, Matrix3D &Q UNUSED)
 
template<>
Matrix3D MatrixCross (Vec3D P UNUSED, Matrix3D &Q UNUSED)
 

Static Public Member Functions

static void set_gb (StatisticsVector< T > *new_gb)
 see StatisticsVector::set_CG_type 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, $1/(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, $1/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 $1/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 33 of file StatisticsPoint.h.

Constructor & Destructor Documentation

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

Constructor sets sensible values.

Definition at line 46 of file StatisticsPoint.h.

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

46  {
47  this->Position.set_zero();
48  mirrorParticle=-1;
49  //~ this->set_zero();
50  }
int mirrorParticle
indicates that a position is a (fake) particles used for periodic walls
void set_zero()
Definition: Vector.h:55
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 53 of file StatisticsPoint.h.

References StatisticsPoint< T >::mirrorParticle.

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

Member Function Documentation

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

Definition at line 831 of file StatisticsPoint.hcc.

831  {
832  return 1.0;
833 }
template<>
double StatisticsPoint< XY >::averagingVolume ( )

Definition at line 834 of file StatisticsPoint.hcc.

834  {
835  return ((gb->get_dim_particle()!=3)?(1.0):(get_zmaxStat()-get_zminStat()));
836 }
Mdouble get_zmaxStat()
see StatisticsVector::get_zmaxStat
Mdouble get_zminStat()
see StatisticsVector::get_zminStat
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
template<>
double StatisticsPoint< XZ >::averagingVolume ( )

Definition at line 837 of file StatisticsPoint.hcc.

837  {
838  return (get_ymaxStat()-get_yminStat());
839 }
Mdouble get_ymaxStat()
see StatisticsVector::get_ymaxStat
Mdouble get_yminStat()
see StatisticsVector::get_yminStat
template<>
double StatisticsPoint< YZ >::averagingVolume ( )

Definition at line 840 of file StatisticsPoint.hcc.

840  {
841  return (get_xmaxStat()-get_xminStat());
842 }
Mdouble get_xminStat()
see StatisticsVector::get_xminStat
Mdouble get_xmaxStat()
see StatisticsVector::get_xmaxStat
template<>
double StatisticsPoint< X >::averagingVolume ( )

Definition at line 843 of file StatisticsPoint.hcc.

843  {
844  return (get_ymaxStat()-get_yminStat())
845  * ((gb->get_dim_particle()!=3)?(1.0):(get_zmaxStat()-get_zminStat()));
846 }
Mdouble get_ymaxStat()
see StatisticsVector::get_ymaxStat
Mdouble get_yminStat()
see StatisticsVector::get_yminStat
Mdouble get_zmaxStat()
see StatisticsVector::get_zmaxStat
Mdouble get_zminStat()
see StatisticsVector::get_zminStat
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
template<>
double StatisticsPoint< Y >::averagingVolume ( )

Definition at line 847 of file StatisticsPoint.hcc.

847  {
848  return (get_xmaxStat()-get_xminStat())
849  * ((gb->get_dim_particle()!=3)?(1.0):(get_zmaxStat()-get_zminStat()));
850 }
Mdouble get_xminStat()
see StatisticsVector::get_xminStat
Mdouble get_zmaxStat()
see StatisticsVector::get_zmaxStat
Mdouble get_zminStat()
see StatisticsVector::get_zminStat
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
Mdouble get_xmaxStat()
see StatisticsVector::get_xmaxStat
template<>
double StatisticsPoint< Z >::averagingVolume ( )

Definition at line 851 of file StatisticsPoint.hcc.

851  {
852  return (get_xmaxStat()-get_xminStat())
853  * (get_ymaxStat()-get_yminStat());
854 }
Mdouble get_ymaxStat()
see StatisticsVector::get_ymaxStat
Mdouble get_yminStat()
see StatisticsVector::get_yminStat
Mdouble get_xminStat()
see StatisticsVector::get_xminStat
Mdouble get_xmaxStat()
see StatisticsVector::get_xmaxStat
template<>
double StatisticsPoint< O >::averagingVolume ( )

Definition at line 855 of file StatisticsPoint.hcc.

855  {
856  return (get_xmaxStat()-get_xminStat())
857  * (get_ymaxStat()-get_yminStat())
858  * ((gb->get_dim_particle()!=3)?(1.0):(get_zmaxStat()-get_zminStat()));
859 }
Mdouble get_ymaxStat()
see StatisticsVector::get_ymaxStat
Mdouble get_yminStat()
see StatisticsVector::get_yminStat
Mdouble get_xminStat()
see StatisticsVector::get_xminStat
Mdouble get_zmaxStat()
see StatisticsVector::get_zmaxStat
Mdouble get_zminStat()
see StatisticsVector::get_zminStat
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
Mdouble get_xmaxStat()
see StatisticsVector::get_xmaxStat
template<>
double StatisticsPoint< RAZ >::averagingVolume ( )

Definition at line 860 of file StatisticsPoint.hcc.

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

Definition at line 861 of file StatisticsPoint.hcc.

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

Definition at line 862 of file StatisticsPoint.hcc.

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

Definition at line 863 of file StatisticsPoint.hcc.

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

Definition at line 864 of file StatisticsPoint.hcc.

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

Definition at line 865 of file StatisticsPoint.hcc.

865 { exit(-1); }
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 238 of file StatisticsPoint.hcc.

References Gaussian, HeavisideSphere, and Polynomial.

238  {
239  Mdouble dist2 = get_distance2(PI);
240  if (get_CG_type()==HeavisideSphere) {
241  return (get_w2()<dist2)?0.0:get_CG_invvolume();
242  } else if (get_CG_type()==Gaussian) {
243  return (get_cutoff2()<dist2)?0.0:get_CG_invvolume() * exp(-dist2/(2.0*get_w2()));
244  } else if (get_CG_type()==Polynomial) {
245  return (get_cutoff2()<dist2)?0.0:get_CG_invvolume()*evaluatePolynomial(sqrt(dist2)/get_cutoff());
246  } else { std::cerr << "error in CG_function" << std::endl; exit(-1); }
247 }
Mdouble get_distance2(const Vec3D &P)
returns the coarse graining distance in the coordinates that are not averaged about ...
Mdouble evaluatePolynomial(Mdouble r)
see StatisticsVector::evaluatePolynomial
Mdouble get_cutoff2()
see StatisticsVector::get_cutoff2
Mdouble get_w2() const
see StatisticsVector::get_w2
Mdouble get_cutoff()
see StatisticsVector::get_cutoff
double Mdouble
Definition: ExtendedMath.h:33
CG get_CG_type() const
see StatisticsVector::get_CG_type
Mdouble get_CG_invvolume()
returns CG_invvolume
template<>
Mdouble StatisticsPoint< RA >::CG_function ( const Vec3D PI)

Definition at line 867 of file StatisticsPoint.hcc.

867  {
868  return CG_function_2D(PI);
869 }
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 870 of file StatisticsPoint.hcc.

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

870  {
871  Mdouble dist2 = get_distance2(PI);
872  Mdouble R2 = sqr(PI.X)+sqr(PI.Y);
873  Mdouble RI2 = sqr(Position.X)+sqr(Position.Y);
874  Mdouble Z2 = sqr(PI.Z-Position.Z);
875  if (get_CG_type()==Gaussian) {
876  return (get_cutoff2()<dist2)?0.0:get_CG_invvolume()
877  * exp(-(R2+RI2+Z2)/(2.0*get_w2())) * besselFunc::I0(sqrt(R2*RI2)/get_w2());
878  } else { std::cerr << "error in CG_function<RZ>" << std::endl; exit(-1); }
879 }
Mdouble get_distance2(const Vec3D &P)
returns the coarse graining distance in the coordinates that are not averaged about ...
Mdouble X
Definition: Vector.h:44
Mdouble get_cutoff2()
see StatisticsVector::get_cutoff2
#define sqr(a)
Definition: ExtendedMath.h:36
Mdouble get_w2() const
see StatisticsVector::get_w2
double Mdouble
Definition: ExtendedMath.h:33
Mdouble Y
Definition: Vector.h:44
CG get_CG_type() const
see StatisticsVector::get_CG_type
Mdouble I0(Mdouble x)
Mdouble get_CG_invvolume()
returns CG_invvolume
Vec3D Position
Position at which evaluation occurs.
Mdouble Z
Definition: Vector.h:44
template<>
Mdouble StatisticsPoint< AZ >::CG_function ( const Vec3D )

Definition at line 880 of file StatisticsPoint.hcc.

880  {
881  std::cerr << "error in CG_function<AZ>" << std::endl; exit(-1);
882 }
template<>
Mdouble StatisticsPoint< R >::CG_function ( const Vec3D PI)

Definition at line 883 of file StatisticsPoint.hcc.

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

883  {
884  Mdouble dist2 = get_distance2(PI);
885  Mdouble R2 = sqr(PI.X)+sqr(PI.Y);
886  Mdouble RI2 = sqr(Position.X)+sqr(Position.Y);
887  if (get_CG_type()==Gaussian) {
888  return (get_cutoff2()<dist2)?0.0:get_CG_invvolume()
889  * exp(-(R2+RI2)/(2.0*get_w2())) * besselFunc::I0(sqrt(R2*RI2)/get_w2());
890  } else { std::cerr << "error in CG_function<R>" << std::endl; exit(-1); }
891 }
Mdouble get_distance2(const Vec3D &P)
returns the coarse graining distance in the coordinates that are not averaged about ...
Mdouble X
Definition: Vector.h:44
Mdouble get_cutoff2()
see StatisticsVector::get_cutoff2
#define sqr(a)
Definition: ExtendedMath.h:36
Mdouble get_w2() const
see StatisticsVector::get_w2
double Mdouble
Definition: ExtendedMath.h:33
Mdouble Y
Definition: Vector.h:44
CG get_CG_type() const
see StatisticsVector::get_CG_type
Mdouble I0(Mdouble x)
Mdouble get_CG_invvolume()
returns CG_invvolume
Vec3D Position
Position at which evaluation occurs.
template<>
Mdouble StatisticsPoint< A >::CG_function ( const Vec3D )

Definition at line 892 of file StatisticsPoint.hcc.

892  {
893  std::cerr << "error in CG_function<A>" << std::endl; exit(-1);
894 }
template<>
Mdouble StatisticsPoint< XY >::CG_function ( const Vec3D PI)

Definition at line 896 of file StatisticsPoint.hcc.

896  {
897  return CG_function_2D(PI);
898 }
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 899 of file StatisticsPoint.hcc.

899  {
900  return CG_function_2D(PI);
901 }
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 902 of file StatisticsPoint.hcc.

902  {
903  return CG_function_2D(PI);
904 }
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 905 of file StatisticsPoint.hcc.

905  {
906  return CG_function_1D(PI);
907 }
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 908 of file StatisticsPoint.hcc.

908  {
909  return CG_function_1D(PI);
910 }
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 911 of file StatisticsPoint.hcc.

911  {
912  return CG_function_1D(PI);
913 }
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 914 of file StatisticsPoint.hcc.

914  {
915  return get_CG_invvolume();
916 }
Mdouble get_CG_invvolume()
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 269 of file StatisticsPoint.hcc.

References Gaussian, HeavisideSphere, constants::pi, and Polynomial.

269  {
270  Mdouble dist2 = get_distance2(PI);
271  if (get_CG_type()==HeavisideSphere) {
272  return (get_w2()<dist2)?0.0:(get_CG_invvolume()*constants::pi*(get_w2()-dist2));
273  } else if (get_CG_type()==Gaussian) {
274  return (get_cutoff2()<dist2)?0.0:get_CG_invvolume() * exp(-dist2/(2.0*get_w2()));
275  } else if (get_CG_type()==Polynomial) {
276  return (get_cutoff2()<dist2)?0.0:get_CG_invvolume()*evaluatePolynomial(sqrt(dist2)/get_cutoff());
277  } else { std::cerr << "error in CG_function_1D" << std::endl; exit(-1); }
278 }
Mdouble get_distance2(const Vec3D &P)
returns the coarse graining distance in the coordinates that are not averaged about ...
Mdouble evaluatePolynomial(Mdouble r)
see StatisticsVector::evaluatePolynomial
Mdouble get_cutoff2()
see StatisticsVector::get_cutoff2
Mdouble get_w2() const
see StatisticsVector::get_w2
Mdouble get_cutoff()
see StatisticsVector::get_cutoff
const Mdouble pi
Definition: ExtendedMath.h:54
double Mdouble
Definition: ExtendedMath.h:33
CG get_CG_type() const
see StatisticsVector::get_CG_type
Mdouble get_CG_invvolume()
returns CG_invvolume
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 set_CG_invvolume

Definition at line 251 of file StatisticsPoint.hcc.

References Gaussian, HeavisideSphere, and Polynomial.

251  {
252  Mdouble dist2 = get_distance2(PI);
253  if (get_CG_type()==HeavisideSphere) {
254  if (get_w2()<dist2) return 0.0;
255  else {
256  Mdouble wn = sqrt(get_w2()-dist2);
257  return get_CG_invvolume()*2.0*wn;
259  //return get_CG_invvolume()*(std::min(wn,gb->getObjectDistanceLeft()) +std::min(wn,gb->getObjectDistanceRight()));
260  }
261  } else if (get_CG_type()==Gaussian) {
262  return (get_cutoff2()<dist2)?0.0:get_CG_invvolume() * exp(-dist2/(2.0*get_w2()));
263  } else if (get_CG_type()==Polynomial) {
264  return (get_cutoff2()<dist2)?0.0:get_CG_invvolume()*evaluatePolynomial(sqrt(dist2)/get_cutoff());
265  } else { std::cerr << "error in CG_function_2D" << std::endl; exit(-1); }
266 }
Mdouble get_distance2(const Vec3D &P)
returns the coarse graining distance in the coordinates that are not averaged about ...
Mdouble evaluatePolynomial(Mdouble r)
see StatisticsVector::evaluatePolynomial
Mdouble get_cutoff2()
see StatisticsVector::get_cutoff2
Mdouble get_w2() const
see StatisticsVector::get_w2
Mdouble get_cutoff()
see StatisticsVector::get_cutoff
double Mdouble
Definition: ExtendedMath.h:33
CG get_CG_type() const
see StatisticsVector::get_CG_type
Mdouble get_CG_invvolume()
returns CG_invvolume
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 281 of file StatisticsPoint.hcc.

References Gaussian, and Polynomial.

281  {
282  //CG_type_todo
283  if (get_CG_type()==Gaussian) {
284  return (P-Position)*(phi/get_w2());
285  } else if (get_CG_type()==Polynomial) {
286  Mdouble r=GetLength(Position-P)/get_w();
288  } else { std::cerr << "error in CG_gradient" << std::endl; exit(-1); }
289 }
Mdouble get_w() const
see StatisticsVector::get_w
Mdouble get_w2() const
see StatisticsVector::get_w2
double Mdouble
Definition: ExtendedMath.h:33
CG get_CG_type() const
see StatisticsVector::get_CG_type
Mdouble get_CG_invvolume()
returns CG_invvolume
Vec3D Position
Position at which evaluation occurs.
Mdouble evaluatePolynomialGradient(Mdouble r)
see StatisticsVector::evaluatePolynomialGradient
template<>
Vec3D StatisticsPoint< YZ >::CG_gradient ( const Vec3D P,
const Mdouble  phi 
)

Definition at line 918 of file StatisticsPoint.hcc.

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

918  {
919  //CG_type_todo
920  if (get_CG_type()==Gaussian) {
921  return Vec3D(0.0,P.Y - Position.Y,P.Z - Position.Z)*(phi/get_w2());
922  } else { std::cerr << "error in CG_gradient<YZ>" << std::endl; exit(-1); }
923 }
Mdouble get_w2() const
see StatisticsVector::get_w2
Mdouble Y
Definition: Vector.h:44
CG get_CG_type() const
see StatisticsVector::get_CG_type
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:40
Vec3D Position
Position at which evaluation occurs.
Mdouble Z
Definition: Vector.h:44
template<>
Vec3D StatisticsPoint< XZ >::CG_gradient ( const Vec3D P,
const Mdouble  phi 
)

Definition at line 924 of file StatisticsPoint.hcc.

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

924  {
925  //CG_type_todo
926  if (get_CG_type()==Gaussian) {
927  return Vec3D(P.X - Position.X,0.0,P.Z - Position.Z)*(phi/get_w2());
928  } else { std::cerr << "error in CG_gradient<XZ>" << std::endl; exit(-1); }
929 }
Mdouble X
Definition: Vector.h:44
Mdouble get_w2() const
see StatisticsVector::get_w2
CG get_CG_type() const
see StatisticsVector::get_CG_type
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:40
Vec3D Position
Position at which evaluation occurs.
Mdouble Z
Definition: Vector.h:44
template<>
Vec3D StatisticsPoint< XY >::CG_gradient ( const Vec3D P,
const Mdouble  phi 
)

Definition at line 930 of file StatisticsPoint.hcc.

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

930  {
931  //CG_type_todo
932  if (get_CG_type()==Gaussian) {
933  return Vec3D(P.X - Position.X,P.Y - Position.Y,0.0)*(phi/get_w2());
934  } else { std::cerr << "error in CG_gradient<XY>" << std::endl; exit(-1); }
935 }
Mdouble X
Definition: Vector.h:44
Mdouble get_w2() const
see StatisticsVector::get_w2
Mdouble Y
Definition: Vector.h:44
CG get_CG_type() const
see StatisticsVector::get_CG_type
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:40
Vec3D Position
Position at which evaluation occurs.
template<>
Vec3D StatisticsPoint< X >::CG_gradient ( const Vec3D P,
const Mdouble  phi 
)

Definition at line 937 of file StatisticsPoint.hcc.

References Gaussian, Polynomial, and Vec3D::X.

937  {
938  //CG_type_todo
939  if (get_CG_type()==Gaussian) {
940  return Vec3D((P.X - Position.X)*(phi/get_w2()),0.0,0.0);
941  } else if (get_CG_type()==Polynomial) {
942  Mdouble r=fabs(Position.X-P.X)/get_w();
944  } else { std::cerr << "error in CG_gradient<X>" << std::endl; exit(-1); }
945 }
Mdouble X
Definition: Vector.h:44
Mdouble get_w() const
see StatisticsVector::get_w
Mdouble get_w2() const
see StatisticsVector::get_w2
double Mdouble
Definition: ExtendedMath.h:33
CG get_CG_type() const
see StatisticsVector::get_CG_type
Mdouble get_CG_invvolume()
returns CG_invvolume
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:40
Vec3D Position
Position at which evaluation occurs.
Mdouble evaluatePolynomialGradient(Mdouble r)
see StatisticsVector::evaluatePolynomialGradient
template<>
Vec3D StatisticsPoint< Y >::CG_gradient ( const Vec3D P,
const Mdouble  phi 
)

Definition at line 946 of file StatisticsPoint.hcc.

References Gaussian, Polynomial, and Vec3D::Y.

946  {
947  //CG_type_todo
948  if (get_CG_type()==Gaussian) {
949  return Vec3D(0.0,(P.Y - Position.Y)*(phi/get_w2()),0.0);
950  } else if (get_CG_type()==Polynomial) {
951  Mdouble r=fabs(Position.Y-P.Y)/get_w();
953  } else { std::cerr << "error in CG_gradient<Y>" << std::endl; exit(-1); }
954 }
Mdouble get_w() const
see StatisticsVector::get_w
Mdouble get_w2() const
see StatisticsVector::get_w2
double Mdouble
Definition: ExtendedMath.h:33
Mdouble Y
Definition: Vector.h:44
CG get_CG_type() const
see StatisticsVector::get_CG_type
Mdouble get_CG_invvolume()
returns CG_invvolume
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:40
Vec3D Position
Position at which evaluation occurs.
Mdouble evaluatePolynomialGradient(Mdouble r)
see StatisticsVector::evaluatePolynomialGradient
template<>
Vec3D StatisticsPoint< Z >::CG_gradient ( const Vec3D P,
const Mdouble  phi 
)

Definition at line 955 of file StatisticsPoint.hcc.

References Gaussian, Polynomial, and Vec3D::Z.

955  {
956  //CG_type_todo
957  if (get_CG_type()==Gaussian) {
958  return Vec3D(0.0,0.0,(P.Z - Position.Z)*(phi/get_w2()));
959  } else if (get_CG_type()==Polynomial) {
960  Mdouble r=fabs(Position.Z-P.Z)/get_w();
962  } else { std::cerr << "error in CG_gradient<Z>" << std::endl; exit(-1); }
963 }
Mdouble get_w() const
see StatisticsVector::get_w
Mdouble get_w2() const
see StatisticsVector::get_w2
double Mdouble
Definition: ExtendedMath.h:33
CG get_CG_type() const
see StatisticsVector::get_CG_type
Mdouble get_CG_invvolume()
returns CG_invvolume
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:40
Vec3D Position
Position at which evaluation occurs.
Mdouble Z
Definition: Vector.h:44
Mdouble evaluatePolynomialGradient(Mdouble r)
see StatisticsVector::evaluatePolynomialGradient
template<>
Vec3D StatisticsPoint< O >::CG_gradient ( const Vec3D ,
const Mdouble   
)

Definition at line 965 of file StatisticsPoint.hcc.

965  {
966  return Vec3D(0.0,0.0,0.0);
967 }
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:40
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 400 of file StatisticsPoint.hcc.

References Gaussian, Vec3D::GetLength(), HeavisideSphere, Polynomial, constants::sqrt_2, and constants::sqrt_pi.

401 {
402  //apply the cutoff in normal direction:
403  Vec3D P_P1 = Position - P1;
404  Mdouble a = dot(P_P1,P1_P2_normal);
405  if ( a > get_cutoff() ) return 0.0;
406  Vec3D P_P2 = Position - P2;
407  Mdouble b = dot(P_P2,P1_P2_normal);
408  if ( -b > get_cutoff() ) return 0.0;
409  //apply the cutoff in tangential direction:
410  Vec3D tangential = P_P1 - a * P1_P2_normal;
411  if (dot(tangential,tangential)>get_cutoff2()) return 0.0;
412  //evaluate:
413  if (get_CG_type()==HeavisideSphere) {
414  Mdouble wn2 = get_w2() - dot(tangential,tangential);
415  if ((wn2<=0) | (a*fabs(a)>=wn2) | (b*fabs(b)<=-wn2)) {
416  return 0;
417  } else {
418  Mdouble wn = sqrt(wn2);
419  return get_CG_invvolume()*( std::min(b,wn)-std::max(a,-wn) ) / P1_P2_distance;
420  }
421  } else if (get_CG_type()==Gaussian) { //Gaussian
422  static Mdouble InvVolumeExp = compute_Gaussian_invvolume(gb->get_dim_particle()-1);
423  static Mdouble w_sqrt_2 = constants::sqrt_2*get_w();
424  static Mdouble P1_P2_distance_for_cutoff=-1, InvVolumeErf=-1;
425  if (P1_P2_distance_for_cutoff!=P1_P2_distance) {
426  P1_P2_distance_for_cutoff = P1_P2_distance;
427  Mdouble amax = -get_cutoff();
428  Mdouble bmax = get_cutoff()+P1_P2_distance;
429  InvVolumeErf = P1_P2_distance/(
430  erf(bmax/w_sqrt_2)*bmax+w_sqrt_2/constants::sqrt_pi*exp(-bmax*bmax/(w_sqrt_2*w_sqrt_2))
431  -erf(amax/w_sqrt_2)*amax-w_sqrt_2/constants::sqrt_pi*exp(-amax*amax/(w_sqrt_2*w_sqrt_2)));
432  // std::cout << "InvVolumeErf" << InvVolumeErf << " InvVolumeExp" << InvVolumeExp << " f" << get_CG_invvolume() * sqrt(2*constants::pi*get_w2()) << std::endl;
433  }
434  Mdouble psi=exp(-dot(tangential,tangential)/(2.0*get_w2())) * InvVolumeExp
435  * ( erf(b/w_sqrt_2) - erf(a/w_sqrt_2) ) * InvVolumeErf /2./P1_P2_distance;
436  rpsi=Position*psi;
437  return psi;
438  } else if (get_CG_type()==Polynomial) {
439  double wn2 = get_w2() - dot(tangential,tangential);
440  if ((wn2<=0) | (a*fabs(a)>=wn2) | (b*fabs(b)<=-wn2)) {
441  return 0;
442  } else {
443  double wn = sqrt(wn2);
444  double w = get_w();
445  return get_CG_invvolume()*evaluateIntegral(std::max(a,-wn)/w,std::min(b,wn)/w,tangential.GetLength()/w)*w / P1_P2_distance;
446  }
447  //CG_type_todo
448  } else { std::cerr << "error in CG_integral" << std::endl; exit(-1); }
449 }
Mdouble get_w() const
see StatisticsVector::get_w
Mdouble get_cutoff2()
see StatisticsVector::get_cutoff2
const Mdouble sqrt_pi
Definition: ExtendedMath.h:55
Mdouble get_w2() const
see StatisticsVector::get_w2
Mdouble evaluateIntegral(Mdouble n1, Mdouble n2, Mdouble t)
see StatisticsVector::evaluateIntegral
Mdouble get_cutoff()
see StatisticsVector::get_cutoff
double Mdouble
Definition: ExtendedMath.h:33
const Mdouble sqrt_2
Definition: ExtendedMath.h:57
CG get_CG_type() const
see StatisticsVector::get_CG_type
double compute_Gaussian_invvolume(int dim)
computes CG_invvolume if CG_type=Gaussian
Mdouble GetLength() const
Definition: Vector.h:248
Mdouble get_CG_invvolume()
returns CG_invvolume
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:40
Vec3D Position
Position at which evaluation occurs.
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
Mdouble dot(const Vec3D &P, const Vec3D &Q)
Returns the dot product of two vectors in the coordinates that are not averaged about.
template<>
Mdouble StatisticsPoint< RA >::CG_integral ( Vec3D P1,
Vec3D P2,
Vec3D P1_P2_normal,
Mdouble  P1_P2_distance,
Vec3D rpsi 
)

Definition at line 982 of file StatisticsPoint.hcc.

982  {
983  Mdouble rpsi_scalar;
984  Mdouble psi = CG_integral_2D(P1, P2, P1_P2_normal, P1_P2_distance, rpsi_scalar);
985  rpsi=Position*psi;
986  return psi;
987 }
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.
double Mdouble
Definition: ExtendedMath.h:33
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 988 of file StatisticsPoint.hcc.

988  {
989  Vec3D P=(P1+P2)/2; return CG_function(P);
990 }
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:40
template<>
Mdouble StatisticsPoint< AZ >::CG_integral ( Vec3D ,
Vec3D ,
Vec3D ,
Mdouble  ,
Vec3D &rpsi  UNUSED 
)

Definition at line 991 of file StatisticsPoint.hcc.

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

Definition at line 994 of file StatisticsPoint.hcc.

994  {
995  Vec3D P=(P1+P2)/2; return CG_function(P);
996 }
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:40
template<>
Mdouble StatisticsPoint< A >::CG_integral ( Vec3D ,
Vec3D ,
Vec3D ,
Mdouble  ,
Vec3D &rpsi  UNUSED 
)

Definition at line 997 of file StatisticsPoint.hcc.

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

Definition at line 1001 of file StatisticsPoint.hcc.

References Vec3D::Z.

1001  {
1002  Mdouble rpsi_scalar=0;
1003  Mdouble psi = CG_integral_2D(P1, P2, P1_P2_normal, P1_P2_distance, rpsi_scalar);
1004  rpsi=Vec3D(Position.X*psi,Position.Y*psi,P1.Z*psi-(P1.Z-P2.Z)*rpsi_scalar);
1005  return psi;
1006 }
Mdouble X
Definition: Vector.h:44
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.
double Mdouble
Definition: ExtendedMath.h:33
Mdouble Y
Definition: Vector.h:44
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:40
Vec3D Position
Position at which evaluation occurs.
Mdouble Z
Definition: Vector.h:44
template<>
Mdouble StatisticsPoint< XZ >::CG_integral ( Vec3D P1,
Vec3D P2,
Vec3D P1_P2_normal,
Mdouble  P1_P2_distance,
Vec3D rpsi 
)

Definition at line 1007 of file StatisticsPoint.hcc.

References Vec3D::Y.

1007  {
1008  Mdouble rpsi_scalar=0;
1009  Mdouble psi = CG_integral_2D(P1, P2, P1_P2_normal, P1_P2_distance, rpsi_scalar);
1010  rpsi=Vec3D(Position.X*psi,P1.Y*psi-(P1.Y-P2.Y)*rpsi_scalar,Position.Z*psi);
1011  return psi;
1012 }
Mdouble X
Definition: Vector.h:44
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.
double Mdouble
Definition: ExtendedMath.h:33
Mdouble Y
Definition: Vector.h:44
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:40
Vec3D Position
Position at which evaluation occurs.
Mdouble Z
Definition: Vector.h:44
template<>
Mdouble StatisticsPoint< YZ >::CG_integral ( Vec3D P1,
Vec3D P2,
Vec3D P1_P2_normal,
Mdouble  P1_P2_distance,
Vec3D rpsi 
)

Definition at line 1013 of file StatisticsPoint.hcc.

References Vec3D::X.

1013  {
1014  Mdouble rpsi_scalar=0;
1015  Mdouble psi = CG_integral_2D(P1, P2, P1_P2_normal, P1_P2_distance, rpsi_scalar);
1016  rpsi=Vec3D(P1.X*psi-(P1.X-P2.X)*rpsi_scalar,Position.Y*psi,Position.Z*psi);
1017  return psi;
1018 }
Mdouble X
Definition: Vector.h:44
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.
double Mdouble
Definition: ExtendedMath.h:33
Mdouble Y
Definition: Vector.h:44
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:40
Vec3D Position
Position at which evaluation occurs.
Mdouble Z
Definition: Vector.h:44
template<>
Mdouble StatisticsPoint< X >::CG_integral ( Vec3D P1,
Vec3D P2,
Vec3D P1_P2_normal,
Mdouble  P1_P2_distance,
Vec3D rpsi 
)

Definition at line 1019 of file StatisticsPoint.hcc.

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

1019  {
1020  Mdouble rpsi_scalar=0;
1021  Mdouble psi = CG_integral_1D(P1, P2, P1_P2_normal, P1_P2_distance, rpsi_scalar);
1022  rpsi=Vec3D(Position.X*psi,P1.Y*psi-(P1.Y-P2.Y)*rpsi_scalar,P1.Z*psi-(P1.Z-P2.Z)*rpsi_scalar);
1023  return psi;
1024 }
Mdouble X
Definition: Vector.h:44
double Mdouble
Definition: ExtendedMath.h:33
Mdouble Y
Definition: Vector.h:44
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:40
Vec3D Position
Position at which evaluation occurs.
Mdouble Z
Definition: Vector.h:44
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 1025 of file StatisticsPoint.hcc.

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

1025  {
1026  Mdouble rpsi_scalar=0;
1027  Mdouble psi = CG_integral_1D(P1, P2, P1_P2_normal, P1_P2_distance, rpsi_scalar);
1028  rpsi=Vec3D(P1.X*psi-(P1.X-P2.X)*rpsi_scalar,Position.Y*psi,P1.Z*psi-(P1.Z-P2.Z)*rpsi_scalar);
1029  return psi;
1030 }
Mdouble X
Definition: Vector.h:44
double Mdouble
Definition: ExtendedMath.h:33
Mdouble Y
Definition: Vector.h:44
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:40
Vec3D Position
Position at which evaluation occurs.
Mdouble Z
Definition: Vector.h:44
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 1031 of file StatisticsPoint.hcc.

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

1031  {
1032  Mdouble rpsi_scalar=0;
1033  Mdouble psi = CG_integral_1D(P1, P2, P1_P2_normal, P1_P2_distance, rpsi_scalar);
1034  rpsi=Vec3D(P1.X*psi-(P1.X-P2.X)*rpsi_scalar,P1.Y*psi-(P1.Y-P2.Y)*rpsi_scalar,Position.Z*psi);
1035  return psi;
1036 }
Mdouble X
Definition: Vector.h:44
double Mdouble
Definition: ExtendedMath.h:33
Mdouble Y
Definition: Vector.h:44
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:40
Vec3D Position
Position at which evaluation occurs.
Mdouble Z
Definition: Vector.h:44
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  UNUSED,
Vec3D &P2  UNUSED,
Vec3D &P1_P2_normal  UNUSED,
Mdouble P1_P2_distance  UNUSED,
Vec3D rpsi 
)
Todo:
Is that right?

Definition at line 1037 of file StatisticsPoint.hcc.

1037  {
1038  Mdouble psi = get_CG_invvolume();
1039  rpsi=P1*psi;
1040  return psi;
1041 }
double Mdouble
Definition: ExtendedMath.h:33
Mdouble get_CG_invvolume()
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 524 of file StatisticsPoint.hcc.

References Gaussian, HeavisideSphere, constants::pi, Polynomial, sqr, constants::sqrt_2, and constants::sqrt_pi.

525 {
526  //apply the cutoff in normal direction:
527  Vec3D P_P1 = Position - P1;
528  Mdouble a = dot(P_P1,P1_P2_normal);
529  if ( a > get_cutoff() ) return 0.0;
530  Vec3D P_P2 = Position - P2;
531  Mdouble b = dot(P_P2,P1_P2_normal);
532  if ( -b > get_cutoff() ) return 0.0;
533  //apply the cutoff in tangential direction:
534  Vec3D tangential = P_P1 - a * P1_P2_normal;
535  if (dot(tangential,tangential)>get_cutoff2()) return 0.0;
536  if (get_CG_type()==HeavisideSphere) {
537  Mdouble wn2 = get_w2() - dot(tangential,tangential);
538  if ((wn2<=0) | (a*fabs(a)>=wn2) | (b*fabs(b)<=-wn2)) {
539  return 0;
540  } else {
541  //if the normal is parallel to the averaging direction
542  if (std::max(fabs(a),fabs(b))<1e-20) {
543  return get_CG_invvolume() * constants::pi * wn2;
544  }
545  Mdouble wn = sqrt(wn2);
546  return get_CG_invvolume() / P1_P2_distance
547  *( ((b>= wn)?( 2.0/3.0*constants::pi*wn2*wn):(b*constants::pi*(wn2-sqr(b)/3.0)))
548  -((a<=-wn)?(-2.0/3.0*constants::pi*wn2*wn):(a*constants::pi*(wn2-sqr(a)/3.0))) );
549  }
550  } else if (get_CG_type()==Gaussian) { //Gaussian
551  if (fabs(b-a)<1e-20) {
552  return get_CG_invvolume() * exp(-dot(P_P1,P_P1)/(2.0*get_w2()));
553  }
554  static Mdouble w_sqrt_2 = constants::sqrt_2*get_w();
555  static Mdouble P1_P2_distance_for_cutoff=-1, InvVolumeErf=-1;
556  if (P1_P2_distance_for_cutoff!=P1_P2_distance) {
557  P1_P2_distance_for_cutoff = P1_P2_distance;
558  Mdouble amax = -get_cutoff();
559  Mdouble bmax = get_cutoff()+P1_P2_distance;
560  InvVolumeErf = P1_P2_distance/(
561  erf(bmax/w_sqrt_2)*bmax+w_sqrt_2/constants::sqrt_pi*exp(-bmax*bmax/(w_sqrt_2*w_sqrt_2))
562  -erf(amax/w_sqrt_2)*amax-w_sqrt_2/constants::sqrt_pi*exp(-amax*amax/(w_sqrt_2*w_sqrt_2))
563  ) / averagingVolume();
564  //std::cout << "InvVolumeErf" << InvVolumeErf << " InvVolumeExp" << InvVolumeExp << " f" << get_CG_invvolume() * sqrt(2*constants::pi*get_w2()) << std::endl;
565  }
566  //Note: use dot(t,t), GetLength2(t), as dot only works on non-averaged directions
567  Mdouble psi = ( erf(b/w_sqrt_2) - erf(a/w_sqrt_2) ) * InvVolumeErf /2./P1_P2_distance;
568  Mdouble phi1 = get_CG_invvolume() * exp(-dot(P_P1,P_P1)/(2.0*get_w2()));
569  Mdouble phi2 = get_CG_invvolume() * exp(-dot(P_P2,P_P2)/(2.0*get_w2()));
570  rpsi_scalar = -a/P1_P2_distance*psi + get_w2()/P1_P2_distance/P1_P2_distance*(phi1-phi2);
571  return psi;
572  } else if (get_CG_type()==Polynomial) {
573  //~ std::cout << setprecision(12) << P1_P2_normal << std::endl;
574  double wn2 = get_w2() - dot(tangential,tangential);
575  if ((wn2<=0) | (a*fabs(a)>=wn2) | (b*fabs(b)<=-wn2)) {
576  return 0;
577  } else if ((P1_P2_distance<1e-12)|(GetLength2(tangential)<1e-24)) {
578  //~ } else if (fabs(b-a)<1e-12) {
579  //if the normal is parallel to the averaging direction
580  //~ std::cout << "normal is parallel to the averaging direction: "
581  //~ << " P_P1 " << P1_P2_distance
582  //~ << " psi= " << CG_function_1D(P1) << std::endl;
583  return CG_function_1D(P1);
584  } else {
585  double wn = sqrt(wn2);
586  double w = get_w();
587  return get_CG_invvolume()*evaluateIntegral(std::max(a,-wn)/w,std::min(b,wn)/w,dot(tangential,tangential)/w)*w / P1_P2_distance;
588  }
589  } else { std::cerr << "error in CG_integral_1D" << std::endl; exit(-1); }
590  std::cout<<"eind testje"<< rpsi_scalar<<std::endl;
591 }
Mdouble get_w() const
see StatisticsVector::get_w
Mdouble CG_function_1D(const Vec3D &PI)
Returns the value of the course graining function phi(P,PI) averaged along a plane.
Mdouble get_cutoff2()
see StatisticsVector::get_cutoff2
const Mdouble sqrt_pi
Definition: ExtendedMath.h:55
#define sqr(a)
Definition: ExtendedMath.h:36
Mdouble get_w2() const
see StatisticsVector::get_w2
Mdouble evaluateIntegral(Mdouble n1, Mdouble n2, Mdouble t)
see StatisticsVector::evaluateIntegral
Mdouble get_cutoff()
see StatisticsVector::get_cutoff
double averagingVolume()
const Mdouble pi
Definition: ExtendedMath.h:54
double Mdouble
Definition: ExtendedMath.h:33
const Mdouble sqrt_2
Definition: ExtendedMath.h:57
CG get_CG_type() const
see StatisticsVector::get_CG_type
Mdouble get_CG_invvolume()
returns CG_invvolume
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:40
Vec3D Position
Position at which evaluation occurs.
Mdouble dot(const Vec3D &P, const Vec3D &Q)
Returns the dot product of two vectors in the coordinates that are not averaged about.
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 453 of file StatisticsPoint.hcc.

References Gaussian, Vec3D::GetLength(), HeavisideSphere, constants::pi, Polynomial, sqr, constants::sqrt_2, and constants::sqrt_pi.

454 {
455  //apply the cutoff in normal direction:
456  Vec3D P_P1 = Position - P1;
457  Mdouble a = dot(P_P1,P1_P2_normal);
458  if ( a > get_cutoff() ) return 0.0;
459  Vec3D P_P2 = Position - P2;
460  Mdouble b = dot(P_P2,P1_P2_normal);
461  if ( -b > get_cutoff() ) return 0.0;
462  //apply the cutoff in tangential direction:
463  Vec3D tangential = P_P1 - a * P1_P2_normal;
464  if (dot(tangential,tangential)>get_cutoff2()) return 0.0;
465  if (get_CG_type()==HeavisideSphere) {
466  Mdouble wn2 = get_w2() - dot(tangential,tangential);
467  if ((wn2<=0) || (a*fabs(a)>=wn2) || (b*fabs(b)<=-wn2)) {
468  return 0;
469  } else {
470  Mdouble wn = sqrt(wn2);
471  //if the normal is parallel to the averaging direction
472  if (std::max(fabs(a),fabs(b))<1e-20) {
473  return get_CG_invvolume() * 2 * wn;
474  }
475  return get_CG_invvolume() / P1_P2_distance
476  *( ((b>= wn)?(constants::pi*wn2/2.0):( b*sqrt(wn2-sqr(b))+wn2*asin(b/wn)))
477  +((a<=-wn)?(constants::pi*wn2/2.0):(-a*sqrt(wn2-sqr(a))-wn2*asin(a/wn))));
478  }
479  } else if (get_CG_type()==Gaussian) { //Gaussian
480  if (dot(P1_P2_normal,P1_P2_normal)<1e-20) {
481  //since we average parallel to the force line, the CG integral is shaped like the CG function
483  return get_CG_invvolume() * exp(-dot(P_P1,P_P1)/(2.0*get_w2()));
484  }
485  static Mdouble InvVolumeExp = compute_Gaussian_invvolume(gb->get_dim_particle()-2);
486  static Mdouble w_sqrt_2 = constants::sqrt_2*get_w();
487  static Mdouble P1_P2_distance_for_cutoff=-1, InvVolumeErf=-1;
488  if (P1_P2_distance_for_cutoff!=P1_P2_distance) {
489  P1_P2_distance_for_cutoff = P1_P2_distance;
490  Mdouble amax = -get_cutoff();
491  Mdouble bmax = get_cutoff()+P1_P2_distance;
492  InvVolumeErf = P1_P2_distance/(
493  erf(bmax/w_sqrt_2)*bmax+w_sqrt_2/constants::sqrt_pi*exp(-bmax*bmax/(w_sqrt_2*w_sqrt_2))
494  -erf(amax/w_sqrt_2)*amax-w_sqrt_2/constants::sqrt_pi*exp(-amax*amax/(w_sqrt_2*w_sqrt_2))
495  ) / averagingVolume();
496  //std::cout << "InvVolumeErf" << InvVolumeErf << " InvVolumeExp" << InvVolumeExp << " f" << get_CG_invvolume() * sqrt(2*constants::pi*get_w2()) << std::endl;
497  }
498  //Note: use dot(t,t), GetLength2(t), as dot only works on non-averaged directions
499  //we also define rpsi
500  Mdouble psi = exp(-dot(tangential,tangential)/(2.0*get_w2())) * InvVolumeExp
501  * ( erf(b/w_sqrt_2) - erf(a/w_sqrt_2) ) * InvVolumeErf /2./P1_P2_distance;
502  Mdouble phi1 = get_CG_invvolume() * exp(-dot(P_P1,P_P1)/(2.0*get_w2()));
503  Mdouble phi2 = get_CG_invvolume() * exp(-dot(P_P2,P_P2)/(2.0*get_w2()));
504  rpsi_scalar = -a/P1_P2_distance*psi + get_w2()/P1_P2_distance/P1_P2_distance*(phi1-phi2);
505  return psi;
506  } else if (get_CG_type()==Polynomial) {
507  double wn2 = get_w2() - dot(tangential,tangential);
508  if ((wn2<=0) | (a*fabs(a)>=wn2) | (b*fabs(b)<=-wn2)) {
509  return 0;
510  } else if (P1_P2_distance<1e-20) {
511  //if the normal is parallel to the averaging direction
512  return CG_function_1D(P_P1);
513  } else {
514  double wn = sqrt(wn2);
515  double w = get_w();
516  return get_CG_invvolume()*evaluateIntegral(std::max(a,-wn)/w,std::min(b,wn)/w,tangential.GetLength()/w)*w / P1_P2_distance;
517  }
518  //CG_type_todo
519  } else { std::cerr << "error in CG_integral_2D" << std::endl; exit(-1); }
520 }
Mdouble get_w() const
see StatisticsVector::get_w
Mdouble CG_function_1D(const Vec3D &PI)
Returns the value of the course graining function phi(P,PI) averaged along a plane.
Mdouble get_cutoff2()
see StatisticsVector::get_cutoff2
const Mdouble sqrt_pi
Definition: ExtendedMath.h:55
#define sqr(a)
Definition: ExtendedMath.h:36
Mdouble get_w2() const
see StatisticsVector::get_w2
Mdouble evaluateIntegral(Mdouble n1, Mdouble n2, Mdouble t)
see StatisticsVector::evaluateIntegral
Mdouble get_cutoff()
see StatisticsVector::get_cutoff
double averagingVolume()
const Mdouble pi
Definition: ExtendedMath.h:54
double Mdouble
Definition: ExtendedMath.h:33
const Mdouble sqrt_2
Definition: ExtendedMath.h:57
CG get_CG_type() const
see StatisticsVector::get_CG_type
double compute_Gaussian_invvolume(int dim)
computes CG_invvolume if CG_type=Gaussian
Mdouble GetLength() const
Definition: Vector.h:248
Mdouble get_CG_invvolume()
returns CG_invvolume
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:40
Vec3D Position
Position at which evaluation occurs.
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
Mdouble dot(const Vec3D &P, const Vec3D &Q)
Returns the dot product of two vectors in the coordinates that are not averaged about.
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 293 of file StatisticsPoint.hcc.

References Gaussian, Vec3D::GetLength(), constants::pi, Polynomial, and sqr.

293  {
294  Vec3D P_P1 = Position - P1;
295  Vec3D P_P2 = Position - P2;
296  Mdouble a = dot(P_P1,P1_P2_normal);
297  Mdouble b = dot(P_P2,P1_P2_normal);
298  Vec3D tangential = P_P1 - a * P1_P2_normal;
299  //CG_type_todo
300  if (get_CG_type()==Gaussian) {
301  Mdouble wsq2 = sqrt(2*get_w2());
302  Mdouble f = sqrt(2*constants::pi*get_w2());
303  return Vec3D(0.0,0.0,(exp(-sqr(a/wsq2))-exp(-sqr(b/wsq2)))/f/(P2.Z-P1.Z));
304  } else if (get_CG_type()==Polynomial) {
305  double wn2 = get_w2() - dot(tangential,tangential);
306  if ((wn2<=0) | (a*fabs(a)>=wn2) | (b*fabs(b)<=-wn2)) {
307  return Vec3D(0,0,0);
308  } else {
310  double wn = sqrt(wn2);
311  double w = get_w();
312  double delta = w*1e-3;
313  double I = get_CG_invvolume()*evaluateIntegral(std::max(a,-wn)/w,std::min(b,wn)/w,tangential.GetLength()/w)*w / P1_P2_distance;
314  Vec3D delta_P_P1 = P_P1 +Vec3D(delta,0,0);
315  Vec3D delta_P_P2 = P_P2 +Vec3D(delta,0,0);
316  a = dot(delta_P_P1,P1_P2_normal);
317  b = dot(delta_P_P2,P1_P2_normal);
318  tangential = delta_P_P1 - a * P1_P2_normal;
319  wn = sqrt(get_w2() - dot(tangential,tangential));
320  double Ix = get_CG_invvolume()*evaluateIntegral(std::max(a,-wn)/w,std::min(b,wn)/w,tangential.GetLength()/w)*w / P1_P2_distance;
321  delta_P_P1 = P_P1 +Vec3D(0,delta,0);
322  delta_P_P2 = P_P2 +Vec3D(0,delta,0);
323  a = dot(delta_P_P1,P1_P2_normal);
324  b = dot(delta_P_P2,P1_P2_normal);
325  tangential = delta_P_P1 - a * P1_P2_normal;
326  wn = sqrt(get_w2() - dot(tangential,tangential));
327  double Iy = get_CG_invvolume()*evaluateIntegral(std::max(a,-wn)/w,std::min(b,wn)/w,tangential.GetLength()/w)*w / P1_P2_distance;
328  delta_P_P1 = P_P1 +Vec3D(0,0,delta);
329  delta_P_P2 = P_P2 +Vec3D(0,0,delta);
330  a = dot(delta_P_P1,P1_P2_normal);
331  b = dot(delta_P_P2,P1_P2_normal);
332  tangential = delta_P_P1 - a * P1_P2_normal;
333  wn = sqrt(get_w2() - dot(tangential,tangential));
334  double Iz = get_CG_invvolume()*evaluateIntegral(std::max(a,-wn)/w,std::min(b,wn)/w,tangential.GetLength()/w)*w / P1_P2_distance;
335  return Vec3D(Ix-I,Iy-I,Iz-I)/delta;
336  }
337  } else { return Vec3D(0,0,0);}
338  //~ if (get_CG_type()==Gaussian) return Vec3D(0.0,0.0,0.0);
339  //~ else { std::cerr << "error in CG_function" << std::endl; exit(-1); }
340 }
Mdouble get_w() const
see StatisticsVector::get_w
#define sqr(a)
Definition: ExtendedMath.h:36
Mdouble get_w2() const
see StatisticsVector::get_w2
Mdouble evaluateIntegral(Mdouble n1, Mdouble n2, Mdouble t)
see StatisticsVector::evaluateIntegral
const Mdouble pi
Definition: ExtendedMath.h:54
double Mdouble
Definition: ExtendedMath.h:33
CG get_CG_type() const
see StatisticsVector::get_CG_type
Mdouble GetLength() const
Definition: Vector.h:248
Mdouble get_CG_invvolume()
returns CG_invvolume
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:40
Vec3D Position
Position at which evaluation occurs.
Mdouble dot(const Vec3D &P, const Vec3D &Q)
Returns the dot product of two vectors in the coordinates that are not averaged about.
template<>
Vec3D StatisticsPoint< Z >::CG_integral_gradient ( Vec3D P1,
Vec3D P2,
Vec3D P1_P2_normal,
Mdouble  P1_P2_distance 
)

Definition at line 1043 of file StatisticsPoint.hcc.

1043  {
1044  return Vec3D(0,0,CG_integral_gradient_1D(P1, P2, P1_P2_normal, P1_P2_distance));
1045 }
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:40
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 343 of file StatisticsPoint.hcc.

References Gaussian, constants::pi, Polynomial, and sqr.

343  {
344  Vec3D P_P1 = Position - P1;
345  Vec3D P_P2 = Position - P2;
346  Mdouble a = dot(P_P1,P1_P2_normal);
347  Mdouble b = dot(P_P2,P1_P2_normal);
348  Vec3D tangential = P_P1 - a * P1_P2_normal;
349  //CG_type_todo
350  if (get_CG_type()==Gaussian) {
351  Mdouble wsq2 = sqrt(2*get_w2());
352  Mdouble f = sqrt(2*constants::pi*get_w2());
353  return (exp(-sqr(a/wsq2))-exp(-sqr(b/wsq2)))/f/(P2.Z-P1.Z);
354  } else if (get_CG_type()==Polynomial) {
355  double wn2 = get_w2() - dot(tangential,tangential);
356  if ((wn2<=0) | (a*fabs(a)>=wn2) | (b*fabs(b)<=-wn2)) {
357  return 0;
358  } else if ((P1_P2_distance<1e-12)|(GetLength2(tangential)<1e-24)) {
359  //if the normal is parallel to the averaging direction
360  std::cout << "normal is parallel to the averaging direction: "
361  << " P1_P2_distance " << P1_P2_distance
362  << " tangential " << tangential << std::endl;
364  return 0;//CG_gradient_1D(P1,CG_function(P1));
365  } else {
366  double wn = sqrt(wn2);
367  double w = get_w();
369  double delta = w*3e-6;
370  //double I = get_CG_invvolume()*evaluateIntegral(std::max(a,-wn)/w,std::min(b,wn)/w,dot(tangential,tangential)/w)*w / P1_P2_distance;
371  Vec3D delta_P_P1 = P_P1 +Vec3D(delta,delta,delta);
372  Vec3D delta_P_P2 = P_P2 +Vec3D(delta,delta,delta);
373  a = dot(delta_P_P1,P1_P2_normal);
374  b = dot(delta_P_P2,P1_P2_normal);
375  tangential = delta_P_P1 - a * P1_P2_normal;
376  wn = sqrt(get_w2() - dot(tangential,tangential));
377  double I2 = get_CG_invvolume()*evaluateIntegral(std::max(a,-wn)/w,std::min(b,wn)/w,dot(tangential,tangential)/w)*w / P1_P2_distance;
378 
379  delta_P_P1 = P_P1 -Vec3D(delta,delta,delta);
380  delta_P_P2 = P_P2 -Vec3D(delta,delta,delta);
381  a = dot(delta_P_P1,P1_P2_normal);
382  b = dot(delta_P_P2,P1_P2_normal);
383  tangential = delta_P_P1 - a * P1_P2_normal;
384  wn = sqrt(get_w2() - dot(tangential,tangential));
385  double I1 = get_CG_invvolume()*evaluateIntegral(std::max(a,-wn)/w,std::min(b,wn)/w,dot(tangential,tangential)/w)*w / P1_P2_distance;
386 
387  return (I2-I1)/(2.*delta);
388  }
389  } else return 0;
390 }
Mdouble get_w() const
see StatisticsVector::get_w
#define sqr(a)
Definition: ExtendedMath.h:36
Mdouble get_w2() const
see StatisticsVector::get_w2
Mdouble evaluateIntegral(Mdouble n1, Mdouble n2, Mdouble t)
see StatisticsVector::evaluateIntegral
const Mdouble pi
Definition: ExtendedMath.h:54
double Mdouble
Definition: ExtendedMath.h:33
CG get_CG_type() const
see StatisticsVector::get_CG_type
Mdouble get_CG_invvolume()
returns CG_invvolume
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:40
Vec3D Position
Position at which evaluation occurs.
Mdouble dot(const Vec3D &P, const Vec3D &Q)
Returns the dot product of two vectors in the coordinates that are not averaged about.
template<StatType T>
Vec3D StatisticsPoint< T >::clearAveragedDirections ( Vec3D  P)

Returns a vector where the averaged directions are zero.

Definition at line 1092 of file StatisticsPoint.hcc.

1092 {return P;}
template<>
Vec3D StatisticsPoint< XY >::clearAveragedDirections ( Vec3D  P)

Definition at line 1093 of file StatisticsPoint.hcc.

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

1093 {return Vec3D(P.X, P.Y, 0);}
Mdouble X
Definition: Vector.h:44
Mdouble Y
Definition: Vector.h:44
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:40
template<>
Vec3D StatisticsPoint< XZ >::clearAveragedDirections ( Vec3D  P)

Definition at line 1094 of file StatisticsPoint.hcc.

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

1094 {return Vec3D(P.X, 0, P.Z);}
Mdouble X
Definition: Vector.h:44
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:40
Mdouble Z
Definition: Vector.h:44
template<>
Vec3D StatisticsPoint< YZ >::clearAveragedDirections ( Vec3D  P)

Definition at line 1095 of file StatisticsPoint.hcc.

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

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

Definition at line 1096 of file StatisticsPoint.hcc.

References Vec3D::X.

1096 {return Vec3D(P.X, 0, 0);}
Mdouble X
Definition: Vector.h:44
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:40
template<>
Vec3D StatisticsPoint< Y >::clearAveragedDirections ( Vec3D  P)

Definition at line 1097 of file StatisticsPoint.hcc.

References Vec3D::Y.

1097 {return Vec3D(0, P.Y, 0);}
Mdouble Y
Definition: Vector.h:44
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:40
template<>
Vec3D StatisticsPoint< Z >::clearAveragedDirections ( Vec3D  P)

Definition at line 1098 of file StatisticsPoint.hcc.

References Vec3D::Z.

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

Definition at line 1099 of file StatisticsPoint.hcc.

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

computes CG_invvolume if CG_type=Gaussian

Definition at line 770 of file StatisticsPoint.hcc.

References cubic, sqr, constants::sqrt_2, and constants::sqrt_pi.

770  {
771  if (dim==0) { return 1.; }
772 
773  //this is the prefactor 1/V of phi(r)=1/V*exp(-|r|^2/w^2) for dim=1
775  //take into account the cutoff radius and the dimension of the problem
776  if (dim==3) {
777  CG_invvolume = cubic(CG_invvolume);
778  //Wolfram alpha: erf(c/(sqrt(2) w))-(sqrt(2/pi) c e^(-c^2/(2 w^2)))/w
779  CG_invvolume /= erf( get_cutoff() / (constants::sqrt_2*get_w()) )
781  } else if (dim==2) {
782  CG_invvolume = sqr(CG_invvolume);
783  //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))
784  CG_invvolume /= 1-exp( -get_cutoff2() / (2*get_w2()) );
785  } else {
786  CG_invvolume /= erf( get_cutoff() / (constants::sqrt_2*get_w()) );
787  }
788  return CG_invvolume;
789 }
Mdouble CG_invvolume
Prefactor of CG function which depends on $w.
Mdouble get_w() const
see StatisticsVector::get_w
Mdouble get_cutoff2()
see StatisticsVector::get_cutoff2
const Mdouble sqrt_pi
Definition: ExtendedMath.h:55
#define sqr(a)
Definition: ExtendedMath.h:36
Mdouble get_w2() const
see StatisticsVector::get_w2
#define cubic(a)
Definition: ExtendedMath.h:37
Mdouble get_cutoff()
see StatisticsVector::get_cutoff
const Mdouble sqrt_2
Definition: ExtendedMath.h:57
template<StatType T>
Vec3D StatisticsPoint< T >::cross ( Vec3D  P,
Vec3D Q 
)

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

Definition at line 221 of file StatisticsPoint.hcc.

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

221  {
222  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);
223 }
Mdouble X
Definition: Vector.h:44
Mdouble Y
Definition: Vector.h:44
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:40
Mdouble Z
Definition: Vector.h:44
template<>
Vec3D StatisticsPoint< XY >::cross ( Vec3D  P,
Vec3D Q 
)

Definition at line 1101 of file StatisticsPoint.hcc.

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

1101 {return Vec3D(0, 0, P.X*Q.Y-P.Y*Q.X);}
Mdouble X
Definition: Vector.h:44
Mdouble Y
Definition: Vector.h:44
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:40
template<>
Vec3D StatisticsPoint< XZ >::cross ( Vec3D  P,
Vec3D Q 
)

Definition at line 1102 of file StatisticsPoint.hcc.

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

1102 {return Vec3D(0, P.Z*Q.X-P.X*Q.Z, 0);}
Mdouble X
Definition: Vector.h:44
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:40
Mdouble Z
Definition: Vector.h:44
template<>
Vec3D StatisticsPoint< YZ >::cross ( Vec3D  P,
Vec3D Q 
)

Definition at line 1103 of file StatisticsPoint.hcc.

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

1103 {return Vec3D(P.Y*Q.Z-P.Z*Q.Y, 0, 0);}
Mdouble Y
Definition: Vector.h:44
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:40
Mdouble Z
Definition: Vector.h:44
template<>
Vec3D StatisticsPoint< X >::cross ( Vec3D UNUSED,
Vec3D &Q  UNUSED 
)

Definition at line 1104 of file StatisticsPoint.hcc.

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

Definition at line 1105 of file StatisticsPoint.hcc.

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

Definition at line 1106 of file StatisticsPoint.hcc.

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

Definition at line 1107 of file StatisticsPoint.hcc.

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

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

Definition at line 233 of file StatisticsPoint.hcc.

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

233  {
234  return P.X*Q.X + P.Y*Q.Y + P.Z*Q.Z;
235 }
Mdouble X
Definition: Vector.h:44
Mdouble Y
Definition: Vector.h:44
Mdouble Z
Definition: Vector.h:44
template<>
Mdouble StatisticsPoint< XY >::dot ( const Vec3D P,
const Vec3D Q 
)

Definition at line 1084 of file StatisticsPoint.hcc.

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

1084 {return P.X*Q.X + P.Y*Q.Y;}
Mdouble X
Definition: Vector.h:44
Mdouble Y
Definition: Vector.h:44
template<>
Mdouble StatisticsPoint< XZ >::dot ( const Vec3D P,
const Vec3D Q 
)

Definition at line 1085 of file StatisticsPoint.hcc.

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

1085 {return P.X*Q.X + P.Z*Q.Z;}
Mdouble X
Definition: Vector.h:44
Mdouble Z
Definition: Vector.h:44
template<>
Mdouble StatisticsPoint< YZ >::dot ( const Vec3D P,
const Vec3D Q 
)

Definition at line 1086 of file StatisticsPoint.hcc.

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

1086 {return P.Y*Q.Y + P.Z*Q.Z;}
Mdouble Y
Definition: Vector.h:44
Mdouble Z
Definition: Vector.h:44
template<>
Mdouble StatisticsPoint< X >::dot ( const Vec3D P,
const Vec3D Q 
)

Definition at line 1087 of file StatisticsPoint.hcc.

References Vec3D::X.

1087 {return P.X*Q.X;}
Mdouble X
Definition: Vector.h:44
template<>
Mdouble StatisticsPoint< Y >::dot ( const Vec3D P,
const Vec3D Q 
)

Definition at line 1088 of file StatisticsPoint.hcc.

References Vec3D::Y.

1088 {return P.Y*Q.Y;}
Mdouble Y
Definition: Vector.h:44
template<>
Mdouble StatisticsPoint< Z >::dot ( const Vec3D P,
const Vec3D Q 
)

Definition at line 1089 of file StatisticsPoint.hcc.

References Vec3D::Z.

1089 {return P.Z*Q.Z;}
Mdouble Z
Definition: Vector.h:44
template<>
Mdouble StatisticsPoint< O >::dot ( const Vec3D ,
const Vec3D  
)

Definition at line 1090 of file StatisticsPoint.hcc.

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

see StatisticsVector::evaluateIntegral

Definition at line 91 of file StatisticsPoint.h.

References StatisticsPoint< T >::gb.

91 {return gb->evaluateIntegral(n1,n2,t);}
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 87 of file StatisticsPoint.h.

References StatisticsPoint< T >::gb.

87 {return gb->evaluatePolynomial(r);}
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 89 of file StatisticsPoint.h.

References StatisticsPoint< T >::gb.

89 {return gb->evaluatePolynomialGradient(r);}
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 187 of file StatisticsPoint.hcc.

187  {
188  Nu /= n;
189  Density /= n;
190  Momentum /= n;
191  if (n==1) {
195  } else {
196  DisplacementMomentum /= n-1;
197  Displacement /= n-1;
199  }
200  MomentumFlux /= n;
201  EnergyFlux /= n;
202  NormalStress /= n;
203  TangentialStress /= n;
204  NormalTraction /= n;
205  TangentialTraction /= n;
206  Fabric /= n;
207  CollisionalHeatFlux /= n;
208  Dissipation /= n;
209  Potential /= n;
212  ContactCoupleStress /= n;
213 }
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
void set_zero()
Definition: Vector.h:55
Mdouble Potential
Elastic energy .
MatrixSymmetric3D MomentumFlux
Momentum flux, .
Vec3D Momentum
Momentum, .
Matrix3D TangentialStress
Stress from tangential forces, .
template<StatType T>
Mdouble StatisticsPoint< T >::get_CG_invvolume ( )
inline

returns CG_invvolume

Definition at line 98 of file StatisticsPoint.h.

References StatisticsPoint< T >::CG_invvolume.

98 {return this->CG_invvolume;}
Mdouble CG_invvolume
Prefactor of CG function which depends on $w.
template<StatType T>
CG StatisticsPoint< T >::get_CG_type ( ) const
inline

see StatisticsVector::get_CG_type

Definition at line 61 of file StatisticsPoint.h.

References StatisticsPoint< T >::gb.

61 {return this->gb->get_CG_type();}
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
template<StatType T>
Mdouble StatisticsPoint< T >::get_cutoff ( )
inline

see StatisticsVector::get_cutoff

Definition at line 69 of file StatisticsPoint.h.

References StatisticsPoint< T >::gb.

69 {return this->gb->get_cutoff();}
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
template<StatType T>
Mdouble StatisticsPoint< T >::get_cutoff2 ( )
inline

see StatisticsVector::get_cutoff2

Definition at line 71 of file StatisticsPoint.h.

References StatisticsPoint< T >::gb.

71 {return this->gb->get_cutoff2();}
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
template<StatType T>
Mdouble StatisticsPoint< T >::get_distance2 ( const Vec3D P)

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

Definition at line 216 of file StatisticsPoint.hcc.

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

216  {
217  return sqr(P.X-Position.X)+sqr(P.Y-Position.Y)+sqr(P.Z-Position.Z);
218 }
Mdouble X
Definition: Vector.h:44
#define sqr(a)
Definition: ExtendedMath.h:36
Mdouble Y
Definition: Vector.h:44
Vec3D Position
Position at which evaluation occurs.
Mdouble Z
Definition: Vector.h:44
template<>
Mdouble StatisticsPoint< XY >::get_distance2 ( const Vec3D P)

Definition at line 1076 of file StatisticsPoint.hcc.

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

1076 {return sqr(P.X-Position.X)+sqr(P.Y-Position.Y);}
Mdouble X
Definition: Vector.h:44
#define sqr(a)
Definition: ExtendedMath.h:36
Mdouble Y
Definition: Vector.h:44
Vec3D Position
Position at which evaluation occurs.
template<>
Mdouble StatisticsPoint< XZ >::get_distance2 ( const Vec3D P)

Definition at line 1077 of file StatisticsPoint.hcc.

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

1077 {return sqr(P.X-Position.X)+sqr(P.Z-Position.Z);}
Mdouble X
Definition: Vector.h:44
#define sqr(a)
Definition: ExtendedMath.h:36
Vec3D Position
Position at which evaluation occurs.
Mdouble Z
Definition: Vector.h:44
template<>
Mdouble StatisticsPoint< YZ >::get_distance2 ( const Vec3D P)

Definition at line 1078 of file StatisticsPoint.hcc.

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

1078 {return sqr(P.Y-Position.Y)+sqr(P.Z-Position.Z);}
#define sqr(a)
Definition: ExtendedMath.h:36
Mdouble Y
Definition: Vector.h:44
Vec3D Position
Position at which evaluation occurs.
Mdouble Z
Definition: Vector.h:44
template<>
Mdouble StatisticsPoint< X >::get_distance2 ( const Vec3D P)

Definition at line 1079 of file StatisticsPoint.hcc.

References sqr, and Vec3D::X.

1079 {return sqr(P.X-Position.X);}
Mdouble X
Definition: Vector.h:44
#define sqr(a)
Definition: ExtendedMath.h:36
Vec3D Position
Position at which evaluation occurs.
template<>
Mdouble StatisticsPoint< Y >::get_distance2 ( const Vec3D P)

Definition at line 1080 of file StatisticsPoint.hcc.

References sqr, and Vec3D::Y.

1080 {return sqr(P.Y-Position.Y);}
#define sqr(a)
Definition: ExtendedMath.h:36
Mdouble Y
Definition: Vector.h:44
Vec3D Position
Position at which evaluation occurs.
template<>
Mdouble StatisticsPoint< Z >::get_distance2 ( const Vec3D P)

Definition at line 1081 of file StatisticsPoint.hcc.

References sqr, and Vec3D::Z.

1081 {return sqr(P.Z-Position.Z);}
#define sqr(a)
Definition: ExtendedMath.h:36
Vec3D Position
Position at which evaluation occurs.
Mdouble Z
Definition: Vector.h:44
template<>
Mdouble StatisticsPoint< O >::get_distance2 ( const Vec3D )

Definition at line 1082 of file StatisticsPoint.hcc.

1082 {return 0;}
template<StatType T>
void StatisticsPoint< T >::get_n ( int nx_,
int ny_,
int nz_ 
)
inline

see StatisticsVector::get_n

Definition at line 85 of file StatisticsPoint.h.

References StatisticsPoint< T >::gb.

85 {this->gb->get_n(nx_,ny_,nz_);}
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
template<StatType T>
Vec3D StatisticsPoint< T >::get_Position ( ) const
inline

returns Position

Definition at line 112 of file StatisticsPoint.h.

References StatisticsPoint< T >::Position.

112 {return this->Position;}
Vec3D Position
Position at which evaluation occurs.
template<StatType T>
Mdouble StatisticsPoint< T >::get_w ( ) const
inline

see StatisticsVector::get_w

Definition at line 67 of file StatisticsPoint.h.

References StatisticsPoint< T >::gb.

67 {return this->gb->get_w();}
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
template<StatType T>
Mdouble StatisticsPoint< T >::get_w2 ( ) const
inline

see StatisticsVector::get_w2

Definition at line 65 of file StatisticsPoint.h.

References StatisticsPoint< T >::gb.

65 {return this->gb->get_w2();}
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
template<StatType T>
Mdouble StatisticsPoint< T >::get_xmaxStat ( )
inline

see StatisticsVector::get_xmaxStat

Definition at line 73 of file StatisticsPoint.h.

References StatisticsPoint< T >::gb.

73 {return this->gb->get_xmaxStat();}
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
template<StatType T>
Mdouble StatisticsPoint< T >::get_xminStat ( )
inline

see StatisticsVector::get_xminStat

Definition at line 79 of file StatisticsPoint.h.

References StatisticsPoint< T >::gb.

79 {return this->gb->get_xminStat();}
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
template<StatType T>
Mdouble StatisticsPoint< T >::get_ymaxStat ( )
inline

see StatisticsVector::get_ymaxStat

Definition at line 75 of file StatisticsPoint.h.

References StatisticsPoint< T >::gb.

75 {return this->gb->get_ymaxStat();}
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
template<StatType T>
Mdouble StatisticsPoint< T >::get_yminStat ( )
inline

see StatisticsVector::get_yminStat

Definition at line 81 of file StatisticsPoint.h.

References StatisticsPoint< T >::gb.

81 {return this->gb->get_yminStat();}
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
template<StatType T>
Mdouble StatisticsPoint< T >::get_zmaxStat ( )
inline

see StatisticsVector::get_zmaxStat

Definition at line 77 of file StatisticsPoint.h.

References StatisticsPoint< T >::gb.

77 {return this->gb->get_zmaxStat();}
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
template<StatType T>
Mdouble StatisticsPoint< T >::get_zminStat ( )
inline

see StatisticsVector::get_zminStat

Definition at line 83 of file StatisticsPoint.h.

References StatisticsPoint< T >::gb.

83 {return this->gb->get_zminStat();}
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
template<StatType T>
StatisticsPoint< T > StatisticsPoint< T >::getSquared ( )

Squares all statistical variables; needed for variance.

Definition at line 61 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, sqr, StatisticsPoint< T >::TangentialStress, and StatisticsPoint< T >::TangentialTraction.

61  {
63  P.Nu = sqr(Nu);
64  P.Density = sqr(Density);
65  P.Momentum = square(Momentum);
67  P.Displacement = square(Displacement);
68  P.MomentumFlux = square(MomentumFlux);
70  P.EnergyFlux = square(EnergyFlux);
71  P.NormalStress = square(NormalStress);
73  P.NormalTraction = square(NormalTraction);
75  P.Fabric = square(Fabric);
78  P.Potential = sqr(Potential);
82  return P;
83 }
MatrixSymmetric3D DisplacementMomentumFlux
Momentum flux from linear displacement, .
Matrix3D ContactCoupleStress
Mdouble Dissipation
Dissipation form collisions, .
#define sqr(a)
Definition: ExtendedMath.h:36
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 .
This class stores statistical values for a given spatial position; to be used in combination with Sta...
MatrixSymmetric3D MomentumFlux
Momentum flux, .
Vec3D Momentum
Momentum, .
Matrix3D TangentialStress
Stress from tangential forces, .
template<StatType T>
Matrix3D StatisticsPoint< T >::MatrixCross ( Vec3D  P,
Matrix3D Q 
)

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

Definition at line 225 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.

225  {
226  return Matrix3D(
227  P.Y*Q.ZX-P.Z*Q.YX, P.Z*Q.XX-P.X*Q.ZX, P.X*Q.YX-P.Y*Q.XX,
228  P.Y*Q.ZY-P.Z*Q.YY, P.Z*Q.XY-P.X*Q.ZY, P.X*Q.YY-P.Y*Q.XY,
229  P.Y*Q.ZZ-P.Z*Q.YZ, P.Z*Q.XZ-P.X*Q.ZZ, P.X*Q.YZ-P.Y*Q.XZ);
230 }
Mdouble XY
Definition: Matrix.h:39
Mdouble X
Definition: Vector.h:44
Mdouble ZY
Definition: Matrix.h:39
Mdouble XZ
Definition: Matrix.h:39
Mdouble ZX
Definition: Matrix.h:39
Mdouble ZZ
Definition: Matrix.h:39
Mdouble YZ
Definition: Matrix.h:39
Mdouble YX
Definition: Matrix.h:39
Mdouble Y
Definition: Vector.h:44
Mdouble XX
Definition: Matrix.h:39
Mdouble YY
Definition: Matrix.h:39
Implementation of a 3D matrix.
Definition: Matrix.h:35
Mdouble Z
Definition: Vector.h:44
template<>
Matrix3D StatisticsPoint< XY >::MatrixCross ( Vec3D  P,
Matrix3D Q 
)

Definition at line 1109 of file StatisticsPoint.hcc.

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

1109  {return Matrix3D(
1110  0, 0, P.X*Q.YX-P.Y*Q.XX,
1111  0, 0, P.X*Q.YY-P.Y*Q.XY,
1112  0, 0, P.X*Q.YZ-P.Y*Q.XZ);}
Mdouble XY
Definition: Matrix.h:39
Mdouble X
Definition: Vector.h:44
Mdouble XZ
Definition: Matrix.h:39
Mdouble YZ
Definition: Matrix.h:39
Mdouble YX
Definition: Matrix.h:39
Mdouble Y
Definition: Vector.h:44
Mdouble XX
Definition: Matrix.h:39
Mdouble YY
Definition: Matrix.h:39
Implementation of a 3D matrix.
Definition: Matrix.h:35
template<>
Matrix3D StatisticsPoint< XZ >::MatrixCross ( Vec3D  P,
Matrix3D Q 
)

Definition at line 1113 of file StatisticsPoint.hcc.

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

1113  {return Matrix3D(
1114  0, P.Z*Q.XX-P.X*Q.ZX, 0,
1115  0, P.Z*Q.XY-P.X*Q.ZY, 0,
1116  0, P.Z*Q.XZ-P.X*Q.ZZ, 0);}
Mdouble XY
Definition: Matrix.h:39
Mdouble X
Definition: Vector.h:44
Mdouble ZY
Definition: Matrix.h:39
Mdouble XZ
Definition: Matrix.h:39
Mdouble ZX
Definition: Matrix.h:39
Mdouble ZZ
Definition: Matrix.h:39
Mdouble XX
Definition: Matrix.h:39
Implementation of a 3D matrix.
Definition: Matrix.h:35
Mdouble Z
Definition: Vector.h:44
template<>
Matrix3D StatisticsPoint< YZ >::MatrixCross ( Vec3D  P,
Matrix3D Q 
)

Definition at line 1117 of file StatisticsPoint.hcc.

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

1117  {return Matrix3D(
1118  P.Y*Q.ZX-P.Z*Q.YX, 0, 0,
1119  P.Y*Q.ZY-P.Z*Q.YY, 0, 0,
1120  P.Y*Q.ZZ-P.Z*Q.YZ, 0, 0);}
Mdouble ZY
Definition: Matrix.h:39
Mdouble ZX
Definition: Matrix.h:39
Mdouble ZZ
Definition: Matrix.h:39
Mdouble YZ
Definition: Matrix.h:39
Mdouble YX
Definition: Matrix.h:39
Mdouble Y
Definition: Vector.h:44
Mdouble YY
Definition: Matrix.h:39
Implementation of a 3D matrix.
Definition: Matrix.h:35
Mdouble Z
Definition: Vector.h:44
template<>
Matrix3D StatisticsPoint< X >::MatrixCross ( Vec3D UNUSED,
Matrix3D &Q  UNUSED 
)

Definition at line 1121 of file StatisticsPoint.hcc.

1121 {return Matrix3D(0,0,0,0,0,0,0,0,0);}
Implementation of a 3D matrix.
Definition: Matrix.h:35
template<>
Matrix3D StatisticsPoint< Y >::MatrixCross ( Vec3D UNUSED,
Matrix3D &Q  UNUSED 
)

Definition at line 1122 of file StatisticsPoint.hcc.

1122 {return Matrix3D(0,0,0,0,0,0,0,0,0);}
Implementation of a 3D matrix.
Definition: Matrix.h:35
template<>
Matrix3D StatisticsPoint< Z >::MatrixCross ( Vec3D UNUSED,
Matrix3D &Q  UNUSED 
)

Definition at line 1123 of file StatisticsPoint.hcc.

1123 {return Matrix3D(0,0,0,0,0,0,0,0,0);}
Implementation of a 3D matrix.
Definition: Matrix.h:35
template<>
Matrix3D StatisticsPoint< O >::MatrixCross ( Vec3D UNUSED,
Matrix3D &Q  UNUSED 
)

Definition at line 1124 of file StatisticsPoint.hcc.

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

Definition at line 815 of file StatisticsPoint.hcc.

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

Definition at line 816 of file StatisticsPoint.hcc.

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

Definition at line 817 of file StatisticsPoint.hcc.

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

Definition at line 818 of file StatisticsPoint.hcc.

818 { return 2; }
template<>
int StatisticsPoint< X >::nonaveragedDim ( )

Definition at line 819 of file StatisticsPoint.hcc.

819 { return 1; }
template<>
int StatisticsPoint< Y >::nonaveragedDim ( )

Definition at line 820 of file StatisticsPoint.hcc.

820 { return 1; }
template<>
int StatisticsPoint< Z >::nonaveragedDim ( )

Definition at line 821 of file StatisticsPoint.hcc.

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

Definition at line 822 of file StatisticsPoint.hcc.

822 { return 0; }
template<>
int StatisticsPoint< RAZ >::nonaveragedDim ( )

Definition at line 823 of file StatisticsPoint.hcc.

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

Definition at line 824 of file StatisticsPoint.hcc.

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

Definition at line 825 of file StatisticsPoint.hcc.

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

Definition at line 826 of file StatisticsPoint.hcc.

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

Definition at line 827 of file StatisticsPoint.hcc.

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

Definition at line 828 of file StatisticsPoint.hcc.

828 { exit(-1); }
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 111 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.

112 {
113  Nu += P.Nu;
114  Density += P.Density;
115  Momentum += P.Momentum;
120  EnergyFlux += P.EnergyFlux;
125  Fabric += P.Fabric;
128  Potential += P.Potential;
132  return *this;
133 }
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 136 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.

137 {
138  Nu -= P.Nu;
139  Density -= P.Density;
140  Momentum -= P.Momentum;
145  EnergyFlux -= P.EnergyFlux;
150  Fabric -= P.Fabric;
153  Potential -= P.Potential;
157  return *this;
158 }
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 161 of file StatisticsPoint.hcc.

162 {
163  Nu /= a;
164  Density /= a;
165  Momentum /= a;
167  Displacement /= a;
168  MomentumFlux /= a;
170  EnergyFlux /= a;
171  NormalStress /= a;
172  TangentialStress /= a;
173  NormalTraction /= a;
174  TangentialTraction /= a;
175  Fabric /= a;
176  CollisionalHeatFlux /= a;
177  Dissipation /= a;
178  Potential /= a;
181  ContactCoupleStress /= a;
182  return *this;
183 }
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 86 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.

87 {
88  Nu = P.Nu;
89  Density = P.Density;
90  Momentum = P.Momentum;
100  Fabric = P.Fabric;
103  Potential = P.Potential;
107  return *this;
108 }
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 685 of file StatisticsPoint.hcc.

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

686 {
687  std::stringstream ss;
688  ss<< "Nu " << Nu
689  <<", Density " << Density
690  << ",\n Momentum " << Momentum
691  << ",\n DisplacementMomentum " << DisplacementMomentum
692  << ",\n Displacement " << Displacement
693  << ",\n MomentumFlux " << MomentumFlux
694  << ",\n DisplacementMomentumFlux " << DisplacementMomentumFlux
695  << ",\n EnergyFlux " << EnergyFlux
696  << ",\n NormalStress " << NormalStress
697  << ",\n TangentialStress " << TangentialStress
698  << ",\n NormalTraction " << NormalTraction
699  << ",\n TangentialTraction " << TangentialTraction
700  << ",\n Fabric " << Fabric
701  << ",\n CollisionalHeatFlux " << CollisionalHeatFlux
702  << ",\n Dissipation " << Dissipation
703  << ",\n Potential " << Potential
704  << ",\n LocalAngularMomentum " << LocalAngularMomentum
705  << ",\n LocalAngularMomentumFlux " << LocalAngularMomentumFlux
706  << ",\n ContactCoupleStress " << ContactCoupleStress;
707  return ss.str();
708 }
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 711 of file StatisticsPoint.hcc.

712 {
713  std::stringstream ss;
714  ss<< "Nu " << sqrt(Nu)
715  << ", Density " << sqrt(Density)
716  << ", Momentum " << sqrt(Momentum)
717  << ", DisplacementMomentum " << sqrt(DisplacementMomentum)
718  << ", Displacement " << sqrt(Displacement)
719  << ", MomentumFlux " << sqrt(MomentumFlux)
720  << ", DisplacementMomentumFlux " << sqrt(DisplacementMomentumFlux)
721  << ", EnergyFlux " << sqrt(EnergyFlux)
722  << ", NormalStress " << sqrt(NormalStress)
723  << ", TangentialStress " << sqrt(TangentialStress)
724  << ", NormalTraction " << sqrt(NormalTraction)
725  << ", TangentialTraction " << sqrt(TangentialTraction)
726  << ", Fabric " << sqrt(Fabric)
727  << ", CollisionalHeatFlux " << sqrt(CollisionalHeatFlux)
728  << ", Dissipation " << sqrt(Dissipation)
729  << ", Potential " << sqrt(Potential)
730  << ", LocalAngularMomentum " << LocalAngularMomentum
731  << ", LocalAngularMomentumFlux " << LocalAngularMomentumFlux
732  << ", ContactCoupleStress " << ContactCoupleStress;
733 
734  return ss.str();
735 }
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>
void StatisticsPoint< T >::set_CG_invvolume ( )

sets CG_invvolume

Definition at line 804 of file StatisticsPoint.hcc.

References Gaussian, HeavisideSphere, and Polynomial.

804  {
805  if (get_CG_type()==HeavisideSphere) {
807  } else if (get_CG_type()==Gaussian) {
809  } else if (get_CG_type()==Polynomial) {
811  } else { std::cerr << "error in CG_function" << std::endl; exit(-1); }
813 }
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()
CG get_CG_type() const
see StatisticsVector::get_CG_type
void set_Polynomial_invvolume(int dim)
sets CG_invvolume if CG_type=Polynomial
template<StatType T>
void StatisticsPoint< T >::set_CG_type ( const char *  CG_type)
inline

see StatisticsVector::set_CG_type

Definition at line 59 of file StatisticsPoint.h.

References StatisticsPoint< T >::gb.

59 {this->gb->set_CG_type(CG_type);}
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
template<StatType T>
void StatisticsPoint< T >::set_Gaussian_invvolume ( int  dim)

sets CG_invvolume if CG_type=Gaussian

Definition at line 765 of file StatisticsPoint.hcc.

765  {
767 }
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::set_CG_type

Definition at line 57 of file StatisticsPoint.h.

References StatisticsPoint< T >::gb.

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

57 {gb = new_gb;}
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 792 of file StatisticsPoint.hcc.

References constants::pi.

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

sets CG_invvolume if CG_type=Polynomial

Definition at line 798 of file StatisticsPoint.hcc.

798  {
799  if (dim==3) CG_invvolume = 1.0/(sqrt(get_w2())*get_w2());
800  else if (dim==2) CG_invvolume = 1.0/get_w2();
801  else CG_invvolume = 1.0/sqrt(get_w2());
802 }
Mdouble CG_invvolume
Prefactor of CG function which depends on $w.
Mdouble get_w2() const
see StatisticsVector::get_w2
template<StatType T>
void StatisticsPoint< T >::set_Position ( Vec3D  new_)
inline

sets Position

Definition at line 110 of file StatisticsPoint.h.

References StatisticsPoint< T >::Position.

110 {this->Position = new_;}
Vec3D Position
Position at which evaluation occurs.
template<StatType T>
void StatisticsPoint< T >::set_w2 ( Mdouble  new_)
inline

see StatisticsVector::set_w2

Definition at line 63 of file StatisticsPoint.h.

References StatisticsPoint< T >::gb.

63 {this->gb->set_w2(new_);}
static StatisticsVector< T > * gb
Pointer to StatisticsVector (to obtain global parameters)
template<StatType T>
void StatisticsPoint< T >::set_zero ( )

Sets all statistical variables to zero.

Definition at line 37 of file StatisticsPoint.hcc.

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

37  {
38  Nu = 0.0;
39  Density = 0.0;
51  Fabric.set_zero();
53  Dissipation = 0.0;
54  Potential = 0.0;
58 }
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, .
void set_zero()
Definition: Matrix.h:50
Mdouble Density
Density, .
MatrixSymmetric3D Displacement
Linear displacement, .
Vec3D TangentialTraction
Traction from tangential forces, .
Matrix3D LocalAngularMomentumFlux
void set_zero()
Definition: Vector.h:55
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 ( ) const

Outputs statistical variables in computer-readable format.

Definition at line 738 of file StatisticsPoint.hcc.

739 {
740  std::stringstream ss;
741  ss.precision(16);
742  ss<< Nu
743  << " " << Density
744  << " " << Momentum
745  << " " << DisplacementMomentum
746  << " " << Displacement
747  << " " << MomentumFlux
748  << " " << DisplacementMomentumFlux
749  << " " << EnergyFlux
750  << " " << NormalStress
751  << " " << TangentialStress
752  << " " << NormalTraction
753  << " " << TangentialTraction
754  << " " << Fabric
755  << " " << CollisionalHeatFlux
756  << " " << Dissipation
757  << " " << Potential
758  << " " << LocalAngularMomentum
759  << " " << LocalAngularMomentumFlux
760  << " " << ContactCoupleStress;
761  return ss.str();
762 }
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 594 of file StatisticsPoint.hcc.

594  {
595  std::stringstream ss;
596  ss<< "Nu "
597  << "Density "
598  << "MomentumX "
599  << "MomentumY "
600  << "MomentumZ "
601  << "DisplacementMomentumX "
602  << "DisplacementMomentumY "
603  << "DisplacementMomentumZ "
604  << "DisplacementXX "
605  << "DisplacementXY "
606  << "DisplacementXZ "
607  << "DisplacementYY "
608  << "DisplacementYZ "
609  << "DisplacementZZ "
610  << "MomentumFluxXX "
611  << "MomentumFluxXY "
612  << "MomentumFluxXZ "
613  << "MomentumFluxYY "
614  << "MomentumFluxYZ "
615  << "MomentumFluxZZ "
616  << "DisplacementMomentumFluxXX "
617  << "DisplacementMomentumFluxXY "
618  << "DisplacementMomentumFluxXZ "
619  << "DisplacementMomentumFluxYY "
620  << "DisplacementMomentumFluxYZ "
621  << "DisplacementMomentumFluxZZ "
622  << "EnergyFluxX "
623  << "EnergyFluxY "
624  << "EnergyFluxZ "
625  << "NormalStressXX "
626  << "NormalStressXY "
627  << "NormalStressXZ "
628  << "NormalStressYX "
629  << "NormalStressYY "
630  << "NormalStressYZ "
631  << "NormalStressZX "
632  << "NormalStressZY "
633  << "NormalStressZZ "
634  << "TangentialStressXX "
635  << "TangentialStressXY "
636  << "TangentialStressXZ "
637  << "TangentialStressYX "
638  << "TangentialStressYY "
639  << "TangentialStressYZ "
640  << "TangentialStressZX "
641  << "TangentialStressZY "
642  << "TangentialStressZZ "
643  << "NormalTractionX "
644  << "NormalTractionY "
645  << "NormalTractionZ "
646  << "TangentialTractionX "
647  << "TangentialTractionY "
648  << "TangentialTractionZ "
649  << "FabricXX "
650  << "FabricXY "
651  << "FabricXZ "
652  << "FabricYY "
653  << "FabricYZ "
654  << "FabricZZ "
655  << "CollisionalHeatFluxX "
656  << "CollisionalHeatFluxY "
657  << "CollisionalHeatFluxZ "
658  << "Dissipation "
659  << "Potential "
660  << "LocalAngularMomentumX "
661  << "LocalAngularMomentumY "
662  << "LocalAngularMomentumZ "
663  << "LocalAngularMomentumFluxXX "
664  << "LocalAngularMomentumFluxXY "
665  << "LocalAngularMomentumFluxXZ "
666  << "LocalAngularMomentumFluxYX "
667  << "LocalAngularMomentumFluxYY "
668  << "LocalAngularMomentumFluxYZ "
669  << "LocalAngularMomentumFluxZX "
670  << "LocalAngularMomentumFluxZY "
671  << "LocalAngularMomentumFluxZZ "
672  << "ContactCoupleStressXX "
673  << "ContactCoupleStressXY "
674  << "ContactCoupleStressXZ "
675  << "ContactCoupleStressYX "
676  << "ContactCoupleStressYY "
677  << "ContactCoupleStressYZ "
678  << "ContactCoupleStressZX "
679  << "ContactCoupleStressZY "
680  << "ContactCoupleStressZZ ";
681  return ss.str();
682 }

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>
Mdouble StatisticsPoint< T >::CG_invvolume

Prefactor of CG function which depends on $w.

Definition at line 238 of file StatisticsPoint.h.

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

template<StatType T>
Vec3D StatisticsPoint< T >::CollisionalHeatFlux

Heat flux from collisions, $\sum_{ij} (v_{ia}+v_ja)/2 f_{ija} l_{ijb} \psi_i$.

Todo:
{Heat flux calculations have not been checked, only implemented}

Definition at line 225 of file StatisticsPoint.h.

Referenced by StatisticsPoint< T >::getSquared(), StatisticsPoint< T >::operator+=(), StatisticsPoint< T >::operator-=(), and StatisticsPoint< T >::operator=().

template<StatType T>
Vec3D StatisticsPoint< T >::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.

Definition at line 204 of file StatisticsPoint.h.

Referenced by StatisticsPoint< T >::getSquared(), StatisticsPoint< T >::operator+=(), StatisticsPoint< T >::operator-=(), and StatisticsPoint< T >::operator=().

template<StatType T>
MatrixSymmetric3D StatisticsPoint< T >::DisplacementMomentumFlux
template<StatType T>
Mdouble StatisticsPoint< T >::Dissipation

Dissipation form collisions, $\sum_{ij} (v_{ia}+v_ja)/2 f_{ija} \psi_i$.

Todo:
{Dissipation calculations have not been checked, only implemented}

Definition at line 228 of file StatisticsPoint.h.

Referenced by StatisticsPoint< T >::getSquared(), StatisticsPoint< T >::operator+=(), StatisticsPoint< T >::operator-=(), and StatisticsPoint< T >::operator=().

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

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

Definition at line 241 of file StatisticsPoint.h.

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

template<StatType T>
Matrix3D StatisticsPoint< T >::NormalStress
template<StatType T>
Vec3D StatisticsPoint< T >::NormalTraction
template<StatType T>
Vec3D StatisticsPoint< T >::Position
private

Position at which evaluation occurs.

Definition at line 247 of file StatisticsPoint.h.

Referenced by StatisticsPoint< T >::get_Position(), StatisticsPoint< T >::set_Position(), and StatisticsPoint< T >::StatisticsPoint().

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

Elastic energy $1/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 231 of file StatisticsPoint.h.

Referenced by StatisticsPoint< T >::getSquared(), StatisticsPoint< T >::operator+=(), StatisticsPoint< T >::operator-=(), and StatisticsPoint< T >::operator=().

template<StatType T>
Matrix3D StatisticsPoint< T >::TangentialStress
template<StatType T>
Vec3D StatisticsPoint< T >::TangentialTraction

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