CGFields::OrientationField Class Reference

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

#include <OrientationField.h>

+ Inheritance diagram for CGFields::OrientationField:

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)
 
- Public Member Functions inherited from CGFields::BaseFields
void setCG (BaseCG *cg)
 
BaseCGgetCG ()
 

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_
 

Additional Inherited Members

- Protected Attributes inherited from CGFields::BaseFields
BaseCGcg_ = nullptr
 Stores a pointer to the baseCG instance to get e.g. the handler and time information. More...
 

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 ( )
12  {
13  setZero();
14  logger(DEBUG, "OrientationField::OrientationField() finished");
15  }
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:32

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
139  {}

◆ addInteractionStatistics()

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

◆ addParticleDifferentialStatistics()

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

◆ 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).

72  {
73  orientation_ += currentInteraction.getOrientation() * phi;
74  }
MatrixSymmetric3D orientation_
Definition: OrientationField.h:142

References getOrientation(), and orientation_.

◆ doInteractionStatistics()

static bool CGFields::OrientationField::doInteractionStatistics ( )
inlinestatic
113  {
114  return false;
115  }

◆ evaluateFixedParticles()

static bool CGFields::OrientationField::evaluateFixedParticles ( )
inlinestatic
108  {
109  return false;
110  }

◆ getOrientation()

MatrixSymmetric3D CGFields::OrientationField::getOrientation ( ) const
inline
102  {
103  return orientation_;
104  }

References orientation_.

Referenced by addParticleStatistics().

◆ getSquared()

OrientationField CGFields::OrientationField::getSquared ( ) const

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

38  {
39  OrientationField orientationField;
40  orientationField.orientation_ = MatrixSymmetric3D::square(orientation_);
41  return orientationField;
42  }
OrientationField()
Definition: OrientationField.cc:11
static MatrixSymmetric3D square(const MatrixSymmetric3D &A)
Calculates the pointwise square.
Definition: MatrixSymmetric.cc:217

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

122  {
123  return false;
124  }

◆ 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.

65  {
67  p.orientation_ = orientation_ * a;
68  return p;
69  }
float * p
Definition: Tutorial_Map_using.cpp:9
const Scalar * a
Definition: level2_cplx_impl.h:32

References a, orientation_, and p.

◆ operator+=()

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

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

47  {
48  orientation_ += P.orientation_;
49  return *this;
50  }
double P
Uniform pressure.
Definition: TwenteMeshGluing.cpp:77

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.

53  {
54  orientation_ -= P.orientation_;
55  return *this;
56  }

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.

59  {
60  orientation_ /= a;
61  return *this;
62  }

References a, and 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.

28  {
29  os << "Orientation " << orientation_;
30  }

References orientation_.

◆ setCylindricalFields() [1/2]

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

◆ setCylindricalFields() [2/2]

void CGFields::OrientationField::setCylindricalFields ( const BaseParticle p)
90  {
91  setFields(p);
92  }
void setFields(const BaseParticle &p)
Definition: OrientationField.cc:76

References p, and setFields().

◆ setFields() [1/2]

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

◆ setFields() [2/2]

void CGFields::OrientationField::setFields ( const BaseParticle p)
77  {
78  Vec3D orientation = p.getOrientation().getAxis();
79  orientation_.XX = orientation.X * orientation.X;
80  orientation_.XY = orientation.X * orientation.Y;
81  orientation_.YY = orientation.Y * orientation.Y;
82  orientation_.XZ = orientation.X * orientation.Z;
83  orientation_.YZ = orientation.Y * orientation.Z;
84  orientation_.ZZ = orientation.Z * orientation.Z;
85  logger(DEBUG, "orientation: %", orientation_);
86  }
Mdouble ZZ
Definition: MatrixSymmetric.h:21
Mdouble YY
Definition: MatrixSymmetric.h:21
Mdouble XZ
Definition: MatrixSymmetric.h:21
Mdouble XY
Definition: MatrixSymmetric.h:21
Mdouble XX
The six distinctive matrix elements.
Definition: MatrixSymmetric.h:21
Mdouble YZ
Definition: MatrixSymmetric.h:21
Definition: Kernel/Math/Vector.h:30
Mdouble Y
Definition: Kernel/Math/Vector.h:45
Mdouble Z
Definition: Kernel/Math/Vector.h:45
Mdouble X
the vector components
Definition: Kernel/Math/Vector.h:45

References DEBUG, logger, orientation_, p, 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.

33  {
35  }
void setZero()
Sets all elements to zero.
Definition: MatrixSymmetric.cc:49

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.

23  {
24  os << orientation_;
25  }

References orientation_.

◆ writeNames()

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

Member Data Documentation

◆ orientation_


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