MercuryDPM  0.11
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Tutorial1.cpp File Reference

Go to the source code of this file.

Classes

class  Tutorial1
 [T1:headers] More...
 

Functions

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

Function Documentation

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]

Definition at line 61 of file Tutorial1.cpp.

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

62 {
63  // Problem setup
64  Tutorial1 problem;
65 
67  problem.setName("Tutorial1");
68  problem.setSystemDimensions(3);
69  problem.setGravity(Vec3D(0.0,0.0,0.0));
70  problem.setXMax(1.0);
71  problem.setYMax(1.0);
72  problem.setZMax(1.0);
73  problem.setTimeMax(2.0);
75 
77  // The normal spring stiffness and normal dissipation is computed and set as
78  // For collision time tc=0.005 and restitution coefficeint rc=1.0,
80  species->setDensity(2500.0); // sets the species type-0 density
81  species->setStiffness(258.5);// sets the spring stiffness
82  species->setDissipation(0.0);// sets the dissipation
84 
86  problem.setSaveCount(10);
91  std::cout << problem.dataFile.getCounter() << std::endl;
93 
95  problem.setXBallsAdditionalArguments("-solidf -v0");
97 
99  problem.setTimeStep(.005/50.0); // (collision time)/50.0
100  problem.solve(argc, argv);
102  return 0;
103 }
void setXMax(Mdouble newXMax)
If the length of the problem domain in x-direction is XMax - XMin, this method sets XMax...
Definition: DPMBase.cc:309
void solve()
The work horse of the code.
Definition: DPMBase.cc:1895
void setTimeMax(Mdouble newTMax)
Allows the upper time limit to be changed.
Definition: DPMBase.cc:179
File restartFile
An instance of class File to handle in- and output into a .restart file.
Definition: Files.h:219
[T1:headers]
Definition: Tutorial1.cpp:42
void setZMax(Mdouble newZMax)
If the length of the problem domain in z-direction is XMax - XMin, this method sets ZMax...
Definition: DPMBase.cc:338
void setSystemDimensions(unsigned int newDim)
Allows for the dimension of the simulation to be changed.
Definition: DPMBase.cc:453
void setGravity(Vec3D newGravity)
Allows to modify the gravity vector.
Definition: DPMBase.cc:431
void setYMax(Mdouble newYMax)
If the length of the problem domain in y-direction is YMax - YMin, this method sets YMax...
Definition: DPMBase.cc:324
File eneFile
An instance of class File to handle in- and output into a .ene file.
Definition: Files.h:214
unsigned int getCounter() const
In case of multiple files, File::getCounter() returns the the number (FILE::Counter_) of the next fil...
Definition: File.cc:216
file will not be created/read
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: Files.cc:149
U * copyAndAddObject(const U &O)
Creates a copy of a Object and adds it to the BaseHandler.
Definition: BaseHandler.h:268
all data will be written into/ read from a single file called name_
File fStatFile
An instance of class File to handle in- and output into a .fstat file.
Definition: Files.h:209
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: Files.cc:138
File dataFile
An instance of class File to handle in- and output into a .data file.
Definition: Files.h:204
Species< LinearViscoelasticNormalSpecies > LinearViscoelasticSpecies
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. elastic, linear visco-elastic... et cetera...
Definition: DPMBase.h:868
void setXBallsAdditionalArguments(std::string newXBArgs)
Set the additional arguments for xballs.
Definition: DPMBase.cc:403
void setFileType(FileType fileType)
Sets the type of file needed to write into or read from. File::fileType_.
Definition: File.cc:209
void setTimeStep(Mdouble newDt)
Allows the time step dt to be changed.
Definition: DPMBase.cc:353
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45