TriangleWallSelfTest.cpp File Reference

Functions

int main ()
 

Function Documentation

◆ main()

int main ( )
31  {
32  Mercury3D dpm;
33  dpm.setTimeMax(1);
34  dpm.setName("TriangleWallSelfTest");
35  dpm.setDomain({0,0,0},{1,1,1});
36  dpm.setGravity({0,0,0});
37 
39  species.setDensity(constants::pi/6.0);
40  Mdouble d = .1;
41  species.setCollisionTimeAndRestitutionCoefficient(0.5,1.0,d*d*d);
42  auto s = dpm.speciesHandler.copyAndAddObject(species);
43  dpm.setTimeStep(0.01);
44 
45  SphericalParticle particle;
46  particle.setSpecies(s);
47  particle.setRadius(0.5*d);
48  particle.setVelocity({0,0,-.1});
49 // particle.setPosition({0,0,.5*d});
50 // dpm.particleHandler.copyAndAddObject(particle);
51  for (Mdouble x=-d/8; x<1+d; x+=d+d/22) {
52  for (Mdouble y=-d/8; y<1+d-x; y+=d+d/22) {
53  particle.setPosition(Vec3D(x, y, .5*d));
54  dpm.particleHandler.copyAndAddObject(particle);
55  }
56  }
57 
58  TriangleWall wall;
59  Vec3D A = {0,0,0};
60  Vec3D B = {1,0,0};
61  Vec3D C = {0,1,0};
62  wall.setSpecies(s);
63  wall.setVertices(A,B,C);
64  dpm.wallHandler.copyAndAddObject(wall);
65  dpm.setParticlesWriteVTK(true);
67  dpm.solve();
68 }
@ ONE_FILE
all data will be written into/ read from a single file called name_
double Mdouble
Definition: GeneralDefine.h:34
@ A
Definition: StatisticsVector.h:42
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
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
void setSpecies(const ParticleSpecies *species)
Defines the species of the current wall.
Definition: BaseWall.cc:169
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1427
void setDomain(const Vec3D &min, const Vec3D &max)
Sets the minimum coordinates of the problem domain.
Definition: DPMBase.cc:1098
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:422
WallHandler wallHandler
An object of the class WallHandler. Contains pointers to all the walls created.
Definition: DPMBase.h:1447
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1437
void setParticlesWriteVTK(bool writeParticlesVTK)
Sets whether particles are written in a VTK file.
Definition: DPMBase.cc:942
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 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
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
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
A TriangleWall is convex polygon defined as an intersection of InfiniteWall's.
Definition: TriangleWall.h:57
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:165
Definition: Vector.h:51
void setWriteVTK(FileType)
Sets whether walls are written into a VTK file.
Definition: WallHandler.cc:467
const Mdouble pi
Definition: ExtendedMath.h:45

References A, BaseHandler< T >::copyAndAddObject(), ONE_FILE, DPMBase::particleHandler, constants::pi, 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, and DPMBase::wallHandler.