MembraneDemo.cpp File Reference
#include <Mercury3D.h>
#include <Species/HertzianViscoelasticMindlinSpecies.h>
#include <Walls/Membrane/Membrane.h>
#include <climits>

Classes

class  MembraneDemo
 

Functions

int main (int argc, char **argv)
 

Function Documentation

◆ main()

int main ( int argc  ,
char **  argv 
)
275 {
276  MembraneDemo problem;
277 
278 
279  problem.setTimeMax(3.0);
280  problem.setGravity(Vec3D(0.0,0.0,-9.81));
281 
282  /* Make sure to add an (unique) name here */
283  problem.setName("MembraneDemo");
284 
286 
287  //Add any configuration which is modified often below...
288  problem.setTimeStep(1e-5);
289 
290  problem.setSaveCount(floor(0.01/problem.getTimeStep()));
291 
292  if (helpers::readFromCommandLine(argc, argv, "-vtk", true))
293  {
294  problem.setParticlesWriteVTK(true);
295  // Write one file per timestep
297  }
298 
299  problem.setNumberOfOMPThreads(helpers::readFromCommandLine(argc, argv, "-omp",1));
300  problem.random.setRandomSeed(helpers::readFromCommandLine(argc, argv, "-seed",1));
301  problem.solve(argc,argv);
302  return 0;
303 }
@ MULTIPLE_FILES
each time-step will be written into/read from separate files numbered consecutively: name_....
@ ONE_FILE
all data will be written into/ read from a single file called name_
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:408
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:422
Mdouble getTimeStep() const
Returns the simulation time step.
Definition: DPMBase.cc:1250
WallHandler wallHandler
An object of the class WallHandler. Contains pointers to all the walls created.
Definition: DPMBase.h:1447
void setFileType(FileType fileType)
Sets File::fileType_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:459
void setParticlesWriteVTK(bool writeParticlesVTK)
Sets whether particles are written in a VTK file.
Definition: DPMBase.cc:942
RNG random
This is a random generator, often used for setting up the initial conditions etc.....
Definition: DPMBase.h:1432
void setNumberOfOMPThreads(int numberOfOMPThreads)
Definition: DPMBase.cc:1257
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
Definition: MembraneDemo.cpp:37
void setRandomSeed(unsigned long int new_seed)
This is the seed for the random number generator (note the call to seed_LFG is only required really i...
Definition: RNG.cc:53
Definition: Vector.h:51
void setWriteVTK(FileType)
Sets whether walls are written into a VTK file.
Definition: WallHandler.cc:467
bool readFromCommandLine(int argc, char *argv[], std::string varName)
Returns true if command line arguments contain varName, false else.
Definition: CommandLineHelpers.cc:103

References DPMBase::getTimeStep(), MULTIPLE_FILES, ONE_FILE, DPMBase::random, helpers::readFromCommandLine(), DPMBase::setFileType(), DPMBase::setGravity(), DPMBase::setName(), DPMBase::setNumberOfOMPThreads(), DPMBase::setParticlesWriteVTK(), RNG::setRandomSeed(), DPMBase::setSaveCount(), DPMBase::setTimeMax(), DPMBase::setTimeStep(), WallHandler::setWriteVTK(), DPMBase::solve(), and DPMBase::wallHandler.