GradVelocityField.h
Go to the documentation of this file.
1 // This file is part of the MercuryDPM project (https://www.mercurydpm.org).
2 // Copyright (c), The MercuryDPM Developers Team. All rights reserved.
3 // License: BSD 3-Clause License; see the LICENSE file in the root directory.
4 
5 #ifndef GradVelocityField_H
6 #define GradVelocityField_H
7 
8 #include <Math/Matrix.h>
9 #include <Math/MatrixSymmetric.h>
11 
12 #include "BaseFields.h"
13 
14 class BaseParticle;
15 
16 class BaseInteraction;
17 
18 namespace CGFields
19 {
20 
22 {
23 public:
24 
29 
34 
39  ~GradVelocityField() = default;
40 
41  static void writeNames(std::ostream& os, unsigned countVariables);
42 
46  void write(std::ostream& os) const;
47 
51  void output(std::ostream& os) const;
52 
56  void setZero();
57 
62 
67 
72 
77 
82 
88 
94  void addParticleStatistics(Mdouble phi, const GradVelocityField& currentInteraction);
95 
96  void addParticleDifferentialStatistics(Vec3D& dphi, const GradVelocityField& currentInteraction);
97 
103  void addInteractionStatistics(Mdouble psi, const GradVelocityField& currentInteraction);
104 
110  void addContactPointStatistics(Mdouble phi, const GradVelocityField& currentInteraction);
111 
113 
115 
116  void setFields(const BaseParticle& p);
117 
118  void setCylindricalFields(const BaseParticle& p);
119 
120 
125  static bool doInteractionStatistics();
126 
128  {
129  return density_;
130  }
131 
133  {
134  return momentum_;
135  }
136 
138  {
139  return ddensity_;
140  }
141 
143  {
144  return dmomentum_;
145  }
146 
148  {
149  return false;
150  }
151 
156  static bool isDifferentialField()
157  {
158  return true;
159  }
160 
161 private:
162 
167 };
168 
169 }
170 #endif
IntegralType
Specifies the two points between which a line integral is computed.
Definition: IntegralType.h:14
float * p
Definition: Tutorial_Map_using.cpp:9
Stores information about interactions between two interactable objects; often particles but could be ...
Definition: BaseInteraction.h:39
Definition: BaseParticle.h:33
A Base class for the fields.
Definition: BaseFields.h:22
Definition: GradVelocityField.h:22
void write(std::ostream &os) const
Writes class content into an output stream, typically a stat file.
Definition: GradVelocityField.cc:33
GradVelocityField & operator+=(const GradVelocityField &P)
Adds the field values on the RHS to the LHS of the equation.
Definition: GradVelocityField.cc:84
void output(std::ostream &os) const
Writes human-readable class content into an output stream, typically a stat file.
Definition: GradVelocityField.cc:44
GradVelocityField & operator/=(Mdouble a)
Divides the field values on the LHS by the RHS of the equation.
Definition: GradVelocityField.cc:124
void setZero()
Sets all fields to zero.
Definition: GradVelocityField.cc:52
Matrix3D dmomentum_
Definition: GradVelocityField.h:166
void setFields(const BaseInteraction &c, IntegralType type)
Definition: GradVelocityField.cc:177
void addContactPointStatistics(Mdouble phi, const GradVelocityField &currentInteraction)
This function should be called from within a loop over all Interactions to compute all the fields tha...
Definition: GradVelocityField.cc:156
void addParticleStatistics(Mdouble phi, const GradVelocityField &currentInteraction)
This function should be called from within a loop over all particles to compute all the fields that a...
Definition: GradVelocityField.cc:137
~GradVelocityField()=default
Destructor, it simply destructs the GradVelocityField and all the objects it contains.
void setCylindricalFields(const BaseInteraction &c, IntegralType type)
Definition: GradVelocityField.cc:187
static bool evaluateFixedParticles()
Definition: GradVelocityField.h:147
void addParticleDifferentialStatistics(Vec3D &dphi, const GradVelocityField &currentInteraction)
Definition: GradVelocityField.cc:160
GradVelocityField & operator=(const GradVelocityField &P)
Copies all field values.
Mdouble density_
Definition: GradVelocityField.h:163
GradVelocityField getSquared() const
Returns the square of all field values (to calculate standard deviation).
Definition: GradVelocityField.cc:63
static bool isDifferentialField()
Definition: GradVelocityField.h:156
GradVelocityField()
Default constructor, sets all field values to zero.
Definition: GradVelocityField.cc:11
GradVelocityField operator*(Mdouble a) const
Multiplies the field values on the left of the '*' by the scalar value on the right of the '*' and re...
Definition: GradVelocityField.cc:110
GradVelocityField(const GradVelocityField &P)=default
Default copy constructor, copies the values of all fields.
Matrix3D getDMomentum() const
Definition: GradVelocityField.h:142
GradVelocityField & operator-=(const GradVelocityField &P)
Subtracts the field values on the RHS from the LHS of the equation.
Definition: GradVelocityField.cc:97
Vec3D ddensity_
Definition: GradVelocityField.h:165
static void writeNames(std::ostream &os, unsigned countVariables)
Definition: GradVelocityField.cc:22
Vec3D getDDensity() const
Definition: GradVelocityField.h:137
void addInteractionStatistics(Mdouble psi, const GradVelocityField &currentInteraction)
This function should be called from within a loop over all Interactions to compute all the fields tha...
Definition: GradVelocityField.cc:147
Vec3D getMomentum() const
Definition: GradVelocityField.h:132
Vec3D momentum_
Definition: GradVelocityField.h:164
Mdouble getDensity() const
Definition: GradVelocityField.h:127
static bool doInteractionStatistics()
Returns true if the class contains fields that are defined as a sum over all Interactions (e....
Definition: GradVelocityField.cc:172
Implementation of a 3D matrix.
Definition: Kernel/Math/Matrix.h:17
Definition: Kernel/Math/Vector.h:30
const Scalar * a
Definition: level2_cplx_impl.h:32
Definition: BaseFields.h:14
double P
Uniform pressure.
Definition: TwenteMeshGluing.cpp:77
int c
Definition: calibrate.py:100
type
Definition: compute_granudrum_aor.py:141