47 tangentialSpringUnitTestProblem.
setName(
"TangentialSpringUnitTest");
53 species->setCollisionTimeAndRestitutionCoefficient(1
e-3, .2, 1. / 8);
54 species->setSlidingStiffness(species->getStiffness() * 2 / 7);
55 species->setSlidingFrictionCoefficient(1e20);
61 tangentialSpringUnitTestProblem.
setTimeMax(2.5);
64 tangentialSpringUnitTestProblem.
solve(argc, argv);
68 logger.assert_always(
p->getPosition().isEqualTo(
Vec3D(0.5, 0.5, 0.25), 1
e-7),
69 "First particles is in the wrong position. It is %",
p->getPosition());
70 logger.assert_always(
p->getVelocity().isEqualTo(
Vec3D(0.0, 0.0, 0.0), 1
e-7),
71 "First particle has the wrong velocity. It is %",
p->getVelocity());
75 Vec3D expectedPosition =
Vec3D(0.96152405440385, 0.5, 0.45015310115274);
76 logger.assert_always((
p->getPosition().isEqualTo(expectedPosition, 1
e-7)),
77 "Second particle has the wrong position. It is %g at time % (should be %g)",
p->getPosition(),
78 tangentialSpringUnitTestProblem.
getTime(), expectedPosition);
79 Vec3D expectedVelocity =
Vec3D(0.32586989790503, 0, -0.62325101431855);
80 logger.assert_always(
p->getVelocity().isEqualTo(expectedVelocity, 1
e-7),
81 "Second particle has the wrong velocity. It is %g (should be %g)",
p->getVelocity(), expectedVelocity);
82 Vec3D expectedAngularVelocity =
Vec3D(0.0, 2.118966061231, 0.0);
83 logger.assert_always(
p->getAngularVelocity().isEqualTo(expectedAngularVelocity, 1
e-7),
84 "Second particles has the wrong angular velocity. It is %g (should be %g)",
p->getAngularVelocity(), expectedAngularVelocity);
Array< double, 1, 3 > e(1./3., 0.5, 2.)
@ NO_FILE
file will not be created/read
Species< LinearViscoelasticNormalSpecies, SlidingFrictionSpecies > LinearViscoelasticSlidingFrictionSpecies
Definition: LinearViscoelasticSlidingFrictionSpecies.h:12
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
float * p
Definition: Tutorial_Map_using.cpp:9
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
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:621
Definition: BaseParticle.h:33
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 getTime() const
Returns the current simulation time.
Definition: DPMBase.cc:799
void setFileType(FileType fileType)
Sets File::fileType_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:437
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1443
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
void setGravity(Vec3D newGravity)
Sets a new value for the gravitational acceleration.
Definition: DPMBase.cc:1374
Definition: TangentialSpringUnitTest.cpp:14
Definition: Kernel/Math/Vector.h:30
const Mdouble pi
Definition: ExtendedMath.h:23