NDDEM
Public Member Functions | Public Attributes | List of all members
Simulation< d > Class Template Reference

#include <DEMND.h>

Public Member Functions

void save_restart (const std::string &filename)
 
void load_restart (const std::string &filename)
 
template<class Archive >
void serialize (Archive &ar)
 
 Simulation (int NN)
 
void init_from_file (char filename[])
 Initialise the simulation from a file. More...
 
void finalise_init ()
 Tell NDDEM that the simulations are now initialised and we can start running. More...
 
void interpret_command (string in)
 Interpret individual script command from string. More...
 
void step_forward_all ()
 Run the whole simulation as defined in the input script. More...
 
void step_forward (int nt)
 Advance the simulation for nt steps (actual duration nt*dt). More...
 
void finalise ()
 Settles the simulation, closing open files etc. More...
 
Vector2Djs getX ()
 Expose the array of locations. More...
 
Vector1Djs getRadii ()
 Expose the array of radii. More...
 
void setRadius (int id, double radius)
 Set the radius of a specific particle. More...
 
void setMass (int id, double mass)
 Set the mass of a specific particle. More...
 
Vector2Djs getVelocity ()
 Expose the array of velocities. More...
 
Vector1Djs getRotationRate ()
 Expose the array of orientation rate. More...
 
Vector2Djs getContactForce ()
 DEPRECATED: Use getContactInfo with the appropriate flags instead. Expose the array of particle id and normal forces. More...
 
Vector2Djs getContactInfos (int flags)
 Expose the array of contact information. More...
 
void setVelocity (int id, Vector1Djs vel)
 Set the array of locations. More...
 
void setAngularVelocity (int id, Vector1Djs omega)
 Set the angular velocity of a single particle. More...
 
void fixParticle (int a, Vector1Djs loc)
 Set a single particle location, velocity, and angular velocity. More...
 
void setFrozen (int a)
 Freeze a single particle. More...
 
double getTime ()
 Expose the current time. More...
 
double getGravityAngle ()
 Expose the current gravity angle. More...
 
Vector2Djs getOrientation ()
 Expose the array of orientation. More...
 
Vector1Djs getBoundary (int a)
 Expose the array of boundaries. More...
 
void setBoundary (int a, Vector1Djs loc)
 
Vector2Djs getWallForce ()
 Expose the array of wall forces. More...
 
void setExternalForce (int id, int duration, Vector1Djs force)
 Set an additional external force on a particle for a certain duration. More...
 
void randomDrop ()
 

Public Attributes

Parameters< dP
 
int N
 
std::vector< std::vector< double > > X
 
std::vector< std::vector< double > > V
 
std::vector< std::vector< double > > A
 
std::vector< std::vector< double > > Omega
 
std::vector< std::vector< double > > F
 
std::vector< std::vector< double > > FOld
 
std::vector< std::vector< double > > Torque
 
std::vector< std::vector< double > > TorqueOld
 
std::vector< double > Vmag
 
std::vector< double > OmegaMag
 
std::vector< double > Z
 
std::vector< std::vector< double > > Fcorr
 
std::vector< std::vector< double > > TorqueCorr
 
std::vector< std::optional< int > > RigidBodyId
 
std::vector< SpecificAction< d > > ExternalAction
 
std::vector< uint32_tPBCFlags
 
std::vector< std::vector< double > > WallForce
 
std::vector< std::vector< double > > empty_array
 
std::vector< std::vector< double > > ParticleForce
 
vector< uint32_tGhost
 
vector< uint32_tGhost_dir
 
v1d Atmp
 
int numthread =1
 
Multiproc< dMP
 
Cells< dcells
 
Octree< doctree
 
double t
 
int ti
 
double dt
 
clock_t tnow
 
clock_t tprevious
 

Constructor & Destructor Documentation

◆ Simulation()

template<int d>
Simulation< d >::Simulation ( int  NN)
inline

Member Function Documentation

◆ init_from_file()

template<int d>
void Simulation< d >::init_from_file ( char  filename[])
inline

Initialise the simulation from a file.

◆ load_restart()

template<int d>
void Simulation< d >::load_restart ( const std::string &  filename)
inline

◆ randomDrop()

template<int d>
void Simulation< d >::randomDrop ( )
inline

< Seed for the boost RNG. Initialised with the default seed of the Mersenne twister in Boost

◆ save_restart()

template<int d>
void Simulation< d >::save_restart ( const std::string &  filename)
inline

◆ serialize()

template<int d>
template<class Archive >
void Simulation< d >::serialize ( Archive &  ar)
inline

◆ setBoundary()

template<int d>
void Simulation< d >::setBoundary ( int  a,
Vector1Djs  loc 
)
inline

◆ step_forward_all()

template<int d>
void Simulation< d >::step_forward_all ( )
inline

Run the whole simulation as defined in the input script.

Parameters
ntnumber of timestep to advance

Member Data Documentation

◆ A

template<int d>
std::vector< std::vector <double> > Simulation< d >::A

◆ Atmp

template<int d>
v1d Simulation< d >::Atmp

◆ cells

template<int d>
Cells<d> Simulation< d >::cells

◆ dt

template<int d>
double Simulation< d >::dt

◆ empty_array

template<int d>
std::vector<std::vector<double> > Simulation< d >::empty_array

◆ ExternalAction

template<int d>
std::vector<SpecificAction<d> > Simulation< d >::ExternalAction

◆ F

template<int d>
std::vector< std::vector <double> > Simulation< d >::F

◆ Fcorr

template<int d>
std::vector< std::vector <double> > Simulation< d >::Fcorr

◆ FOld

template<int d>
std::vector< std::vector <double> > Simulation< d >::FOld

◆ Ghost

template<int d>
vector<uint32_t> Simulation< d >::Ghost

◆ Ghost_dir

template<int d>
vector<uint32_t> Simulation< d >::Ghost_dir

◆ MP

template<int d>
Multiproc<d> Simulation< d >::MP

◆ N

template<int d>
int Simulation< d >::N

◆ numthread

template<int d>
int Simulation< d >::numthread =1

◆ octree

template<int d>
Octree<d> Simulation< d >::octree

◆ Omega

template<int d>
std::vector< std::vector <double> > Simulation< d >::Omega

◆ OmegaMag

template<int d>
std::vector< double > Simulation< d >::OmegaMag

◆ P

template<int d>
Parameters<d> Simulation< d >::P

◆ ParticleForce

template<int d>
std::vector< std::vector <double> > Simulation< d >::ParticleForce

◆ PBCFlags

template<int d>
std::vector<uint32_t> Simulation< d >::PBCFlags

◆ RigidBodyId

template<int d>
std::vector< std::optional<int> > Simulation< d >::RigidBodyId

◆ t

template<int d>
double Simulation< d >::t

◆ ti

template<int d>
int Simulation< d >::ti

◆ tnow

template<int d>
clock_t Simulation< d >::tnow

◆ Torque

template<int d>
std::vector< std::vector <double> > Simulation< d >::Torque

◆ TorqueCorr

template<int d>
std::vector< std::vector <double> > Simulation< d >::TorqueCorr

◆ TorqueOld

template<int d>
std::vector< std::vector <double> > Simulation< d >::TorqueOld

◆ tprevious

template<int d>
clock_t Simulation< d >::tprevious

◆ V

template<int d>
std::vector< std::vector <double> > Simulation< d >::V

◆ Vmag

template<int d>
std::vector< double > Simulation< d >::Vmag

◆ WallForce

template<int d>
std::vector< std::vector <double> > Simulation< d >::WallForce

◆ X

template<int d>
std::vector< std::vector <double> > Simulation< d >::X

◆ Z

template<int d>
std::vector< double > Simulation< d >::Z

The documentation for this class was generated from the following file: