NetDEM v1.0
Loading...
Searching...
No Matches
netdem::ExternalForce Class Reference

A class used to add external forces to particles in a DEM simulation. This is a pre-modifier, which will be executed at the beginning of a DEM cycle. More...

#include <external_force.hpp>

Inheritance diagram for netdem::ExternalForce:
netdem::Modifier

Public Member Functions

 ExternalForce ()
 Default constructor for ExternalForce class.
 
void SetForce (int id, double fx, double fy, double fz)
 Sets the force for a specific particle by ID.
 
void SetMoment (int id, double mx, double my, double mz)
 Sets the moment for a specific particle by ID.
 
void SetForce (const VecXT< int > &id_list, double fx, double fy, double fz)
 Sets the force for a list of particles.
 
void SetMoment (const VecXT< int > &id_list, double mx, double my, double mz)
 Sets the moment for a list of particles.
 
void AddForce (int id, double fx, double fy, double fz)
 Adds to the force for a specific particle by ID.
 
void AddMoment (int id, double mx, double my, double mz)
 Adds to the moment for a specific particle by ID.
 
void AddForce (const VecXT< int > &id_list, double fx, double fy, double fz)
 Adds to the force for a list of particles.
 
void AddMoment (const VecXT< int > &id_list, double mx, double my, double mz)
 Adds to the moment for a list of particles.
 
Vec3d GetForce (int id)
 Gets the total force on a specific particle by ID.
 
Vec3d GetMoment (int id)
 Gets the total moment on a specific particle by ID.
 
void Clear ()
 Clears all applied forces and moments from particles.
 
ModifierClone () const override
 Clones the current ExternalForce instance.
 
void SyncToAllProcessors ()
 Synchronizes applied forces and moments across all processors in a distributed simulation.
 
void Execute () override
 Executes the ExternalForce instance.
 
void Update () override
 Updates the ExternalForce instance.
 
- Public Member Functions inherited from netdem::Modifier
 Modifier ()
 Default constructor for Modifier class.
 
virtual void Init (Simulation *sim)
 Initializes the Modifier instance.
 
virtual void Enable ()
 Enables the Modifier instance.
 
virtual void Disable ()
 Disables the Modifier instance.
 
virtual ~Modifier ()
 Destructor for Modifier class.
 

Protected Attributes

std::unordered_set< int > particle_id_list
 The list of particle IDs.
 
VecXT< Particle * > particle_list
 The list of particles.
 
VecXT< Vec3dforce_list
 The list of particle forces to apply.
 
VecXT< Vec3dmoment_list
 

Additional Inherited Members

- Public Attributes inherited from netdem::Modifier
std::string label {"default"}
 
DEMSolver::CyclePoint cycle_point {DEMSolver::CyclePoint::pre}
 
Simulationsim {nullptr}
 
Scenescene {nullptr}
 
bool update_with_scene {false}
 
bool enable_logging {true}
 

Detailed Description

A class used to add external forces to particles in a DEM simulation. This is a pre-modifier, which will be executed at the beginning of a DEM cycle.

Constructor & Destructor Documentation

◆ ExternalForce()

netdem::ExternalForce::ExternalForce ( )

Default constructor for ExternalForce class.

Member Function Documentation

◆ AddForce() [1/2]

void netdem::ExternalForce::AddForce ( const VecXT< int > & id_list,
double fx,
double fy,
double fz )

Adds to the force for a list of particles.

Parameters
id_listA vector of particle IDs to add force to.
fxThe x-component of the force vector to add.
fyThe y-component of the force vector to add.
fzThe z-component of the force vector to add.

◆ AddForce() [2/2]

void netdem::ExternalForce::AddForce ( int id,
double fx,
double fy,
double fz )

Adds to the force for a specific particle by ID.

Parameters
idThe ID of the particle to add force to.
fxThe x-component of the force vector to add.
fyThe y-component of the force vector to add.
fzThe z-component of the force vector to add.

◆ AddMoment() [1/2]

void netdem::ExternalForce::AddMoment ( const VecXT< int > & id_list,
double mx,
double my,
double mz )

Adds to the moment for a list of particles.

Parameters
id_listA vector of particle IDs to add moment to.
mxThe x-component of the moment vector to add.
myThe y-component of the moment vector to add.
mzThe z-component of the moment vector to add.

◆ AddMoment() [2/2]

void netdem::ExternalForce::AddMoment ( int id,
double mx,
double my,
double mz )

Adds to the moment for a specific particle by ID.

Parameters
idThe ID of the particle to add moment to.
mxThe x-component of the moment vector to add.
myThe y-component of the moment vector to add.
mzThe z-component of the moment vector to add.

◆ Clear()

void netdem::ExternalForce::Clear ( )

Clears all applied forces and moments from particles.

◆ Clone()

Modifier * netdem::ExternalForce::Clone ( ) const
overridevirtual

Clones the current ExternalForce instance.

Returns
A pointer to the cloned ExternalForce instance.

Reimplemented from netdem::Modifier.

◆ Execute()

void netdem::ExternalForce::Execute ( )
overridevirtual

Executes the ExternalForce instance.

Reimplemented from netdem::Modifier.

◆ GetForce()

Vec3d netdem::ExternalForce::GetForce ( int id)

Gets the total force on a specific particle by ID.

Parameters
idThe ID of the particle to get the force for.
Returns
The force vector on the particle.

◆ GetMoment()

Vec3d netdem::ExternalForce::GetMoment ( int id)

Gets the total moment on a specific particle by ID.

Parameters
idThe ID of the particle to get the moment for.
Returns
The moment vector on the particle.

◆ SetForce() [1/2]

void netdem::ExternalForce::SetForce ( const VecXT< int > & id_list,
double fx,
double fy,
double fz )

Sets the force for a list of particles.

Parameters
id_listA vector of particle IDs to set the force for.
fxThe x-component of the force vector.
fyThe y-component of the force vector.
fzThe z-component of the force vector.

◆ SetForce() [2/2]

void netdem::ExternalForce::SetForce ( int id,
double fx,
double fy,
double fz )

Sets the force for a specific particle by ID.

Parameters
idThe ID of the particle to set the force for.
fxThe x-component of the force vector.
fyThe y-component of the force vector.
fzThe z-component of the force vector.

◆ SetMoment() [1/2]

void netdem::ExternalForce::SetMoment ( const VecXT< int > & id_list,
double mx,
double my,
double mz )

Sets the moment for a list of particles.

Parameters
id_listA vector of particle IDs to set the moment for.
mxThe x-component of the moment vector.
myThe y-component of the moment vector.
mzThe z-component of the moment vector.

◆ SetMoment() [2/2]

void netdem::ExternalForce::SetMoment ( int id,
double mx,
double my,
double mz )

Sets the moment for a specific particle by ID.

Parameters
idThe ID of the particle to set the moment for.
mxThe x-component of the moment vector.
myThe y-component of the moment vector.
mzThe z-component of the moment vector.

◆ SyncToAllProcessors()

void netdem::ExternalForce::SyncToAllProcessors ( )

Synchronizes applied forces and moments across all processors in a distributed simulation.

◆ Update()

void netdem::ExternalForce::Update ( )
overridevirtual

Updates the ExternalForce instance.

Reimplemented from netdem::Modifier.

Member Data Documentation

◆ force_list

VecXT<Vec3d> netdem::ExternalForce::force_list
protected

The list of particle forces to apply.

◆ moment_list

VecXT<Vec3d> netdem::ExternalForce::moment_list
protected

◆ particle_id_list

std::unordered_set<int> netdem::ExternalForce::particle_id_list
protected

The list of particle IDs.

◆ particle_list

VecXT<Particle *> netdem::ExternalForce::particle_list
protected

The list of particles.


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