TriangleWallSelfTest.cpp File Reference

Functions

int main ()
 

Function Documentation

◆ main()

int main ( )
10  {
11  Mercury3D dpm;
12  dpm.setTimeMax(1);
13  dpm.setName("TriangleWallSelfTest");
14  dpm.setDomain({0,0,0},{1,1,1});
15  dpm.setGravity({0,0,0});
16 
18  species.setDensity(constants::pi/6.0);
19  Mdouble d = .1;
20  species.setCollisionTimeAndRestitutionCoefficient(0.5,1.0,d*d*d);
21  auto s = dpm.speciesHandler.copyAndAddObject(species);
22  dpm.setTimeStep(0.01);
23 
24  SphericalParticle particle;
25  particle.setSpecies(s);
26  particle.setRadius(0.5*d);
27  particle.setVelocity({0,0,-.1});
28 // particle.setPosition({0,0,.5*d});
29 // dpm.particleHandler.copyAndAddObject(particle);
30  for (Mdouble x=-d/8; x<1+d; x+=d+d/22) {
31  for (Mdouble y=-d/8; y<1+d-x; y+=d+d/22) {
32  particle.setPosition(Vec3D(x, y, .5*d));
33  dpm.particleHandler.copyAndAddObject(particle);
34  }
35  }
36 
37  TriangleWall wall;
38  Vec3D A = {0,0,0};
39  Vec3D B = {1,0,0};
40  Vec3D C = {0,1,0};
41  wall.setSpecies(s);
42  wall.setVertices(A,B,C);
43  dpm.wallHandler.copyAndAddObject(wall);
44  dpm.setParticlesWriteVTK(true);
46  dpm.solve();
47 }
@ ONE_FILE
all data will be written into/ read from a single file called name_
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
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
Definition: BaseInteractable.cc:328
virtual void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
Definition: BaseInteractable.h:218
virtual void setRadius(Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species)
Definition: BaseParticle.cc:548
virtual void setSpecies(const ParticleSpecies *species)
Definition: BaseParticle.cc:798
void setSpecies(const ParticleSpecies *species)
Defines the species of the current wall.
Definition: BaseWall.cc:148
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1433
void setDomain(const Vec3D &min, const Vec3D &max)
Sets the minimum coordinates of the problem domain.
Definition: DPMBase.cc:1089
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:400
WallHandler wallHandler
An object of the class WallHandler. Contains pointers to all the walls created.
Definition: DPMBase.h:1453
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1443
void setParticlesWriteVTK(bool writeParticlesVTK)
Sets whether particles are written in a VTK file.
Definition: DPMBase.cc:933
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
void solve()
The work horse of the code.
Definition: DPMBase.cc:4334
void setGravity(Vec3D newGravity)
Sets a new value for the gravitational acceleration.
Definition: DPMBase.cc:1374
The matrix class, also used for vectors and row-vectors.
Definition: Eigen/Eigen/src/Core/Matrix.h:186
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
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
A TriangleWall is convex polygon defined as an intersection of InfiniteWall's.
Definition: TriangleWall.h:36
void setVertices(Vec3D A, Vec3D B, Vec3D C)
Sets member variables such that the wall represents a triangle with vertices A, B,...
Definition: TriangleWall.cc:144
Definition: Kernel/Math/Vector.h:30
void setWriteVTK(FileType)
Sets whether walls are written into a VTK file.
Definition: WallHandler.cc:445
Definition: matrices.h:74
Scalar * y
Definition: level1_cplx_impl.h:128
RealScalar s
Definition: level1_cplx_impl.h:130
const Mdouble pi
Definition: ExtendedMath.h:23
list x
Definition: plotDoE.py:28

References BaseHandler< T >::copyAndAddObject(), ONE_FILE, DPMBase::particleHandler, constants::pi, s, LinearViscoelasticNormalSpecies::setCollisionTimeAndRestitutionCoefficient(), ParticleSpecies::setDensity(), DPMBase::setDomain(), DPMBase::setGravity(), DPMBase::setName(), DPMBase::setParticlesWriteVTK(), BaseInteractable::setPosition(), BaseParticle::setRadius(), BaseParticle::setSpecies(), BaseWall::setSpecies(), DPMBase::setTimeMax(), DPMBase::setTimeStep(), BaseInteractable::setVelocity(), TriangleWall::setVertices(), WallHandler::setWriteVTK(), DPMBase::solve(), DPMBase::speciesHandler, DPMBase::wallHandler, plotDoE::x, and y.