CGFields::DisplacementField Class Reference

Computed the displacement fields. More...

#include <DisplacementField.h>

+ Inheritance diagram for CGFields::DisplacementField:

Public Member Functions

 DisplacementField ()
 
 DisplacementField (const DisplacementField &other)=default
 
 ~DisplacementField ()=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...
 
DisplacementField getSquared () const
 Returns the square of all field values (to calculate standard deviation). More...
 
DisplacementFieldoperator= (const DisplacementField &P)
 Copies all field values. More...
 
DisplacementFieldoperator+= (const DisplacementField &P)
 Adds the field values on the RHS to the LHS of the equation. More...
 
DisplacementFieldoperator-= (const DisplacementField &P)
 Subtracts the field values on the RHS from the LHS of the equation. More...
 
DisplacementFieldoperator/= (Mdouble a)
 Divides the field values on the LHS by the RHS of the equation. More...
 
DisplacementField 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 DisplacementField &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 getDisplacementMomentumFlux () const
 
Vec3D getDisplacementMomentum () const
 
void setFields (const BaseInteraction &c, IntegralType type)
 
void setCylindricalFields (const BaseInteraction &c, IntegralType type)
 
void addParticleDifferentialStatistics (Vec3D &dphi, const DisplacementField &currentInteraction)
 
void addInteractionStatistics (Mdouble psi, const DisplacementField &currentInteraction)
 
void addContactPointStatistics (Mdouble phi, const DisplacementField &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 displacementMomentumFlux_
 
Vec3D displacementMomentum_
 

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

Computed the displacement fields.

The displacement moment and the displacement moment flux are calculated from the previous position of the particle and the time since the last evaluation of the data files

Constructor & Destructor Documentation

◆ DisplacementField() [1/2]

CGFields::DisplacementField::DisplacementField ( )
12  {
13  setZero();
14  logger(DEBUG, "DisplacementField::DisplacementField() 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: DisplacementField.cc:35

References DEBUG, logger, and setZero().

Referenced by getSquared().

◆ DisplacementField() [2/2]

CGFields::DisplacementField::DisplacementField ( const DisplacementField other)
default

◆ ~DisplacementField()

CGFields::DisplacementField::~DisplacementField ( )
default

Member Function Documentation

◆ addContactPointStatistics()

void CGFields::DisplacementField::addContactPointStatistics ( Mdouble  phi,
const DisplacementField currentInteraction 
)
inline
138  {}

◆ addInteractionStatistics()

void CGFields::DisplacementField::addInteractionStatistics ( Mdouble  psi,
const DisplacementField currentInteraction 
)
inline
135  {}

◆ addParticleDifferentialStatistics()

void CGFields::DisplacementField::addParticleDifferentialStatistics ( Vec3D dphi,
const DisplacementField currentInteraction 
)
inline
132  {}

◆ addParticleStatistics()

void CGFields::DisplacementField::addParticleStatistics ( Mdouble  phi,
const DisplacementField 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).

82  {
83  displacementMomentum_ += currentInteraction.getDisplacementMomentum() * phi;
84  displacementMomentumFlux_ += currentInteraction.getDisplacementMomentumFlux() * phi;
85  }
MatrixSymmetric3D displacementMomentumFlux_
Definition: DisplacementField.h:141
Vec3D displacementMomentum_
Definition: DisplacementField.h:142

References displacementMomentum_, displacementMomentumFlux_, getDisplacementMomentum(), and getDisplacementMomentumFlux().

◆ doInteractionStatistics()

static bool CGFields::DisplacementField::doInteractionStatistics ( )
inlinestatic
112  {
113  return false;
114  }

◆ evaluateFixedParticles()

static bool CGFields::DisplacementField::evaluateFixedParticles ( )
inlinestatic
107  {
108  return false;
109  }

◆ getDisplacementMomentum()

Vec3D CGFields::DisplacementField::getDisplacementMomentum ( ) const
inline
103 { return displacementMomentum_; }

References displacementMomentum_.

Referenced by addParticleStatistics().

◆ getDisplacementMomentumFlux()

MatrixSymmetric3D CGFields::DisplacementField::getDisplacementMomentumFlux ( ) const
inline

◆ getSquared()

DisplacementField CGFields::DisplacementField::getSquared ( ) const

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

42  {
44 
45  DisplacementField.displacementMomentum_ = Vec3D::square(displacementMomentum_);
47  return DisplacementField;
48  }
DisplacementField()
Definition: DisplacementField.cc:11
static MatrixSymmetric3D square(const MatrixSymmetric3D &A)
Calculates the pointwise square.
Definition: MatrixSymmetric.cc:217
static Vec3D square(const Vec3D &a)
Calculates the pointwise square of a Vec3D.
Definition: Vector.cc:94

References DisplacementField(), displacementMomentum_, displacementMomentumFlux_, MatrixSymmetric3D::square(), and Vec3D::square().

◆ isDifferentialField()

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

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

121  {
122  return false;
123  }

◆ operator*()

DisplacementField CGFields::DisplacementField::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.

74  {
76  p.displacementMomentum_ = displacementMomentum_ * a;
77  p.displacementMomentumFlux_ = displacementMomentumFlux_ * a;
78  return p;
79  }
float * p
Definition: Tutorial_Map_using.cpp:9
const Scalar * a
Definition: level2_cplx_impl.h:32

References a, displacementMomentum_, displacementMomentumFlux_, and p.

◆ operator+=()

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

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

53  {
54  displacementMomentum_ += P.displacementMomentum_;
55  displacementMomentumFlux_ += P.displacementMomentumFlux_;
56  return *this;
57  }
double P
Uniform pressure.
Definition: TwenteMeshGluing.cpp:77

References displacementMomentum_, displacementMomentumFlux_, and Global_Physical_Variables::P.

◆ operator-=()

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

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

60  {
61  displacementMomentum_ -= P.displacementMomentum_;
62  displacementMomentumFlux_ -= P.displacementMomentumFlux_;
63  return *this;
64  }

References displacementMomentum_, displacementMomentumFlux_, and Global_Physical_Variables::P.

◆ operator/=()

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

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

67  {
70  return *this;
71  }

References a, displacementMomentum_, and displacementMomentumFlux_.

◆ operator=()

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

Copies all field values.

◆ output()

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

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

30  {
31  os << "displacementMomentum " << displacementMomentum_ << " ";
32  os << "displacementMomentumFlux " << displacementMomentumFlux_ << " ";
33  }

References displacementMomentum_, and displacementMomentumFlux_.

◆ setCylindricalFields() [1/2]

void CGFields::DisplacementField::setCylindricalFields ( const BaseInteraction c,
IntegralType  type 
)
inline
129  {}

◆ setCylindricalFields() [2/2]

void CGFields::DisplacementField::setCylindricalFields ( const BaseParticle p)
104  {
105  setFields(p);
106  }
void setFields(const BaseParticle &p)
Definition: DisplacementField.cc:87

References p, and setFields().

◆ setFields() [1/2]

void CGFields::DisplacementField::setFields ( const BaseInteraction c,
IntegralType  type 
)
inline
126  {}

◆ setFields() [2/2]

void CGFields::DisplacementField::setFields ( const BaseParticle p)
88  {
89  CGHandler* cgHandler = getCG()->getHandler();
90  DPMBase* dpmBase = getCG()->getHandler()->getDPMBase();
91 
92  Vec3D displacement = p.getDisplacement2(dpmBase->getXMin(), dpmBase->getXMax(),
93  dpmBase->getYMin(), dpmBase->getYMax(),
94  dpmBase->getZMin(), dpmBase->getZMax(),
95  dpmBase->getTime() - cgHandler->getPreviousEvaluationTime());
96 
97  displacementMomentum_ = displacement * p.getMass();
98  displacementMomentumFlux_ = MatrixSymmetric3D::selfDyadic(displacement) * p.getMass();
99 
100  }
CGHandler * getHandler() const
Returns handler_, a pointer to the CGHandler.
Definition: BaseCG.cc:60
DPMBase * getDPMBase()
Gets the problem that is solved using this handler.
Definition: BaseHandler.h:733
BaseCG * getCG()
Definition: BaseFields.h:26
Container that stores all CG objects.
Definition: CGHandler.h:45
Mdouble getPreviousEvaluationTime()
Returns the time of the last read/evaluated time step.
Definition: CGHandler.h:132
The DPMBase header includes quite a few header files, defining all the handlers, which are essential....
Definition: DPMBase.h:56
Mdouble getXMin() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMin() returns XMin.
Definition: DPMBase.h:603
Mdouble getXMax() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax.
Definition: DPMBase.h:610
Mdouble getYMin() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMin() returns YMin.
Definition: DPMBase.h:616
Mdouble getTime() const
Returns the current simulation time.
Definition: DPMBase.cc:799
Mdouble getYMax() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax.
Definition: DPMBase.h:622
Mdouble getZMax() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMax() returns ZMax.
Definition: DPMBase.h:634
Mdouble getZMin() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMin() returns ZMin.
Definition: DPMBase.h:628
static MatrixSymmetric3D selfDyadic(const Vec3D &a)
Calculates the dyadic product of a Vec3D with itself: .
Definition: MatrixSymmetric.cc:242
Definition: Kernel/Math/Vector.h:30

References displacementMomentum_, displacementMomentumFlux_, CGFields::BaseFields::getCG(), BaseHandler< T >::getDPMBase(), BaseCG::getHandler(), CGHandler::getPreviousEvaluationTime(), DPMBase::getTime(), DPMBase::getXMax(), DPMBase::getXMin(), DPMBase::getYMax(), DPMBase::getYMin(), DPMBase::getZMax(), DPMBase::getZMin(), p, and MatrixSymmetric3D::selfDyadic().

Referenced by setCylindricalFields().

◆ setZero()

void CGFields::DisplacementField::setZero ( )

Sets all fields to zero.

36  {
39  }
void setZero()
Sets all elements to zero.
Definition: MatrixSymmetric.cc:49
void setZero()
Sets all elements to zero.
Definition: Vector.cc:23

References displacementMomentum_, displacementMomentumFlux_, MatrixSymmetric3D::setZero(), and Vec3D::setZero().

Referenced by DisplacementField().

◆ write()

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

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

24  {
25  os << displacementMomentum_ << " "
26  << displacementMomentumFlux_ << " ";
27  }

References displacementMomentum_, and displacementMomentumFlux_.

◆ writeNames()

void CGFields::DisplacementField::writeNames ( std::ostream &  os,
unsigned  countVariables 
)
static
18  {
19  os << countVariables + 1 << "-" << countVariables + 3 << ":displacementMomentum " //orientation
20  << countVariables + 4 << "-" << countVariables + 9 << ":displacementMomentumFlux ";
21  }

Member Data Documentation

◆ displacementMomentum_

Vec3D CGFields::DisplacementField::displacementMomentum_
private

◆ displacementMomentumFlux_


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