OrientationField.h
Go to the documentation of this file.
1 //Copyright (c) 2013-2023, The MercuryDPM Developers Team. All rights reserved.
2 //For the list of developers, see <http://www.MercuryDPM.org/Team>.
3 //
4 //Redistribution and use in source and binary forms, with or without
5 //modification, are permitted provided that the following conditions are met:
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above copyright
9 // notice, this list of conditions and the following disclaimer in the
10 // documentation and/or other materials provided with the distribution.
11 // * Neither the name MercuryDPM nor the
12 // names of its contributors may be used to endorse or promote products
13 // derived from this software without specific prior written permission.
14 //
15 //THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 //ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 //WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 //DISCLAIMED. IN NO EVENT SHALL THE MERCURYDPM DEVELOPERS TEAM BE LIABLE FOR ANY
19 //DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 //(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 //LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 //ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 //(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 //SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 
26 #ifndef MERCURYDPM_ORIENTATIONFIELD_H
27 #define MERCURYDPM_ORIENTATIONFIELD_H
28 
29 #include <Math/Matrix.h>
30 #include <Math/MatrixSymmetric.h>
32 #include <array>
33 
34 class BaseParticle;
35 
36 class BaseInteraction;
37 namespace CGFields
38 {
39 
52  {
53  public:
55 
56  OrientationField(const OrientationField& other) = default;
57 
58  ~OrientationField() = default;
59 
60  static void writeNames(std::ostream& os, unsigned countVariables);
61 
65  void write(std::ostream& os) const;
66 
70  void output(std::ostream& os) const;
71 
75  void setZero();
76 
81 
86 
91 
96 
101 
107 
113  void addParticleStatistics(Mdouble phi, const OrientationField& currentInteraction);
114 
115  void setFields(const BaseParticle& p);
116 
117  void setCylindricalFields(const BaseParticle& p);
118 
119 
121  {
122  return orientation_;
123  }
124 
125 
127  {
128  return false;
129  }
130 
132  {
133  return false;
134  }
135 
140  static bool isDifferentialField()
141  {
142  return false;
143  }
144 
146  {}
147 
149  {}
150 
151  void addParticleDifferentialStatistics(Vec3D& dphi, const OrientationField& currentInteraction)
152  {}
153 
154  void addInteractionStatistics(Mdouble psi, const OrientationField& currentInteraction)
155  {}
156 
157  void addContactPointStatistics(Mdouble phi, const OrientationField& currentInteraction)
158  {}
159 
160  private:
162  };
163 }
164 
165 #endif //MERCURYDPM_ORIENTATIONFIELD_H
IntegralType
Specifies the two points between which a line integral is computed.
Definition: IntegralType.h:34
Stores information about interactions between two interactable objects; often particles but could be ...
Definition: BaseInteraction.h:60
Definition: BaseParticle.h:54
Contains the computed field values, like density, momentum and stress.
Definition: OrientationField.h:52
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 a...
Definition: OrientationField.cc:92
void setFields(const BaseInteraction &c, IntegralType type)
Definition: OrientationField.h:145
static bool evaluateFixedParticles()
Definition: OrientationField.h:126
void addInteractionStatistics(Mdouble psi, const OrientationField &currentInteraction)
Definition: OrientationField.h:154
OrientationField & operator=(const OrientationField &P)
Copies all field values.
OrientationField(const OrientationField &other)=default
void setCylindricalFields(const BaseParticle &p)
Definition: OrientationField.cc:110
OrientationField & operator+=(const OrientationField &P)
Adds the field values on the RHS to the LHS of the equation.
Definition: OrientationField.cc:67
void addParticleDifferentialStatistics(Vec3D &dphi, const OrientationField &currentInteraction)
Definition: OrientationField.h:151
static bool isDifferentialField()
Definition: OrientationField.h:140
void setCylindricalFields(const BaseInteraction &c, IntegralType type)
Definition: OrientationField.h:148
static void writeNames(std::ostream &os, unsigned countVariables)
Definition: OrientationField.cc:38
static bool doInteractionStatistics()
Definition: OrientationField.h:131
void write(std::ostream &os) const
Writes class content into an output stream, typically a stat file.
Definition: OrientationField.cc:43
MatrixSymmetric3D getOrientation() const
Definition: OrientationField.h:120
void setFields(const BaseParticle &p)
Definition: OrientationField.cc:97
OrientationField getSquared() const
Returns the square of all field values (to calculate standard deviation).
Definition: OrientationField.cc:58
void setZero()
Sets all fields to zero.
Definition: OrientationField.cc:53
OrientationField & operator/=(Mdouble a)
Divides the field values on the LHS by the RHS of the equation.
Definition: OrientationField.cc:79
OrientationField 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: OrientationField.cc:85
void output(std::ostream &os) const
Writes human-readable class content into an output stream, typically a stat file.
Definition: OrientationField.cc:48
void addContactPointStatistics(Mdouble phi, const OrientationField &currentInteraction)
Definition: OrientationField.h:157
OrientationField()
Definition: OrientationField.cc:32
MatrixSymmetric3D orientation_
Definition: OrientationField.h:161
OrientationField & operator-=(const OrientationField &P)
Subtracts the field values on the RHS from the LHS of the equation.
Definition: OrientationField.cc:73
Implementation of a 3D symmetric matrix.
Definition: MatrixSymmetric.h:37
Definition: Vector.h:51
Definition: GradVelocityField.cc:30
double P
Uniform pressure.
Definition: TwenteMeshGluing.cpp:73