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 setXMax(Mdouble newXMax)
If the length of the problem domain in x-direction is XMax - XMin, this method sets XMax...
void solve()
The work horse of the code.
The DPMBase header includes quite a few header files, defining all the handlers, which are essential...
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
void setTimeMax(Mdouble newTMax)
Allows the upper time limit to be changed.
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
void setYMin(Mdouble newYMin)
If the length of the problem domain in y-direction is YMax - YMin, this method sets YMin...
void setZMax(Mdouble newZMax)
If the length of the problem domain in z-direction is XMax - XMin, this method sets ZMax...
void setDimension(unsigned int newDim)
Sets the system and particle dimension.
void setFileType(FileType fileType)
Sets File::fileType_ for all files (ene, data, fstat, restart, stat)
void setGravity(Vec3D newGravity)
Allows to modify the gravity vector.
LL< Log::ERROR > ERROR
Error log level.
T square(T val)
squares a number
void setRadius(const Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species) ...
void clear()
Empties the whole ParticleHandler by removing all BaseParticle.
void setYMax(Mdouble newYMax)
If the length of the problem domain in y-direction is YMax - YMin, this method sets YMax...
Mdouble getElasticEnergy() const
Returns the global elastic energy within the system.
file will not be created/read
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.
void setXMin(Mdouble newXMin)
If the length of the problem domain in x-direction is XMax - XMin, this method sets XMin...
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created...
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)
void setZMin(Mdouble newZMin)
If the length of the problem domain in z-direction is ZMax - ZMin, this method sets ZMin...
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 setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
void setupInitialConditions()
This function allows to set the initial conditions for our problem to be solved, by default particle ...
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.
int main(int argc UNUSED, char *argv[] UNUSED)