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

Go to the source code of this file.

Classes

class  WallSpecies
 this tests if moving the wall works with CWall::move(Vec3D velocity,Vec3D dt). More...
 

Functions

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

Function Documentation

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

Definition at line 99 of file wallSpecies_demo.cpp.

References BaseHandler< T >::getObject(), BaseInteractable::getVelocity(), DPMBase::particleHandler, Files::setName(), DPMBase::solve(), Vec3D::X, and Vec3D::Z.

100 {
101  std::cout << std::endl << "Simulation of one particle, d=0.1, interacting with walls with different coefficeient of resitution" << std::endl;
102  std::cout << std::endl << "The purpose of the test is to check walls species information is correctly picked up" << std::endl;
103  WallSpecies problem;
104  problem.setName("wallSpecies");
105  problem.solve();
106  std::cout << "v_z(tmax) = " << std::setprecision(14) << problem.particleHandler.getObject(0)->getVelocity().Z << " (should be 0.25 give or take)" << std::endl;
107  std::cout << "v_x(tmax) = " << std::setprecision(14) << problem.particleHandler.getObject(0)->getVelocity().X << " (should be 0.5 give or take)" << std::endl;
108 }
void solve()
The work horse of the code.
Definition: DPMBase.cc:1895
Mdouble X
the vector components
Definition: Vector.h:52
this tests if moving the wall works with CWall::move(Vec3D velocity,Vec3D dt).
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: Files.cc:149
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created...
Definition: DPMBase.h:878
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:415
virtual const Vec3D & getVelocity() const
Returns the velocity of this interactable.
Mdouble Z
Definition: Vector.h:52