HGridUpdateUnitTest.cpp File Reference
#include <iostream>
#include <Species/LinearViscoelasticSpecies.h>
#include "Chute.h"

Classes

class  DPM
 In this file a cubic packing of 5^3 particles in a tri-axial box is created and allowed to settle under small gravity. After that Z statistics are calculated. More...
 

Functions

int main ()
 

Function Documentation

◆ main()

int main ( )
71 {
72 
73  // Problem parameters
74  DPM problem;
76  problem.setHGridCellOverSizeRatio(2);
77  problem.setHGridUpdateEachTimeStep(false);
78  problem.setName("HGridUpdateUnitTest"); // data output file name
79  problem.setTimeStep(1e-4);
80  problem.setTimeMax(10);
81  problem.setDomain({0,0,0},{1,1,1});
82 
83  // Particle species
84  LinearViscoelasticSpecies species; // initialise species
85  species.setDensity(2000); // particle density
86  species.setCollisionTimeAndRestitutionCoefficient( 5e-3, 0.8, 1);
87  auto s = problem.speciesHandler.copyAndAddObject(species); // assign species to problem species handler
88 
89  SphericalParticle particle;
90  particle.setSpecies(s);
91  particle.setRadius(0.5);
92  particle.setVelocity({1,0,0});
93  auto p = problem.particleHandler.copyAndAddObject(particle);
94 
95  //logger(INFO,"Cell %",)
96 
97 
98  //solve
99  problem.solve();
100  problem.hGridInfo();
101  return 0;
102 }
@ NO_FILE
file will not be created/read
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:379
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
Definition: BaseInteractable.cc:350
virtual void setRadius(Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species)
Definition: BaseParticle.cc:553
void setSpecies(const ParticleSpecies *species)
Definition: BaseParticle.cc:818
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1427
void setDomain(const Vec3D &min, const Vec3D &max)
Sets the minimum coordinates of the problem domain.
Definition: DPMBase.cc:1098
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:422
void setFileType(FileType fileType)
Sets File::fileType_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:459
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1437
void setTimeStep(Mdouble newDt)
Sets a new value for the simulation time step.
Definition: DPMBase.cc:1234
void setTimeMax(Mdouble newTMax)
Sets a new value for the maximum simulation duration.
Definition: DPMBase.cc:873
void solve()
The work horse of the code.
Definition: DPMBase.cc:4270
In this file a cubic packing of 5^3 particles in a tri-axial box is created and allowed to settle und...
Definition: HGridUpdateUnitTest.cpp:30
void setCollisionTimeAndRestitutionCoefficient(Mdouble tc, Mdouble eps, BaseParticle *p)
Sets k, disp such that it matches a given tc and eps for a collision of two copies of particle p.
Definition: LinearViscoelasticNormalSpecies.cc:212
void hGridInfo(std::ostream &os=std::cout) const
Writes the info of the HGrid to the screen in a nice format.
Definition: MercuryBase.cc:655
void setHGridUpdateEachTimeStep(bool updateEachTimeStep)
Sets whether or not the HGrid must be updated every time step.
Definition: MercuryBase.cc:176
void setHGridCellOverSizeRatio(Mdouble cellOverSizeRatio)
Sets the ratio of the smallest cell over the smallest particle.
Definition: MercuryBase.cc:463
void setDensity(Mdouble density)
Definition: ParticleSpecies.cc:108
A spherical particle is the most simple particle used in MercuryDPM.
Definition: SphericalParticle.h:37

References BaseHandler< T >::copyAndAddObject(), MercuryBase::hGridInfo(), NO_FILE, DPMBase::particleHandler, LinearViscoelasticNormalSpecies::setCollisionTimeAndRestitutionCoefficient(), ParticleSpecies::setDensity(), DPMBase::setDomain(), DPMBase::setFileType(), MercuryBase::setHGridCellOverSizeRatio(), MercuryBase::setHGridUpdateEachTimeStep(), DPMBase::setName(), BaseParticle::setRadius(), BaseParticle::setSpecies(), DPMBase::setTimeMax(), DPMBase::setTimeStep(), BaseInteractable::setVelocity(), DPMBase::solve(), and DPMBase::speciesHandler.