MercuryDPM  0.11
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
inclined_plane.cpp File Reference

Go to the source code of this file.

Classes

class  incl_plane
 

Functions

int main (int argc, char *argv[])
 

Function Documentation

int main ( int argc  ,
char *  argv[] 
)

Start off my solving the default problem

Definition at line 50 of file inclined_plane.cpp.

References BaseHandler< T >::copyAndAddObject(), BaseHandler< T >::getObject(), BaseInteractable::getVelocity(), DPMBase::particleHandler, constants::pi, DPMBase::setGravity(), Files::setName(), DPMBase::setParticleDimensions(), Files::setSaveCount(), DPMBase::setSystemDimensions(), DPMBase::setTimeMax(), DPMBase::setTimeStep(), DPMBase::setXMax(), DPMBase::setYMax(), DPMBase::setZMax(), DPMBase::solve(), DPMBase::speciesHandler, and DPMBase::write().

51 {
52  std::cout<<"Single particle rolling on a bottom plate"<<std::endl;
54  incl_plane problem;
55 
57  problem.setName("inclined_plane");
58  problem.setSaveCount(5000);
59  problem.setSystemDimensions(2);
60  problem.setParticleDimensions(3);
61  Mdouble theta = 15.0*constants::pi/180.0;
62  problem.setGravity(9.8*Vec3D(std::sin(theta),-std::cos(theta),0.0));
63  species->setDensity(2000);
64  species->setStiffness(10000);
65  species->setDissipation(0);
66  species->setSlidingStiffness(10000);
67  species->setSlidingDissipation(0);
68  species->setSlidingFrictionCoefficient(0.5);
69  //species->setRollingStiffness(10000);
70  //species->setRollingDissipation(0);
71  //species->setRollingFrictionCoefficient(0.5);
72  //tc=7e-5
73  problem.setTimeStep(2e-6);
74  problem.setTimeMax(1.0);
75  problem.setXMax(0.1);
76  problem.setYMax(0.1);
77  problem.setZMax(0.1);
78  problem.solve(argc, argv);
79  problem.write(std::cout, true);
80  std::cout << problem.particleHandler.getObject(0)->getVelocity() << std::endl;
81 
82 }
virtual void write(std::ostream &os, bool writeAllParticles=true) const
Loads all MD data and plots statistics for all timesteps in the .data file.
Definition: DPMBase.cc:1642
void setXMax(Mdouble newXMax)
If the length of the problem domain in x-direction is XMax - XMin, this method sets XMax...
Definition: DPMBase.cc:309
void solve()
The work horse of the code.
Definition: DPMBase.cc:1895
void setTimeMax(Mdouble newTMax)
Allows the upper time limit to be changed.
Definition: DPMBase.cc:179
double Mdouble
void setParticleDimensions(unsigned int particleDimensions)
Allows the dimension of the particle (f.e. for mass) to be changed. e.g. discs or spheres...
Definition: DPMBase.cc:474
void setZMax(Mdouble newZMax)
If the length of the problem domain in z-direction is XMax - XMin, this method sets ZMax...
Definition: DPMBase.cc:338
void setSystemDimensions(unsigned int newDim)
Allows for the dimension of the simulation to be changed.
Definition: DPMBase.cc:453
Species< LinearViscoelasticNormalSpecies, SlidingFrictionSpecies > LinearViscoelasticSlidingFrictionSpecies
void setGravity(Vec3D newGravity)
Allows to modify the gravity vector.
Definition: DPMBase.cc:431
void setYMax(Mdouble newYMax)
If the length of the problem domain in y-direction is YMax - YMin, this method sets YMax...
Definition: DPMBase.cc:324
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: Files.cc:149
U * copyAndAddObject(const U &O)
Creates a copy of a Object and adds it to the BaseHandler.
Definition: BaseHandler.h:268
const Mdouble pi
Definition: ExtendedMath.h:42
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created...
Definition: DPMBase.h:878
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:415
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: Files.cc:138
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. elastic, linear visco-elastic... et cetera...
Definition: DPMBase.h:868
void setTimeStep(Mdouble newDt)
Allows the time step dt to be changed.
Definition: DPMBase.cc:353
virtual const Vec3D & getVelocity() const
Returns the velocity of this interactable.
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45