62 int main(
int argc,
char* argv[])
103 problem.
solve(argc, argv);
@ NO_FILE
file will not be created/read
@ ONE_FILE
all data will be written into/ read from a single file called name_
LL< Log::INFO > INFO
Info log level.
Definition: Logger.cc:55
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
int main(int argc, char *argv[])
[T1:class]
Definition: Tutorial1_ParticleInOuterSpace.cpp:62
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
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:613
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
Definition: BaseInteractable.cc:350
virtual void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
Definition: BaseInteractable.h:239
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
Mdouble getXMax() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax.
Definition: DPMBase.h:626
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:408
File eneFile
An instance of class File to handle in- and output into a .ene file.
Definition: DPMBase.h:1488
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1427
File fStatFile
An instance of class File to handle in- and output into a .fstat file.
Definition: DPMBase.h:1483
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:422
File dataFile
An instance of class File to handle in- and output into a .data file.
Definition: DPMBase.h:1478
void setYMax(Mdouble newYMax)
Sets the value of YMax, the upper bound of the problem domain in the y-direction.
Definition: DPMBase.cc:1191
File restartFile
An instance of class File to handle in- and output into a .restart file.
Definition: DPMBase.h:1493
void setXBallsAdditionalArguments(std::string newXBArgs)
Set the additional arguments for xballs.
Definition: DPMBase.cc:1347
void setXMax(Mdouble newXMax)
Sets the value of XMax, the upper bound of the problem domain in the x-direction.
Definition: DPMBase.cc:1165
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1437
void setZMax(Mdouble newZMax)
Sets the value of ZMax, the upper bound of the problem domain in the z-direction.
Definition: DPMBase.cc:1217
Mdouble getYMax() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax.
Definition: DPMBase.h:638
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 setSystemDimensions(unsigned int newDim)
Sets the system dimensionality.
Definition: DPMBase.cc:1417
void solve()
The work horse of the code.
Definition: DPMBase.cc:4270
void setGravity(Vec3D newGravity)
Sets a new value for the gravitational acceleration.
Definition: DPMBase.cc:1383
Mdouble getZMax() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMax() returns ZMax.
Definition: DPMBase.h:650
void setFileType(FileType fileType)
Sets the type of file needed to write into or read from. File::fileType_.
Definition: File.cc:215
unsigned int getCounter() const
In case of multiple files, File::getCounter() returns the the number (FILE::Counter_) of the next fil...
Definition: File.cc:223
void setDissipation(Mdouble dissipation)
Allows the normal dissipation to be changed.
Definition: LinearViscoelasticNormalSpecies.cc:117
void setStiffness(Mdouble new_k)
Allows the spring constant to be changed.
Definition: LinearViscoelasticNormalSpecies.cc:93
This adds on the hierarchical grid code for 3D problems.
Definition: Mercury3D.h:37
void setDensity(Mdouble density)
Definition: ParticleSpecies.cc:108
A spherical particle is the most simple particle used in MercuryDPM.
Definition: SphericalParticle.h:37
[T1:headers]
Definition: Tutorial1_ParticleInOuterSpace.cpp:44
void setupInitialConditions() override
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: Tutorial1_ParticleInOuterSpace.cpp:48
66 int main(
int argc,
char* argv[])
101 problem.
solve(argc, argv);
int main(int argc, char *argv[])
[T3:class]
Definition: Tutorial3_BouncingBallElastic.cpp:66
void setSpecies(const ParticleSpecies *species)
Defines the species of the current wall.
Definition: BaseWall.cc:169
WallHandler wallHandler
An object of the class WallHandler. Contains pointers to all the walls created.
Definition: DPMBase.h:1447
void setParticlesWriteVTK(bool writeParticlesVTK)
Sets whether particles are written in a VTK file.
Definition: DPMBase.cc:942
Mdouble getZMin() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMin() returns ZMin.
Definition: DPMBase.h:644
A infinite wall fills the half-space {point: (position_-point)*normal_<=0}.
Definition: InfiniteWall.h:48
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...
Definition: InfiniteWall.cc:118
[T3:headers]
Definition: Tutorial3_BouncingBallElastic.cpp:44
void setupInitialConditions() override
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: Tutorial3_BouncingBallElastic.cpp:47
void setWriteVTK(FileType)
Sets whether walls are written into a VTK file.
Definition: WallHandler.cc:467
83 int main(
int argc,
char* argv[])
106 species0.setStiffness(259.018);
107 species0.setDissipation(0.0334);
108 species0.setSlidingStiffness(2.0 / 7.0 * species0.getStiffness());
109 species0.setRollingStiffness(2.0 / 5.0 * species0.getStiffness());
110 species0.setSlidingFrictionCoefficient(0.0);
111 species0.setRollingFrictionCoefficient(0.0);
118 species1.setStiffness(259.018);
119 species1.setDissipation(0.0334);
120 species1.setSlidingStiffness(2.0 / 7.0 * species1.getStiffness());
121 species1.setRollingStiffness(2.0 / 5.0 * species1.getStiffness());
122 species1.setSlidingFrictionCoefficient(0.5);
123 species1.setRollingFrictionCoefficient(0.0);
129 species01->setStiffness(259.018);
130 species01->setDissipation(0.0334);
131 species01->setSlidingStiffness(2.0 / 7.0 * species01->getStiffness());
132 species01->setRollingStiffness(2.0 / 5.0 * species01->getStiffness());
133 species01->setSlidingFrictionCoefficient(0.5);
134 species01->setRollingFrictionCoefficient(0.0);
140 species2.setStiffness(258.5);
141 species2.setDissipation(0.0);
142 species2.setSlidingStiffness(2.0 / 7.0 * species2.getStiffness());
143 species2.setRollingStiffness(2.0 / 5.0 * species2.getStiffness());
144 species2.setSlidingFrictionCoefficient(0.5);
145 species2.setRollingFrictionCoefficient(0.5);
151 species02->setStiffness(259.018);
152 species02->setDissipation(0.0334);
153 species02->setSlidingStiffness(2.0 / 7.0 * species02->getStiffness());
154 species02->setRollingStiffness(2.0 / 5.0 * species02->getStiffness());
155 species02->setSlidingFrictionCoefficient(0.5);
156 species02->setRollingFrictionCoefficient(0.5);
168 problem.
solve(argc, argv);
int main(int argc, char *argv[])
[T9:class]
Definition: Tutorial9_InclinedPlane.cpp:83
Mdouble getRadius() const
Returns the particle's radius.
Definition: BaseParticle.h:348
std::enable_if<!std::is_pointer< typename U::MixedSpeciesType >::value, typename U::MixedSpeciesType * >::type getMixedObject(const U *S, const U *T)
Definition: SpeciesHandler.h:74
[T9:headers]
Definition: Tutorial9_InclinedPlane.cpp:44
void setupInitialConditions() override
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: Tutorial9_InclinedPlane.cpp:47
const Mdouble pi
Definition: ExtendedMath.h:45
Mdouble cos(Mdouble x)
Definition: ExtendedMath.cc:64
Mdouble sin(Mdouble x)
Definition: ExtendedMath.cc:44
89 std::vector<Vec3D> points(3);
139 logger(
INFO,
"Shifting bottom wall downward");
154 int main(
int argc,
char *argv[])
165 HG.minParticleRadius = 6e-3;
166 HG.maxParticleRadius = 10e-3;
173 const Mdouble contractionWidth = 2.5e-2;
174 const Mdouble contractionHeight = 5e-2;
175 HG.contractionWidth = contractionWidth;
176 HG.contractionHeight = contractionHeight;
186 HG.speciesHandler.copyAndAddObject(species);
194 logger(
INFO,
"minParticleMass = %", minParticleMass);
200 logger(
INFO,
"restitution coefficient = %", r);
205 HG.setTimeStep(tc / 10.0);
207 HG.setSaveCount(500);
211 HG.solve(argc, argv);
double Mdouble
Definition: GeneralDefine.h:34
int main(int argc, char *argv[])
[T11:class]
Definition: Tutorial11_AxisymmetricWalls.cpp:154
Use AxisymmetricIntersectionOfWalls to Screw Screw::read Screw::read Screw::read define axisymmetric ...
Definition: AxisymmetricIntersectionOfWalls.h:126
void setAxis(Vec3D a)
Definition: AxisymmetricIntersectionOfWalls.cc:152
T * getLastObject()
Gets a pointer to the last Object in this BaseHandler.
Definition: BaseHandler.h:634
void setYMin(Mdouble newYMin)
Sets the value of YMin, the lower bound of the problem domain in the y-direction.
Definition: DPMBase.cc:1034
Mdouble getTimeStep() const
Returns the simulation time step.
Definition: DPMBase.cc:1250
Mdouble getTime() const
Returns the current simulation time.
Definition: DPMBase.cc:808
void setFileType(FileType fileType)
Sets File::fileType_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:459
void setZMin(Mdouble newZMin)
Sets the value of ZMin, the lower bound of the problem domain in the z-direction.
Definition: DPMBase.cc:1058
RNG random
This is a random generator, often used for setting up the initial conditions etc.....
Definition: DPMBase.h:1432
void setXMin(Mdouble newXMin)
Sets the value of XMin, the lower bound of the problem domain in the x-direction.
Definition: DPMBase.cc:1010
void createOpenPrism(std::vector< Vec3D > points, Vec3D prismAxis)
Creates an open prism which is a polygon between the points, except the first and last point,...
Definition: IntersectionOfWalls.cc:467
Mdouble getCollisionTime(Mdouble mass) const
Calculates collision time for two copies of a particle of given disp, k, mass.
Definition: LinearViscoelasticNormalSpecies.cc:137
Mdouble getRestitutionCoefficient(Mdouble mass) const
Calculates restitution coefficient for two copies of given disp, k, mass.
Definition: LinearViscoelasticNormalSpecies.cc:168
unsigned int getNumberOfObjects() const override
Returns the number of objects in the container. In parallel code this practice is forbidden to avoid ...
Definition: ParticleHandler.cc:1325
Mdouble getDensity() const
Allows density_ to be accessed.
Definition: ParticleSpecies.cc:118
Mdouble getRandomNumber()
This is a random generating routine can be used for initial positions.
Definition: RNG.cc:143
[T11:headers]
Definition: Tutorial11_AxisymmetricWalls.cpp:38
Tutorial11(const Mdouble width, const Mdouble height)
[T11:constructor]
Definition: Tutorial11_AxisymmetricWalls.cpp:41
Mdouble contractionHeight
Definition: Tutorial11_AxisymmetricWalls.cpp:146
Mdouble maxParticleRadius
Definition: Tutorial11_AxisymmetricWalls.cpp:148
void setupInitialConditions() override
[T11:constructor]
Definition: Tutorial11_AxisymmetricWalls.cpp:66
Mdouble minParticleRadius
Definition: Tutorial11_AxisymmetricWalls.cpp:147
void actionsAfterTimeStep() override
[T11:initialConditions]
Definition: Tutorial11_AxisymmetricWalls.cpp:136
Mdouble contractionWidth
[T11:functiontime]
Definition: Tutorial11_AxisymmetricWalls.cpp:145
Mdouble Y
Definition: Vector.h:66
Mdouble Z
Definition: Vector.h:66
Mdouble X
the vector components
Definition: Vector.h:66
T cubic(const T val)
calculates the cube of a number
Definition: ExtendedMath.h:115
#include <iostream>
{
}
int main()
[ChuteDemo:include]
Definition: ChuteDemo.cpp:34
void setHandler(SpeciesHandler *handler)
Sets the pointer to the handler to which this species belongs.
Definition: BaseSpecies.cc:91
Creates chutes with different bottoms. Inherits from Mercury3D (-> MercuryBase -> DPMBase).
Definition: Chute.h:65
void setInflowParticleRadius(Mdouble inflowParticleRadius)
Sets the radius of the inflow particles to a single one (i.e. ensures a monodisperse inflow).
Definition: Chute.cc:848
void setInflowVelocityVariance(Mdouble inflowVelocityVariance)
Sets the inflow velocity variance.
Definition: Chute.cc:1010
void setInflowVelocity(Mdouble inflowVelocity)
Sets the average inflow velocity.
Definition: Chute.cc:983
Mdouble getInflowParticleRadius() const
Returns the average radius of inflow particles.
Definition: Chute.cc:929
void setChuteAngle(Mdouble chuteAngle)
Sets gravity vector according to chute angle (in degrees)
Definition: Chute.cc:768
void setInflowHeight(Mdouble inflowHeight)
Sets maximum inflow height (Z-direction)
Definition: Chute.cc:957
void setFixedParticleRadius(Mdouble fixedParticleRadius)
Sets the particle radius of the fixed particles which constitute the (rough) chute bottom.
Definition: Chute.cc:653
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
Mdouble getMassFromRadius(Mdouble radius) const
Definition: ParticleSpecies.cc:123
45 bool isStrainRateControlled)
125 strainRate.
XX = -0.02;
126 strainRate.
YY = -0.02;
127 strainRate.
ZZ = -0.02;
132 gainFactor.
XY = 0.0001;
133 gainFactor.
XX = 0.0001;
134 gainFactor.
YY = 0.0001;
135 gainFactor.
ZZ = 0.0001;
139 bool isStrainRateControlled =
true;
145 dpm.setName(
"Tutorial_IsotropicCompression");
149 dpm.setSaveCount(100);
156 dpm.setParticlesWriteVTK(
true);
#define UNUSED
Definition: GeneralDefine.h:39
int main(int argc UNUSED, char *argv[] UNUSED)
[REV_ISO:class]
Definition: REVIsotropicCompressionDemo.cpp:114
void setHandler(BoundaryHandler *handler)
Sets the boundary's BoundaryHandler.
Definition: BaseBoundary.cc:134
virtual void clear()
Empties the whole BaseHandler by removing all Objects and setting all other variables to 0.
Definition: BaseHandler.h:528
unsigned int getSize() const
Gets the size of the particleHandler (including mpi and periodic particles)
Definition: BaseHandler.h:655
It's an insertion boundary which has cuboidal shape (yes, 'CuboidalInsertionBoundary' would have been...
Definition: CubeInsertionBoundary.h:42
void set(BaseParticle *particleToCopy, unsigned int maxFailed, Vec3D posMin, Vec3D posMax, Vec3D velMin={0, 0, 0}, Vec3D velMax={0, 0, 0})
Sets the properties of the InsertionBoundary for mutliple different particle types.
Definition: CubeInsertionBoundary.cc:107
Vec3D getMax() const
Definition: DPMBase.h:670
void setMin(const Vec3D &min)
Sets the minimum coordinates of the problem domain.
Definition: DPMBase.cc:1118
Vec3D getMin() const
Definition: DPMBase.h:664
void setMax(const Vec3D &max)
Sets the maximum coordinates of the problem domain.
Definition: DPMBase.cc:1082
void checkBoundaryBeforeTimeStep(DPMBase *md) override
Fills the boundary with particles.
Definition: InsertionBoundary.cc:184
void setInitialVolume(Mdouble initialVolume)
Gets the Volume which should be inserted by the insertion routine.
Definition: InsertionBoundary.cc:643
void setStiffnessAndRestitutionCoefficient(Mdouble k_, Mdouble eps, Mdouble mass)
Sets k, disp such that it matches a given tc and eps for a collision of two copies of P.
Definition: LinearViscoelasticNormalSpecies.cc:186
Implementation of a 3D matrix.
Definition: Matrix.h:38
Mdouble XY
Definition: Matrix.h:43
Mdouble YY
Definition: Matrix.h:43
Mdouble ZZ
Definition: Matrix.h:43
Mdouble XX
all nine matrix elements
Definition: Matrix.h:43
A cuboid box consists of periodic boundaries that can be strain/stress controlled and achieve differe...
Definition: StressStrainControlBoundary.h:55
void set(const Matrix3D &stressGoal, const Matrix3D &strainRate, const Matrix3D &gainFactor, bool isStrainRateControlled)
Sets all boundary inputs at once and determines which deformation mode it is, then combine the right ...
Definition: StressStrainControlBoundary.cc:310
[REV_ISO:headers]
Definition: REVIsotropicCompressionDemo.cpp:40
StressStrainControl(const Matrix3D &stressGoal, const Matrix3D &strainRate, const Matrix3D &gainFactor, bool isStrainRateControlled)
[REV_ISO:construct]
Definition: REVIsotropicCompressionDemo.cpp:44
bool isStrainRateControlled_
Definition: REVIsotropicCompressionDemo.cpp:107
Matrix3D strainRate_
Definition: REVIsotropicCompressionDemo.cpp:105
Matrix3D gainFactor_
Definition: REVIsotropicCompressionDemo.cpp:106
Matrix3D stressGoal_
[REV_ISO:setIni]
Definition: REVIsotropicCompressionDemo.cpp:104
void setupInitialConditions() override
[REV_ISO:construct]
Definition: REVIsotropicCompressionDemo.cpp:65
Mdouble log(Mdouble Power)
Definition: ExtendedMath.cc:104
T square(const T val)
squares a number
Definition: ExtendedMath.h:106