WallSpeciesUnitTest.cpp File Reference
#include "DPMBase.h"
#include "Particles/SphericalParticle.h"
#include "Walls/InfiniteWall.h"
#include "Species/LinearViscoelasticSpecies.h"
#include <cmath>
#include <iostream>
#include <iomanip>

Classes

class  WallSpecies
 

Functions

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

Function Documentation

◆ main()

int main ( int argc  UNUSED,
char *argv[]  UNUSED 
)
90 {
91  logger(VERBOSE, "\nSimulation of one particle, d=0.1, interacting with walls with different coefficient of "
92  "restitution\n\n"
93  "The purpose of the test is to check walls species information is correctly picked up");
94  WallSpecies problem;
95  problem.setFileType(FileType::NO_FILE); //comment if you want file output
96  problem.setName("WallSpecies");
97  problem.solve();
98  const Vec3D v = problem.particleHandler.getObject(0)->getVelocity();
99  logger(INFO, "v_x(t_max)=% should be ~0.5", v.X);
100  logger(INFO, "v_z(t_max)=% should be ~0.25", v.Z);
101  helpers::check(v.Z, 0.23642946655364, 1e-7, "v_z");
102  helpers::check(v.X, 0.49298992225767, 1e-7, "v_x");
103 }
@ NO_FILE
file will not be created/read
LL< Log::VERBOSE > VERBOSE
Verbose information.
Definition: Logger.cc:57
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.
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:613
virtual const Vec3D & getVelocity() const
Returns the velocity of this interactable.
Definition: BaseInteractable.cc:329
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 setFileType(FileType fileType)
Sets File::fileType_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:459
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1437
void solve()
The work horse of the code.
Definition: DPMBase.cc:4270
Definition: Vector.h:51
Mdouble Z
Definition: Vector.h:66
Mdouble X
the vector components
Definition: Vector.h:66
Definition: WallSpeciesUnitTest.cpp:39
void check(double real, double ideal, double error, std::string errorMessage)
Definition: TestHelpers.cc:37

References helpers::check(), BaseHandler< T >::getObject(), BaseInteractable::getVelocity(), INFO, logger, NO_FILE, DPMBase::particleHandler, DPMBase::setFileType(), DPMBase::setName(), DPMBase::solve(), VERBOSE, Vec3D::X, and Vec3D::Z.