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

Generic class to handle the simulation set up. More...

#include <Parameters.h>

Public Member Functions

 Parameters ()
 
 Parameters (int NN)
 Set the default values for all parameters. Calls to setup parameter function should be provided after initialisation of this class. More...
 
void reset_ND (int NN)
 reset the full simulation. More...
 
template<class Archive >
void serialize (Archive &ar)
 
int set_boundaries ()
 Set default boundaries. More...
 
void perform_PBC (v1d &X, uint32_t &PBCFlags)
 Bring particle back in the simulation box if the grains cross the boundaries. More...
 
void perform_PBCLE_move ()
 
void perform_PBCLE (v1d &X, v1d &V, uint32_t &PBCFlag)
 
bool perform_forceinsphere (v1d &X)
 
void perform_MOVINGWALL ()
 Move the boundary wall if moving. More...
 
int init_mass ()
 Initialise particle mass. More...
 
int init_inertia ()
 Initialise particle moment of inertia. More...
 
void do_nothing (double time __attribute__((unused)))
 
void do_gravityrotate (double deltatime)
 
void load_datafile (char path[], v2d &X, v2d &V, v2d &Omega)
 Load and parse input script. More...
 
void check_events (float time, v2d &X, v2d &V, v2d &Omega)
 Verify if an event triggers at the current time time. More...
 
void interpret_command (istream &in, v2d &X, v2d &V, v2d &Omega)
 Parse input script commands. More...
 
void interpret_command (string &in, v2d &X, v2d &V, v2d &Omega)
 Parse input script commands. More...
 
void remove_particle (int idx, v2d &X, v2d &V, v2d &A, v2d &Omega, v2d &F, v2d &FOld, v2d &Torque, v2d &TorqueOld)
 Not tested. More...
 
void add_particle ()
 Not implemented. More...
 
void init_locations (char *line, v2d &X, char *extras)
 Set particle locations. More...
 
void init_radii (char line[], v1d &r)
 Set particle radii. More...
 
void display_info (int tint, v2d &V, v2d &Omega, v2d &F, v2d &Torque, int, int)
 On screen information display. More...
 
void quit_cleanly ()
 Close opened dump files in the event of an emergency quit (usually a SIGINT signal to the process) More...
 
void finalise ()
 Close opened dump files. More...
 
void xml_header ()
 Write the Xml header (should go into a file dedicated to the writing though ...) More...
 
int dumphandling (int ti, double t, v2d &X, v2d &V, v1d &Vmag, v2d &A, v2d &Omega, v1d &OmegaMag, vector< uint32_t > &PBCFlags, v1d &Z, Multiproc< d > &MP)
 Dump writing functions. More...
 
int savecsvcontact (FILE *out, ExportData outflags, Multiproc< d > &MP, cv2d &X)
 

Public Attributes

int N
 Number of particles. More...
 
int tdump
 Write dump file every this many timesteps. More...
 
int tinfo
 Show detail information on scren every this many timesteps. More...
 
double T
 Run until this time (note it is a floating point). More...
 
double dt
 timestep More...
 
double rho
 density More...
 
double Kn
 Normal spring constant. More...
 
double Kt
 Tangential spring constant. More...
 
double Gamman
 Normal dissipation. More...
 
double Gammat
 Tangential dissipation. More...
 
double Mu
 Fricton. More...
 
double Mu_wall
 
double damping
 
bool forceinsphere
 
double cellsize
 Size of cells for contact detection. More...
 
ContactModels ContactModel =HOOKE
 Model of interparticle contact. More...
 
ContactStrategies contact_strategy = NAIVE
 Strategy for the contact detection. More...
 
vector< std::pair< ExportType, ExportData > > dumps
 Vector linking dump file and data dumped. More...
 
vector< double > r
 Particle radii. More...
 
vector< double > m
 Particle mass. More...
 
vector< double > I
 Particule moment of inertia. More...
 
vector< double > g
 Gravity vector. More...
 
vector< bool > Frozen
 Frozen atom if true. More...
 
vector< Boundary< d > > Boundaries
 List of boundaries. Second dimension is {min, max, length, type}. More...
 
string Directory
 Saving directory. More...
 
bool orientationtracking
 Track orientation? More...
 
bool wallforcecompute
 Compute for on the wall? More...
 
bool wallforcerequested
 Compute for on the wall? More...
 
bool wallforcecomputed
 Compute for on the wall? More...
 
double graddesc_gamma
 Decay rate parameters for the gradient descent algorithm. More...
 
double graddesc_tol
 Tolerance for the gradient descent algorithm. More...
 
bool contactforcedump
 Extract the forces between grains as well? More...
 
unsigned long int seed = 5489UL
 Seed for the boost RNG. Initialised with the default seed of the Mersenne twister in Boost. More...
 
double gravityrotateangle = 0.0
 
RigidBodies_< dRigidBodies
 Handle all the rigid bodies. More...
 
vector< Mesh< d > > Meshes
 Handle all meshes. More...
 
int n_restart =-1
 Restart writing frequency. More...
 
std::string restart_filename =""
 Restart filename. More...
 
unsigned char restart_flag
 
multimap< float, string > events
 For storing events. first is the time at which the event triggers, second is the event command string, parsed on the fly when the event gets triggered. More...
 
double grav_intensity = 10
 
double grav_omega =1
 
int grav_rotdim [2] ={0,1}
 
void(Parameters::* update_gravity )(double time) = &Parameters::do_nothing
 
XMLWriterxmlout
 

Detailed Description

template<int d>
class Parameters< d >

Generic class to handle the simulation set up.

Constructor & Destructor Documentation

◆ Parameters() [1/2]

template<int d>
Parameters< d >::Parameters ( )
inline

◆ Parameters() [2/2]

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

Set the default values for all parameters. Calls to setup parameter function should be provided after initialisation of this class.

Member Function Documentation

◆ add_particle()

template<int d>
void Parameters< d >::add_particle

Not implemented.

◆ check_events()

template<int d>
void Parameters< d >::check_events ( float  time,
v2d X,
v2d V,
v2d Omega 
)

Verify if an event triggers at the current time time.

◆ display_info()

template<int d>
void Parameters< d >::display_info ( int  tint,
v2d V,
v2d Omega,
v2d F,
v2d Torque,
int  nct,
int  ngst 
)

On screen information display.

◆ do_gravityrotate()

template<int d>
void Parameters< d >::do_gravityrotate ( double  deltatime)
inline

◆ do_nothing()

template<int d>
void Parameters< d >::do_nothing ( double time   __attribute__(unused))
inline

◆ dumphandling()

template<int d>
int Parameters< d >::dumphandling ( int  ti,
double  t,
v2d X,
v2d V,
v1d Vmag,
v2d A,
v2d Omega,
v1d OmegaMag,
vector< uint32_t > &  PBCFlags,
v1d Z,
Multiproc< d > &  MP 
)

Dump writing functions.

◆ finalise()

template<int d>
void Parameters< d >::finalise

Close opened dump files.

◆ init_inertia()

template<int d>
int Parameters< d >::init_inertia

Initialise particle moment of inertia.

◆ init_locations()

template<int d>
void Parameters< d >::init_locations ( char *  line,
v2d X,
char *  extras 
)

Set particle locations.

◆ init_mass()

template<int d>
int Parameters< d >::init_mass

Initialise particle mass.

◆ init_radii()

template<int d>
void Parameters< d >::init_radii ( char  line[],
v1d r 
)

Set particle radii.

◆ interpret_command() [1/2]

template<int d>
void Parameters< d >::interpret_command ( istream &  in,
v2d X,
v2d V,
v2d Omega 
)

Parse input script commands.

◆ interpret_command() [2/2]

template<int d>
void Parameters< d >::interpret_command ( string &  in,
v2d X,
v2d V,
v2d Omega 
)

Parse input script commands.

◆ load_datafile()

template<int d>
void Parameters< d >::load_datafile ( char  path[],
v2d X,
v2d V,
v2d Omega 
)

Load and parse input script.

◆ perform_forceinsphere()

template<int d>
bool Parameters< d >::perform_forceinsphere ( v1d X)
inline

◆ perform_MOVINGWALL()

template<int d>
void Parameters< d >::perform_MOVINGWALL

Move the boundary wall if moving.

◆ perform_PBC()

template<int d>
void Parameters< d >::perform_PBC ( v1d X,
uint32_t PBCFlags 
)

Bring particle back in the simulation box if the grains cross the boundaries.

◆ perform_PBCLE()

template<int d>
void Parameters< d >::perform_PBCLE ( v1d X,
v1d V,
uint32_t PBCFlag 
)

◆ perform_PBCLE_move()

template<int d>
void Parameters< d >::perform_PBCLE_move

◆ quit_cleanly()

template<int d>
void Parameters< d >::quit_cleanly

Close opened dump files in the event of an emergency quit (usually a SIGINT signal to the process)

◆ remove_particle()

template<int d>
void Parameters< d >::remove_particle ( int  idx,
v2d X,
v2d V,
v2d A,
v2d Omega,
v2d F,
v2d FOld,
v2d Torque,
v2d TorqueOld 
)

Not tested.

Warning
not really tested

◆ reset_ND()

template<int d>
void Parameters< d >::reset_ND ( int  NN)
inline

reset the full simulation.

◆ savecsvcontact()

template<int d>
int Parameters< d >::savecsvcontact ( FILE *  out,
ExportData  outflags,
Multiproc< d > &  MP,
cv2d X 
)
inline

◆ serialize()

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

◆ set_boundaries()

template<int d>
int Parameters< d >::set_boundaries

Set default boundaries.

Some Infos on set_boundaries.

◆ xml_header()

template<int d>
void Parameters< d >::xml_header

Write the Xml header (should go into a file dedicated to the writing though ...)

Member Data Documentation

◆ Boundaries

template<int d>
vector< Boundary<d> > Parameters< d >::Boundaries

List of boundaries. Second dimension is {min, max, length, type}.

◆ cellsize

template<int d>
double Parameters< d >::cellsize

Size of cells for contact detection.

◆ contact_strategy

template<int d>
ContactStrategies Parameters< d >::contact_strategy = NAIVE

Strategy for the contact detection.

◆ contactforcedump

template<int d>
bool Parameters< d >::contactforcedump

Extract the forces between grains as well?

◆ ContactModel

template<int d>
ContactModels Parameters< d >::ContactModel =HOOKE

Model of interparticle contact.

◆ damping

template<int d>
double Parameters< d >::damping

◆ Directory

template<int d>
string Parameters< d >::Directory

Saving directory.

◆ dt

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

timestep

◆ dumps

template<int d>
vector<std::pair<ExportType,ExportData> > Parameters< d >::dumps

Vector linking dump file and data dumped.

◆ events

template<int d>
multimap<float, string> Parameters< d >::events

For storing events. first is the time at which the event triggers, second is the event command string, parsed on the fly when the event gets triggered.

◆ forceinsphere

template<int d>
bool Parameters< d >::forceinsphere

◆ Frozen

template<int d>
vector<bool> Parameters< d >::Frozen

Frozen atom if true.

◆ g

template<int d>
vector<double> Parameters< d >::g

Gravity vector.

◆ Gamman

template<int d>
double Parameters< d >::Gamman

Normal dissipation.

◆ Gammat

template<int d>
double Parameters< d >::Gammat

Tangential dissipation.

◆ graddesc_gamma

template<int d>
double Parameters< d >::graddesc_gamma

Decay rate parameters for the gradient descent algorithm.

◆ graddesc_tol

template<int d>
double Parameters< d >::graddesc_tol

Tolerance for the gradient descent algorithm.

◆ grav_intensity

template<int d>
double Parameters< d >::grav_intensity = 10

◆ grav_omega

template<int d>
double Parameters< d >::grav_omega =1

◆ grav_rotdim

template<int d>
int Parameters< d >::grav_rotdim[2] ={0,1}

◆ gravityrotateangle

template<int d>
double Parameters< d >::gravityrotateangle = 0.0

◆ I

template<int d>
vector<double> Parameters< d >::I

Particule moment of inertia.

◆ Kn

template<int d>
double Parameters< d >::Kn

Normal spring constant.

◆ Kt

template<int d>
double Parameters< d >::Kt

Tangential spring constant.

◆ m

template<int d>
vector<double> Parameters< d >::m

Particle mass.

◆ Meshes

template<int d>
vector<Mesh<d> > Parameters< d >::Meshes

Handle all meshes.

◆ Mu

template<int d>
double Parameters< d >::Mu

Fricton.

◆ Mu_wall

template<int d>
double Parameters< d >::Mu_wall

◆ N

template<int d>
int Parameters< d >::N

Number of particles.

◆ n_restart

template<int d>
int Parameters< d >::n_restart =-1

Restart writing frequency.

◆ orientationtracking

template<int d>
bool Parameters< d >::orientationtracking

Track orientation?

◆ r

template<int d>
vector<double> Parameters< d >::r

Particle radii.

◆ restart_filename

template<int d>
std::string Parameters< d >::restart_filename =""

Restart filename.

◆ restart_flag

template<int d>
unsigned char Parameters< d >::restart_flag

◆ rho

template<int d>
double Parameters< d >::rho

density

◆ RigidBodies

template<int d>
RigidBodies_<d> Parameters< d >::RigidBodies

Handle all the rigid bodies.

◆ seed

template<int d>
unsigned long int Parameters< d >::seed = 5489UL

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

◆ T

template<int d>
double Parameters< d >::T

Run until this time (note it is a floating point).

◆ tdump

template<int d>
int Parameters< d >::tdump

Write dump file every this many timesteps.

◆ tinfo

template<int d>
int Parameters< d >::tinfo

Show detail information on scren every this many timesteps.

◆ update_gravity

template<int d>
void(Parameters::* Parameters< d >::update_gravity) (double time) = &Parameters::do_nothing

◆ wallforcecompute

template<int d>
bool Parameters< d >::wallforcecompute

Compute for on the wall?

◆ wallforcecomputed

template<int d>
bool Parameters< d >::wallforcecomputed

Compute for on the wall?

◆ wallforcerequested

template<int d>
bool Parameters< d >::wallforcerequested

Compute for on the wall?

◆ xmlout

template<int d>
XMLWriter* Parameters< d >::xmlout

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