ConstantRestitutionSelfTest.cpp File Reference

Classes

struct  ConstantRestitutionSelfTest
 

Functions

int main ()
 

Function Documentation

◆ main()

int main ( )
21 {
23  dpm.setName("ConstantRestitutionSelfTest");
24  dpm.setSaveCount(2);
25 
27  species->setDensity(1000);
28  species->setConstantRestitution(true);
29  Mdouble radius = 2.5e-3;
30  const Mdouble stiffness = 24067/species->getMassFromRadius(radius);
31  //species->setPlasticParameters(0.2*stiffness, stiffness, 0.873*stiffness, 0.05);
32  species->setPlasticParameters(stiffness, stiffness, 0.0, 0.05);
33  species->setRestitutionCoefficient(0.45, 1.0);
34  dpm.setTimeStep(0.02*species->getCollisionTime(1.0));
35  dpm.setTimeMax(60.0*dpm.getTimeStep());
36 
37  radius = 1e-4;
38  Mdouble relativeVelocity = 1;
39 
40  SphericalParticle particle;
41  particle.setSpecies(species);
42  particle.setRadius(radius);
43  particle.setPosition(Vec3D(-radius,0,0));
44  particle.setVelocity(Vec3D(0.5*relativeVelocity,0,0));
45  auto particle1 = dpm.particleHandler.copyAndAddObject(particle);
46 
47  particle.setPosition(-particle.getPosition());
48  particle.setVelocity(-particle.getVelocity());
49  auto particle2 = dpm.particleHandler.copyAndAddObject(particle);
50 
51  dpm.setDomain(radius*Vec3D(-2,-1,-1),radius*Vec3D(2,1,1));
52 
53  dpm.solve();
54 
55  //Values that are now independent of the particle radius
56  logger(INFO,"Max. Overlap %",dpm.maxOverlap);
57  logger(INFO,"Collision time %",dpm.collisionTime);
58  logger(INFO,"Restitution %",particle2->getVelocity().X/relativeVelocity);
59  return 0;
60 }
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Species< LinearPlasticViscoelasticNormalSpecies > LinearPlasticViscoelasticSpecies
Definition: LinearPlasticViscoelasticSpecies.h:11
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
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
virtual const Vec3D & getVelocity() const
Returns the velocity of this interactable.
Definition: BaseInteractable.cc:307
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
Definition: BaseInteractable.cc:328
virtual void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
Definition: BaseInteractable.h:218
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
Definition: BaseInteractable.h:197
virtual void setRadius(Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species)
Definition: BaseParticle.cc:548
virtual void setSpecies(const ParticleSpecies *species)
Definition: BaseParticle.cc:798
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 setDomain(const Vec3D &min, const Vec3D &max)
Sets the minimum coordinates of the problem domain.
Definition: DPMBase.cc:1089
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
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
A spherical particle is the most simple particle used in MercuryDPM.
Definition: SphericalParticle.h:16
Definition: Kernel/Math/Vector.h:30
#define INFO(i)
Definition: mumps_solver.h:54
radius
Definition: UniformPSDSelfTest.py:15
Definition: ConstantRestitutionSelfTest.cpp:9
Mdouble maxOverlap
Definition: ConstantRestitutionSelfTest.cpp:17
Mdouble collisionTime
Definition: ConstantRestitutionSelfTest.cpp:16

References ConstantRestitutionSelfTest::collisionTime, BaseHandler< T >::copyAndAddObject(), e(), BaseInteractable::getPosition(), DPMBase::getTimeStep(), BaseInteractable::getVelocity(), INFO, logger, ConstantRestitutionSelfTest::maxOverlap, DPMBase::particleHandler, UniformPSDSelfTest::radius, DPMBase::setDomain(), DPMBase::setName(), BaseInteractable::setPosition(), BaseParticle::setRadius(), DPMBase::setSaveCount(), BaseParticle::setSpecies(), DPMBase::setTimeMax(), DPMBase::setTimeStep(), BaseInteractable::setVelocity(), DPMBase::solve(), and DPMBase::speciesHandler.