MercuryDPM  Trunk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OrientationField.h
Go to the documentation of this file.
1 //Copyright (c) 2013-2020, 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 MERCURY_ORIENTATIONFIELD_H
27 #define MERCURY_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 //MERCURY_ORIENTATIONFIELD_H
double Mdouble
Definition: GeneralDefine.h:34
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...
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...
Stores information about interactions between two interactable objects; often particles but could be ...
void output(std::ostream &os) const
Writes human-readable class content into an output stream, typically a stat file. ...
IntegralType
Specifies the two points between which a line integral is computed.
Definition: IntegralType.h:33
OrientationField & operator+=(const OrientationField &P)
Adds the field values on the RHS to the LHS of the equation.
OrientationField & operator-=(const OrientationField &P)
Subtracts the field values on the RHS from the LHS of the equation.
OrientationField getSquared() const
Returns the square of all field values (to calculate standard deviation).
void addParticleDifferentialStatistics(Vec3D &dphi, const OrientationField &currentInteraction)
OrientationField & operator=(const OrientationField &P)
Copies all field values.
void setZero()
Sets all fields to zero.
MatrixSymmetric3D orientation_
static bool doInteractionStatistics()
OrientationField & operator/=(Mdouble a)
Divides the field values on the LHS by the RHS of the equation.
MatrixSymmetric3D getOrientation() const
void setFields(const BaseInteraction &c, IntegralType type)
static bool evaluateFixedParticles()
Contains the computed field values, like density, momentum and stress.
Definition: Vector.h:49
void setCylindricalFields(const BaseInteraction &c, IntegralType type)
void setFields(const BaseParticle &p)
void addInteractionStatistics(Mdouble psi, const OrientationField &currentInteraction)
void write(std::ostream &os) const
Writes class content into an output stream, typically a stat file.
Implementation of a 3D symmetric matrix.
static void writeNames(std::ostream &os, unsigned countVariables)
void setCylindricalFields(const BaseParticle &p)
void addContactPointStatistics(Mdouble phi, const OrientationField &currentInteraction)