52 logger(
INFO,
"Test if the LinearViscoelasticReversibleAdhesiveInteraction conserves energy");
54 energyUnitTest.
setName(
"ReversibleAdhesiveEnergyUnitTest");
57 species1.setStiffness(500);
58 species1.setAdhesionStiffness(100);
59 species1.setAdhesionForceMax(10);
61 energyUnitTest.
setTimeStep(0.002 * species1.getCollisionTime(1.0));
66 energyUnitTest.
solve();
70 logger(
ERROR,
"energy loss is %, but should be %", lostEnergy, 0.0);
73 logger(
INFO,
"Test if the LinearViscoelasticIrreversibleAdhesiveInteraction looses the right amount of energy\n",
76 energyUnitTest2.
setName(
"IrreversibleAdhesiveEnergyUnitTest");
79 species2.setStiffness(500);
80 species2.setAdhesionStiffness(100);
81 species2.setAdhesionForceMax(10);
84 energyUnitTest2.
setTimeStep(0.0002 * species2.getCollisionTime(1.0));
89 energyUnitTest2.
solve();
100 logger(
ERROR,
"energy loss is %, but should be %", lostEnergy, 0.5);
Array< double, 1, 3 > e(1./3., 0.5, 2.)
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:32
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:360
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:386
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1433
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:400
Mdouble getTimeStep() const
Returns the simulation time step.
Definition: DPMBase.cc:1241
Mdouble getKineticEnergy() const
Returns the global kinetic energy stored in the system.
Definition: DPMBase.cc:1535
void setTimeStep(Mdouble newDt)
Sets a new value for the simulation time step.
Definition: DPMBase.cc:1225
void setTimeMax(Mdouble newTMax)
Sets a new value for the maximum simulation duration.
Definition: DPMBase.cc:864
void solve()
The work horse of the code.
Definition: DPMBase.cc:4334
Mdouble getElasticEnergy() const
Returns the global elastic energy within the system.
Definition: DPMBase.cc:1521
Definition: EnergyUnitTest.cpp:18
void setDensity(Mdouble density)
Definition: ParticleSpecies.cc:88
Contains material and contact force properties.
Definition: Species.h:14
#define INFO(i)
Definition: mumps_solver.h:54
const Mdouble pi
Definition: ExtendedMath.h:23
T square(const T val)
squares a number
Definition: ExtendedMath.h:86
bool isEqual(Mdouble v1, Mdouble v2, Mdouble absError)
Compares the difference of two Mdouble with an absolute error, useful in UnitTests.
Definition: ExtendedMath.cc:230