MercuryDPM  0.11
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FreeFallSelfTest.cpp File Reference
#include "Mercury2D.h"
#include "Particles/BaseParticle.h"
#include "Walls/InfiniteWall.h"
#include <iostream>
#include <Species/LinearViscoelasticSpecies.h>

Go to the source code of this file.

Classes

class  FreeFallSelfTest
 This case does a single elastic particle falling on an infinite plane. The k is chosen so that the maximum overlap with the wall is around 2% of the partcles dimater; whereas, the time is taken to ensure 50 steps with a collision. More...
 

Functions

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

Function Documentation

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

Start off my solving the default problem

Definition at line 54 of file FreeFallSelfTest.cpp.

References SpeciesHandler::addObject(), Files::fStatFile, NO_FILE, File::setFileType(), Files::setName(), DPMBase::setParticleDimensions(), Files::setSaveCount(), DPMBase::setTimeStep(), DPMBase::setXMax(), DPMBase::setYMax(), DPMBase::solve(), and DPMBase::speciesHandler.

55 {
56  std::cout<<"Single particle bouncing vertically on the bottom plate"<<std::endl;
58  FreeFallSelfTest freeFallSelfTestProblem;
59  auto species = new LinearViscoelasticSpecies;
60  freeFallSelfTestProblem.speciesHandler.addObject(species);
61  species->setDensity(2000.0);
62  freeFallSelfTestProblem.setParticleDimensions(3);
63  species->setStiffness(8000000.0);
64 
65  freeFallSelfTestProblem.setName("FreeFallSelfTest");
66  freeFallSelfTestProblem.setSaveCount(500);
67  freeFallSelfTestProblem.fStatFile.setFileType(FileType::NO_FILE);
68  freeFallSelfTestProblem.setTimeStep(1e-6);
69  freeFallSelfTestProblem.setYMax(0.1);
70  freeFallSelfTestProblem.setXMax(0.01);
71  freeFallSelfTestProblem.solve(argc, argv);
72 }
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 setParticleDimensions(unsigned int particleDimensions)
Allows the dimension of the particle (f.e. for mass) to be changed. e.g. discs or spheres...
Definition: DPMBase.cc:474
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 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
virtual void addObject(ParticleSpecies *const S)
Adds a new ParticleSpecies to the SpeciesHandler.
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
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 setFileType(FileType fileType)
Sets the type of file needed to write into or read from. File::fileType_.
Definition: File.cc:209
This case does a single elastic particle falling on an infinite plane. The k is chosen so that the ma...
void setTimeStep(Mdouble newDt)
Allows the time step dt to be changed.
Definition: DPMBase.cc:353