MercuryDPM  0.11
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FreeCooling3DDemo.cpp File Reference
#include <iostream>
#include <Species/LinearViscoelasticSpecies.h>
#include "Mercury3D.h"
#include "Particles/BaseParticle.h"
#include "Walls/InfiniteWall.h"
#include "MercuryTime.h"

Go to the source code of this file.

Classes

class  FreeCooling3DDemoProblem
 todo{This code is not working as is wanted} More...
 

Functions

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

Function Documentation

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

Start off my solving the default problem

Definition at line 86 of file FreeCooling3DDemo.cpp.

References SpeciesHandler::addObject(), FreeCooling3DDemoProblem::N, DPMBase::setGravity(), MercuryBase::setHGridCellOverSizeRatio(), MercuryBase::setHGridMaxLevels(), MercuryBase::setHGridUpdateEachTimeStep(), Files::setName(), Files::setSaveCount(), DPMBase::setSystemDimensions(), DPMBase::setTimeMax(), DPMBase::setTimeStep(), DPMBase::setXMax(), DPMBase::setYMax(), DPMBase::setZMax(), DPMBase::solve(), DPMBase::speciesHandler, Time::tic(), and Time::toc().

87 {
88  std::cout << "In this file 10^3 particles with the same velocity are placed "
89  "in a tri-axial box. This makes them collide with the walls and eachother. "
90  "Afterwards the same run is performed with hgrid on. It tests the working "
91  "(and speedup) of the hgrid." << std::endl;
92 
93  Time time;
94  time.tic();
97  auto species = new LinearViscoelasticSpecies;
98  problem.speciesHandler.addObject(species);
99  species->setDensity(2000);
100  species->setDissipation(0.005);
101  species->setStiffness(1e3);
102 
103  problem.setXMax(0.1);
104  problem.setYMax(0.1);
105  problem.setZMax(0.1);
106  problem.N=1000;
107  problem.setName("FreeCooling3DDemo");
108  problem.setGravity(Vec3D(0.0,0.0,0.0));
109  problem.setTimeStep(5e-5);
110  problem.setSaveCount(4);
111  problem.setTimeMax(0.08);
112  problem.setSystemDimensions(3);
113 
114  problem.setHGridMaxLevels(1);
115  problem.setHGridCellOverSizeRatio(1.2);
116  problem.setHGridUpdateEachTimeStep(false);
117  problem.solve();
118 
119  std::cout << "Total time to run this simulation: " << time.toc() << "s" << std::endl;
120 }
unsigned int N
Number of particles in the system.
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
void setHGridUpdateEachTimeStep(bool updateEachTimeStep)
Sets whether or not the HGrid must be updated every time step.
Definition: MercuryBase.cc:172
Allows for timing the algorithms; accurate up to 0.01 sec.
Definition: MercuryTime.h:40
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 tic()
This is like a start button of a stopwatch. Assigns the variable start with the current number of clo...
Definition: MercuryTime.h:48
void setSystemDimensions(unsigned int newDim)
Allows for the dimension of the simulation to be changed.
Definition: DPMBase.cc:453
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
Mdouble toc()
This is like a stop button of a stopwatch. Assigns the variable finish to the current value of ticks ...
Definition: MercuryTime.h:58
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: Files.cc:149
virtual void addObject(ParticleSpecies *const S)
Adds a new ParticleSpecies to the SpeciesHandler.
void setHGridCellOverSizeRatio(Mdouble cellOverSizeRatio)
Sets the ratio of the smallest cell over the smallest particle.
Definition: MercuryBase.cc:487
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: Files.cc:138
Species< LinearViscoelasticNormalSpecies > LinearViscoelasticSpecies
void setHGridMaxLevels(unsigned int HGridMaxLevels)
Sets the maximum number of levels of the HGrid in this MercuryBase.
Definition: MercuryBase.cc:500
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. elastic, linear visco-elastic... et cetera...
Definition: DPMBase.h:868
todo{This code is not working as is wanted}
void setTimeStep(Mdouble newDt)
Allows the time step dt to be changed.
Definition: DPMBase.cc:353
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45