CGCoordinates::X Class Reference

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

#include <X.h>

+ Inheritance diagram for CGCoordinates::X:

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 setX (Mdouble x)
 Returns the position of the current CGPoint, in the non-averaged directions. More...
 
Mdouble getX () 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)
 

Protected Attributes

Mdouble x_
 

Detailed Description

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

See XYZ for details.

Member Function Documentation

◆ getCNormal()

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

65 {
66  return (c.getContactPoint().X - x_) * normal.X;
67 }
Mdouble x_
Definition: X.h:99
void normal(const Vector< double > &x, Vector< double > &normal)
Definition: free_surface_rotation.cc:65
int c
Definition: calibrate.py:100

References calibrate::c, WallFunction::normal(), and x_.

◆ getDistanceSquared()

Mdouble X::getDistanceSquared ( const Vec3D p) const

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

40 {
41  return mathsFunc::square(p.X - x_);
42 }
float * p
Definition: Tutorial_Map_using.cpp:9
T square(const T val)
squares a number
Definition: ExtendedMath.h:86

References p, mathsFunc::square(), and x_.

◆ getINormal()

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

Todo:
change from normal.X to sign(normal.X)
55 {
56  return (c.getI()->getPosition().X - x_) * normal.X;
57 }

References calibrate::c, WallFunction::normal(), and x_.

◆ getLength()

Mdouble X::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
49 {
50  return fabs(p.X);
51 }
Real fabs(const Real &a)
Definition: boostmultiprec.cpp:117

References boost::multiprecision::fabs(), and p.

◆ getName()

std::string X::getName ( )
static
70 {
71  return "X";
72 }

◆ getPNormal()

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

60 {
61  return (c.getP()->getPosition().X - x_) * normal.X;
62 }

References calibrate::c, WallFunction::normal(), and x_.

◆ getVolumeOfAveragedDimensions()

Mdouble X::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
24 {
25  return (max.Y - min.Y) * (max.Z - min.Z);
26 }
#define min(a, b)
Definition: datatypes.h:22
#define max(a, b)
Definition: datatypes.h:23

References max, and min.

◆ getX()

Mdouble X::getX ( ) const
34 {
35  return x_;
36 }

References x_.

◆ isResolvedIn()

static bool CGCoordinates::X::isResolvedIn ( unsigned  i)
inlinestatic
90 {return i==0?true:false;}
int i
Definition: BiCGSTAB_step_by_step.cpp:9

References i.

◆ setX()

void X::setX ( Mdouble  x)

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

29 {
30  x_ = x;
31 }
list x
Definition: plotDoE.py:28

References plotDoE::x, and x_.

◆ write()

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

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

17 {
18  os << x_ << ' ';
19 }

References x_.

◆ writeNames()

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

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

12 {
13  os << "x ";
14 }

Member Data Documentation

◆ x_

Mdouble CGCoordinates::X::x_
protected

The x-position of the current CGPoint.

Referenced by getCNormal(), getDistanceSquared(), getINormal(), getPNormal(), getX(), setX(), and write().


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