CoilSelfTest.cpp File Reference

Classes

class  CoilSelfTest
 [CST:headers] More...
 

Functions

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

Function Documentation

◆ main()

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

[CST:class]

[CST:main]

[CSTproblemSetup]

[CSTproblemSetup]

[CST:species]

[CST:species]

[CST:solve]

[CST:solve]

159 {
160 
161  // create CoilSelfTest object
162  CoilSelfTest problem;
163 
164  // set some basic problem properties
166  problem.setName("CoilSelfTest");
167  problem.setSystemDimensions(3);
168  problem.setGravity(Vec3D(0.0, -9.8, 0.0));
169 
170  // set problem geometry
171  problem.setXMax(1.0);
172  problem.setYMax(5.0);
173  problem.setZMax(2.0);
174  problem.setXMin(-1.0);
175  problem.setYMin(-1.0);
176  problem.setTimeMax(0.5);
178  problem.particleRadius = 0.2;
179 
182  species.setDensity(1000);
183  Mdouble tc = 0.05;
184  Mdouble restitutionCoefficient = 0.8;
185 
186  Mdouble particleMass = pow(problem.particleRadius, 3) * constants::pi * 4.0 / 3.0 * species.getDensity();
187  species.setCollisionTimeAndRestitutionCoefficient(tc, restitutionCoefficient, particleMass);
188  problem.speciesHandler.copyAndAddObject(species);
190 
192  problem.setTimeStep(0.02 * 0.05);
194  problem.getTimeStep()));
195  problem.solve();
197 
198 }
double Mdouble
Definition: GeneralDefine.h:34
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
[CST:headers]
Definition: CoilSelfTest.cpp:43
Mdouble particleRadius
Definition: CoilSelfTest.cpp:152
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:408
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1427
void setYMin(Mdouble newYMin)
Sets the value of YMin, the lower bound of the problem domain in the y-direction.
Definition: DPMBase.cc:1034
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
void setYMax(Mdouble newYMax)
Sets the value of YMax, the upper bound of the problem domain in the y-direction.
Definition: DPMBase.cc:1191
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 setXMin(Mdouble newXMin)
Sets the value of XMin, the lower bound of the problem domain in the x-direction.
Definition: DPMBase.cc:1010
Mdouble getTimeMax() const
Returns the maximum simulation duration.
Definition: DPMBase.cc:888
void setGravity(Vec3D newGravity)
Sets a new value for the gravitational acceleration.
Definition: DPMBase.cc:1383
void setCollisionTimeAndRestitutionCoefficient(Mdouble tc, Mdouble eps, BaseParticle *p)
Sets k, disp such that it matches a given tc and eps for a collision of two copies of particle p.
Definition: LinearViscoelasticNormalSpecies.cc:212
void setDensity(Mdouble density)
Definition: ParticleSpecies.cc:108
Mdouble getDensity() const
Allows density_ to be accessed.
Definition: ParticleSpecies.cc:118
Definition: Vector.h:51
const Mdouble pi
Definition: ExtendedMath.h:45
unsigned int getSaveCountFromNumberOfSavesAndTimeMaxAndTimeStep(unsigned int numberOfSaves, Mdouble timeMax, Mdouble timeStep)
Returns the correct saveCount if the total number of saves, the final time and the time step is known...
Definition: FormulaHelpers.cc:96

References BaseHandler< T >::copyAndAddObject(), ParticleSpecies::getDensity(), helpers::getSaveCountFromNumberOfSavesAndTimeMaxAndTimeStep(), DPMBase::getTimeMax(), DPMBase::getTimeStep(), CoilSelfTest::particleRadius, constants::pi, LinearViscoelasticNormalSpecies::setCollisionTimeAndRestitutionCoefficient(), ParticleSpecies::setDensity(), DPMBase::setGravity(), DPMBase::setName(), DPMBase::setSaveCount(), DPMBase::setSystemDimensions(), DPMBase::setTimeMax(), DPMBase::setTimeStep(), DPMBase::setXMax(), DPMBase::setXMin(), DPMBase::setYMax(), DPMBase::setYMin(), DPMBase::setZMax(), DPMBase::solve(), and DPMBase::speciesHandler.