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

Go to the source code of this file.

Classes

class  NewtonsCradleSelftest
 In this file a cubic packing of 5^3 particles in a tri-axial box is created and allowed to settle under small gravity. After that Z statistics are calculated. More...
 

Functions

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

Function Documentation

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

should give you Density 1

Definition at line 84 of file CubicPackingSelfTest.cpp.

References BaseHandler< T >::copyAndAddObject(), BaseHandler< T >::getObject(), DPMBase::getTimeMax(), NewtonsCradleSelftest::N, StatisticsVector< T >::setCGShape(), StatisticsVector< T >::setCGTimeMin(), StatisticsVector< T >::setCGWidth(), ParticleSpecies::setDensity(), DPMBase::setGravity(), StatisticsVector< T >::setN(), Files::setName(), Files::setSaveCount(), StatisticsVector< T >::setSuperExact(), DPMBase::setSystemDimensions(), DPMBase::setTimeMax(), StatisticsVector< T >::setTimeMaxStat(), DPMBase::setTimeStep(), StatisticsVector< T >::setVerbosityLevel(), DPMBase::solve(), DPMBase::speciesHandler, and StatisticsVector< T >::statistics_from_fstat_and_data().

85 {
86  NewtonsCradleSelftest problem;
87  problem.setName("CubicPackingSelfTest");
89 
90  //set the number of particles
91  problem.N = 5;
92  problem.setSystemDimensions(3);
93  problem.speciesHandler.getObject(0)->setDensity(1.9098593);
94  problem.setGravity(Vec3D(0., 0., -1.));
95  species->setCollisionTimeAndRestitutionCoefficient(.01, .1, 1.);
96  problem.setTimeStep(.0002);
97  problem.setTimeMax(0.2);
98  problem.setSaveCount(1000);
99  problem.solve();
100 
101  StatisticsVector<Z> stats("CubicPackingSelfTest");
102  double n = 500;
103  stats.setN(n);
104  stats.setCGWidth(.1);
105  stats.setSuperExact(false);
106  stats.setCGShape("Gaussian");
107  stats.setCGTimeMin(problem.getTimeMax() * .999999);
108  stats.setTimeMaxStat(1e20);
109  stats.setVerbosityLevel(0);
110  stats.statistics_from_fstat_and_data();
112 
113 }
void solve()
The work horse of the code.
Definition: DPMBase.cc:1895
void setTimeMax(Mdouble newTMax)
Allows the upper time limit to be changed.
Definition: DPMBase.cc:179
void setSystemDimensions(unsigned int newDim)
Allows for the dimension of the simulation to be changed.
Definition: DPMBase.cc:453
void setGravity(Vec3D newGravity)
Allows to modify the gravity vector.
Definition: DPMBase.cc:431
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: Files.cc:149
U * copyAndAddObject(const U &O)
Creates a copy of a Object and adds it to the BaseHandler.
Definition: BaseHandler.h:268
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:415
void setDensity(Mdouble density)
Allows the density to be changed.
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
In this file a cubic packing of 5^3 particles in a tri-axial box is created and allowed to settle und...
This class is used to extract statistical data from MD simulations.
void setTimeStep(Mdouble newDt)
Allows the time step dt to be changed.
Definition: DPMBase.cc:353
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
Mdouble getTimeMax() const
Allows the user to access the total simulation time during the simulation. Cannot change it though...
Definition: DPMBase.cc:194