MercuryDPM  Trunk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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).

Definition at line 51 of file OrientationField.h.

Constructor & Destructor Documentation

CGFields::OrientationField::OrientationField ( )

Definition at line 32 of file OrientationField.cc.

References DEBUG, logger, and setZero().

33  {
34  setZero();
35  logger(DEBUG, "OrientationField::OrientationField() finished");
36  }
Logger< MERCURY_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.
CGFields::OrientationField::OrientationField ( const OrientationField other)
default
CGFields::OrientationField::~OrientationField ( )
default

Member Function Documentation

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

Definition at line 157 of file OrientationField.h.

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

Definition at line 154 of file OrientationField.h.

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

Definition at line 151 of file OrientationField.h.

152  {}
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).

Definition at line 92 of file OrientationField.cc.

References getOrientation(), and orientation_.

93  {
94  orientation_ += currentInteraction.getOrientation() * phi;
95  }
MatrixSymmetric3D orientation_
static bool CGFields::OrientationField::doInteractionStatistics ( )
inlinestatic

Definition at line 131 of file OrientationField.h.

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

Definition at line 126 of file OrientationField.h.

127  {
128  return false;
129  }
MatrixSymmetric3D CGFields::OrientationField::getOrientation ( ) const
inline

Definition at line 120 of file OrientationField.h.

References orientation_.

Referenced by addParticleStatistics().

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

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

Definition at line 58 of file OrientationField.cc.

References orientation_, and MatrixSymmetric3D::square().

59  {
60  OrientationField orientationField;
61  orientationField.orientation_ = MatrixSymmetric3D::square(orientation_);
62  return orientationField;
63  }
static MatrixSymmetric3D square(const MatrixSymmetric3D &A)
Calculates the pointwise square.
MatrixSymmetric3D orientation_
static bool CGFields::OrientationField::isDifferentialField ( )
inlinestatic

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

Definition at line 140 of file OrientationField.h.

141  {
142  return false;
143  }
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.

Definition at line 85 of file OrientationField.cc.

References orientation_.

86  {
88  p.orientation_ = orientation_ * a;
89  return p;
90  }
MatrixSymmetric3D orientation_
OrientationField & CGFields::OrientationField::operator+= ( const OrientationField P)

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

Definition at line 67 of file OrientationField.cc.

References orientation_.

68  {
69  orientation_ += P.orientation_;
70  return *this;
71  }
MatrixSymmetric3D orientation_
OrientationField & CGFields::OrientationField::operator-= ( const OrientationField P)

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

Definition at line 73 of file OrientationField.cc.

References orientation_.

74  {
75  orientation_ -= P.orientation_;
76  return *this;
77  }
MatrixSymmetric3D orientation_
OrientationField & CGFields::OrientationField::operator/= ( Mdouble  a)

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

Definition at line 79 of file OrientationField.cc.

References orientation_.

80  {
81  orientation_ /= a;
82  return *this;
83  }
MatrixSymmetric3D orientation_
OrientationField & CGFields::OrientationField::operator= ( const OrientationField P)
default

Copies all field values.

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

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

Definition at line 48 of file OrientationField.cc.

References orientation_.

49  {
50  os << "Orientation " << orientation_;
51  }
MatrixSymmetric3D orientation_
void CGFields::OrientationField::setCylindricalFields ( const BaseParticle p)

Definition at line 110 of file OrientationField.cc.

References setFields().

111  {
112  setFields(p);
113  }
void setFields(const BaseParticle &p)
void CGFields::OrientationField::setCylindricalFields ( const BaseInteraction c,
IntegralType  type 
)
inline

Definition at line 148 of file OrientationField.h.

149  {}
void CGFields::OrientationField::setFields ( const BaseParticle p)

Definition at line 97 of file OrientationField.cc.

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

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  }
Mdouble X
the vector components
Definition: Vector.h:65
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here...
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 orientation_
Mdouble Y
Definition: Vector.h:65
Definition: Vector.h:49
const Quaternion & getOrientation() const
Returns the orientation of this BaseInteractable.
Mdouble Z
Definition: Vector.h:65
Mdouble XX
The six distinctive matrix elements.
void CGFields::OrientationField::setFields ( const BaseInteraction c,
IntegralType  type 
)
inline

Definition at line 145 of file OrientationField.h.

146  {}
void CGFields::OrientationField::setZero ( )

Sets all fields to zero.

Definition at line 53 of file OrientationField.cc.

References orientation_, and MatrixSymmetric3D::setZero().

Referenced by OrientationField().

54  {
56  }
void setZero()
Sets all elements to zero.
MatrixSymmetric3D orientation_
void CGFields::OrientationField::write ( std::ostream &  os) const

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

Definition at line 43 of file OrientationField.cc.

References orientation_.

44  {
45  os << orientation_;
46  }
MatrixSymmetric3D orientation_
void CGFields::OrientationField::writeNames ( std::ostream &  os,
unsigned  countVariables 
)
static

Definition at line 38 of file OrientationField.cc.

39  {
40  os << countVariables + 1 << ":Orientation "; //orientation
41  }

Member Data Documentation

MatrixSymmetric3D CGFields::OrientationField::orientation_
private

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