LiquidMigrationFields.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 #ifndef LiquidMigrationFields_H
26 #define LiquidMigrationFields_H
27 
28 #include <Math/Matrix.h>
29 #include <Math/MatrixSymmetric.h>
31 
32 class BaseParticle;
33 
34 class BaseInteraction;
35 
36 namespace CGFields
37 {
38 
39 
51 {
52 public:
53 
58 
63 
69 
70  static void writeNames(std::ostream& os, unsigned countVariables);
71 
75  void write(std::ostream& os) const;
76 
80  void output(std::ostream& os) const;
81 
85  void setZero();
86 
91 
96 
101 
106 
111 
117 
123  void addParticleStatistics(Mdouble phi, const LiquidMigrationFields& currentInteraction);
124 
125  void addParticleDifferentialStatistics(Vec3D& dphi, const LiquidMigrationFields& currentInteraction);
126 
132  void addInteractionStatistics(Mdouble psi, const LiquidMigrationFields& currentInteraction);
133 
139  void addContactPointStatistics(Mdouble phi, const LiquidMigrationFields& currentInteraction);
140 
141  void setFields(const BaseInteraction& c, IntegralType type);
142 
144 
145  void setFields(const BaseParticle& p);
146 
147  void setCylindricalFields(const BaseParticle& p);
148 
153  static bool doInteractionStatistics();
154 
156  {
157  return liquidBridgeVolume_;
158  }
159 
161  {
162  return liquidFilmVolume_;
163  }
164 
166  {
167  return true;
168  }
169 
174  static bool isDifferentialField()
175  {
176  return false;
177  }
178 
179 private:
180 
188 
196 };
197 
198 }
199 #endif
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: LiquidMigrationFields.h:51
LiquidMigrationFields & operator/=(Mdouble a)
Divides the field values on the LHS by the RHS of the equation.
Definition: LiquidMigrationFields.cc:131
Mdouble getLiquidBridgeVolume() const
Definition: LiquidMigrationFields.h:155
void addContactPointStatistics(Mdouble phi, const LiquidMigrationFields &currentInteraction)
This function should be called from within a loop over all Interactions to compute all the fields tha...
Definition: LiquidMigrationFields.cc:166
static bool doInteractionStatistics()
Returns true if the class contains fields that are defined as a sum over all Interactions (e....
Definition: LiquidMigrationFields.cc:171
LiquidMigrationFields(const LiquidMigrationFields &P)=default
Default copy constructor, copies the values of all fields.
void setFields(const BaseInteraction &c, IntegralType type)
Definition: LiquidMigrationFields.cc:176
static bool isDifferentialField()
Definition: LiquidMigrationFields.h:174
LiquidMigrationFields()
Default constructor, sets all field values to zero.
Definition: LiquidMigrationFields.cc:34
void setCylindricalFields(const BaseInteraction &c, IntegralType type)
Definition: LiquidMigrationFields.cc:211
LiquidMigrationFields & operator=(const LiquidMigrationFields &P)
Copies all field values.
void addParticleStatistics(Mdouble phi, const LiquidMigrationFields &currentInteraction)
This function should be called from within a loop over all particles to compute all the fields that a...
Definition: LiquidMigrationFields.cc:142
Mdouble getLiquidFilmVolume() const
Definition: LiquidMigrationFields.h:160
void addInteractionStatistics(Mdouble psi, const LiquidMigrationFields &currentInteraction)
This function should be called from within a loop over all Interactions to compute all the fields tha...
Definition: LiquidMigrationFields.cc:156
Mdouble liquidFilmVolume_
Definition: LiquidMigrationFields.h:195
void write(std::ostream &os) const
Writes class content into an output stream, typically a stat file.
Definition: LiquidMigrationFields.cc:54
void addParticleDifferentialStatistics(Vec3D &dphi, const LiquidMigrationFields &currentInteraction)
Definition: LiquidMigrationFields.cc:147
LiquidMigrationFields 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: LiquidMigrationFields.cc:119
LiquidMigrationFields & operator+=(const LiquidMigrationFields &P)
Adds the field values on the RHS to the LHS of the equation.
Definition: LiquidMigrationFields.cc:97
LiquidMigrationFields getSquared() const
Returns the square of all field values (to calculate standard deviation).
Definition: LiquidMigrationFields.cc:78
void output(std::ostream &os) const
Writes human-readable class content into an output stream, typically a stat file.
Definition: LiquidMigrationFields.cc:63
void setZero()
Sets all fields to zero.
Definition: LiquidMigrationFields.cc:69
static void writeNames(std::ostream &os, unsigned countVariables)
Definition: LiquidMigrationFields.cc:45
static bool evaluateFixedParticles()
Definition: LiquidMigrationFields.h:165
~LiquidMigrationFields()=default
Destructor, it simply destructs the LiquidMigrationFields and all the objects it contains.
LiquidMigrationFields & operator-=(const LiquidMigrationFields &P)
Subtracts the field values on the RHS from the LHS of the equation.
Definition: LiquidMigrationFields.cc:108
Mdouble liquidBridgeVolume_
Definition: LiquidMigrationFields.h:187
Definition: Vector.h:51
Definition: GradVelocityField.cc:30
double P
Uniform pressure.
Definition: TwenteMeshGluing.cpp:73