73 std::cout <<
"Test if the LinearViscoelasticReversibleAdhesiveInteraction conserves energy" << std::endl;
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 std::cout <<
"Test if the LinearViscoelasticIrreversibleAdhesiveInteraction looses the right amount of energy" << std::endl;
96 energyUnitTest2.
setName(
"IrreversibleAdhesiveEnergyUnitTest");
99 species2.setStiffness(500);
100 species2.setAdhesionStiffness(100);
101 species2.setAdhesionForceMax(10);
102 std::cout <<
"maxVelocity=" << species2.getMaximumVelocity(0.5, 1.0) << std::endl;
104 energyUnitTest2.
setTimeStep(0.0002 * species2.getCollisionTime(1.0));
105 std::cout <<
"timeStep=" << energyUnitTest2.
getTimeStep() << std::endl;
109 energyUnitTest2.
solve();
120 logger(
ERROR,
"energy loss is %, but should be %", lostEnergy, 0.5);
void solve()
The work horse of the code.
void setTimeMax(Mdouble newTMax)
Allows the upper time limit to be changed.
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
LL< Log::ERROR > ERROR
Error log level.
T square(T val)
squares a number
Mdouble getElasticEnergy() const
Returns the global elastic energy within the system.
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
U * copyAndAddObject(const U &O)
Creates a copy of a Object and adds it to the BaseHandler.
Mdouble getKineticEnergy() const
Returns the global kinetic energy stored in the system.
void setDensity(Mdouble density)
Allows the density to be changed.
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. elastic, linear visco-elastic... et cetera...
bool isEqual(Mdouble v1, Mdouble v2, double absError)
Compares the difference of two Mdouble with an absolute error, useful in UnitTests.
void setTimeStep(Mdouble newDt)
Allows the time step dt to be changed.
Contains material and contact force properties.
Mdouble getTimeStep() const
Allows the time step dt to be accessed.