92 for (
unsigned int i = 2; i <
N; i++)
110 return pow(
omega, rand);
114 return pow(rand * (pow(
omega, 1.0 +
alpha) - 1.0) + 1.0, 1.0 / (1.0 +
alpha));
128 denominator = log(
omega);
137 numerator = log(e) - log(s);
141 numerator = (pow(e, 4.0 +
alpha) - pow(s, 4.0 +
alpha)) / (4.0 +
alpha);
143 return numerator / denominator;
168 MD_problem.
omega = 40;
169 MD_problem.
alpha = -2;
174 MD_problem.
setName(
"HGridUnitTest_MD");
184 HGrid_problem1.
setName(
"HGridUnitTest_HGrid1");
190 HGrid_problem2.
setName(
"HGridUnitTest_HGrid2");
192 std::cout <<
"Solving the MD problem" << std::endl;
194 std::cout <<
"Solving the first HGrid problem" << std::endl;
195 HGrid_problem1.
solve();
196 std::cout <<
"Solving the second HGrid problem" << std::endl;
197 HGrid_problem2.
solve();
204 if (!(*mdIt)->getPosition().isEqualTo((*hGrid1It)->getPosition(),1e-10))
208 if (!(*mdIt)->getPosition().isEqualTo((*hGrid2It)->getPosition(), 1e-10))
void set(Vec3D normal, Mdouble distanceLeft, Mdouble distanceRight)
Defines a periodic wall.
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.
The DPMBase header includes quite a few header files, defining all the handlers, which are essential...
Mdouble X
the vector components
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
void setTimeMax(Mdouble newTMax)
Allows the upper time limit to be changed.
void setYMin(Mdouble newYMin)
If the length of the problem domain in y-direction is YMax - YMin, this method sets YMin...
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 setStorageCapacity(const unsigned int N)
Sets the storage capacity of this BaseHandler.
Mdouble getYMin() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMin() returns YMin...
const std::vector< T * >::const_iterator end() const
Gets the end of the const_iterator over all BaseBoundary in this BaseHandler.
void setParticleDimensions(unsigned int particleDimensions)
Allows the dimension of the particle (f.e. for mass) to be changed. e.g. discs or spheres...
void setZMax(Mdouble newZMax)
If the length of the problem domain in z-direction is XMax - XMin, this method sets ZMax...
int main(int argc UNUSED, char *argv[] UNUSED)
void setSystemDimensions(unsigned int newDim)
Allows for the dimension of the simulation to be changed.
void setRadius(const Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species) ...
double DistInt(double s, double e)
const std::vector< T * >::const_iterator begin() const
Gets the begin of the const_iterator over all Object in this BaseHandler.
Defines a pair of periodic walls. Inherits from BaseBoundary.
Mdouble getXMax() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax...
void clear()
Empties the whole ParticleHandler by removing all BaseParticle.
void setHGridMethod(HGridMethod hGridMethod)
Sets the HGridMethod to either BOTTOMUP or TOPDOWN.
void setYMax(Mdouble newYMax)
If the length of the problem domain in y-direction is YMax - YMin, this method sets YMax...
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.
BoundaryHandler boundaryHandler
An object of the class BoundaryHandler which concerns insertion and deletion of particles into or fro...
This adds on the hierarchical grid code for 3D problems.
void setXMin(Mdouble newXMin)
If the length of the problem domain in x-direction is XMax - XMin, this method sets XMin...
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created...
void setupInitialConditions()
This function allows to set the initial conditions for our problem to be solved, by default particle ...
void setDensity(Mdouble density)
Allows the density to be changed.
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Mdouble getRadius() const
Returns the particle's radius_.
void setZMin(Mdouble newZMin)
If the length of the problem domain in z-direction is ZMax - ZMin, this method sets ZMin...
Species< LinearViscoelasticNormalSpecies > LinearViscoelasticSpecies
void setHGridMaxLevels(unsigned int HGridMaxLevels)
Sets the maximum number of levels of the HGrid in this MercuryBase.
unsigned int getNumberOfObjects() const
Gets the number of Object in this BaseHandler.
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. elastic, linear visco-elastic... et cetera...
HGrid_demo(DPMBase &other)
Mdouble getYMax() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax...
RNG random
This is a random generator, often used for setting up the initial conditions etc...
void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
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.
Contains material and contact force properties.
Implementation of a 3D vector (by Vitaliy).
void setHGridDistribution(HGridDistribution hGridDistribution)
Sets how the sizes of the cells of different levels are distributed.
LinearViscoelasticSpecies * species
Mdouble getRandomNumber(Mdouble min, Mdouble max)
This is a random generating routine can be used for initial positions.
void clear()
Empties the whole BaseHandler by removing all Objects and setting all other variables to 0...