41 template<
class NormalForceSpecies,
class FrictionForceSpecies,
class AdhesiveForceSpecies>
114 template<
class NormalForceInteraction,
class FrictionForceInteraction=EmptyFrictionInteraction,
class AdhesiveForceInteraction=EmptyAdhesiveInteraction>
141 void read(std::istream& is)
final;
144 void write(std::ostream& os)
const final;
147 std::string
getName() const final;
171 void setMPIInteraction(
void* historyDataArray,
unsigned int index, const
bool resetPointers) final;
173 void getInteractionDetails(
void* interactionDataArray,
unsigned int index,
unsigned int& identificationP,
187 FrictionForceInteraction(
P, I, timeStamp), AdhesiveForceInteraction(
P, I, timeStamp)
189 #ifdef DEBUG_CONSTRUCTOR
190 std::cout<<
"Interaction::Interaction() finished"<<std::endl;
195 template<
class NormalForceInteraction,
class FrictionForceInteraction,
class AdhesiveForceInteraction>
199 #ifdef DEBUG_CONSTRUCTOR
200 std::cout<<
"Interaction::Interaction() finished"<<std::endl;
204 template<
class NormalForceInteraction,
class FrictionForceInteraction,
class AdhesiveForceInteraction>
209 #ifdef DEBUG_CONSTRUCTOR
210 std::cout<<
"Interaction::Interaction(const Interaction &p finished"<<std::endl;
214 template<
class NormalForceInteraction,
class FrictionForceInteraction,
class AdhesiveForceInteraction>
217 #ifdef DEBUG_DESTRUCTOR
218 std::cout<<
"Interaction::~Interaction() finished"<<std::endl;
225 template<
class NormalForceInteraction,
class FrictionForceInteraction,
class AdhesiveForceInteraction>
236 template<
class NormalForceInteraction,
class FrictionForceInteraction,
class AdhesiveForceInteraction>
240 NormalForceInteraction::write(os);
241 FrictionForceInteraction::write(os);
242 AdhesiveForceInteraction::write(os);
250 template<
class NormalForceInteraction,
class FrictionForceInteraction,
class AdhesiveForceInteraction>
253 NormalForceInteraction::read(is);
254 FrictionForceInteraction::read(is);
255 AdhesiveForceInteraction::read(is);
263 template<
class NormalForceInteraction,
class FrictionForceInteraction,
class AdhesiveForceInteraction>
266 NormalForceInteraction::reverseHistory();
267 FrictionForceInteraction::reverseHistory();
268 AdhesiveForceInteraction::reverseHistory();
271 template<
class NormalForceInteraction,
class FrictionForceInteraction,
class AdhesiveForceInteraction>
275 NormalForceInteraction::rotateHistory(rotationMatrix);
276 FrictionForceInteraction::rotateHistory(rotationMatrix);
277 AdhesiveForceInteraction::rotateHistory(rotationMatrix);
284 template<
class NormalForceInteraction,
class FrictionForceInteraction,
class AdhesiveForceInteraction>
287 return NormalForceInteraction::getBaseName() + FrictionForceInteraction::getBaseName() +
288 AdhesiveForceInteraction::getBaseName() +
"Interaction";
296 template<
class NormalForceInteraction,
class FrictionForceInteraction,
class AdhesiveForceInteraction>
300 FrictionForceInteraction::integrate(timeStep);
311 template<
class NormalForceInteraction,
class FrictionForceInteraction,
class AdhesiveForceInteraction>
314 NormalForceInteraction::computeNormalForce();
315 FrictionForceInteraction::computeFrictionForce();
316 AdhesiveForceInteraction::computeAdhesionForce();
325 template<
class NormalForceInteraction,
class FrictionForceInteraction,
class AdhesiveForceInteraction>
329 return NormalForceInteraction::getElasticEnergy() + FrictionForceInteraction::getElasticEnergy() +
330 AdhesiveForceInteraction::getElasticEnergy();
333 template<
class NormalForceInteraction,
class FrictionForceInteraction,
class AdhesiveForceInteraction>
336 AdhesiveForceInteraction::actionsAfterTimeStep();
342 template<
class NormalForceInteraction,
class FrictionForceInteraction,
class AdhesiveForceInteraction>
347 return NormalForceInteraction::getElasticEnergyAtEquilibrium(adhesiveForce);
351 template<
class NormalForceInteraction,
class FrictionForceInteraction,
class AdhesiveForceInteraction>
353 void* interactionDataArray,
unsigned int index)
const
360 array[index] = interactionData;
363 template<
class NormalForceInteraction,
class FrictionForceInteraction,
class AdhesiveForceInteraction>
365 void* interactionDataArray,
unsigned int index,
const bool resetPointers)
374 template<
class NormalForceInteraction,
class FrictionForceInteraction,
class AdhesiveForceInteraction>
376 void* interactionDataArray,
unsigned int index,
unsigned int& identificationP,
unsigned int& identificationI,
377 bool& isWallInteraction,
unsigned& timeStamp)
382 identificationP = interactionData.
P;
383 identificationI = interactionData.
I;
389 template<
class NormalForceInteraction,
class FrictionForceInteraction,
class AdhesiveForceInteraction>
392 unsigned int numberOfInteractions)
const
395 void* interactionArray =
static_cast<void*
>(array);
396 return interactionArray;
399 template<
class NormalForceInteraction,
class FrictionForceInteraction,
class AdhesiveForceInteraction>
408 template<
class NormalForceInteraction,
class FrictionForceInteraction,
class AdhesiveForceInteraction>
411 #ifdef MERCURYDPM_USE_MPI
double Mdouble
Definition: GeneralDefine.h:34
@ INTERACTION
Definition: MpiContainer.h:67
Defines the basic properties that a interactable object can have.
Definition: BaseInteractable.h:55
Stores information about interactions between two interactable objects; often particles but could be ...
Definition: BaseInteraction.h:60
bool isWallInteraction()
Definition: BaseInteraction.cc:955
Contains information about the contact between two interactables, BaseInteraction::P_ and BaseInterac...
Definition: Interaction.h:116
Interaction()
Empty constructor.
Definition: Interaction.h:196
void createMPIType() final
Definition: Interaction.h:409
void setMPIInteraction(void *historyDataArray, unsigned int index, const bool resetPointers) final
Definition: Interaction.h:364
void * createMPIInteractionDataArray(unsigned int numberOfInteractions) const final
Definition: Interaction.h:391
Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > * copy() const final
Creates a copy of this Interaction.
Definition: Interaction.h:227
void rotateHistory(Matrix3D &rotationMatrix) final
When periodic particles are used, some interactions need certain history properties rotated (e....
Definition: Interaction.h:272
void getMPIInteraction(void *historyDataArray, unsigned int index) const final
copies the history interactions into the data array
Definition: Interaction.h:352
std::string getName() const final
Returns the name of the Interaction.
Definition: Interaction.h:285
Mdouble getElasticEnergy() const final
Returns the elastic energy stored in the Interaction.
Definition: Interaction.h:327
void getInteractionDetails(void *interactionDataArray, unsigned int index, unsigned int &identificationP, unsigned int &identificationI, bool &isWallInteraction, unsigned &timeStamp)
Definition: Interaction.h:375
void read(std::istream &is) final
Read Interaction properties from a file.
Definition: Interaction.h:251
void computeInteraction()
Computes the interaction parameters based on the forces and torques.
void deleteMPIInteractionDataArray(void *dataArray) final
Definition: Interaction.h:401
void computeForce() final
Computes the normal, tangential, and adhesive forces.
Definition: Interaction.h:312
void reverseHistory() final
Reverses the parameters of the contact force.
Definition: Interaction.h:264
void integrate(Mdouble timeStep) final
Integrates the time-dependent parameters of the contact force.
Definition: Interaction.h:298
Mdouble getElasticEnergyAtEquilibrium(Mdouble adhesiveForce) const
returns the overlap at which the repulsive elastic force equals a given adhesive force; to be impleme...
Definition: Interaction.h:344
void actionsAfterTimeStep()
Definition: Interaction.h:334
void write(std::ostream &os) const final
Writes Interaction properties to a file.
Definition: Interaction.h:238
virtual ~Interaction()
The default destructor.
Definition: Interaction.h:215
This class contains all information and functions required for communication between processors.
Definition: MpiContainer.h:130
static MPIContainer & Instance()
fetch the instance to be used for communication
Definition: MpiContainer.h:134
void createMercuryMPIType(T t, MercuryMPIType type)
Get the communicator used for MPI commands.
Definition: MpiContainer.h:564
Definition: MPIInteraction.h:48
bool isWallInteraction
Definition: MPIInteraction.h:55
unsigned int P
Definition: MPIInteraction.h:52
unsigned timeStamp
Definition: MPIInteraction.h:56
void copyToInteraction(Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction, const bool resetPointers)
Definition: MPIInteraction.h:363
void copyFromInteraction(const Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > *interaction)
Definition: MPIInteraction.h:330
unsigned int I
Definition: MPIInteraction.h:53
Implementation of a 3D matrix.
Definition: Matrix.h:38
Contains material and contact force properties.
Definition: Species.h:35
double P
Uniform pressure.
Definition: TwenteMeshGluing.cpp:73