CGCoordinates::RZ Class Reference

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

#include <RZ.h>

+ Inheritance diagram for CGCoordinates::RZ:

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 setRZ (Mdouble x, Mdouble z)
 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 r_
 
Mdouble z_
 

Detailed Description

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

See XYZ for details.

Member Function Documentation

◆ getCNormal()

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

82 {
83  return (c.getContactPoint().X - r_) * normal.X
84  + (c.getContactPoint().Z - z_) * normal.Z;
85 }
const Vec3D & getContactPoint() const
Gets constant reference to contact point (vector).
Definition: BaseInteraction.h:234
Mdouble z_
Definition: RZ.h:128
Mdouble r_
Definition: RZ.h:124
Mdouble Z
Definition: Vector.h:66
Mdouble X
the vector components
Definition: Vector.h:66

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

◆ getDistanceSquared()

Mdouble RZ::getDistanceSquared ( const Vec3D p) const

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

55 {
56  return mathsFunc::square(sqrt(p.X * p.X + p.Y * p.Y) - r_) + mathsFunc::square(p.Z - z_);
57 }
Mdouble Y
Definition: Vector.h:66
T square(const T val)
squares a number
Definition: ExtendedMath.h:106

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

◆ getINormal()

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

70 {
71  return (c.getI()->getPosition().X - r_) * normal.X
72  + (c.getI()->getPosition().Z - z_) * normal.Z;
73 }
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
Definition: BaseInteractable.h:218
BaseInteractable * getI()
Returns a pointer to the second object involved in the interaction (often a wall or a particle).
Definition: BaseInteraction.h:285

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

◆ getLength()

Mdouble RZ::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:
65 {
66  return p.getLength();
67 }
static Mdouble getLength(const Vec3D &a)
Calculates the length of a Vec3D: .
Definition: Vector.cc:331

References Vec3D::getLength().

◆ getName()

std::string RZ::getName ( )
static
95 {
96  return "RZ";
97 }

◆ getPNormal()

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

76 {
77  return (c.getP()->getPosition().X - r_) * normal.X
78  + (c.getP()->getPosition().Z - z_) * normal.Z;
79 }
BaseInteractable * getP()
Returns a pointer to first object involved in the interaction (normally a particle).
Definition: BaseInteraction.h:274

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

◆ getTangentialSquared()

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

88 {
89  return mathsFunc::square(c.getP()->getPosition().X - r_)
91  - mathsFunc::square(pNormal);
92 }

References BaseInteraction::getP(), BaseInteractable::getPosition(), r_, mathsFunc::square(), Vec3D::X, Vec3D::Z, and z_.

◆ getVolumeOfAveragedDimensions()

Mdouble RZ::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
44 {
45  return 1.0;
46 }

◆ isResolvedIn()

static bool CGCoordinates::RZ::isResolvedIn ( unsigned  i)
inlinestatic
115 {return i==1?false:true;}
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51

References constants::i.

◆ setRZ()

void RZ::setRZ ( Mdouble  x,
Mdouble  z 
)

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

49 {
50  r_ = x;
51  z_ = z;
52 }

References r_, and z_.

◆ write()

void RZ::write ( std::ostream &  os) const

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

38 {
39  os << r_ << ' ' << z_ << ' ';
40 }

References r_, and z_.

◆ writeNames()

void RZ::writeNames ( std::ostream &  os)
static

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

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

Member Data Documentation

◆ r_

Mdouble CGCoordinates::RZ::r_
protected

The r-position of the current CGPoint.

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

◆ z_

Mdouble CGCoordinates::RZ::z_
protected

The z-position of the current CGPoint.

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


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