Tutorial9_InclinedPlane.cpp File Reference

Classes

class  Tutorial9
 [T9:headers] More...
 

Functions

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

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)

[T9:class]

[T9:main]

84 {
85 
86  // Problem setup
87  Tutorial9 problem;//instantiate an object of class Tutorial 9
88 
89  double angle = constants::pi / 180.0 * 20.0;
90 
91  problem.setName("Tutorial9");
92  problem.setSystemDimensions(3);
93  problem.setGravity(Vec3D(sin(angle), 0.0, -cos(angle)) * 9.81);
94  problem.setXMax(0.3);
95  problem.setYMax(0.3);
96  problem.setZMax(0.05);
97  problem.setTimeMax(0.5);
98 
99  // The normal spring stiffness and normal dissipation is computed and set as
100  // For collision time tc=0.005 and restitution coefficeint rc=0.88,
101 
102  //Properties index 0
104 
105  species0.setDensity(2500.0);//sets the species type_0 density
106  species0.setStiffness(259.018);//sets the spring stiffness.
107  species0.setDissipation(0.0334);//sets the dissipation.
108  species0.setSlidingStiffness(2.0 / 7.0 * species0.getStiffness());
109  species0.setRollingStiffness(2.0 / 5.0 * species0.getStiffness());
110  species0.setSlidingFrictionCoefficient(0.0);
111  species0.setRollingFrictionCoefficient(0.0);
112  auto ptrToSp0=problem.speciesHandler.copyAndAddObject(species0);
113 
114  //Properties index 1
116 
117  species1.setDensity(2500.0);//sets the species type-1 density
118  species1.setStiffness(259.018);//sets the spring stiffness
119  species1.setDissipation(0.0334);//sets the dissipation
120  species1.setSlidingStiffness(2.0 / 7.0 * species1.getStiffness());
121  species1.setRollingStiffness(2.0 / 5.0 * species1.getStiffness());
122  species1.setSlidingFrictionCoefficient(0.5);
123  species1.setRollingFrictionCoefficient(0.0);
124  auto ptrToSp1=problem.speciesHandler.copyAndAddObject(species1);
125 
126  //Combination of properties index 0 and index 1
127  auto species01 = problem.speciesHandler.getMixedObject(ptrToSp0,ptrToSp1);
128 
129  species01->setStiffness(259.018);//sets the spring stiffness
130  species01->setDissipation(0.0334);//sets the dissipation
131  species01->setSlidingStiffness(2.0 / 7.0 * species01->getStiffness());
132  species01->setRollingStiffness(2.0 / 5.0 * species01->getStiffness());
133  species01->setSlidingFrictionCoefficient(0.5);
134  species01->setRollingFrictionCoefficient(0.0);
135 
136  //Properties index 2
138 
139  species2.setDensity(2500.0);//sets the species type-2 density
140  species2.setStiffness(258.5);//sets the spring stiffness
141  species2.setDissipation(0.0);//sets the dissipation
142  species2.setSlidingStiffness(2.0 / 7.0 * species2.getStiffness());
143  species2.setRollingStiffness(2.0 / 5.0 * species2.getStiffness());
144  species2.setSlidingFrictionCoefficient(0.5);
145  species2.setRollingFrictionCoefficient(0.5);
146  auto ptrToSp2 = problem.speciesHandler.copyAndAddObject(species2);
147 
148  //Combination of properties index 0 and index 2
149  auto species02 = problem.speciesHandler.getMixedObject(ptrToSp0, ptrToSp2);
150 
151  species02->setStiffness(259.018);//sets the stiffness
152  species02->setDissipation(0.0334);//sets the dissipation
153  species02->setSlidingStiffness(2.0 / 7.0 * species02->getStiffness());
154  species02->setRollingStiffness(2.0 / 5.0 * species02->getStiffness());
155  species02->setSlidingFrictionCoefficient(0.5);
156  species02->setRollingFrictionCoefficient(0.5);
157 
158  //Output
159  problem.setSaveCount(10);
164 
165  problem.setXBallsAdditionalArguments("-solidf -v0 -s 8");
166 
167  problem.setTimeStep(0.005 / 50.0);
168  problem.solve(argc, argv);
169 
170  return 0;
171 }
@ NO_FILE
file will not be created/read
@ ONE_FILE
all data will be written into/ read from a single file called name_
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
void setDensity(Mdouble density)
Definition: ParticleSpecies.cc:108
std::enable_if<!std::is_pointer< typename U::MixedSpeciesType >::value, typename U::MixedSpeciesType * >::type getMixedObject(const U *S, const U *T)
Definition: SpeciesHandler.h:74
Contains material and contact force properties.
Definition: Species.h:35
[T9:headers]
Definition: Tutorial9_InclinedPlane.cpp:44
Definition: Vector.h:51
const Mdouble pi
Definition: ExtendedMath.h:45
Mdouble cos(Mdouble x)
Definition: ExtendedMath.cc:64
Mdouble sin(Mdouble x)
Definition: ExtendedMath.cc:44

References BaseHandler< T >::copyAndAddObject(), mathsFunc::cos(), DPMBase::dataFile, DPMBase::eneFile, DPMBase::fStatFile, SpeciesHandler::getMixedObject(), NO_FILE, ONE_FILE, constants::pi, DPMBase::restartFile, ParticleSpecies::setDensity(), File::setFileType(), DPMBase::setGravity(), DPMBase::setName(), DPMBase::setSaveCount(), DPMBase::setSystemDimensions(), DPMBase::setTimeMax(), DPMBase::setTimeStep(), DPMBase::setXBallsAdditionalArguments(), DPMBase::setXMax(), DPMBase::setYMax(), DPMBase::setZMax(), mathsFunc::sin(), DPMBase::solve(), and DPMBase::speciesHandler.