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

Go to the source code of this file.

Classes

class  Tutorial9
 [T9:headers] More...
 

Functions

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

Function Documentation

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

[T9:class]

[T9:main]

Definition at line 82 of file Tutorial9.cpp.

References BaseHandler< T >::copyAndAddObject(), Files::dataFile, Files::eneFile, Files::fStatFile, SpeciesHandler::getMixedObject(), NO_FILE, ONE_FILE, constants::pi, 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.

83 {
84 
85  // Problem setup
86  Tutorial9 problem; // instantiate an object of class Tutorial 9
87 
88  double angle = constants::pi/180.0*20.0;
89 
90  problem.setName("Tutorial9");
91  problem.setSystemDimensions(3);
92  problem.setGravity(Vec3D(sin(angle),0.0,-cos(angle))*9.81);
93  problem.setXMax(0.3);
94  problem.setYMax(0.3);
95  problem.setZMax(0.05);
96  problem.setTimeMax(0.5);
97 
101  auto species01 = problem.speciesHandler.getMixedObject(species0, species1);
102  auto species02 = problem.speciesHandler.getMixedObject(species0, species2);
103 
104  // The normal spring stiffness and normal dissipation is computed and set as
105  // For collision time tc=0.005 and restitution coefficeint rc=0.88,
106 
107  species0->setDensity(2500.0); // sets the species type-0 density
108  species0->setStiffness(259.018);// sets the spring stiffness
109  species0->setSlidingStiffness(2.0/7.0*species0->getStiffness());
110  species0->setRollingStiffness(2.0/5.0*species0->getStiffness());
111  species0->setDissipation(0.0334);// sets the dissipation
112  species0->setSlidingFrictionCoefficient(0.0);
113  species0->setRollingFrictionCoefficient(0.0);
114 
115  species1->setDensity(2500.0); // sets the species type-1 density
116  species1->setStiffness(259.018);// sets the spring stiffness
117  species1->setDissipation(0.0334);// sets the dissipation
118  species1->setSlidingStiffness(2.0/7.0*species1->getStiffness());
119  species1->setRollingStiffness(2.0/5.0*species1->getStiffness());
120  species1->setSlidingFrictionCoefficient(0.5);
121  species1->setRollingFrictionCoefficient(0.0);
122 
123  species01->setStiffness(259.018);
124  species01->setDissipation(0.0334);// sets the dissipation
125  species01->setSlidingStiffness(2.0/7.0*species01->getStiffness());
126  species01->setRollingStiffness(2.0/5.0*species01->getStiffness());
127  species01->setSlidingFrictionCoefficient(0.5);
128  species01->setRollingFrictionCoefficient(0.0);
129 
130  species2->setDensity(2500.0); // sets the species type-2 density
131  species2->setStiffness(258.5);// sets the spring stiffness
132  species2->setDissipation(0.0);// sets the dissipation
133  species2->setSlidingStiffness(2.0/7.0*species2->getStiffness());
134  species2->setRollingStiffness(2.0/5.0*species2->getStiffness());
135  species2->setSlidingFrictionCoefficient(0.5);
136  species2->setRollingFrictionCoefficient(0.5);
137 
138  species02->setStiffness(259.018);
139  species02->setDissipation(0.0334);// sets the dissipation
140  species02->setSlidingStiffness(2.0/7.0*species02->getStiffness());
141  species02->setRollingStiffness(2.0/5.0*species02->getStiffness());
142  species02->setSlidingFrictionCoefficient(0.5);
143  species02->setRollingFrictionCoefficient(0.5);
144 
145  problem.setSaveCount(10);
150 
151  problem.setXBallsAdditionalArguments("-solidf -v0 -s 8");
152 
153  problem.setTimeStep(0.005/50.0);
154  problem.solve(argc, argv);
155 
156  return 0;
157 }
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
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
Species< LinearViscoelasticNormalSpecies, FrictionSpecies > LinearViscoelasticFrictionSpecies
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
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
const Mdouble pi
Definition: ExtendedMath.h:42
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
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. elastic, linear visco-elastic... et cetera...
Definition: DPMBase.h:868
U::MixedSpeciesType * getMixedObject(const U *S, const U *T)
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
[T9:headers]
Definition: Tutorial9.cpp:42