48 unsigned int N1 =
static_cast<unsigned int>(pow(
N, 0.33)) + 1;
50 for (
unsigned int i = 0; i <
N; i++)
52 unsigned int ix =
static_cast<unsigned int>(i%N1);
53 unsigned int iz =
static_cast<unsigned int>(i/N1/N1);
54 unsigned int iy = (i - ix - N1 * N1 * iz) / N1;
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;
99 species->setDensity(2000);
100 species->setDissipation(0.005);
101 species->setStiffness(1e3);
107 problem.
setName(
"FreeCooling3DDemo");
119 std::cout <<
"Total time to run this simulation: " << time.
toc() <<
"s" << std::endl;
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...
void solve()
The work horse of the code.
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
void setTimeMax(Mdouble newTMax)
Allows the upper time limit to be changed.
Mdouble getZMax() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMax() returns ZMax...
Mdouble getXMin() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMin() returns XMin...
void setHGridUpdateEachTimeStep(bool updateEachTimeStep)
Sets whether or not the HGrid must be updated every time step.
Allows for timing the algorithms; accurate up to 0.01 sec.
int main(int argc UNUSED, char *argv[] UNUSED)
Mdouble getYMin() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMin() returns YMin...
void setZMax(Mdouble newZMax)
If the length of the problem domain in z-direction is XMax - XMin, this method sets ZMax...
void tic()
This is like a start button of a stopwatch. Assigns the variable start with the current number of clo...
void setSystemDimensions(unsigned int newDim)
Allows for the dimension of the simulation to be changed.
void setGravity(Vec3D newGravity)
Allows to modify the gravity vector.
void setRadius(const Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species) ...
Mdouble getXMax() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax...
void setYMax(Mdouble newYMax)
If the length of the problem domain in y-direction is YMax - YMin, this method sets YMax...
Mdouble toc()
This is like a stop button of a stopwatch. Assigns the variable finish to the current value of ticks ...
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
U * copyAndAddObject(const U &O)
Creates a copy of a Object and adds it to the BaseHandler.
virtual void addObject(ParticleSpecies *const S)
Adds a new ParticleSpecies to the SpeciesHandler.
This adds on the hierarchical grid code for 3D problems.
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created...
void setHGridCellOverSizeRatio(Mdouble cellOverSizeRatio)
Sets the ratio of the smallest cell over the smallest particle.
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Species< LinearViscoelasticNormalSpecies > LinearViscoelasticSpecies
void setHGridMaxLevels(unsigned int HGridMaxLevels)
Sets the maximum number of levels of the HGrid in this MercuryBase.
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. elastic, linear visco-elastic... et cetera...
todo{This code is not working as is wanted}
Mdouble getYMax() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax...
WallHandler wallHandler
An object of the class WallHandler. Contains pointers to all the walls created.
void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
void set(Vec3D normal, Vec3D point)
Defines a standard wall, given an outward normal vector s.t. normal*x=normal*point for all x of the w...
Mdouble getZMin() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMin() returns ZMin...
void setTimeStep(Mdouble newDt)
Allows the time step dt to be changed.
This is a class defining walls.
Implementation of a 3D vector (by Vitaliy).
void clear()
Empties the whole BaseHandler by removing all Objects and setting all other variables to 0...
void setupInitialConditions()
This function allows to set the initial conditions for our problem to be solved, by default particle ...