26 #ifndef MPIINTERACTION_H
27 #define MPIINTERACTION_H
39 template<
class NormalForceSpecies,
class FrictionForceSpecies,
class AdhesiveForceSpecies>
46 template<
class NormalForceInteraction,
class FrictionForceInteraction,
class AdhesiveForceInteraction>
61 typename std::conditional<
63 std::is_base_of<SlidingFrictionInteraction, FrictionForceInteraction>::value,
Vec3D,
Empty>::type
67 typename std::conditional<
71 typename std::conditional<
76 typename std::conditional<
78 (std::is_base_of<LiquidMigrationWilletInteraction, AdhesiveForceInteraction>::value
79 || std::is_base_of<LiquidBridgeWilletInteraction, AdhesiveForceInteraction>::value
81 std::is_base_of<IrreversibleAdhesiveInteraction, AdhesiveForceInteraction>::value),
bool,
Empty>::type
wasInContact;
84 typename std::conditional<
86 std::is_base_of<BondedInteraction, AdhesiveForceInteraction>::value,
bool,
Empty>::type
bonded;
89 typename std::conditional<
94 typename std::conditional<
96 std::is_base_of<LinearPlasticViscoelasticInteraction, NormalForceInteraction>::value,
Mdouble,
Empty>::type
maxOverlap;
103 const bool resetPointers);
106 template<
class DUMMY= FrictionForceInteraction>
107 typename std::enable_if<std::is_base_of<SlidingFrictionInteraction, DUMMY>::value,
void>::type
111 slidingSpring = interaction->FrictionForceInteraction::getSlidingSpring();
115 template<
class DUMMY= FrictionForceInteraction>
116 typename std::enable_if<std::is_base_of<SlidingFrictionInteraction, DUMMY>::value,
void>::type
120 interaction->FrictionForceInteraction::setSlidingSpring(
slidingSpring);
124 template<
class DUMMY = FrictionForceInteraction>
125 typename std::enable_if<!(std::is_base_of<SlidingFrictionInteraction, DUMMY>::value),
void>::type
132 template<
class DUMMY = FrictionForceInteraction>
133 typename std::enable_if<!(std::is_base_of<SlidingFrictionInteraction, DUMMY>::value),
void>::type
141 template<
class DUMMY= FrictionForceInteraction>
142 typename std::enable_if<std::is_base_of<FrictionInteraction, DUMMY>::value,
void>::type
146 rollingSpring = interaction->FrictionForceInteraction::getRollingSpring();
147 torsionSpring = interaction->FrictionForceInteraction::getTorsionSpring();
151 template<
class DUMMY= FrictionForceInteraction>
152 typename std::enable_if<std::is_base_of<FrictionInteraction, DUMMY>::value,
void>::type
156 interaction->FrictionForceInteraction::setRollingSpring(
rollingSpring);
157 interaction->FrictionForceInteraction::setTorsionSpring(
torsionSpring);
161 template<
class DUMMY = FrictionForceInteraction>
162 typename std::enable_if<!(std::is_base_of<FrictionInteraction, DUMMY>::value),
void>::type
169 template<
class DUMMY = FrictionForceInteraction>
170 typename std::enable_if<!(std::is_base_of<FrictionInteraction, DUMMY>::value),
void>::type
177 template<
class DUMMY = AdhesiveForceInteraction>
178 typename std::enable_if<(
179 std::is_base_of<LiquidMigrationWilletInteraction, DUMMY>::value
180 || std::is_base_of<LiquidBridgeWilletInteraction, DUMMY>::value
181 || std::is_base_of<IrreversibleAdhesiveInteraction, DUMMY>::value),
void>::type
185 wasInContact = interaction->AdhesiveForceInteraction::getWasInContact();
189 template<
class DUMMY = AdhesiveForceInteraction>
190 typename std::enable_if<(
191 std::is_base_of<LiquidMigrationWilletInteraction, DUMMY>::value
192 || std::is_base_of<LiquidBridgeWilletInteraction, DUMMY>::value
193 || std::is_base_of<IrreversibleAdhesiveInteraction, DUMMY>::value),
void>::type
197 interaction->AdhesiveForceInteraction::setWasInContact(
wasInContact);
201 template<
class DUMMY = AdhesiveForceInteraction>
202 typename std::enable_if<!(
203 std::is_base_of<LiquidMigrationWilletInteraction, DUMMY>::value
204 || std::is_base_of<LiquidBridgeWilletInteraction, DUMMY>::value
205 || std::is_base_of<IrreversibleAdhesiveInteraction, DUMMY>::value),
void>::type
212 template<
class DUMMY = AdhesiveForceInteraction>
213 typename std::enable_if<!(
214 std::is_base_of<LiquidMigrationWilletInteraction, DUMMY>::value
215 || std::is_base_of<LiquidBridgeWilletInteraction, DUMMY>::value
216 || std::is_base_of<IrreversibleAdhesiveInteraction, DUMMY>::value),
void>::type
223 template<
class DUMMY = AdhesiveForceInteraction>
224 typename std::enable_if<(std::is_base_of<BondedInteraction, DUMMY>::value),
void>::type
228 bonded = interaction->AdhesiveForceInteraction::getBonded();
232 template<
class DUMMY = AdhesiveForceInteraction>
233 typename std::enable_if<(std::is_base_of<BondedInteraction, DUMMY>::value),
void>::type
236 interaction->AdhesiveForceInteraction::setBonded(
bonded);
240 template<
class DUMMY = AdhesiveForceInteraction>
241 typename std::enable_if<!(std::is_base_of<BondedInteraction, DUMMY>::value),
void>::type
248 template<
class DUMMY = AdhesiveForceInteraction>
249 typename std::enable_if<!(std::is_base_of<BondedInteraction, DUMMY>::value),
void>::type
255 template<
class DUMMY = AdhesiveForceInteraction>
256 typename std::enable_if<(std::is_base_of<LiquidMigrationWilletInteraction, DUMMY>::value),
void>::type
264 template<
class DUMMY = AdhesiveForceInteraction>
265 typename std::enable_if<(std::is_base_of<LiquidMigrationWilletInteraction, DUMMY>::value),
void>::type
273 template<
class DUMMY = AdhesiveForceInteraction>
274 typename std::enable_if<!(std::is_base_of<LiquidMigrationWilletInteraction, DUMMY>::value),
void>::type
281 template<
class DUMMY = AdhesiveForceInteraction>
282 typename std::enable_if<!(std::is_base_of<LiquidMigrationWilletInteraction, DUMMY>::value),
void>::type
289 template<
class DUMMY = NormalForceInteraction>
290 typename std::enable_if<(std::is_base_of<LinearPlasticViscoelasticInteraction, DUMMY>::value),
void>::type
294 maxOverlap = interaction->NormalForceInteraction::getMaxOverlap();
298 template<
class DUMMY = NormalForceInteraction>
299 typename std::enable_if<(std::is_base_of<LinearPlasticViscoelasticInteraction, DUMMY>::value),
void>::type
303 interaction->NormalForceInteraction::setMaxOverlap(
maxOverlap);
307 template<
class DUMMY = NormalForceInteraction>
308 typename std::enable_if<!(std::is_base_of<LinearPlasticViscoelasticInteraction, DUMMY>::value),
void>::type
315 template<
class DUMMY = NormalForceInteraction>
316 typename std::enable_if<!(std::is_base_of<LinearPlasticViscoelasticInteraction, DUMMY>::value),
void>::type
324 template<
class NormalForceInteraction,
class FrictionForceInteraction,
class AdhesiveForceInteraction>
329 template<
class NormalForceInteraction,
class FrictionForceInteraction,
class AdhesiveForceInteraction>
336 if (interaction->
getP() ==
nullptr)
logger(
WARN,
"P is not defined!!");
337 if (interaction->
getI() ==
nullptr)
logger(
WARN,
"I is not defined!!");
343 isWallInteraction =
true;
347 isWallInteraction =
false;
353 getSlidingSpring(interaction);
354 getFrictionSprings(interaction);
355 getWasInContact(interaction);
356 getBonded(interaction);
357 getLiquidBridge(interaction);
358 getMaximumOverlap(interaction);
362 template<
class NormalForceInteraction,
class FrictionForceInteraction,
class AdhesiveForceInteraction>
365 const bool resetPointers)
372 setSlidingSpring(interaction);
373 setFrictionSprings(interaction);
374 setWasInContact(interaction);
375 setBonded(interaction);
376 setLiquidBridge(interaction);
377 setMaximumOverlap(interaction);
double Mdouble
Definition: GeneralDefine.h:34
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
LL< Log::WARN > WARN
Warning log level.
Definition: Logger.cc:54
Stores information about interactions between two interactable objects; often particles but could be ...
Definition: BaseInteraction.h:60
void setBasicMPIInteractionValues(int P, int I, unsigned timeStamp, Vec3D force, Vec3D torque, bool isWallInteraction, bool resetPointers)
Definition: BaseInteraction.cc:961
const Vec3D & getForce() const
Gets the current force (vector) between the two interacting objects.
Definition: BaseInteraction.h:210
const Vec3D & getTorque() const
Gets the current torque (vector) between the two interacting objects.
Definition: BaseInteraction.h:218
Mdouble getTimeStamp() const
Returns an Mdouble which is the time stamp of the interaction.
Definition: BaseInteraction.h:319
BaseInteractable * getI()
Returns a pointer to the second object involved in the interaction (often a wall or a particle).
Definition: BaseInteraction.h:285
BaseInteractable * getP()
Returns a pointer to first object involved in the interaction (normally a particle).
Definition: BaseInteraction.h:274
unsigned int getId() const
Returns the unique identifier of any particular object.
Definition: BaseObject.h:125
Definition: BaseParticle.h:54
Data class to send an empty class over MPI.
Definition: MpiDataClass.h:131
Contains information about the contact between two interactables, BaseInteraction::P_ and BaseInterac...
Definition: Interaction.h:116
Definition: MPIInteraction.h:48
bool isWallInteraction
Definition: MPIInteraction.h:55
unsigned int P
Definition: MPIInteraction.h:52
std::enable_if<(std::is_base_of< BondedInteraction, DUMMY >::value), void >::type getBonded(const Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
Definition: MPIInteraction.h:225
std::enable_if< std::is_base_of< FrictionInteraction, DUMMY >::value, void >::type getFrictionSprings(const Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
Definition: MPIInteraction.h:143
unsigned timeStamp
Definition: MPIInteraction.h:56
Vec3D torque
Definition: MPIInteraction.h:58
std::enable_if<(std::is_base_of< LinearPlasticViscoelasticInteraction, DUMMY >::value), void >::type setMaximumOverlap(Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
Definition: MPIInteraction.h:300
std::enable_if< std::is_base_of< SlidingFrictionInteraction, DUMMY >::value, void >::type setSlidingSpring(Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
Definition: MPIInteraction.h:117
void copyToInteraction(Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction, const bool resetPointers)
Definition: MPIInteraction.h:363
std::enable_if<(std::is_base_of< BondedInteraction, DUMMY >::value), void >::type setBonded(Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
Definition: MPIInteraction.h:234
std::enable_if<(std::is_base_of< LiquidMigrationWilletInteraction, DUMMY >::value||std::is_base_of< LiquidBridgeWilletInteraction, DUMMY >::value||std::is_base_of< IrreversibleAdhesiveInteraction, DUMMY >::value), void >::type setWasInContact(Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
Definition: MPIInteraction.h:194
std::enable_if<!(std::is_base_of< LiquidMigrationWilletInteraction, DUMMY >::value), void >::type getLiquidBridge(const Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
Definition: MPIInteraction.h:275
std::conditional< std::is_base_of< FrictionInteraction, FrictionForceInteraction >::value, Vec3D, Empty >::type rollingSpring
Definition: MPIInteraction.h:69
std::enable_if<(std::is_base_of< LiquidMigrationWilletInteraction, DUMMY >::value), void >::type setLiquidBridge(Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
Definition: MPIInteraction.h:266
Vec3D force
Definition: MPIInteraction.h:57
std::enable_if<!(std::is_base_of< LinearPlasticViscoelasticInteraction, DUMMY >::value), void >::type getMaximumOverlap(const Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
Definition: MPIInteraction.h:309
std::enable_if<!(std::is_base_of< FrictionInteraction, DUMMY >::value), void >::type getFrictionSprings(const Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
Definition: MPIInteraction.h:163
std::enable_if<!(std::is_base_of< LinearPlasticViscoelasticInteraction, DUMMY >::value), void >::type setMaximumOverlap(Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
Definition: MPIInteraction.h:317
std::enable_if<!(std::is_base_of< FrictionInteraction, DUMMY >::value), void >::type setFrictionSprings(Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
Definition: MPIInteraction.h:171
std::conditional< std::is_base_of< FrictionInteraction, FrictionForceInteraction >::value, Vec3D, Empty >::type torsionSpring
Definition: MPIInteraction.h:73
std::enable_if<!(std::is_base_of< SlidingFrictionInteraction, DUMMY >::value), void >::type getSlidingSpring(const Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
Definition: MPIInteraction.h:126
std::conditional< std::is_base_of< SlidingFrictionInteraction, FrictionForceInteraction >::value, Vec3D, Empty >::type slidingSpring
Definition: MPIInteraction.h:64
std::conditional< std::is_base_of< BondedInteraction, AdhesiveForceInteraction >::value, bool, Empty >::type bonded
Definition: MPIInteraction.h:86
std::conditional<(std::is_base_of< LiquidMigrationWilletInteraction, AdhesiveForceInteraction >::value||std::is_base_of< LiquidBridgeWilletInteraction, AdhesiveForceInteraction >::value||std::is_base_of< IrreversibleAdhesiveInteraction, AdhesiveForceInteraction >::value), bool, Empty >::type wasInContact
Definition: MPIInteraction.h:81
void copyFromInteraction(const Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
Definition: MPIInteraction.h:330
std::enable_if<!(std::is_base_of< LiquidMigrationWilletInteraction, DUMMY >::value||std::is_base_of< LiquidBridgeWilletInteraction, DUMMY >::value||std::is_base_of< IrreversibleAdhesiveInteraction, DUMMY >::value), void >::type getWasInContact(const Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
Definition: MPIInteraction.h:206
unsigned int speciesId
Definition: MPIInteraction.h:54
std::enable_if< std::is_base_of< SlidingFrictionInteraction, DUMMY >::value, void >::type getSlidingSpring(const Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
Definition: MPIInteraction.h:108
std::conditional< std::is_base_of< LinearPlasticViscoelasticInteraction, NormalForceInteraction >::value, Mdouble, Empty >::type maxOverlap
Definition: MPIInteraction.h:96
std::enable_if<(std::is_base_of< LiquidMigrationWilletInteraction, DUMMY >::value||std::is_base_of< LiquidBridgeWilletInteraction, DUMMY >::value||std::is_base_of< IrreversibleAdhesiveInteraction, DUMMY >::value), void >::type getWasInContact(const Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
Definition: MPIInteraction.h:182
std::enable_if<(std::is_base_of< LinearPlasticViscoelasticInteraction, DUMMY >::value), void >::type getMaximumOverlap(const Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
Definition: MPIInteraction.h:291
std::enable_if<!(std::is_base_of< LiquidMigrationWilletInteraction, DUMMY >::value), void >::type setLiquidBridge(Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
Definition: MPIInteraction.h:283
std::enable_if< std::is_base_of< FrictionInteraction, DUMMY >::value, void >::type setFrictionSprings(Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
Definition: MPIInteraction.h:153
std::enable_if<!(std::is_base_of< LiquidMigrationWilletInteraction, DUMMY >::value||std::is_base_of< LiquidBridgeWilletInteraction, DUMMY >::value||std::is_base_of< IrreversibleAdhesiveInteraction, DUMMY >::value), void >::type setWasInContact(Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
Definition: MPIInteraction.h:217
unsigned int I
Definition: MPIInteraction.h:53
std::enable_if<(std::is_base_of< LiquidMigrationWilletInteraction, DUMMY >::value), void >::type getLiquidBridge(const Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
Definition: MPIInteraction.h:257
std::enable_if<!(std::is_base_of< BondedInteraction, DUMMY >::value), void >::type getBonded(const Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
Definition: MPIInteraction.h:242
MPIInteraction()
Definition: MPIInteraction.h:325
std::enable_if<!(std::is_base_of< SlidingFrictionInteraction, DUMMY >::value), void >::type setSlidingSpring(Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
Definition: MPIInteraction.h:134
std::conditional< std::is_base_of< LiquidMigrationWilletInteraction, AdhesiveForceInteraction >::value, Mdouble, Empty >::type liquidbridgeVolume
Definition: MPIInteraction.h:91
std::enable_if<!(std::is_base_of< BondedInteraction, DUMMY >::value), void >::type setBonded(Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
Definition: MPIInteraction.h:250
double P
Uniform pressure.
Definition: TwenteMeshGluing.cpp:73