NetDEM v1.0
|
A solver class for performing discrete element method (DEM) simulations. More...
#include <dem_solver.hpp>
Public Types | |
enum | CyclePoint { pre , mid_0 , mid_1 , mid_2 , mid_3 , mid_4 , post , num_cycle_points } |
Public Member Functions | |
DEMSolver () | |
void | Init (Simulation *sim) |
Initialize the solver with a given simulation object. | |
void | UpdatePreModifiers () |
step 0 | |
void | UpdateLinkedList () |
step 1 | |
void | UpdateContacts () |
step 2 | |
void | UpdateParticleContactForce () |
step 3 | |
void | UpdateWallContactForce () |
step 4 | |
void | UpdateParticleMotion () |
step 5 | |
void | UpdateWallMotion () |
step 5 | |
void | UpdatePostModifiers () |
step 6 | |
void | Cycle (int num_cycles) |
Perform a given number of cycles of the simulation. | |
void | Solve (double time) |
Solve the simulation for a certain amount of time. | |
Public Attributes | |
double | timestep {1.0e-4} |
DEMProfiler | dem_profiler |
ContactSolverFactory | contact_solver_factory |
A solver class for performing discrete element method (DEM) simulations.
This class provides a set of methods and member variables for updating the position, velocity, and contact forces of particles and walls in a DEM simulation. The class also includes methods for initializing the simulation, updating the neighbor lists and contacts, and running a certain number of cycles or solving for a given amount of time.
An enum representing different points in the update cycle where modifiers can be applied.
Enumerator | |
---|---|
pre | |
mid_0 | Before the main simulation loop begins. |
mid_1 | After UpdatePreModifiers() but before UpdateLinkedList(). |
mid_2 | After UpdateLinkedList() but before UpdateContacts(). |
mid_3 | After UpdateParticleContactForce() but before UpdateParticleMotion(). |
mid_4 | After UpdateWallContactForce() but before UpdateWallMotion(). |
post | After UpdateParticleMotion() but before UpdatePostModifiers(). |
num_cycle_points | After the main simulation loop ends. The total number of cycle points. |
DEMSolver::DEMSolver | ( | ) |
A default constructor for this class.
void DEMSolver::Cycle | ( | int | num_cycles | ) |
Perform a given number of cycles of the simulation.
This method runs a given number of cycles of the simulation loop, performing all necessary updates (neighbor lists, contacts, motion integration) at each cycle point. Modifiers can be applied before, during, and after the main update loop.
num_cycles | The number of cycles to perform. |
void DEMSolver::Init | ( | Simulation * | sim | ) |
Initialize the solver with a given simulation object.
This method initializes the DEMSolver object with a pointer to a Simulation object, which contains all the necessary input parameters and particle/wall data for the simulation. It is called once at the beginning of the simulation.
sim | A pointer to the Simulation object representing the current simulation. |
void DEMSolver::Solve | ( | double | time | ) |
Solve the simulation for a certain amount of time.
This method solves the simulation for a given amount of time, by running multiple cycles of the simulation loop until the desired duration is reached. Modifiers can be applied before, during, and after the main update loop.
time | The total duration to simulate, in seconds. |
void DEMSolver::UpdateContacts | ( | ) |
step 2
Compute contact forces between particles and walls.
void DEMSolver::UpdateLinkedList | ( | ) |
step 1
Update the linked list of particles in the simulation.
void DEMSolver::UpdateParticleContactForce | ( | ) |
step 3
Compute contact forces between particles.
void DEMSolver::UpdateParticleMotion | ( | ) |
step 5
Integrate particle motion using the computed contact forces.
void DEMSolver::UpdatePostModifiers | ( | ) |
step 6
Apply post-cycle modifiers to the simulation state.
void DEMSolver::UpdatePreModifiers | ( | ) |
step 0
Apply pre-cycle modifiers to the simulation state.
void DEMSolver::UpdateWallContactForce | ( | ) |
step 4
Compute contact forces between particles and walls.
void DEMSolver::UpdateWallMotion | ( | ) |
step 5
Integrate wall motion using the computed contact forces.
ContactSolverFactory netdem::DEMSolver::contact_solver_factory |
A factory object for storing solvers for contacts between particles and walls.
DEMProfiler netdem::DEMSolver::dem_profiler |
A profiler object for tracking performance metrics during the simulation.
double netdem::DEMSolver::timestep {1.0e-4} |
The timestep to use when integrating particle motion.