NDDEM
Functions
API

Functions

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

Detailed Description

These functions are useful for external access, for interactive runs. This is the basic flow of API calls to run an interactive simulation:

Function Documentation

◆ finalise()

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

Settles the simulation, closing open files etc.

◆ finalise_init()

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

Tell NDDEM that the simulations are now initialised and we can start running.

Warning
It is important to remember to call this function in interactive run!

◆ fixParticle()

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

Set a single particle location, velocity, and angular velocity.

◆ getBoundary()

template<int d>
Vector1Djs Simulation< d >::getBoundary ( int  a)
inline

Expose the array of boundaries.

◆ getContactForce()

template<int d>
Vector2Djs Simulation< d >::getContactForce ( )
inline

DEPRECATED: Use getContactInfo with the appropriate flags instead. Expose the array of particle id and normal forces.

◆ getContactInfos()

template<int d>
Vector2Djs Simulation< d >::getContactInfos ( int  flags)
inline

Expose the array of contact information.

◆ getGravityAngle()

template<int d>
double Simulation< d >::getGravityAngle ( )
inline

Expose the current gravity angle.

◆ getOrientation()

template<int d>
Vector2Djs Simulation< d >::getOrientation ( )
inline

Expose the array of orientation.

◆ getRadii()

template<int d>
Vector1Djs Simulation< d >::getRadii ( )
inline

Expose the array of radii.

◆ getRotationRate()

template<int d>
Vector1Djs Simulation< d >::getRotationRate ( )
inline

Expose the array of orientation rate.

◆ getTime()

template<int d>
double Simulation< d >::getTime ( )
inline

Expose the current time.

◆ getVelocity()

template<int d>
Vector2Djs Simulation< d >::getVelocity ( )
inline

Expose the array of velocities.

◆ getWallForce()

template<int d>
Vector2Djs Simulation< d >::getWallForce ( )
inline

Expose the array of wall forces.

◆ getX()

template<int d>
Vector2Djs Simulation< d >::getX ( )
inline

Expose the array of locations.

◆ interpret_command()

template<int d>
void Simulation< d >::interpret_command ( string  in)
inline

Interpret individual script command from string.

Parameters
inInput command string

◆ setAngularVelocity()

template<int d>
void Simulation< d >::setAngularVelocity ( int  id,
Vector1Djs  omega 
)
inline

Set the angular velocity of a single particle.

◆ setExternalForce()

template<int d>
void Simulation< d >::setExternalForce ( int  id,
int  duration,
Vector1Djs  force 
)
inline

Set an additional external force on a particle for a certain duration.

Parameters
idparticle id
durationnumber of timesteps to apply the force for
forceforce vector to apply

◆ setFrozen()

template<int d>
void Simulation< d >::setFrozen ( int  a)
inline

Freeze a single particle.

◆ setMass()

template<int d>
void Simulation< d >::setMass ( int  id,
double  mass 
)
inline

Set the mass of a specific particle.

◆ setRadius()

template<int d>
void Simulation< d >::setRadius ( int  id,
double  radius 
)
inline

Set the radius of a specific particle.

◆ setVelocity()

template<int d>
void Simulation< d >::setVelocity ( int  id,
Vector1Djs  vel 
)
inline

Set the array of locations.

Set the velocity of a single particle

◆ step_forward()

template<int d>
void Simulation< d >::step_forward ( int  nt)
inline

Advance the simulation for nt steps (actual duration nt*dt).

Parameters
ntnumber of timestep to advance