MercuryDPM  Trunk
CGCoordinates::Z Class Reference

Defines the non-averaged directions on which spatial coarse-graining is applied (the z-direction for Z); all other directions are averaged over homogeneously. More...

#include <Z.h>

Inheritance diagram for CGCoordinates::Z:

## Public Member Functions

void write (std::ostream &os) const
Writes the coordinates in human-readable form to an ostream. More...

Mdouble getDistanceSquared (const Vec3D &p) const
Returns the square of the distance between the particle p and the current CGPoint, in the non-averaged directions. More...

void setZ (Mdouble x)
Returns the position of the current CGPoint, in the non-averaged directions. More...

Mdouble getZ () const

Mdouble getINormal (const BaseInteraction &c, const Vec3D &normal) const
For the Interaction between particles/walls P and I, this function returns the dot product between the normal vector of the interaction and the branch vector from the current CGPoint towards I. More...

Mdouble getPNormal (const BaseInteraction &c, const Vec3D &normal) const
For the Interaction between particles/walls P and I, this function returns the dot product between the normal vector of the interaction and the branch vector from the current CGPoint towards P. More...

Mdouble getCNormal (const BaseInteraction &c, const Vec3D &normal) const
For the Interaction between particles/walls P and I, this function returns the dot product between the normal vector of the interaction and the branch vector from the current CGPoint towards the contact point. More...

Public Member Functions inherited from CGCoordinates::BaseCoordinates
virtual Mdouble getWeight ()

## Static Public Member Functions

static void writeNames (std::ostream &os)
Writes the coordinate names in human-readable form to an ostream. More...

static Mdouble getVolumeOfAveragedDimensions (const Vec3D &min, const Vec3D &max)
returns the factor the CGFunction has to be divided by, due to integrating the variables over the averaged dimensions, 1.0 for XYZ. More...

static Mdouble getLength (const Vec3D &p)
Returns the length of the input vector in the non-averaged directions. More...

static bool isResolvedIn (unsigned i)

static std::string getName ()

Static Public Member Functions inherited from CGCoordinates::Base_X_Y_Z
static Mdouble getGaussPrefactor (Mdouble width, Mdouble cutoff)
Computes the prefactor of the Gauss CGFunction, which is dependent on the number of non-averaged dimensions. More...

static Mdouble getGaussIntegralPrefactor (Mdouble distance, Mdouble width, Mdouble cutoff)
Computes the prefactor of the Gauss line integral, which is dependent on the number of non-averaged dimensions. More...

static void normalisePolynomialCoefficients (std::vector< Mdouble > &coefficients, Mdouble cutoff)
Normalises the coefficients of Polynomial CGFunction such that the integral over all non-averaged dimensions is unity. More...

static const unsigned countVariables ()

Static Public Member Functions inherited from CGCoordinates::BaseCoordinates
static Mdouble getDomainVolume (const Vec3D &min, const Vec3D &max)

Mdouble z_

## Detailed Description

Defines the non-averaged directions on which spatial coarse-graining is applied (the z-direction for Z); all other directions are averaged over homogeneously.

See XYZ for details.

Definition at line 50 of file Z.h.

## Member Function Documentation

 Mdouble Z::getCNormal ( const BaseInteraction & c, const Vec3D & normal ) const

For the Interaction between particles/walls P and I, this function returns the dot product between the normal vector of the interaction and the branch vector from the current CGPoint towards the contact point.

For all points S on the contact line from I to P, this is the maximum value for (S-R)*normal. This is the upper limit of integration along the contact line

Definition at line 91 of file Z.cc.

References BaseInteraction::getContactPoint(), Vec3D::Z, and z_.

92 {
93  return (c.getContactPoint().Z - z_) * normal.Z;
94 }
Mdouble z_
Definition: Z.h:120
const Vec3D & getContactPoint() const
Gets constant reference to contact point (vector).
Mdouble Z
Definition: Vector.h:65
 Mdouble Z::getDistanceSquared ( const Vec3D & p ) const

Returns the square of the distance between the particle p and the current CGPoint, in the non-averaged directions.

Definition at line 54 of file Z.cc.

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

55 {
56  return mathsFunc::square(p.Z - z_);
57 }
Mdouble z_
Definition: Z.h:120
T square(const T val)
squares a number
Definition: ExtendedMath.h:104
Mdouble Z
Definition: Vector.h:65
 Mdouble Z::getINormal ( const BaseInteraction & c, const Vec3D & normal ) const

For the Interaction between particles/walls P and I, this function returns the dot product between the normal vector of the interaction and the branch vector from the current CGPoint towards I.

For all points S on the contact line from I to P, this is the minimum value for (S-R)*normal. This is the lower limit of integration along the contact line

Definition at line 73 of file Z.cc.

References BaseInteraction::getI(), BaseInteractable::getPosition(), Vec3D::Z, and z_.

74 {
75  return (c.getI()->getPosition().Z - z_) * normal.Z;
76 }
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
Mdouble z_
Definition: Z.h:120
BaseInteractable * getI()
Returns a pointer to the second object involved in the interaction (often a wall or a particle)...
Mdouble Z
Definition: Vector.h:65
 Mdouble Z::getLength ( const Vec3D & p )
static

Returns the length of the input vector in the non-averaged directions.

Parameters
 [in] p vector whose length should be determined
Returns
length of the vector in the non-averaged directions
Todo:

Definition at line 64 of file Z.cc.

References Vec3D::Z.

65 {
66  return fabs(p.Z);
67 }
Mdouble Z
Definition: Vector.h:65
 std::string Z::getName ( )
static

Definition at line 96 of file Z.cc.

97 {
98  return "Z";
99 }
 Mdouble Z::getPNormal ( const BaseInteraction & c, const Vec3D & normal ) const

For the Interaction between particles/walls P and I, this function returns the dot product between the normal vector of the interaction and the branch vector from the current CGPoint towards P.

For all points S on the contact line from I to P, this is the maximum value for (S-R)*normal. This is the upper limit of integration along the contact line

Definition at line 82 of file Z.cc.

References BaseInteraction::getP(), BaseInteractable::getPosition(), Vec3D::Z, and z_.

83 {
84  return (c.getP()->getPosition().Z - z_) * normal.Z;
85 }
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
Mdouble z_
Definition: Z.h:120
BaseInteractable * getP()
Returns a pointer to first object involved in the interaction (normally a particle).
Mdouble Z
Definition: Vector.h:65
 Mdouble Z::getVolumeOfAveragedDimensions ( const Vec3D & min, const Vec3D & max )
static

returns the factor the CGFunction has to be divided by, due to integrating the variables over the averaged dimensions, 1.0 for XYZ.

Todo:
Generalise to 2D

Definition at line 44 of file Z.cc.

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

45 {
46  return (max.X - min.X) * (max.Y - min.Y);
47 }
Mdouble X
the vector components
Definition: Vector.h:65
Mdouble Y
Definition: Vector.h:65
 Mdouble CGCoordinates::Z::getZ ( ) const
inline

Definition at line 87 of file Z.h.

References z_.

88  { return z_; }
Mdouble z_
Definition: Z.h:120
 static bool CGCoordinates::Z::isResolvedIn ( unsigned i )
inlinestatic

Definition at line 111 of file Z.h.

111 {return i==2?true:false;}
 void Z::setZ ( Mdouble x )

Returns the position of the current CGPoint, in the non-averaged directions.

Definition at line 49 of file Z.cc.

References z_.

50 {
51  z_ = z;
52 }
Mdouble z_
Definition: Z.h:120
 void Z::write ( std::ostream & os ) const

Writes the coordinates in human-readable form to an ostream.

Definition at line 37 of file Z.cc.

References z_.

38 {
39  os << z_ << ' ';
40 }
Mdouble z_
Definition: Z.h:120
 void Z::writeNames ( std::ostream & os )
static

Writes the coordinate names in human-readable form to an ostream.

Definition at line 32 of file Z.cc.

33 {
34  os << "z ";
35 }

## Member Data Documentation

 Mdouble CGCoordinates::Z::z_
protected

The z-position of the current CGPoint.

Definition at line 120 of file Z.h.

Referenced by getCNormal(), getDistanceSquared(), getINormal(), getPNormal(), getZ(), setZ(), and write().

The documentation for this class was generated from the following files:
• CG/Coordinates/Z.h
• CG/Coordinates/Z.cc