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

Classes

class  MembraneSelfTest
 

Functions

int main (int argc, char **argv)
 

Function Documentation

◆ main()

int main ( int argc  ,
char **  argv 
)
249 {
250  MembraneSelfTest problem;
251 
252 
253  problem.setTimeMax(0.2);
254  problem.setGravity(Vec3D(0.0,0.0,-9.81));
255 
256  /* Make sure to add an (unique) name here */
257  problem.setName("MembraneSelfTest");
258 
259  // problem.setFileType(FileType::ONE_FILE);
260 
265 
266  //Add any configuration which is modified often below...
267  problem.setTimeStep(1e-5);
268 
269  problem.setSaveCount(floor(1.0/problem.getTimeStep()));
270 
271  if (helpers::readFromCommandLine(argc, argv, "-vtk"))
272  {
273  helpers::removeFromCommandline(argc, argv, "-vtk", 0);
274  problem.setSaveCount(floor(0.01/problem.getTimeStep()));
275  problem.setParticlesWriteVTK(true);
276  // Write one file per timestep
278  }
279 
280  problem.solve(argc,argv);
281  return 0;
282 }
@ MULTIPLE_FILES
each time-step will be written into/read from separate files numbered consecutively: name_....
@ NO_FILE
file will not be created/read
@ 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
File eneFile
An instance of class File to handle in- and output into a .ene file.
Definition: DPMBase.h:1488
File fStatFile
An instance of class File to handle in- and output into a .fstat file.
Definition: DPMBase.h:1483
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
File dataFile
An instance of class File to handle in- and output into a .data file.
Definition: DPMBase.h:1478
WallHandler wallHandler
An object of the class WallHandler. Contains pointers to all the walls created.
Definition: DPMBase.h:1447
File restartFile
An instance of class File to handle in- and output into a .restart file.
Definition: DPMBase.h:1493
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 setFileType(FileType fileType)
Sets the type of file needed to write into or read from. File::fileType_.
Definition: File.cc:215
Definition: MembraneSelfTest.cpp:38
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
bool removeFromCommandline(int &argc, char *argv[], std::string varName, int nArgs)
May be used to hide arguments from argc and argv.
Definition: CommandLineHelpers.cc:43

References DPMBase::dataFile, DPMBase::eneFile, DPMBase::fStatFile, DPMBase::getTimeStep(), MULTIPLE_FILES, NO_FILE, ONE_FILE, helpers::readFromCommandLine(), helpers::removeFromCommandline(), DPMBase::restartFile, File::setFileType(), DPMBase::setGravity(), DPMBase::setName(), DPMBase::setParticlesWriteVTK(), DPMBase::setSaveCount(), DPMBase::setTimeMax(), DPMBase::setTimeStep(), WallHandler::setWriteVTK(), DPMBase::solve(), and DPMBase::wallHandler.