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  }
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
void setZero()
Sets all fields to zero.
Definition: OrientationField.cc:53

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  }
MatrixSymmetric3D orientation_
Definition: OrientationField.h:161

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  }
OrientationField()
Definition: OrientationField.cc:32
static MatrixSymmetric3D square(const MatrixSymmetric3D &A)
Calculates the pointwise square.
Definition: MatrixSymmetric.cc:238

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  }
double P
Uniform pressure.
Definition: TwenteMeshGluing.cpp:73

References orientation_, and Global_Physical_Variables::P.

◆ 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_, and Global_Physical_Variables::P.

◆ 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  }
void setFields(const BaseParticle &p)
Definition: OrientationField.cc:97

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  }
const Quaternion & getOrientation() const
Returns the orientation of this BaseInteractable.
Definition: BaseInteractable.h:230
Mdouble ZZ
Definition: MatrixSymmetric.h:42
Mdouble YY
Definition: MatrixSymmetric.h:42
Mdouble XZ
Definition: MatrixSymmetric.h:42
Mdouble XY
Definition: MatrixSymmetric.h:42
Mdouble XX
The six distinctive matrix elements.
Definition: MatrixSymmetric.h:42
Mdouble YZ
Definition: MatrixSymmetric.h:42
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
Definition: Vector.h:51
Mdouble Y
Definition: Vector.h:66
Mdouble Z
Definition: Vector.h:66
Mdouble X
the vector components
Definition: Vector.h:66

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  }
void setZero()
Sets all elements to zero.
Definition: MatrixSymmetric.cc:70

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: