Tutorial3_BouncingBallElastic.cpp File Reference

Classes

class  Tutorial3
 [T3:headers] More...
 

Functions

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

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)

[T3:class]

[T3:main]

[T3:speciesProp]

[T3:speciesProp]

[T3:output]

[T3:output]

[T3:visualOutput]

[T3:visualOutput]

[T3:solve]

[T3:solve]

55 {
56 
57  // Problem setup
59 
60  // name the output files
61  problem.setName("Tutorial3");
62  // remove old output files with the same name
63  problem.removeOldFiles();
64  // set gravivational acceleration
65  problem.setGravity(Vec3D(0.0, 0.0, -9.81));
66  // set domain size (xMin = yMin = zMin = 0 by default)
67  problem.setXMax(0.5);
68  problem.setYMax(0.5);
69  problem.setZMax(0.5);
70  problem.setTimeMax(2.0);
71 
73  // Sets a linear spring-damper contact law.
74  // The normal spring stiffness and normal dissipation is computed and set as
75  // For collision time tc=0.005 and restitution coefficient rc=1.0,
76  auto species = problem.speciesHandler.copyAndAddObject(LinearViscoelasticSpecies());
77  species->setDensity(2500.0);
78  double mass = species->getMassFromRadius(0.005);
79  double collisionTime = 0.005;
80  double restitution = 1.0;
81  species->setCollisionTimeAndRestitutionCoefficient(collisionTime,restitution,mass);
82  logger(INFO, "Stiffness %, dissipation %", species->getStiffness(), species->getDissipation());
84 
86  problem.setSaveCount(25);
88 
89  // Output vtk files for ParaView visualisation
91  problem.wallHandler.setWriteVTK(FileType::ONE_FILE);
92  problem.setParticlesWriteVTK(true);
94 
96  // Sets time step to 1/50th of the collision time
97  problem.setTimeStep(0.005 / 50.0);
98  // Start the solver (calls setupInitialConditions and initiates time loop)
99  problem.solve(argc, argv);
101  return 0;
102 }
@ ONE_FILE
all data will be written into/ read from a single file called name_
Species< LinearViscoelasticNormalSpecies > LinearViscoelasticSpecies
Definition: LinearViscoelasticSpecies.h:11
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
[T3:headers]
Definition: Tutorial3_BouncingBallElastic.cpp:26
Definition: Kernel/Math/Vector.h:30
#define INFO(i)
Definition: mumps_solver.h:54
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213

References INFO, logger, ONE_FILE, and problem.