35 p0.setPosition(
Vec3D(0.1 , 0.1, 0.1 ));
36 p0.setVelocity(
Vec3D(0.1, 0.0, 0.0));
45 int main(
int argc,
char* argv[])
69 problem.speciesHandler.copyAndAddObject(species);
90 problem.setParticlesWriteVTK(
true);
95 problem.setTimeStep(0.005 / 50.0);
@ NO_FILE
file will not be created/read
@ ONE_FILE
all data will be written into/ read from a single file called name_
Vector3f p0
Definition: MatrixBase_all.cpp:2
int main(int argc, char *argv[])
[T1:class]
Definition: Tutorial1_ParticleInOuterSpace.cpp:45
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:360
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:621
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1433
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1443
void setDissipation(Mdouble dissipation)
Allows the normal dissipation to be changed.
Definition: LinearViscoelasticNormalSpecies.cc:96
void setStiffness(Mdouble new_k)
Allows the spring constant to be changed.
Definition: LinearViscoelasticNormalSpecies.cc:72
This adds on the hierarchical grid code for 3D problems.
Definition: Mercury3D.h:16
void setDensity(Mdouble density)
Definition: ParticleSpecies.cc:88
A spherical particle is the most simple particle used in MercuryDPM.
Definition: SphericalParticle.h:16
[T1:headers]
Definition: Tutorial1_ParticleInOuterSpace.cpp:22
void setupInitialConditions() override
Use setupInitialConditions to define your particle and wall positions.
Definition: Tutorial1_ParticleInOuterSpace.cpp:27
Definition: Kernel/Math/Vector.h:30
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213
37 p0.setVelocity(
Vec3D(0.0, 0.0, 0.0));
54 int main(
int argc,
char* argv[])
79 double collisionTime = 0.005;
80 double restitution = 1.0;
92 problem.setParticlesWriteVTK(
true);
97 problem.setTimeStep(0.005 / 50.0);
Species< LinearViscoelasticNormalSpecies > LinearViscoelasticSpecies
Definition: LinearViscoelasticSpecies.h:11
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[])
[T3:class]
Definition: Tutorial3_BouncingBallElastic.cpp:54
void setSpecies(const ParticleSpecies *species)
Defines the species of the current wall.
Definition: BaseWall.cc:148
WallHandler wallHandler
An object of the class WallHandler. Contains pointers to all the walls created.
Definition: DPMBase.h:1453
Mdouble getZMin() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMin() returns ZMin.
Definition: DPMBase.h:628
A infinite wall fills the half-space {point: (position_-point)*normal_<=0}.
Definition: InfiniteWall.h:27
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:97
Mdouble getStiffness() const
Allows the spring constant to be accessed.
Definition: LinearViscoelasticNormalSpecies.cc:83
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:191
Mdouble getDissipation() const
Allows the normal dissipation to be accessed.
Definition: LinearViscoelasticNormalSpecies.cc:109
Mdouble getMassFromRadius(Mdouble radius) const
Definition: ParticleSpecies.cc:103
[T3:headers]
Definition: Tutorial3_BouncingBallElastic.cpp:26
void setupInitialConditions() override
Use setupInitialConditions to define your particle and wall positions.
Definition: Tutorial3_BouncingBallElastic.cpp:30
#define INFO(i)
Definition: mumps_solver.h:54
33 p0.setVelocity(
Vec3D(0.0, 0.0, 0.0));
40 p0.setVelocity(
Vec3D(0.0, 0.0, 0.0));
47 p0.setVelocity(
Vec3D(0.0, 0.0, 0.0));
62 int main(
int argc,
char* argv[])
93 auto ptrToSp0=
problem.speciesHandler.copyAndAddObject(species0);
104 auto ptrToSp1=
problem.speciesHandler.copyAndAddObject(species1);
108 auto species01 =
problem.speciesHandler.getMixedObject(ptrToSp0,ptrToSp1);
109 species01->setStiffness(259.018);
110 species01->setDissipation(0.0334);
111 species01->setSlidingStiffness(2.0 / 7.0 * species01->getStiffness());
112 species01->setRollingStiffness(2.0 / 5.0 * species01->getStiffness());
113 species01->setSlidingFrictionCoefficient(0.5);
114 species01->setRollingFrictionCoefficient(0.0);
125 auto ptrToSp2 =
problem.speciesHandler.copyAndAddObject(species2);
128 auto species02 =
problem.speciesHandler.getMixedObject(ptrToSp0, ptrToSp2);
129 species02->setStiffness(259.018);
130 species02->setDissipation(0.0334);
131 species02->setSlidingStiffness(2.0 / 7.0 * species02->getStiffness());
132 species02->setRollingStiffness(2.0 / 5.0 * species02->getStiffness());
133 species02->setSlidingFrictionCoefficient(0.5);
134 species02->setRollingFrictionCoefficient(0.5);
152 problem.setParticlesWriteVTK(
true);
157 problem.setTimeStep(0.005 / 50.0);
AnnoyingScalar cos(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:136
AnnoyingScalar sin(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:137
int main(int argc, char *argv[])
[T9:class]
Definition: Tutorial9_InclinedPlane.cpp:62
void setRollingFrictionCoefficient(Mdouble new_mu)
Allows the (dynamic) Coulomb friction coefficient to be changed; also sets mu_s by default.
Definition: FrictionSpecies.cc:165
void setRollingStiffness(Mdouble new_kt)
Allows the spring constant to be changed.
Definition: FrictionSpecies.cc:128
void setSlidingStiffness(Mdouble new_kt)
Allows the spring constant to be changed.
Definition: SlidingFrictionSpecies.cc:83
void setSlidingFrictionCoefficient(Mdouble new_mu)
Allows the (dynamic) Coulomb friction coefficient to be changed; also sets mu_s by default.
Definition: SlidingFrictionSpecies.cc:120
[T9:headers]
Definition: Tutorial9_InclinedPlane.cpp:23
void setupInitialConditions() override
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: Tutorial9_InclinedPlane.cpp:26
double angle(const double &t)
Angular position as a function of time t.
Definition: jeffery_orbit.cc:98
const Mdouble pi
Definition: ExtendedMath.h:23
78 std::vector<Vec3D> points(3);
113 z +
p0.getRadius()));
131 logger(
INFO,
"Shifting bottom wall downward");
146 int main(
int argc,
char *argv[])
157 HG.minParticleRadius = 6
e-3;
158 HG.maxParticleRadius = 10
e-3;
165 const Mdouble contractionWidth = 2.5e-2;
166 const Mdouble contractionHeight = 5
e-2;
167 HG.contractionWidth = contractionWidth;
168 HG.contractionHeight = contractionHeight;
178 HG.speciesHandler.copyAndAddObject(species);
186 logger(
INFO,
"minParticleMass = %", minParticleMass);
197 HG.setTimeStep(tc / 10.0);
199 HG.setSaveCount(500);
203 HG.solve(argc, argv);
Array< double, 1, 3 > e(1./3., 0.5, 2.)
double Mdouble
Definition: GeneralDefine.h:13
int main(int argc, char *argv[])
[T11:class]
Definition: Tutorial11_AxisymmetricWalls.cpp:146
Use AxisymmetricIntersectionOfWalls to Screw Screw::read Screw::read Screw::read define axisymmetric ...
Definition: AxisymmetricIntersectionOfWalls.h:105
void setAxis(Vec3D a)
Definition: AxisymmetricIntersectionOfWalls.cc:149
void setDisplayedSegments(const std::vector< Mdouble > &displayedSegments)
Sets the displayed segments.
Definition: AxisymmetricIntersectionOfWalls.h:189
T * getLastObject()
Gets a pointer to the last Object in this BaseHandler.
Definition: BaseHandler.h:642
virtual void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
Definition: BaseInteractable.h:218
File eneFile
An instance of class File to handle in- and output into a .ene file.
Definition: DPMBase.h:1494
File fStatFile
An instance of class File to handle in- and output into a .fstat file.
Definition: DPMBase.h:1489
void setYMin(Mdouble newYMin)
Sets the value of YMin, the lower bound of the problem domain in the y-direction.
Definition: DPMBase.cc:1025
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:400
Mdouble getTimeStep() const
Returns the simulation time step.
Definition: DPMBase.cc:1241
Mdouble getTime() const
Returns the current simulation time.
Definition: DPMBase.cc:799
void setYMax(Mdouble newYMax)
Sets the value of YMax, the upper bound of the problem domain in the y-direction.
Definition: DPMBase.cc:1182
void setFileType(FileType fileType)
Sets File::fileType_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:437
void setZMin(Mdouble newZMin)
Sets the value of ZMin, the lower bound of the problem domain in the z-direction.
Definition: DPMBase.cc:1049
File restartFile
An instance of class File to handle in- and output into a .restart file.
Definition: DPMBase.h:1499
void setXBallsAdditionalArguments(std::string newXBArgs)
Set the additional arguments for xballs.
Definition: DPMBase.cc:1338
void setXMax(Mdouble newXMax)
Sets the value of XMax, the upper bound of the problem domain in the x-direction.
Definition: DPMBase.cc:1156
void setZMax(Mdouble newZMax)
Sets the value of ZMax, the upper bound of the problem domain in the z-direction.
Definition: DPMBase.cc:1208
void setParticlesWriteVTK(bool writeParticlesVTK)
Sets whether particles are written in a VTK file.
Definition: DPMBase.cc:933
RNG random
This is a random generator, often used for setting up the initial conditions etc.....
Definition: DPMBase.h:1438
void setXMin(Mdouble newXMin)
Sets the value of XMin, the lower bound of the problem domain in the x-direction.
Definition: DPMBase.cc:1001
void setGravity(Vec3D newGravity)
Sets a new value for the gravitational acceleration.
Definition: DPMBase.cc:1374
void setFileType(FileType fileType)
Sets the type of file needed to write into or read from. File::fileType_.
Definition: File.cc:193
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:446
Mdouble getCollisionTime(Mdouble mass) const
Calculates collision time for two copies of a particle of given disp, k, mass.
Definition: LinearViscoelasticNormalSpecies.cc:116
Mdouble getRestitutionCoefficient(Mdouble mass) const
Calculates restitution coefficient for two copies of given disp, k, mass.
Definition: LinearViscoelasticNormalSpecies.cc:147
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:1323
Mdouble getDensity() const
Allows density_ to be accessed.
Definition: ParticleSpecies.cc:98
Mdouble getRandomNumber()
This is a random generating routine can be used for initial positions.
Definition: RNG.cc:123
[T11:headers]
Definition: Tutorial11_AxisymmetricWalls.cpp:24
Tutorial11(const Mdouble width, const Mdouble height)
[T11:constructor]
Definition: Tutorial11_AxisymmetricWalls.cpp:27
Mdouble contractionHeight
Definition: Tutorial11_AxisymmetricWalls.cpp:138
Mdouble maxParticleRadius
Definition: Tutorial11_AxisymmetricWalls.cpp:140
void setupInitialConditions() override
[T11:constructor]
Definition: Tutorial11_AxisymmetricWalls.cpp:52
Mdouble minParticleRadius
Definition: Tutorial11_AxisymmetricWalls.cpp:139
void actionsAfterTimeStep() override
[T11:initialConditions]
Definition: Tutorial11_AxisymmetricWalls.cpp:128
Mdouble contractionWidth
[T11:functiontime]
Definition: Tutorial11_AxisymmetricWalls.cpp:137
Mdouble Y
Definition: Kernel/Math/Vector.h:45
Mdouble Z
Definition: Kernel/Math/Vector.h:45
Mdouble X
the vector components
Definition: Kernel/Math/Vector.h:45
void setWriteVTK(FileType)
Sets whether walls are written into a VTK file.
Definition: WallHandler.cc:445
@ N
Definition: constructor.cpp:22
StridedVectorType vx(make_vector(x, *n, std::abs(*incx)))
double height(const double &x)
Height of domain.
Definition: simple_spine_channel.cc:429
int c
Definition: calibrate.py:100
const Mdouble inf
Definition: GeneralDefine.h:23
Mdouble cos(Mdouble x)
Definition: ExtendedMath.cc:43
Mdouble sin(Mdouble x)
Definition: ExtendedMath.cc:23
T cubic(const T val)
calculates the cube of a number
Definition: ExtendedMath.h:95
void set(Container &c, Position position, const Value &value)
Definition: stdlist_overload.cpp:36
70 p0.setVelocity(
Vec3D(0.0, 0.0, 0.0));
94 for (
unsigned int i = 0;
i <
Nx;
i++)
96 for (
unsigned int j = 0;
j <
Ny;
j++)
98 for (
unsigned int k = 0;
k <
Nz;
k++)
103 if (!pCoil->getDistanceAndNormal(
p0, distance,
normal))
109 logger(
DEBUG,
"particle at position % could not be inserted",
p0.getPosition());
145 problem.setName(
"CoilSelfTest");
146 problem.setSystemDimensions(3);
163 Mdouble restitutionCoefficient = 0.8;
167 problem.speciesHandler.copyAndAddObject(species);
171 problem.setTimeStep(0.02 * 0.05);
int i
Definition: BiCGSTAB_step_by_step.cpp:9
int main(int argc UNUSED, char *argv[] UNUSED)
[CST:class]
Definition: CoilSelfTest.cpp:137
#define UNUSED
Definition: GeneralDefine.h:18
RowVector3d w
Definition: Matrix_resize_int.cpp:3
[CST:headers]
Definition: CoilSelfTest.cpp:22
Coil * coil
[CST:beforetime]
Definition: CoilSelfTest.cpp:130
Mdouble particleRadius
Definition: CoilSelfTest.cpp:131
void actionsBeforeTimeStep() override
Definition: CoilSelfTest.cpp:118
void setupInitialConditions() override
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: CoilSelfTest.cpp:24
This class defines a coil in the z-direction from a (constant) starting point, a (constant) length L,...
Definition: Coil.h:20
void set(Vec3D Start, Mdouble length, Mdouble radius, Mdouble numberOfRevelations, Mdouble omega, Mdouble thickness)
Set all parameters of this Coil.
Definition: Coil.cc:81
void move_time(Mdouble dt)
Rotate the Coil for a period dt, so that the offset_ changes with omega_*dt.
Definition: Coil.cc:193
EIGEN_DEVICE_FUNC const GlobalUnaryPowReturnType< Derived, ScalarExponent > pow(const Eigen::ArrayBase< Derived > &x, const ScalarExponent &exponent)
Definition: GlobalFunctions.h:137
Definition: InfiniteWallWithHole.h:17
void set(Vec3D normal, Mdouble position, Mdouble holeRadius)
Defines a standard wall, given an outward normal vector s. t. normal*x=position.
Definition: InfiniteWallWithHole.cc:51
void clear() override
Empties the whole ParticleHandler by removing all BaseParticle.
Definition: ParticleHandler.cc:971
char char char int int * k
Definition: level2_impl.h:374
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 floor(const bfloat16 &a)
Definition: BFloat16.h:643
unsigned Nx
Number of elements in each direction (used by SimpleCubicMesh)
Definition: structured_cubic_point_source.cc:114
unsigned Ny
Definition: structured_cubic_point_source.cc:115
unsigned Nz
Number of elements in z-direction.
Definition: axisym_linear_elasticity/cylinder/cylinder.cc:62
void normal(const Vector< double > &x, Vector< double > &normal)
Definition: free_surface_rotation.cc:65
unsigned int getSaveCountFromNumberOfSavesAndTimeMaxAndTimeStep(unsigned int numberOfSaves, Mdouble timeMax, Mdouble timeStep)
Returns the correct saveCount if the total number of saves, the final time and the time step is known...
Definition: FormulaHelpers.cc:75
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2
21 logger(
INFO,
"\nDemo of the chute flow with a rough bottom");
24 Chute roughBottomSelfTest;
25 roughBottomSelfTest.
setName(
"roughBottomMultiLayer");
52 roughBottomSelfTest.
solve();
@ MULTILAYER
Definition: Chute.h:32
void setChuteWidth(Mdouble chuteWidth)
Sets the chute width (Y-direction)
Definition: Chute.cc:1018
void setInflowParticleRadius(Mdouble inflowParticleRadius)
Sets the radius of the inflow particles to a single one (i.e. ensures a monodisperse inflow).
Definition: Chute.cc:827
void setRoughBottomType(RoughBottomType roughBottomType)
Sets the type of rough bottom of the chute.
Definition: Chute.cc:693
virtual void setChuteLength(Mdouble chuteLength)
Sets the chute length (X-direction)
Definition: Chute.cc:1038
void setChuteAngleAndMagnitudeOfGravity(Mdouble chuteAngle, Mdouble gravity)
Sets gravity vector according to chute angle (in degrees)
Definition: Chute.cc:768
void setFixedParticleRadius(Mdouble fixedParticleRadius)
Sets the particle radius of the fixed particles which constitute the (rough) chute bottom.
Definition: Chute.cc:632
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:386
void setTimeStep(Mdouble newDt)
Sets a new value for the simulation time step.
Definition: DPMBase.cc:1225
void setTimeMax(Mdouble newTMax)
Sets a new value for the maximum simulation duration.
Definition: DPMBase.cc:864
int main()
[RB:headers]
Definition: roughBottomSelfTest.cpp:18
25 bool isStrainRateControlled)
64 particle.setRadius(
radius);
106 strainRate.
XX = -0.02;
107 strainRate.
YY = -0.02;
108 strainRate.
ZZ = -0.02;
113 gainFactor.
XY = 0.0001;
114 gainFactor.
XX = 0.0001;
115 gainFactor.
YY = 0.0001;
116 gainFactor.
ZZ = 0.0001;
120 bool isStrainRateControlled =
true;
126 dpm.setName(
"Tutorial_IsotropicCompression");
130 dpm.setSaveCount(100);
137 dpm.setParticlesWriteVTK(
true);
AnnoyingScalar sqrt(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:134
int main(int argc UNUSED, char *argv[] UNUSED)
[REV_ISO:class]
Definition: REVIsotropicCompressionDemo.cpp:95
void setHandler(BoundaryHandler *handler)
Sets the boundary's BoundaryHandler.
Definition: BaseBoundary.cc:113
virtual void clear()
Empties the whole BaseHandler by removing all Objects and setting all other variables to 0.
Definition: BaseHandler.h:536
unsigned int getSize() const
Gets the size of the particleHandler (including mpi and periodic particles)
Definition: BaseHandler.h:663
It's an insertion boundary which has cuboidal shape (yes, 'CuboidalInsertionBoundary' would have been...
Definition: CubeInsertionBoundary.h:21
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:86
Vec3D getMax() const
Returns the maximum coordinates of the problem domain.
Definition: DPMBase.h:659
void setMin(const Vec3D &min)
Sets the minimum coordinates of the problem domain.
Definition: DPMBase.cc:1109
Vec3D getMin() const
Returns the minimum coordinates of the problem domain.
Definition: DPMBase.h:653
void setSystemDimensions(unsigned int newDim)
Sets the system dimensionality.
Definition: DPMBase.cc:1408
void setMax(const Vec3D &max)
Sets the maximum coordinates of the problem domain.
Definition: DPMBase.cc:1073
void checkBoundaryBeforeTimeStep(DPMBase *md) override
Fills the boundary with particles.
Definition: InsertionBoundary.cc:163
void setInitialVolume(Mdouble initialVolume)
Gets the Volume which should be inserted by the insertion routine.
Definition: InsertionBoundary.cc:620
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:165
Implementation of a 3D matrix.
Definition: Kernel/Math/Matrix.h:17
Mdouble XY
Definition: Kernel/Math/Matrix.h:22
Mdouble YY
Definition: Kernel/Math/Matrix.h:22
Mdouble ZZ
Definition: Kernel/Math/Matrix.h:22
Mdouble XX
all nine matrix elements
Definition: Kernel/Math/Matrix.h:22
A cuboid box consists of periodic boundaries that can be strain/stress controlled and achieve differe...
Definition: StressStrainControlBoundary.h:34
void set(const Matrix3D &stressGoal, const Matrix3D &strainRate, const Matrix3D &pGain, bool isStrainRateControlled, const Matrix3D &iGain={0, 0, 0, 0, 0, 0, 0, 0, 0})
Sets all boundary inputs at once and determines which deformation mode it is, then combine the right ...
Definition: StressStrainControlBoundary.cc:288
[REV_ISO:headers]
Definition: REVIsotropicCompressionDemo.cpp:20
StressStrainControl(const Matrix3D &stressGoal, const Matrix3D &strainRate, const Matrix3D &gainFactor, bool isStrainRateControlled)
[REV_ISO:construct]
Definition: REVIsotropicCompressionDemo.cpp:24
bool isStrainRateControlled_
Definition: REVIsotropicCompressionDemo.cpp:88
Matrix3D strainRate_
Definition: REVIsotropicCompressionDemo.cpp:86
Matrix3D gainFactor_
Definition: REVIsotropicCompressionDemo.cpp:87
Matrix3D stressGoal_
[REV_ISO:setIni]
Definition: REVIsotropicCompressionDemo.cpp:85
void setupInitialConditions() override
[REV_ISO:construct]
Definition: REVIsotropicCompressionDemo.cpp:45
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 log(const bfloat16 &a)
Definition: BFloat16.h:618
T square(const T val)
squares a number
Definition: ExtendedMath.h:86