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!!");
338 P = interaction->getP()->getId();
339 I = interaction->getI()->getId();
341 if (dynamic_cast<const BaseParticle*>(interaction->getI()) ==
nullptr)
343 isWallInteraction =
true;
347 isWallInteraction =
false;
350 timeStamp = interaction->getTimeStamp();
351 force = interaction->getForce();
352 torque = interaction->getTorque();
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);
std::conditional< std::is_base_of< SlidingFrictionInteraction, FrictionForceInteraction >::value, Vec3D, Empty >::type slidingSpring
std::enable_if<(std::is_base_of< LiquidMigrationWilletInteraction, DUMMY >::value), void >::type setLiquidBridge(Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
std::conditional< std::is_base_of< LinearPlasticViscoelasticInteraction, NormalForceInteraction >::value, Mdouble, Empty >::type maxOverlap
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)
std::enable_if<!(std::is_base_of< LiquidMigrationWilletInteraction, DUMMY >::value), void >::type setLiquidBridge(Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here...
std::enable_if<!(std::is_base_of< BondedInteraction, DUMMY >::value), void >::type getBonded(const Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
std::enable_if<!(std::is_base_of< LinearPlasticViscoelasticInteraction, DUMMY >::value), void >::type setMaximumOverlap(Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
std::conditional< std::is_base_of< BondedInteraction, AdhesiveForceInteraction >::value, bool, Empty >::type bonded
std::enable_if<!(std::is_base_of< BondedInteraction, DUMMY >::value), void >::type setBonded(Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
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
Data class to send an empty class over MPI.
std::conditional< std::is_base_of< LiquidMigrationWilletInteraction, AdhesiveForceInteraction >::value, Mdouble, Empty >::type liquidbridgeVolume
std::enable_if<(std::is_base_of< BondedInteraction, DUMMY >::value), void >::type getBonded(const Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
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)
void copyFromInteraction(const Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
std::enable_if< std::is_base_of< FrictionInteraction, DUMMY >::value, void >::type setFrictionSprings(Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
Stores information about interactions between two interactable objects; often particles but could be ...
std::conditional< std::is_base_of< FrictionInteraction, FrictionForceInteraction >::value, Vec3D, Empty >::type torsionSpring
std::enable_if<(std::is_base_of< LinearPlasticViscoelasticInteraction, DUMMY >::value), void >::type getMaximumOverlap(const Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
std::enable_if<!(std::is_base_of< SlidingFrictionInteraction, DUMMY >::value), void >::type setSlidingSpring(Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
std::enable_if<!(std::is_base_of< FrictionInteraction, DUMMY >::value), void >::type setFrictionSprings(Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
std::enable_if< std::is_base_of< SlidingFrictionInteraction, DUMMY >::value, void >::type setSlidingSpring(Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
LL< Log::WARN > WARN
Warning log level.
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)
std::enable_if<(std::is_base_of< LiquidMigrationWilletInteraction, DUMMY >::value), void >::type getLiquidBridge(const Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
std::enable_if<(std::is_base_of< BondedInteraction, DUMMY >::value), void >::type setBonded(Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
void copyToInteraction(Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction, const bool resetPointers)
std::conditional< std::is_base_of< FrictionInteraction, FrictionForceInteraction >::value, Vec3D, Empty >::type rollingSpring
std::enable_if<!(std::is_base_of< SlidingFrictionInteraction, DUMMY >::value), void >::type getSlidingSpring(const Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
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)
std::enable_if<(std::is_base_of< LinearPlasticViscoelasticInteraction, DUMMY >::value), void >::type setMaximumOverlap(Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
std::enable_if<!(std::is_base_of< LinearPlasticViscoelasticInteraction, DUMMY >::value), void >::type getMaximumOverlap(const Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
std::enable_if< std::is_base_of< SlidingFrictionInteraction, DUMMY >::value, void >::type getSlidingSpring(const Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
std::enable_if< std::is_base_of< FrictionInteraction, DUMMY >::value, void >::type getFrictionSprings(const Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
std::enable_if<!(std::is_base_of< LiquidMigrationWilletInteraction, DUMMY >::value), void >::type getLiquidBridge(const Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
std::enable_if<!(std::is_base_of< FrictionInteraction, DUMMY >::value), void >::type getFrictionSprings(const Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
void setBasicMPIInteractionValues(int P, int I, unsigned timeStamp, Vec3D force, Vec3D torque, bool isWallInteraction, bool resetPointers)
Contains information about the contact between two interactables, BaseInteraction::P_ and BaseInterac...