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

A class used to group particles in a DEM simulation. More...

#include <particle_group.hpp>

Inheritance diagram for netdem::ParticleGroup:
netdem::Modifier netdem::BreakageAnalysis netdem::BreakageAnalysisPD netdem::DeformationAnalysis netdem::ParticleEnergyEvaluator netdem::ParticleStressEvaluator

Public Member Functions

 ParticleGroup ()
 Default constructor for ParticleGroup class.
 
VecXT< Particle * > const & GetParticles ()
 Get the particles.
 
void AddParticle (int id)
 Adds a particle to the group.
 
void RemoveParticle (int id)
 Removes a particle from the group.
 
void AddParticle (const VecXT< int > &ids)
 Adds multiple particles to the group.
 
void RemoveParticle (const VecXT< int > &ids)
 Removes multiple particles from the group.
 
void AddParticle (const std::initializer_list< int > &ids)
 Adds multiple particles to the group.
 
void RemoveParticle (const std::initializer_list< int > &ids)
 Removes multiple particles from the group.
 
void SetParticle (int id)
 Sets a particle to the group.
 
void SetParticle (const VecXT< int > &ids)
 Sets multiple particles to the group.
 
void SetParticle (const std::initializer_list< int > &ids)
 Sets multiple particles to the group.
 
void SetParticleFromScene ()
 Sets the particles to all the particles in the scene scene.
 
void Clear ()
 Clears all particles from the group.
 
ModifierClone () const override
 Clones the current ParticleGroup instance.
 
void Execute () override
 Executes the ParticleGroup instance.
 
void Update () override
 Updates the ParticleGroup 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.
 

Public Attributes

bool use_particles_in_scene {false}
 A flag indicating whether to group all particle in the scene.
 
- 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}
 

Protected Attributes

std::unordered_set< int > particle_id_list
 The list of particle IDs.
 
VecXT< Particle * > particle_list
 The list of particles.
 

Detailed Description

A class used to group particles in a DEM simulation.

The ParticleGroup class is used to group particles together for various operations, such as setting their velocity or spin properties.

Constructor & Destructor Documentation

◆ ParticleGroup()

netdem::ParticleGroup::ParticleGroup ( )

Default constructor for ParticleGroup class.

Member Function Documentation

◆ AddParticle() [1/3]

void netdem::ParticleGroup::AddParticle ( const std::initializer_list< int > & ids)

Adds multiple particles to the group.

Parameters
idsA vector of particle IDs to add.

◆ AddParticle() [2/3]

void netdem::ParticleGroup::AddParticle ( const VecXT< int > & ids)

Adds multiple particles to the group.

Parameters
idsA vector of particle IDs to add.

◆ AddParticle() [3/3]

void netdem::ParticleGroup::AddParticle ( int id)

Adds a particle to the group.

Parameters
idThe ID of the particle to add.

◆ Clear()

void netdem::ParticleGroup::Clear ( )

Clears all particles from the group.

◆ Clone()

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

Clones the current ParticleGroup instance.

Returns
A pointer to the cloned ParticleGroup instance.

Reimplemented from netdem::Modifier.

Reimplemented in netdem::ParticleStressEvaluator.

◆ Execute()

void netdem::ParticleGroup::Execute ( )
overridevirtual

Executes the ParticleGroup instance.

Reimplemented from netdem::Modifier.

Reimplemented in netdem::ParticleStressEvaluator.

◆ GetParticles()

VecXT< Particle * > const & netdem::ParticleGroup::GetParticles ( )

Get the particles.

◆ RemoveParticle() [1/3]

void netdem::ParticleGroup::RemoveParticle ( const std::initializer_list< int > & ids)

Removes multiple particles from the group.

Parameters
idsA vector of particle IDs to remove.

◆ RemoveParticle() [2/3]

void netdem::ParticleGroup::RemoveParticle ( const VecXT< int > & ids)

Removes multiple particles from the group.

Parameters
idsA vector of particle IDs to remove.

◆ RemoveParticle() [3/3]

void netdem::ParticleGroup::RemoveParticle ( int id)

Removes a particle from the group.

Parameters
idThe ID of the particle to remove.

◆ SetParticle() [1/3]

void netdem::ParticleGroup::SetParticle ( const std::initializer_list< int > & ids)

Sets multiple particles to the group.

Parameters
idsA vector of particle IDs to add.

◆ SetParticle() [2/3]

void netdem::ParticleGroup::SetParticle ( const VecXT< int > & ids)

Sets multiple particles to the group.

Parameters
idsA vector of particle IDs to add.

◆ SetParticle() [3/3]

void netdem::ParticleGroup::SetParticle ( int id)

Sets a particle to the group.

Parameters
idThe ID of the particle to add.

◆ SetParticleFromScene()

void netdem::ParticleGroup::SetParticleFromScene ( )

Sets the particles to all the particles in the scene scene.

Examples
02_energy_test.cpp.

◆ Update()

void netdem::ParticleGroup::Update ( )
overridevirtual

Updates the ParticleGroup instance.

Updates the particle_list based on the current particle_id_list.

Reimplemented from netdem::Modifier.

Reimplemented in netdem::ParticleStressEvaluator.

Member Data Documentation

◆ particle_id_list

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

The list of particle IDs.

◆ particle_list

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

The list of particles.

◆ use_particles_in_scene

bool netdem::ParticleGroup::use_particles_in_scene {false}

A flag indicating whether to group all particle in the scene.


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