TwoParticleElasticCollisionInteractionSelfTest.cpp File Reference
#include "Mercury2D.h"
#include "Walls/InfiniteWall.h"
#include <iostream>
#include "Species/Species.h"
#include "Species/LinearViscoelasticSpecies.h"

Classes

class  TwoParticleElasticCollisionInteraction
 In this file two particles are symmetrically placed in a bi-axial box are allowed to jump around under gravity. It tests walls gravity and symmetry. More...
 

Functions

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

Function Documentation

◆ main()

int main ( int argc  UNUSED,
char *argv[]  UNUSED 
)
70 {
71  TwoParticleElasticCollisionInteraction twoParticleElasticCollisionInteractionProblem;
72  twoParticleElasticCollisionInteractionProblem.setName("TwoParticleElasticCollisionInteractionSelfTest");
73 
74  auto species = new LinearViscoelasticSpecies;
75  twoParticleElasticCollisionInteractionProblem.speciesHandler.addObject(species);
76  species->setDensity(2000);
77  species->setStiffness(1e4);
78 
79  twoParticleElasticCollisionInteractionProblem.setTimeMax(0.25);
80  twoParticleElasticCollisionInteractionProblem.setSaveCount(10);
81  twoParticleElasticCollisionInteractionProblem.setTimeStep(2e-5);
82  twoParticleElasticCollisionInteractionProblem.fStatFile.setFileType(FileType::NO_FILE);
83  twoParticleElasticCollisionInteractionProblem.getInteractionFile().setFileType(FileType::ONE_FILE);
84 
85  twoParticleElasticCollisionInteractionProblem.solve();
86 
87 }
@ NO_FILE
file will not be created/read
@ ONE_FILE
all data will be written into/ read from a single file called name_
Species< LinearViscoelasticNormalSpecies > LinearViscoelasticSpecies
Definition: LinearViscoelasticSpecies.h:33
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
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 & getInteractionFile()
Return a reference to the file InteractionsFile.
Definition: DPMBase.cc:345
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 solve()
The work horse of the code.
Definition: DPMBase.cc:4270
void setFileType(FileType fileType)
Sets the type of file needed to write into or read from. File::fileType_.
Definition: File.cc:215
void addObject(ParticleSpecies *S) override
Adds a new ParticleSpecies to the SpeciesHandler.
Definition: SpeciesHandler.cc:890
In this file two particles are symmetrically placed in a bi-axial box are allowed to jump around unde...
Definition: TwoParticleElasticCollisionInteractionSelfTest.cpp:34

References SpeciesHandler::addObject(), DPMBase::fStatFile, DPMBase::getInteractionFile(), NO_FILE, ONE_FILE, File::setFileType(), DPMBase::setName(), DPMBase::setSaveCount(), DPMBase::setTimeMax(), DPMBase::setTimeStep(), DPMBase::solve(), and DPMBase::speciesHandler.