ObliqueImpactSelfTest.cpp File Reference

Classes

class  ObliqueImpactSelfTest
 

Functions

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

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)
65 {
66  logger(INFO, "Single particle hitting the bottom plate in an oblique impact");
67  // Make the problem and set the name
68  ObliqueImpactSelfTest ObliqueImpactSelfTestProblem;
69  ObliqueImpactSelfTestProblem.setName("ObliqueImpactSelfTest");
70 
71  //Set the species of the particle and wall, and its properties
73  species.setDensity(6./constants::pi);
74  ObliqueImpactSelfTestProblem.setParticleDimensions(3);
75  species.setEffectiveElasticModulusAndPoissonRatio(1e5, 0.3);
76 // species.setDissipation(0.2);
77 // species.setSlidingDissipation(0.9);
78  species.setSlidingFrictionCoefficient(0.1);
79  ObliqueImpactSelfTestProblem.speciesHandler.copyAndAddObject(species);
80 
81  //set the parameters for the solver
82  ObliqueImpactSelfTestProblem.setSaveCount(500);
83  ObliqueImpactSelfTestProblem.setFileType(FileType::ONE_FILE);
84  ObliqueImpactSelfTestProblem.fStatFile.setFileType(FileType::ONE_FILE);
85 // ObliqueImpactSelfTestProblem.wallHandler.setWriteVTK(FileType::NO_FILE);
86  ObliqueImpactSelfTestProblem.setTimeStep(0.25e-8);
87 
88  //solve the system, the single particle will now bounce on the plate
89  ObliqueImpactSelfTestProblem.solve(argc, argv);
90  helpers::writeToFile(ObliqueImpactSelfTestProblem.getName() + ".gnu", "plot '" + ObliqueImpactSelfTestProblem.getName() + ".fstat' u 8:($10*$14) w lp");
91  logger(INFO, "finished oblique impact test: run 'gnuplot %.gnu' to view output", ObliqueImpactSelfTestProblem.getName());
92 }
@ ONE_FILE
all data will be written into/ read from a single file called name_
LL< Log::INFO > INFO
Info log level.
Definition: Logger.cc:55
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
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
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
void setParticleDimensions(unsigned int particleDimensions)
Sets the particle dimensionality.
Definition: DPMBase.cc:1448
const std::string & getName() const
Returns the name of the file. Does not allow to change it though.
Definition: DPMBase.cc:399
void setFileType(FileType fileType)
Sets File::fileType_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:459
void setTimeStep(Mdouble newDt)
Sets a new value for the simulation time step.
Definition: DPMBase.cc:1234
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
Definition: ObliqueImpactSelfTest.cpp:36
void setDensity(Mdouble density)
Definition: ParticleSpecies.cc:108
Contains material and contact force properties.
Definition: Species.h:35
const Mdouble pi
Definition: ExtendedMath.h:45
bool writeToFile(std::string filename, std::string filecontent)
Writes a string to a file.
Definition: FileIOHelpers.cc:58

References BaseHandler< T >::copyAndAddObject(), DPMBase::fStatFile, DPMBase::getName(), INFO, logger, ONE_FILE, constants::pi, ParticleSpecies::setDensity(), DPMBase::setFileType(), File::setFileType(), DPMBase::setName(), DPMBase::setParticleDimensions(), DPMBase::setSaveCount(), DPMBase::setTimeStep(), DPMBase::solve(), DPMBase::speciesHandler, and helpers::writeToFile().