Tutorial1_ParticleInOuterSpace.cpp File Reference

Classes

class  Tutorial1
 [T1:headers] More...
 

Functions

int main (int argc, char *argv[])
 [T1:class] More...
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)

[T1:class]

[T1:main]

[T1:problemSetup]

[T1:problemSetup]

[T1:speciesProp]

[T1:speciesProp]

[T1:output]

[T1:output]

[T1:visualOutput]

[T1:visualOutput]

[T1:solve]

[T1:solve]

63 {
64  // Problem setup
65  Tutorial1 problem;
66 
68  problem.setName("Tutorial1");
69  problem.setSystemDimensions(3);
70  problem.setGravity(Vec3D(0.0, 0.0, 0.0));
71  problem.setXMax(1.0);
72  problem.setYMax(1.0);
73  problem.setZMax(1.0);
74  problem.setTimeMax(2.0);
76 
78  //Set the species of particles and walls
79  //The normal spring stiffness and normal dissipation is computed and set as
80  //For collision time tc=0.005 and restitution coefficeint rc=1.0
82  species.setDensity(2500.0); //sets the species type_0 density
83  species.setStiffness(258.5);//sets the spring stiffness.
84  species.setDissipation(0.0); //sets the dissipation.
85  problem.speciesHandler.copyAndAddObject(species);
87 
89  problem.setSaveCount(10);
94  logger(INFO, "run number: %", problem.dataFile.getCounter());
96 
98  problem.setXBallsAdditionalArguments("-solidf -v0");
100 
102  problem.setTimeStep(0.005 / 50.0); // (collision time)/50.0
103  problem.solve(argc, argv);
105  return 0;
106 }
@ NO_FILE
file will not be created/read
@ ONE_FILE
all data will be written into/ read from a single file called name_
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
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
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1427
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
File dataFile
An instance of class File to handle in- and output into a .data file.
Definition: DPMBase.h:1478
void setYMax(Mdouble newYMax)
Sets the value of YMax, the upper bound of the problem domain in the y-direction.
Definition: DPMBase.cc:1191
File restartFile
An instance of class File to handle in- and output into a .restart file.
Definition: DPMBase.h:1493
void setXBallsAdditionalArguments(std::string newXBArgs)
Set the additional arguments for xballs.
Definition: DPMBase.cc:1347
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 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 setSystemDimensions(unsigned int newDim)
Sets the system dimensionality.
Definition: DPMBase.cc:1417
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
unsigned int getCounter() const
In case of multiple files, File::getCounter() returns the the number (FILE::Counter_) of the next fil...
Definition: File.cc:223
void setDissipation(Mdouble dissipation)
Allows the normal dissipation to be changed.
Definition: LinearViscoelasticNormalSpecies.cc:117
void setStiffness(Mdouble new_k)
Allows the spring constant to be changed.
Definition: LinearViscoelasticNormalSpecies.cc:93
void setDensity(Mdouble density)
Definition: ParticleSpecies.cc:108
[T1:headers]
Definition: Tutorial1_ParticleInOuterSpace.cpp:44
Definition: Vector.h:51

References BaseHandler< T >::copyAndAddObject(), DPMBase::dataFile, DPMBase::eneFile, DPMBase::fStatFile, File::getCounter(), INFO, logger, NO_FILE, ONE_FILE, DPMBase::restartFile, ParticleSpecies::setDensity(), LinearViscoelasticNormalSpecies::setDissipation(), File::setFileType(), DPMBase::setGravity(), DPMBase::setName(), DPMBase::setSaveCount(), LinearViscoelasticNormalSpecies::setStiffness(), DPMBase::setSystemDimensions(), DPMBase::setTimeMax(), DPMBase::setTimeStep(), DPMBase::setXBallsAdditionalArguments(), DPMBase::setXMax(), DPMBase::setYMax(), DPMBase::setZMax(), DPMBase::solve(), and DPMBase::speciesHandler.