ParallelUnitTestMPI.cpp File Reference
#include "Mercury3D.h"
#include <iostream>
#include "Species/LinearViscoelasticFrictionSpecies.h"
#include <cstdlib>

Classes

class  MpiPeriodicBoundaryUnitTest
 

Functions

int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)
47 {
48  //Create the problem
50  problem.setName("ParallelUnitTestMPI");
51 
52  //Create a species
54  species->setDensity(1.0);
55 
56  //Set domain accordingly (domain boundaries are not walls!)
57  problem.setXMin(-10.0);
58  problem.setXMax(10.0);
59  problem.setYMin(-10.0);
60  problem.setYMax(10.0);
61  problem.setZMin(-10.0);
62  problem.setZMax(10.0);
63 
64  //specify particle properties
65  species->setDensity(6.0/constants::pi);
66 
67  //specify body forces
68  problem.setGravity(Vec3D(0.0, 0.0, 0.0));
69 
70  //Set the number of domains for parallel decomposition
71  problem.setNumberOfDomains({2,2,2});
72 
73  //specify contact properties
74  //normal forces
75  species->setStiffness(1e5);
76  species->setDissipation(0.63);
77  //tangential (sliding) forces
78  species->setSlidingFrictionCoefficient(0.5);
79  species->setSlidingStiffness(1.2e4);
80  species->setSlidingDissipation(0.16);
81  //tangential (rolling) torques
82  species->setRollingFrictionCoefficient(0.2);
83  species->setRollingStiffness(1.2e4);
84  species->setRollingDissipation(6.3e-2);
85  //normal (torsion/spin) torques
86  species->setTorsionFrictionCoefficient(0.1);
87  species->setTorsionStiffness(1.2e4);
88  species->setSlidingDissipation(6.3e-2);
89 
90  //set other simulation parameters
91  //Mdouble MinParticleMass = species->getDensity()*4.0 / 3.0 * constants::pi ;
92  //Mdouble tc = species->getCollisionTime(MinParticleMass);
93  problem.setTimeStep(0.1);
94  problem.setTimeMax(60.0);//run until 3.0 to see full simulation
95  problem.setSaveCount(1); //used to be 500
96 
97  //Set output to paraview
98  problem.setParticlesWriteVTK(true);
99 
100  problem.solve(argc, argv);
101 
102  return 0;
103 }
Species< LinearViscoelasticNormalSpecies, FrictionSpecies > LinearViscoelasticFrictionSpecies
Definition: LinearViscoelasticFrictionSpecies.h:34
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 setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:408
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1427
void setYMin(Mdouble newYMin)
Sets the value of YMin, the lower bound of the problem domain in the y-direction.
Definition: DPMBase.cc:1034
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:422
void setNumberOfDomains(std::vector< unsigned > direction)
Sets the number of domains in x-,y- and z-direction. Required for parallel computations.
Definition: DPMBase.cc:5213
void setYMax(Mdouble newYMax)
Sets the value of YMax, the upper bound of the problem domain in the y-direction.
Definition: DPMBase.cc:1191
void setZMin(Mdouble newZMin)
Sets the value of ZMin, the lower bound of the problem domain in the z-direction.
Definition: DPMBase.cc:1058
void setXMax(Mdouble newXMax)
Sets the value of XMax, the upper bound of the problem domain in the x-direction.
Definition: DPMBase.cc:1165
void setZMax(Mdouble newZMax)
Sets the value of ZMax, the upper bound of the problem domain in the z-direction.
Definition: DPMBase.cc:1217
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 setXMin(Mdouble newXMin)
Sets the value of XMin, the lower bound of the problem domain in the x-direction.
Definition: DPMBase.cc:1010
void setGravity(Vec3D newGravity)
Sets a new value for the gravitational acceleration.
Definition: DPMBase.cc:1383
Definition: PeriodicBoundary1MPI2Test.cpp:33
void setDensity(Mdouble density)
Definition: ParticleSpecies.cc:108
Contains material and contact force properties.
Definition: Species.h:35
Definition: Vector.h:51
const Mdouble pi
Definition: ExtendedMath.h:45

References BaseHandler< T >::copyAndAddObject(), constants::pi, ParticleSpecies::setDensity(), DPMBase::setGravity(), DPMBase::setName(), DPMBase::setNumberOfDomains(), DPMBase::setParticlesWriteVTK(), DPMBase::setSaveCount(), DPMBase::setTimeMax(), DPMBase::setTimeStep(), DPMBase::setXMax(), DPMBase::setXMin(), DPMBase::setYMax(), DPMBase::setYMin(), DPMBase::setZMax(), DPMBase::setZMin(), DPMBase::solve(), and DPMBase::speciesHandler.