73 logger(
INFO,
"Test if the LinearViscoelasticReversibleAdhesiveInteraction conserves energy");
75 energyUnitTest.
setName(
"ReversibleAdhesiveEnergyUnitTest");
78 species1.setStiffness(500);
79 species1.setAdhesionStiffness(100);
80 species1.setAdhesionForceMax(10);
82 energyUnitTest.
setTimeStep(0.002 * species1.getCollisionTime(1.0));
87 energyUnitTest.
solve();
91 logger(
ERROR,
"energy loss is %, but should be %", lostEnergy, 0.0);
94 logger(
INFO,
"Test if the LinearViscoelasticIrreversibleAdhesiveInteraction looses the right amount of energy\n",
97 energyUnitTest2.
setName(
"IrreversibleAdhesiveEnergyUnitTest");
100 species2.setStiffness(500);
101 species2.setAdhesionStiffness(100);
102 species2.setAdhesionForceMax(10);
105 energyUnitTest2.
setTimeStep(0.0002 * species2.getCollisionTime(1.0));
110 energyUnitTest2.
solve();
121 logger(
ERROR,
"energy loss is %, but should be %", lostEnergy, 0.5);
double Mdouble
Definition: GeneralDefine.h:34
LL< Log::INFO > INFO
Info log level.
Definition: Logger.cc:55
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
LL< Log::ERROR > ERROR
Error log level.
Definition: Logger.cc:53
std::enable_if<!std::is_pointer< U >::value, U * >::type copyAndAddObject(const U &object)
Creates a copy of a Object and adds it to the BaseHandler.
Definition: BaseHandler.h:379
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:408
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1427
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:422
Mdouble getTimeStep() const
Returns the simulation time step.
Definition: DPMBase.cc:1250
Mdouble getKineticEnergy() const
Returns the global kinetic energy stored in the system.
Definition: DPMBase.cc:1544
void setTimeStep(Mdouble newDt)
Sets a new value for the simulation time step.
Definition: DPMBase.cc:1234
void setTimeMax(Mdouble newTMax)
Sets a new value for the maximum simulation duration.
Definition: DPMBase.cc:873
void solve()
The work horse of the code.
Definition: DPMBase.cc:4270
Mdouble getElasticEnergy() const
Returns the global elastic energy within the system.
Definition: DPMBase.cc:1530
Definition: EnergyUnitTest.cpp:39
void setDensity(Mdouble density)
Definition: ParticleSpecies.cc:108
Contains material and contact force properties.
Definition: Species.h:35
const Mdouble pi
Definition: ExtendedMath.h:45
T square(const T val)
squares a number
Definition: ExtendedMath.h:106
bool isEqual(Mdouble v1, Mdouble v2, Mdouble absError)
Compares the difference of two Mdouble with an absolute error, useful in UnitTests.
Definition: ExtendedMath.cc:251