ParhamiMcKeepingParticlePairSelfTest.cpp File Reference

Functions

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

Function Documentation

◆ main()

int main ( int argc  UNUSED,
char *argv[]  UNUSED 
)
33  {
34  //create new simulation; as no specialised functions are needed,
35  //Mercury3D is used directly instead of creating a derived class as usual.
36  Mercury3D ps;
37 
38  //add Species
40  s.setDensity(3950e18);
41  s.setEffectiveElasticModulus(0); //?? This seems to correspond to dt~tc/50
42  s.setDissipation(0); //?
43  // mass 2e-21 => fg = 2e-20
44  // k=1e-04 => del=fg/k = tiny
45  Mdouble alpha = 4.5;
46  Mdouble beta = 4;
47  Mdouble atomicVolume = 8.47e-30; /*Omega*/
48  Mdouble surfaceEnergy = 1.1; /*gamma_s*/
49  Mdouble thicknessDiffusion = 1.3e-8; /*deltaB*D0B*/
50  Mdouble activationEnergy = 475e3 /*QB*/;
51  Mdouble temperature = 1473; /*T*/
52  Mdouble pseudoSlidingFrictionCoefficient = 0.01; /*\etaPart*/
53  s.set(alpha, beta, atomicVolume, surfaceEnergy, thicknessDiffusion, activationEnergy, temperature, pseudoSlidingFrictionCoefficient);
55 
56  //add particle
59  p.setRadius(50e-9);
60  p.setPosition(p.getRadius() * Vec3D(0, 0, 1.0-1e-6*1e-3));
62 
63  //add second particle
64  p.setPosition(p.getRadius() * Vec3D(0, 0, -1.0));
66 
67  //set time-stepping and output parameters
69  ps.setXBallsAdditionalArguments(" -v0 -solidf ");
70  ps.setGravity(Vec3D(0, 0, 0));
71  ps.setTimeStep(1e-4);
72  ps.setSaveCount(1000);
73  ps.setTimeMax(10);
74  ps.setMin(50e-9 * Vec3D(-1, -1, -2));
75  ps.setMax(50e-9 * Vec3D(1, 1, 2));
76  ps.setName("ParhamiMcKeepingParticlePairSelfTest");
77 
78  //run
79  ps.solve();
80 
81  logger(INFO, "Execute 'gnuplot ParhamiMcKeepingParticlePairSelfTest.gnu' to view output");
82  helpers::writeToFile("ParhamiMcKeepingParticlePairSelfTest.gnu",
83  "set xlabel 't [s]'\n"
84  "set ylabel 'delta/d'\n"
85  "p 'ParhamiMcKeepingParticlePairSelfTest.fstat' u 1:($7/1e-7) every 5::3 w lp\n"
86  );
87 
88 
89 }
@ ONE_FILE
all data will be written into/ read from a single file called name_
double Mdouble
Definition: GeneralDefine.h:34
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.
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
virtual void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
Definition: BaseInteractable.h:239
Mdouble getRadius() const
Returns the particle's radius.
Definition: BaseParticle.h:348
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 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 setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:422
void setFileType(FileType fileType)
Sets File::fileType_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:459
void setMin(const Vec3D &min)
Sets the minimum coordinates of the problem domain.
Definition: DPMBase.cc:1118
void setXBallsAdditionalArguments(std::string newXBArgs)
Set the additional arguments for xballs.
Definition: DPMBase.cc:1347
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1437
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 setMax(const Vec3D &max)
Sets the maximum coordinates of the problem domain.
Definition: DPMBase.cc:1082
void setGravity(Vec3D newGravity)
Sets a new value for the gravitational acceleration.
Definition: DPMBase.cc:1383
This adds on the hierarchical grid code for 3D problems.
Definition: Mercury3D.h:37
void setDensity(Mdouble density)
Definition: ParticleSpecies.cc:108
Contains material and contact force properties.
Definition: Species.h:35
A spherical particle is the most simple particle used in MercuryDPM.
Definition: SphericalParticle.h:37
Definition: Vector.h:51
bool writeToFile(std::string filename, std::string filecontent)
Writes a string to a file.
Definition: FileIOHelpers.cc:58
Mdouble beta(Mdouble z, Mdouble w)
This is the beta function, returns the approximation based on cmath's implementation of ln(gamma)
Definition: ExtendedMath.cc:164

References mathsFunc::beta(), BaseHandler< T >::copyAndAddObject(), BaseHandler< T >::getObject(), BaseParticle::getRadius(), INFO, logger, ONE_FILE, DPMBase::particleHandler, ParticleSpecies::setDensity(), DPMBase::setFileType(), DPMBase::setGravity(), DPMBase::setMax(), DPMBase::setMin(), DPMBase::setName(), BaseInteractable::setPosition(), BaseParticle::setRadius(), DPMBase::setSaveCount(), BaseParticle::setSpecies(), DPMBase::setTimeMax(), DPMBase::setTimeStep(), DPMBase::setXBallsAdditionalArguments(), DPMBase::solve(), DPMBase::speciesHandler, and helpers::writeToFile().