61 int main(
int argc,
char *argv[])
66 tangentialSpringUnitTestProblem.
setName(
"TangentialSpringUnitTest");
68 species->setCollisionTimeAndRestitutionCoefficient(1e-3,.2,1./8);
69 species->setSlidingStiffness(species->getStiffness()*2/7);
70 species->setSlidingFrictionCoefficient(1e20);
74 tangentialSpringUnitTestProblem.
setTimeMax(2.5);
75 tangentialSpringUnitTestProblem.
solve(argc,argv);
77 std::vector<BaseParticle*>::iterator pIt = tangentialSpringUnitTestProblem.
particleHandler.
begin();
79 if (!(*pIt)->getPosition().isEqualTo(
Vec3D(0.5,0.5,0.25), 1e-7))
logger(
FATAL,
"First particles is in the wrong position. It is %",(*pIt)->getPosition());
80 if (!(*pIt)->getVelocity().isEqualTo(
Vec3D(0.0,0.0,0.0) , 1e-7))
logger(
FATAL,
"First particle has the wrong velocity");
83 if (!((*pIt)->getPosition().isEqualTo(
Vec3D(0.961524052956078, 0.5, 0.450153103106219), 1e-7)))
logger(
FATAL,
"Second particle has the wrong position. It is % at time %",(*pIt)->getPosition(),tangentialSpringUnitTestProblem.
getTime());
84 if (!(*pIt)->getVelocity().isEqualTo(
Vec3D(0.325869890236916, 0, -0.623251003973752) , 1e-7))
logger(
FATAL,
"Second particle has the wrong velocity. It is %",(*pIt)->getVelocity());
85 if (!(*pIt)->getAngularVelocity().isEqualTo(
Vec3D(0.0,2.11896618998424,0.0) , 1e-7))
logger(
FATAL,
"Second particles has the wrong angular velocity. It is %", (*pIt)->getAngularVelocity());
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...
In this file, the rolling behaviour of the tangential spring is tested. This is done by placing one n...
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 setParticleDimensions(unsigned int particleDimensions)
Allows the dimension of the particle (f.e. for mass) to be changed. e.g. discs or spheres...
void setZMax(Mdouble newZMax)
If the length of the problem domain in z-direction is XMax - XMin, this method sets ZMax...
void setSystemDimensions(unsigned int newDim)
Allows for the dimension of the simulation to be changed.
Species< LinearViscoelasticNormalSpecies, SlidingFrictionSpecies > LinearViscoelasticSlidingFrictionSpecies
void setGravity(Vec3D newGravity)
Allows to modify the gravity vector.
void setRadius(const Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species) ...
const std::vector< T * >::const_iterator begin() const
Gets the begin of the const_iterator over all Object in this BaseHandler.
Logger< Log::ERROR > testLogger("Tangential Spring Unit Test")
void setYMax(Mdouble newYMax)
If the length of the problem domain in y-direction is YMax - YMin, this method sets YMax...
void setupInitialConditions()
This function allows to set the initial conditions for our problem to be solved, by default particle ...
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.
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created...
LL< Log::FATAL > FATAL
Fatal log level.
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. elastic, linear visco-elastic... et cetera...
void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
void setTimeStep(Mdouble newDt)
Allows the time step dt to be changed.
Implementation of a 3D vector (by Vitaliy).
Mdouble getTime() const
Access function for the time.
int main(int argc, char *argv[])
void fixParticle()
Fix Particle function. It fixes a Particle by setting its inverse mass and inertia and velocities to ...