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

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
 

Detailed Description

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.

Member Enumeration Documentation

◆ CyclePoint

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.

Constructor & Destructor Documentation

◆ DEMSolver()

DEMSolver::DEMSolver ( )

A default constructor for this class.

Member Function Documentation

◆ Cycle()

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.

Parameters
num_cyclesThe number of cycles to perform.
Examples
81_voronoi_packing.cpp.

◆ Init()

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.

Parameters
simA pointer to the Simulation object representing the current simulation.

◆ Solve()

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.

Parameters
timeThe total duration to simulate, in seconds.

◆ UpdateContacts()

void DEMSolver::UpdateContacts ( )

step 2

Compute contact forces between particles and walls.

◆ UpdateLinkedList()

void DEMSolver::UpdateLinkedList ( )

step 1

Update the linked list of particles in the simulation.

◆ UpdateParticleContactForce()

void DEMSolver::UpdateParticleContactForce ( )

step 3

Compute contact forces between particles.

◆ UpdateParticleMotion()

void DEMSolver::UpdateParticleMotion ( )

step 5

Integrate particle motion using the computed contact forces.

◆ UpdatePostModifiers()

void DEMSolver::UpdatePostModifiers ( )

step 6

Apply post-cycle modifiers to the simulation state.

◆ UpdatePreModifiers()

void DEMSolver::UpdatePreModifiers ( )

step 0

Apply pre-cycle modifiers to the simulation state.

◆ UpdateWallContactForce()

void DEMSolver::UpdateWallContactForce ( )

step 4

Compute contact forces between particles and walls.

◆ UpdateWallMotion()

void DEMSolver::UpdateWallMotion ( )

step 5

Integrate wall motion using the computed contact forces.

Member Data Documentation

◆ contact_solver_factory

◆ dem_profiler

DEMProfiler netdem::DEMSolver::dem_profiler

A profiler object for tracking performance metrics during the simulation.

◆ timestep


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