revision: v0.14
CGFields::OrientationField Class Reference

Contains the computed field values, like density, momentum and stress. More...

#include <OrientationField.h>

Public Member Functions

 OrientationField ()
 
 OrientationField (const OrientationField &other)=default
 
 ~OrientationField ()=default
 
void write (std::ostream &os) const
 Writes class content into an output stream, typically a stat file. More...
 
void output (std::ostream &os) const
 Writes human-readable class content into an output stream, typically a stat file. More...
 
void setZero ()
 Sets all fields to zero. More...
 
OrientationField getSquared () const
 Returns the square of all field values (to calculate standard deviation). More...
 
OrientationFieldoperator= (const OrientationField &P)
 Copies all field values. More...
 
OrientationFieldoperator+= (const OrientationField &P)
 Adds the field values on the RHS to the LHS of the equation. More...
 
OrientationFieldoperator-= (const OrientationField &P)
 Subtracts the field values on the RHS from the LHS of the equation. More...
 
OrientationFieldoperator/= (Mdouble a)
 Divides the field values on the LHS by the RHS of the equation. More...
 
OrientationField operator* (Mdouble a) const
 Multiplies the field values on the left of the '*' by the scalar value on the right of the '*' and returns the answer. More...
 
void addParticleStatistics (Mdouble phi, const OrientationField &currentInteraction)
 This function should be called from within a loop over all particles to compute all the fields that are defined as a sum over all particles (e.g. density, momentum). More...
 
void setFields (const BaseParticle &p)
 
void setCylindricalFields (const BaseParticle &p)
 
MatrixSymmetric3D getOrientation () const
 
void setFields (const BaseInteraction &c, IntegralType type)
 
void setCylindricalFields (const BaseInteraction &c, IntegralType type)
 
void addParticleDifferentialStatistics (Vec3D &dphi, const OrientationField &currentInteraction)
 
void addInteractionStatistics (Mdouble psi, const OrientationField &currentInteraction)
 
void addContactPointStatistics (Mdouble phi, const OrientationField &currentInteraction)
 

Static Public Member Functions

static void writeNames (std::ostream &os, unsigned countVariables)
 
static bool evaluateFixedParticles ()
 
static bool doInteractionStatistics ()
 
static bool isDifferentialField ()
 

Private Attributes

MatrixSymmetric3D orientation_
 

Detailed Description

Contains the computed field values, like density, momentum and stress.

CGPoints inherits from this class; CGPoints::evaluate adds to the values of these variables.

Todo:
These are currently the only fields that are computed. However, this class is destined to be extended to contain additional information such as fabric, energy, local angular momentum. Also, a simpler version is planned, where only particle statistics are evaluated (density and momentum).

Constructor & Destructor Documentation

◆ OrientationField() [1/2]

CGFields::OrientationField::OrientationField ( )
33  {
34  setZero();
35  logger(DEBUG, "OrientationField::OrientationField() finished");
36  }

References DEBUG, logger, and setZero().

◆ OrientationField() [2/2]

CGFields::OrientationField::OrientationField ( const OrientationField other)
default

◆ ~OrientationField()

CGFields::OrientationField::~OrientationField ( )
default

Member Function Documentation

◆ addContactPointStatistics()

void CGFields::OrientationField::addContactPointStatistics ( Mdouble  phi,
const OrientationField currentInteraction 
)
inline
158  {}

◆ addInteractionStatistics()

void CGFields::OrientationField::addInteractionStatistics ( Mdouble  psi,
const OrientationField currentInteraction 
)
inline
155  {}

◆ addParticleDifferentialStatistics()

void CGFields::OrientationField::addParticleDifferentialStatistics ( Vec3D dphi,
const OrientationField currentInteraction 
)
inline
152  {}

◆ addParticleStatistics()

void CGFields::OrientationField::addParticleStatistics ( Mdouble  phi,
const OrientationField currentInteraction 
)

This function should be called from within a loop over all particles to compute all the fields that are defined as a sum over all particles (e.g. density, momentum).

93  {
94  orientation_ += currentInteraction.getOrientation() * phi;
95  }

References getOrientation(), and orientation_.

◆ doInteractionStatistics()

static bool CGFields::OrientationField::doInteractionStatistics ( )
inlinestatic
132  {
133  return false;
134  }

◆ evaluateFixedParticles()

static bool CGFields::OrientationField::evaluateFixedParticles ( )
inlinestatic
127  {
128  return false;
129  }

◆ getOrientation()

MatrixSymmetric3D CGFields::OrientationField::getOrientation ( ) const
inline
121  {
122  return orientation_;
123  }

References orientation_.

Referenced by addParticleStatistics().

◆ getSquared()

OrientationField CGFields::OrientationField::getSquared ( ) const

Returns the square of all field values (to calculate standard deviation).

59  {
60  OrientationField orientationField;
61  orientationField.orientation_ = MatrixSymmetric3D::square(orientation_);
62  return orientationField;
63  }

References orientation_, and MatrixSymmetric3D::square().

◆ isDifferentialField()

static bool CGFields::OrientationField::isDifferentialField ( )
inlinestatic

A bool that determines if the derivative of the CG function has to be computed

141  {
142  return false;
143  }

◆ operator*()

OrientationField CGFields::OrientationField::operator* ( Mdouble  a) const

Multiplies the field values on the left of the '*' by the scalar value on the right of the '*' and returns the answer.

86  {
88  p.orientation_ = orientation_ * a;
89  return p;
90  }

References orientation_.

◆ operator+=()

OrientationField & CGFields::OrientationField::operator+= ( const OrientationField P)

Adds the field values on the RHS to the LHS of the equation.

68  {
69  orientation_ += P.orientation_;
70  return *this;
71  }

References orientation_.

◆ operator-=()

OrientationField & CGFields::OrientationField::operator-= ( const OrientationField P)

Subtracts the field values on the RHS from the LHS of the equation.

74  {
75  orientation_ -= P.orientation_;
76  return *this;
77  }

References orientation_.

◆ operator/=()

OrientationField & CGFields::OrientationField::operator/= ( Mdouble  a)

Divides the field values on the LHS by the RHS of the equation.

80  {
81  orientation_ /= a;
82  return *this;
83  }

References orientation_.

◆ operator=()

OrientationField & CGFields::OrientationField::operator= ( const OrientationField P)
default

Copies all field values.

◆ output()

void CGFields::OrientationField::output ( std::ostream &  os) const

Writes human-readable class content into an output stream, typically a stat file.

49  {
50  os << "Orientation " << orientation_;
51  }

References orientation_.

◆ setCylindricalFields() [1/2]

void CGFields::OrientationField::setCylindricalFields ( const BaseInteraction c,
IntegralType  type 
)
inline
149  {}

◆ setCylindricalFields() [2/2]

void CGFields::OrientationField::setCylindricalFields ( const BaseParticle p)
111  {
112  setFields(p);
113  }

References setFields().

◆ setFields() [1/2]

void CGFields::OrientationField::setFields ( const BaseInteraction c,
IntegralType  type 
)
inline
146  {}

◆ setFields() [2/2]

void CGFields::OrientationField::setFields ( const BaseParticle p)
98  {
99  Vec3D orientation = p.getOrientation().getAxis();
100  orientation_.XX = orientation.X * orientation.X;
101  orientation_.XY = orientation.X * orientation.Y;
102  orientation_.YY = orientation.Y * orientation.Y;
103  orientation_.XZ = orientation.X * orientation.Z;
104  orientation_.YZ = orientation.Y * orientation.Z;
105  orientation_.ZZ = orientation.Z * orientation.Z;
106  logger(DEBUG, "orientation: %", orientation_);
107  }

References DEBUG, Quaternion::getAxis(), BaseInteractable::getOrientation(), logger, orientation_, Vec3D::X, MatrixSymmetric3D::XX, MatrixSymmetric3D::XY, MatrixSymmetric3D::XZ, Vec3D::Y, MatrixSymmetric3D::YY, MatrixSymmetric3D::YZ, Vec3D::Z, and MatrixSymmetric3D::ZZ.

Referenced by setCylindricalFields().

◆ setZero()

void CGFields::OrientationField::setZero ( )

Sets all fields to zero.

54  {
56  }

References orientation_, and MatrixSymmetric3D::setZero().

Referenced by OrientationField().

◆ write()

void CGFields::OrientationField::write ( std::ostream &  os) const

Writes class content into an output stream, typically a stat file.

44  {
45  os << orientation_;
46  }

References orientation_.

◆ writeNames()

void CGFields::OrientationField::writeNames ( std::ostream &  os,
unsigned  countVariables 
)
static
39  {
40  os << countVariables + 1 << ":Orientation "; //orientation
41  }

Member Data Documentation

◆ orientation_


The documentation for this class was generated from the following files:
CGFields::OrientationField::setZero
void setZero()
Sets all fields to zero.
Definition: OrientationField.cc:53
logger
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
Vec3D::X
Mdouble X
the vector components
Definition: Vector.h:65
CGFields::OrientationField::setFields
void setFields(const BaseParticle &p)
Definition: OrientationField.cc:97
BaseInteractable::getOrientation
const Quaternion & getOrientation() const
Returns the orientation of this BaseInteractable.
Definition: BaseInteractable.h:230
CGFields::OrientationField::orientation_
MatrixSymmetric3D orientation_
Definition: OrientationField.h:161
Vec3D
Definition: Vector.h:50
CGFields::OrientationField::OrientationField
OrientationField()
Definition: OrientationField.cc:32
MatrixSymmetric3D::setZero
void setZero()
Sets all elements to zero.
Definition: MatrixSymmetric.cc:70
MatrixSymmetric3D::XZ
Mdouble XZ
Definition: MatrixSymmetric.h:42
MatrixSymmetric3D::ZZ
Mdouble ZZ
Definition: MatrixSymmetric.h:42
MatrixSymmetric3D::XY
Mdouble XY
Definition: MatrixSymmetric.h:42
Vec3D::Y
Mdouble Y
Definition: Vector.h:65
MatrixSymmetric3D::XX
Mdouble XX
The six distinctive matrix elements.
Definition: MatrixSymmetric.h:42
Quaternion::getAxis
Vec3D getAxis() const
Converts the quaternions into a normal vector by rotating the vector x=(1,0,0); see See Wiki for deta...
Definition: Quaternion.cc:501
MatrixSymmetric3D::square
static MatrixSymmetric3D square(const MatrixSymmetric3D &A)
Calculates the pointwise square.
Definition: MatrixSymmetric.cc:238
MatrixSymmetric3D::YZ
Mdouble YZ
Definition: MatrixSymmetric.h:42
Vec3D::Z
Mdouble Z
Definition: Vector.h:65
MatrixSymmetric3D::YY
Mdouble YY
Definition: MatrixSymmetric.h:42