26 #ifndef MIXEDSPECIES_H
27 #define MIXEDSPECIES_H
41 template<
class NormalForceSpecies,
class FrictionForceSpecies = EmptyFrictionSpecies,
class AdhesiveForceSpecies = EmptyAdhesiveSpecies>
69 void read(std::istream& is)
final;
72 void write(std::ostream& os)
const final;
75 std::string
getName()
const final;
101 template<
class NormalForceSpecies,
class FrictionForceSpecies,
class AdhesiveForceSpecies>
105 logger(
DEBUG,
"MixedSpecies::MixedSpecies() finished");
108 template<
class NormalForceSpecies,
class FrictionForceSpecies,
class AdhesiveForceSpecies>
118 logger(
DEBUG,
"MixedSpecies::MixedSpecies(const MixedSpecies &p) finished");
121 template<
class NormalForceSpecies,
class FrictionForceSpecies,
class AdhesiveForceSpecies>
132 logger(
DEBUG,
"MixedSpecies::MixedSpecies(const MixedSpecies &p) finished");
135 template<
class NormalForceSpecies,
class FrictionForceSpecies,
class AdhesiveForceSpecies>
138 logger(
DEBUG,
"MixedSpecies::~MixedSpecies() finished");
142 template<
class NormalForceSpecies,
class FrictionForceSpecies,
class AdhesiveForceSpecies>
157 template<
class NormalForceSpecies,
class FrictionForceSpecies,
class AdhesiveForceSpecies>
163 logger(
WARN,
"Error in %::copyInto: cannot copy into a nullptr");
182 template<
class NormalForceSpecies,
class FrictionForceSpecies,
class AdhesiveForceSpecies>
190 NormalForceSpecies::write(os);
191 FrictionForceSpecies::write(os);
192 AdhesiveForceSpecies::write(os);
199 template<
class NormalForceSpecies,
class FrictionForceSpecies,
class AdhesiveForceSpecies>
205 unsigned int id, index;
207 is >> dummy >> index;
211 NormalForceSpecies::read(is);
212 FrictionForceSpecies::read(is);
213 AdhesiveForceSpecies::read(is);
230 template<
class NormalForceSpecies,
class FrictionForceSpecies,
class AdhesiveForceSpecies>
233 return NormalForceSpecies::getBaseName()
234 + FrictionForceSpecies::getBaseName()
235 + AdhesiveForceSpecies::getBaseName() +
"MixedSpecies";
246 template<
class NormalForceSpecies,
class FrictionForceSpecies,
class AdhesiveForceSpecies>
255 template<
class NormalForceSpecies,
class FrictionForceSpecies,
class AdhesiveForceSpecies>
262 template<
class NormalForceSpecies,
class FrictionForceSpecies,
class AdhesiveForceSpecies>
268 delete interactionDestroyer;
277 template<
class NormalForceSpecies,
class FrictionForceSpecies,
class AdhesiveForceSpecies>
280 return FrictionForceSpecies::getUseAngularDOFs();
289 template<
class NormalForceSpecies,
class FrictionForceSpecies,
class AdhesiveForceSpecies>
293 logger.assert_always(T!=
nullptr && S!=
nullptr,
"Arguments of mixAll cannot be null pointers");
301 logger.assert_always(TN!=
nullptr && TF!=
nullptr && TA!=
nullptr,
302 "Cannot mix two species of different type (% and %)",S->
getName(),T->
getName());
307 logger.assert_always(SN!=
nullptr && SF!=
nullptr && SA!=
nullptr,
308 "Cannot mix two species of different type (% and %)",S->
getName(),T->
getName());
310 NormalForceSpecies::mix(SN,TN);
311 FrictionForceSpecies::mix(SF,TF);
312 AdhesiveForceSpecies::mix(SA,TA);
std::string getName(int argc, char *argv[])
Definition: CombineParallelDataFiles.cpp:12
LL< Log::DEBUG > DEBUG
Debug information.
Definition: Logger.cc:58
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
Defines a short-range (non-contact) force parallel to the contact normal, usually adhesive.
void setBaseSpecies(BaseSpecies *baseSpecies)
Definition: BaseForce.h:40
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 getConstantRestitution() const
Definition: BaseNormalForce.h:46
virtual std::string getName() const =0
A purely virtual function.
unsigned int getId() const
Returns the unique identifier of any particular object.
Definition: BaseObject.h:125
unsigned int getIndex() const
Returns the index of the object in the handler.
Definition: BaseObject.h:118
void setIndex(unsigned int index)
Allows one to assign an index to an object in the handler/container.
Definition: BaseObject.cc:64
void setId(unsigned long id)
Assigns a unique identifier to each object in the handler (container) which remains constant even aft...
Definition: BaseObject.cc:72
BaseSpecies is the class from which all other species are derived.
Definition: BaseSpecies.h:50
BaseAdhesiveForce * adhesiveForce_
A pointer to the adhesive force parameters \detail This pointer is used by the Interaction's to get a...
Definition: BaseSpecies.h:187
void read(std::istream &is) override
Definition: BaseSpecies.cc:140
BaseNormalForce * getNormalForce() const
Definition: BaseSpecies.h:148
BaseFrictionForce * frictionForce_
A pointer to the friction force parameters \detail This pointer is used by the Interaction's to get a...
Definition: BaseSpecies.h:180
BaseNormalForce * normalForce_
A pointer to the normal force parameters \detail This pointer is used by the Interaction's to get a p...
Definition: BaseSpecies.h:173
void write(std::ostream &os) const override
Sets the boolean constantRestitution_.
Definition: BaseSpecies.cc:131
Defines a contact force orthogonal to the contact normal.
Contains information about the contact between two interactables, BaseInteraction::P_ and BaseInterac...
Definition: Interaction.h:116
Contains contact force properties for contacts between particles with two different species.
Definition: MixedSpecies.h:43
void deleteEmptyInteraction(BaseInteraction *interaction) const final
Definition: MixedSpecies.h:263
BaseInteraction * getNewInteraction(BaseInteractable *const P, BaseInteractable *const I, unsigned timeStamp) const final
When a contact between two particles is determined, an Interaction object is created,...
Definition: MixedSpecies.h:247
bool getUseAngularDOFs() const final
Returns true if torques have to be calculated.
Definition: MixedSpecies.h:278
std::string getName() const final
Returns the name of the MixedSpecies as it is used in the restart file.
Definition: MixedSpecies.h:231
BaseInteraction * getEmptyInteraction() const final
Definition: MixedSpecies.h:257
void mixAll(BaseSpecies *const S, BaseSpecies *const T) final
sets the MixedSpecies properties by mixing the properties of two particle species
Definition: MixedSpecies.h:290
MixedSpecies()
The default constructor.
Definition: MixedSpecies.h:102
MixedSpecies< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies > * copy() const final
Creates a deep copy of the MixedSpecies from which it is called.
Definition: MixedSpecies.h:145
virtual ~MixedSpecies()
The default destructor.
Definition: MixedSpecies.h:136
void read(std::istream &is) final
Reads the species properties from an input stream.
Definition: MixedSpecies.h:201
void write(std::ostream &os) const final
Writes the MixedSpecies properties to an output stream.
Definition: MixedSpecies.h:184
void copyInto(BaseSpecies *bs) const final
Copies the content of this into the species bs, if they are of the same type.
Definition: MixedSpecies.h:159
Defines a contact force parallel to the contact normal.
Contains material and contact force properties.
Definition: Species.h:35
double P
Uniform pressure.
Definition: TwenteMeshGluing.cpp:73