MercuryDPM  Trunk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CGCoordinates::XY Class Reference

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

#include <XY.h>

+ Inheritance diagram for CGCoordinates::XY:

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 setXY (Mdouble x, Mdouble y)
 Returns the position of the current CGPoint, in the non-averaged directions. More...
 
Mdouble getINormal (const BaseInteraction &c, const Vec3D &normal) const
 For the Interaction between particles/walls P and I, this function returns the dot product between the normal vector of the interaction and the branch vector from the current CGPoint towards I. More...
 
Mdouble getPNormal (const BaseInteraction &c, const Vec3D &normal) const
 For the Interaction between particles/walls P and I, this function returns the dot product between the normal vector of the interaction and the branch vector from the current CGPoint towards P. More...
 
Mdouble getCNormal (const BaseInteraction &c, const Vec3D &normal) const
 For the Interaction between particles/walls P and I, this function returns the dot product between the normal vector of the interaction and the branch vector from the current CGPoint towards the contact point. More...
 
Mdouble getTangentialSquared (const BaseInteraction &c, Mdouble pNormal) const
 For the Interaction between particles/walls P and I, this function returns the square of the minimum distance between the the current CGPoint and the branch vector between P and I. More...
 
- Public Member Functions inherited from CGCoordinates::BaseCoordinates
virtual Mdouble getWeight ()
 

Static Public Member Functions

static void writeNames (std::ostream &os)
 Writes the coordinate names in human-readable form to an ostream. More...
 
static Mdouble getVolumeOfAveragedDimensions (const Vec3D &min, const Vec3D &max)
 returns the factor the CGFunction has to be divided by, due to integrating the variables over the averaged dimensions, 1.0 for XYZ. More...
 
static Mdouble getLength (const Vec3D &p)
 Returns the length of the input vector in the non-averaged directions. More...
 
static bool isResolvedIn (unsigned i)
 
static std::string getName ()
 
- Static Public Member Functions inherited from CGCoordinates::Base_XY_XZ_YZ
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)
 

Protected Attributes

Mdouble x_
 
Mdouble y_
 

Detailed Description

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

See XYZ for details.

Definition at line 50 of file XY.h.

Member Function Documentation

Mdouble XY::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.

Definition at line 81 of file XY.cc.

References BaseInteraction::getContactPoint(), Vec3D::X, x_, Vec3D::Y, and y_.

82 {
83  return (c.getContactPoint().X - x_) * normal.X
84  + (c.getContactPoint().Y - y_) * normal.Y;
85 }
Mdouble X
the vector components
Definition: Vector.h:65
Mdouble y_
Definition: XY.h:128
const Vec3D & getContactPoint() const
Gets constant reference to contact point (vector).
Mdouble Y
Definition: Vector.h:65
Mdouble x_
Definition: XY.h:124
Mdouble XY::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 XY.cc.

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

55 {
56  return mathsFunc::square(p.X - x_) + mathsFunc::square(p.Y - y_);
57 }
Mdouble X
the vector components
Definition: Vector.h:65
Mdouble y_
Definition: XY.h:128
Mdouble Y
Definition: Vector.h:65
Mdouble x_
Definition: XY.h:124
T square(const T val)
squares a number
Definition: ExtendedMath.h:104
Mdouble XY::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.

Definition at line 69 of file XY.cc.

References BaseInteraction::getI(), BaseInteractable::getPosition(), Vec3D::X, x_, Vec3D::Y, and y_.

70 {
71  return (c.getI()->getPosition().X - x_) * normal.X
72  + (c.getI()->getPosition().Y - y_) * normal.Y;
73 }
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
Mdouble X
the vector components
Definition: Vector.h:65
Mdouble y_
Definition: XY.h:128
BaseInteractable * getI()
Returns a pointer to the second object involved in the interaction (often a wall or a particle)...
Mdouble Y
Definition: Vector.h:65
Mdouble x_
Definition: XY.h:124
Mdouble XY::getLength ( const Vec3D p)
static

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

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

Definition at line 64 of file XY.cc.

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

65 {
66  return sqrt(p.X * p.X + p.Y * p.Y);
67 }
Mdouble X
the vector components
Definition: Vector.h:65
Mdouble Y
Definition: Vector.h:65
std::string XY::getName ( )
static

Definition at line 94 of file XY.cc.

95 {
96  return "XY";
97 }
Mdouble XY::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.

Definition at line 75 of file XY.cc.

References BaseInteraction::getP(), BaseInteractable::getPosition(), Vec3D::X, x_, Vec3D::Y, and y_.

76 {
77  return (c.getP()->getPosition().X - x_) * normal.X
78  + (c.getP()->getPosition().Y - y_) * normal.Y;
79 }
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
Mdouble X
the vector components
Definition: Vector.h:65
Mdouble y_
Definition: XY.h:128
BaseInteractable * getP()
Returns a pointer to first object involved in the interaction (normally a particle).
Mdouble Y
Definition: Vector.h:65
Mdouble x_
Definition: XY.h:124
Mdouble XY::getTangentialSquared ( const BaseInteraction c,
Mdouble  pNormal 
) const

For the Interaction between particles/walls P and I, this function returns the square of the minimum distance between the the current CGPoint and the branch vector between P and I.

Definition at line 87 of file XY.cc.

References BaseInteraction::getP(), BaseInteractable::getPosition(), mathsFunc::square(), Vec3D::X, x_, Vec3D::Y, and y_.

88 {
89  return mathsFunc::square(c.getP()->getPosition().X - x_)
91  - mathsFunc::square(pNormal);
92 }
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
Mdouble X
the vector components
Definition: Vector.h:65
Mdouble y_
Definition: XY.h:128
BaseInteractable * getP()
Returns a pointer to first object involved in the interaction (normally a particle).
Mdouble Y
Definition: Vector.h:65
Mdouble x_
Definition: XY.h:124
T square(const T val)
squares a number
Definition: ExtendedMath.h:104
Mdouble XY::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 43 of file XY.cc.

References Vec3D::Z.

44 {
45  return max.Z - min.Z;
46 }
Mdouble Z
Definition: Vector.h:65
static bool CGCoordinates::XY::isResolvedIn ( unsigned  i)
inlinestatic

Definition at line 115 of file XY.h.

115 {return i==2?false:true;}
void XY::setXY ( Mdouble  x,
Mdouble  y 
)

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

Definition at line 48 of file XY.cc.

References x_, and y_.

49 {
50  x_ = x;
51  y_ = y;
52 }
Mdouble y_
Definition: XY.h:128
Mdouble x_
Definition: XY.h:124
void XY::write ( std::ostream &  os) const

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

Definition at line 37 of file XY.cc.

References x_, and y_.

38 {
39  os << x_ << ' ' << y_ << ' ';
40 }
Mdouble y_
Definition: XY.h:128
Mdouble x_
Definition: XY.h:124
void XY::writeNames ( std::ostream &  os)
static

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

Definition at line 32 of file XY.cc.

33 {
34  os << "x y ";
35 }

Member Data Documentation

Mdouble CGCoordinates::XY::x_
protected

The x-position of the current CGPoint.

Definition at line 124 of file XY.h.

Referenced by getCNormal(), getDistanceSquared(), getINormal(), getPNormal(), getTangentialSquared(), setXY(), and write().

Mdouble CGCoordinates::XY::y_
protected

The y-position of the current CGPoint.

Definition at line 128 of file XY.h.

Referenced by getCNormal(), getDistanceSquared(), getINormal(), getPNormal(), getTangentialSquared(), setXY(), and write().


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