NetDEM v1.0
|
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>
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. | |
Modifier * | Clone () 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< Vec3d > | force_list |
The list of particle forces to apply. | |
VecXT< Vec3d > | moment_list |
Additional Inherited Members | |
Public Attributes inherited from netdem::Modifier | |
std::string | label {"default"} |
DEMSolver::CyclePoint | cycle_point {DEMSolver::CyclePoint::pre} |
Simulation * | sim {nullptr} |
Scene * | scene {nullptr} |
bool | update_with_scene {false} |
bool | enable_logging {true} |
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.
netdem::ExternalForce::ExternalForce | ( | ) |
Default constructor for ExternalForce class.
void netdem::ExternalForce::AddForce | ( | const VecXT< int > & | id_list, |
double | fx, | ||
double | fy, | ||
double | fz ) |
Adds to the force for a list of particles.
id_list | A vector of particle IDs to add force to. |
fx | The x-component of the force vector to add. |
fy | The y-component of the force vector to add. |
fz | The z-component of the force vector to add. |
void netdem::ExternalForce::AddForce | ( | int | id, |
double | fx, | ||
double | fy, | ||
double | fz ) |
Adds to the force for a specific particle by ID.
id | The ID of the particle to add force to. |
fx | The x-component of the force vector to add. |
fy | The y-component of the force vector to add. |
fz | The z-component of the force vector to add. |
void netdem::ExternalForce::AddMoment | ( | const VecXT< int > & | id_list, |
double | mx, | ||
double | my, | ||
double | mz ) |
Adds to the moment for a list of particles.
id_list | A vector of particle IDs to add moment to. |
mx | The x-component of the moment vector to add. |
my | The y-component of the moment vector to add. |
mz | The z-component of the moment vector to add. |
void netdem::ExternalForce::AddMoment | ( | int | id, |
double | mx, | ||
double | my, | ||
double | mz ) |
Adds to the moment for a specific particle by ID.
id | The ID of the particle to add moment to. |
mx | The x-component of the moment vector to add. |
my | The y-component of the moment vector to add. |
mz | The z-component of the moment vector to add. |
void netdem::ExternalForce::Clear | ( | ) |
Clears all applied forces and moments from particles.
|
overridevirtual |
Clones the current ExternalForce instance.
Reimplemented from netdem::Modifier.
|
overridevirtual |
Executes the ExternalForce instance.
Reimplemented from netdem::Modifier.
Vec3d netdem::ExternalForce::GetForce | ( | int | id | ) |
Gets the total force on a specific particle by ID.
id | The ID of the particle to get the force for. |
Vec3d netdem::ExternalForce::GetMoment | ( | int | id | ) |
Gets the total moment on a specific particle by ID.
id | The ID of the particle to get the moment for. |
void netdem::ExternalForce::SetForce | ( | const VecXT< int > & | id_list, |
double | fx, | ||
double | fy, | ||
double | fz ) |
Sets the force for a list of particles.
id_list | A vector of particle IDs to set the force for. |
fx | The x-component of the force vector. |
fy | The y-component of the force vector. |
fz | The z-component of the force vector. |
void netdem::ExternalForce::SetForce | ( | int | id, |
double | fx, | ||
double | fy, | ||
double | fz ) |
Sets the force for a specific particle by ID.
id | The ID of the particle to set the force for. |
fx | The x-component of the force vector. |
fy | The y-component of the force vector. |
fz | The z-component of the force vector. |
void netdem::ExternalForce::SetMoment | ( | const VecXT< int > & | id_list, |
double | mx, | ||
double | my, | ||
double | mz ) |
Sets the moment for a list of particles.
id_list | A vector of particle IDs to set the moment for. |
mx | The x-component of the moment vector. |
my | The y-component of the moment vector. |
mz | The z-component of the moment vector. |
void netdem::ExternalForce::SetMoment | ( | int | id, |
double | mx, | ||
double | my, | ||
double | mz ) |
Sets the moment for a specific particle by ID.
id | The ID of the particle to set the moment for. |
mx | The x-component of the moment vector. |
my | The y-component of the moment vector. |
mz | The z-component of the moment vector. |
void netdem::ExternalForce::SyncToAllProcessors | ( | ) |
Synchronizes applied forces and moments across all processors in a distributed simulation.
|
overridevirtual |
Updates the ExternalForce instance.
Reimplemented from netdem::Modifier.
|
protected |
The list of particle IDs.