Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
VelocityVerletIntegrator< dim, PropertiesIndex > Class Template Reference

#include <velocity_verlet_integrator.h>

Inheritance diagram for VelocityVerletIntegrator< dim, PropertiesIndex >:
[legend]

Public Member Functions

 VelocityVerletIntegrator ()=default
virtual void integrate_start (Particles::ParticleHandler< dim > &particle_handler, const Tensor< 1, 3 > &body_force, const double time_step, std::vector< Tensor< 1, 3 > > &torque, std::vector< Tensor< 1, 3 > > &force, const std::vector< double > &MOI) override
virtual void integrate_end (Particles::ParticleHandler< dim > &particle_handler, const Tensor< 1, 3 > &body_force, const double time_step, std::vector< Tensor< 1, 3 > > &torque, std::vector< Tensor< 1, 3 > > &force, const std::vector< double > &MOI) override
virtual void integrate_end (Particles::ParticleHandler< dim > &particle_handler, const Tensor< 1, 3 > &body_force, const double time_step, std::vector< Tensor< 1, 3 > > &torque, std::vector< Tensor< 1, 3 > > &force, const std::vector< double > &MOI, const parallel::distributed::Triangulation< dim > &triangulation, AdaptiveSparseContacts< dim, PropertiesIndex > &sparse_contacts_object) override
virtual void integrate (Particles::ParticleHandler< dim > &particle_handler, const Tensor< 1, 3 > &body_force, const double time_step, std::vector< Tensor< 1, 3 > > &torque, std::vector< Tensor< 1, 3 > > &force, const std::vector< double > &MOI) override
virtual void integrate (Particles::ParticleHandler< dim > &particle_handler, const Tensor< 1, 3 > &body_force, const double time_step, std::vector< Tensor< 1, 3 > > &torque, std::vector< Tensor< 1, 3 > > &force, const std::vector< double > &MOI, const parallel::distributed::Triangulation< dim > &triangulation, AdaptiveSparseContacts< dim, PropertiesIndex > &sparse_contacts_object) override
void integrate_with_advected_particles (Particles::ParticleHandler< dim > &particle_handler, const Tensor< 1, 3 > &body_force, const double time_step, std::vector< Tensor< 1, 3 > > &torque, std::vector< Tensor< 1, 3 > > &force, const std::vector< double > &MOI, const parallel::distributed::Triangulation< dim > &triangulation, AdaptiveSparseContacts< dim, PropertiesIndex > &sparse_contacts_object)
Public Member Functions inherited from Integrator< dim, PropertiesIndex >
 Integrator ()=default
virtual ~Integrator ()=default

Detailed Description

template<int dim, typename PropertiesIndex>
class VelocityVerletIntegrator< dim, PropertiesIndex >

Implementation of a classical velocity verlet scheme for the integration of the particle motion. Note that reinitialization of force and torque is also integrated into integration class.

Velocity Verlet is a second-order integration scheme. It is implemented in its staggered (leapfrog) form: the velocities are stored at the half steps and the positions at the integer steps. Consequently, carrying out n time steps requires n + 1 integration operations.

Calculation procedure:

Opening half step (integrate_start), carried out once at the first time step v(1/2) = v(0) + 1/2 * a(0) * dt x(1) = x(0) + v(1/2) * dt

Regular steps (integrate), carried out at every subsequent time step a(n) = F(n) / m v(n+1/2) = v(n-1/2) + a(n) * dt x(n+1) = x(n) + v(n+1/2) * dt

Closing half step (integrate_end), carried out once the final position is reached to synchronize the velocities with the positions a(n) = F(n) / m v(n) = v(n-1/2) + 1/2 * a(n) * dt

Template Parameters
dimAn integer that denotes the number of spatial dimensions.
PropertiesIndexIndex of the properties used within the ParticleHandler.

Definition at line 44 of file velocity_verlet_integrator.h.

Constructor & Destructor Documentation

◆ VelocityVerletIntegrator()

template<int dim, typename PropertiesIndex>
VelocityVerletIntegrator< dim, PropertiesIndex >::VelocityVerletIntegrator ( )
default

Member Function Documentation

◆ integrate() [1/2]

template<int dim, typename PropertiesIndex>
void VelocityVerletIntegrator< dim, PropertiesIndex >::integrate ( Particles::ParticleHandler< dim > & particle_handler,
const Tensor< 1, 3 > & body_force,
const double time_step,
std::vector< Tensor< 1, 3 > > & torque,
std::vector< Tensor< 1, 3 > > & force,
const std::vector< double > & MOI )
overridevirtual

Carry out a regular step of the Velocity Verlet scheme, that is, a full velocity step followed by a full position step.

This function is called at every time step but the first one, which is handled by integrate_start(). It assumes that the velocities are already staggered, that is, that they are known at t(n-1/2) whereas the positions are known at t(n), and it preserves that staggering:

a(n) = g + F(n) / m v(n+1/2) = v(n-1/2) + a(n) * dt x(n+1) = x(n) + v(n+1/2) * dt

The velocity is advanced before the position and the updated velocity is the one used to advance the position, which is what makes the scheme second order and symplectic. Note that the acceleration is evaluated from the force accumulated by the contact force objects since the previous step, hence the force and the torque containers are reset to zero once they have been consumed. The angular velocity is advanced in the same manner from the torque and the moment of inertia.

All three components of the velocity and of the angular velocity are advanced, even in 2D, since the third component of the angular velocity is the one that carries the rotation in 2D. Only the first dim components of the position are advanced.

Parameters
particle_handlerThe particle handler whose particle motion we wish to integrate
body_forceA constant volumetric body force applied to all particles
time_stepThe value of the time step used for the integration
torqueTorque acting on particles. It is reset to zero at the end of the integration
forceForce acting on particles. It is reset to zero at the end of the integration
MOIA container of moment of inertia of particles

Implements Integrator< dim, PropertiesIndex >.

Definition at line 214 of file velocity_verlet_integrator.cc.

References point_nd_to_3d().

◆ integrate() [2/2]

template<int dim, typename PropertiesIndex>
void VelocityVerletIntegrator< dim, PropertiesIndex >::integrate ( Particles::ParticleHandler< dim > & particle_handler,
const Tensor< 1, 3 > & body_force,
const double time_step,
std::vector< Tensor< 1, 3 > > & torque,
std::vector< Tensor< 1, 3 > > & force,
const std::vector< double > & MOI,
const parallel::distributed::Triangulation< dim > & triangulation,
AdaptiveSparseContacts< dim, PropertiesIndex > & sparse_contacts_object )
overridevirtual

Carry out a regular step of the Velocity Verlet scheme when the adaptive sparse contacts are enabled.

The integration is identical to the one described above, but it is only carried out for the particles that belong to mobile cells. The particles of the active and inactive cells only have their force and torque reset, so that they remain at rest. The particles of the advected cells are displaced with the average velocity and acceleration of their cell, which is handled by integrate_with_advected_particles(). When the sparse contacts are disabled, or on the iteration at which the mobility status is reset, this function simply falls back to the regular integration.

Parameters
particle_handlerThe particle handler whose particle motion we wish to integrate
body_forceA constant volumetric body force applied to all particles
time_stepThe value of the time step used for the integration
torqueTorque acting on particles. It is reset to zero at the end of the integration
forceForce acting on particles. It is reset to zero at the end of the integration
MOIA container of moment of inertia of particles
triangulationThe triangulation of the background mesh
sparse_contacts_objectThe object that stores the mobility status of the cells

Implements Integrator< dim, PropertiesIndex >.

Definition at line 294 of file velocity_verlet_integrator.cc.

References DEMActionManager::get_action_manager(), AdaptiveSparseContacts< dim, PropertiesIndex >::get_mobility_status(), AdaptiveSparseContacts< dim, PropertiesIndex >::has_advected_particles(), integrate(), integrate_with_advected_particles(), AdaptiveSparseContacts< dim, PropertiesIndex >::mobile, and point_nd_to_3d().

◆ integrate_end() [1/2]

template<int dim, typename PropertiesIndex>
void VelocityVerletIntegrator< dim, PropertiesIndex >::integrate_end ( Particles::ParticleHandler< dim > & particle_handler,
const Tensor< 1, 3 > & body_force,
const double time_step,
std::vector< Tensor< 1, 3 > > & torque,
std::vector< Tensor< 1, 3 > > & force,
const std::vector< double > & MOI )
overridevirtual

Integrate the closing half step of the Velocity Verlet scheme. The velocities are advanced by half a time step to synchronize them with the positions. The positions are left untouched.

Parameters
particle_handlerThe particle handler whose particle motion we wish to integrate
body_forceA constant volumetric body force applied to all particles
time_stepThe value of the time step used for the integration
torqueTorque acting on particles. It is reset to zero at the end of the integration
forceForce acting on particles. It is reset to zero at the end of the integration
MOIA container of moment of inertia of particles

Implements Integrator< dim, PropertiesIndex >.

Definition at line 70 of file velocity_verlet_integrator.cc.

◆ integrate_end() [2/2]

template<int dim, typename PropertiesIndex>
void VelocityVerletIntegrator< dim, PropertiesIndex >::integrate_end ( Particles::ParticleHandler< dim > & particle_handler,
const Tensor< 1, 3 > & body_force,
const double time_step,
std::vector< Tensor< 1, 3 > > & torque,
std::vector< Tensor< 1, 3 > > & force,
const std::vector< double > & MOI,
const parallel::distributed::Triangulation< dim > & triangulation,
AdaptiveSparseContacts< dim, PropertiesIndex > & sparse_contacts_object )
overridevirtual

Integrate the closing half step of the Velocity Verlet scheme when the adaptive sparse contacts are enabled. Only the particles located in mobile cells have their velocities advanced, the other ones only have their force and torque reset.

Parameters
particle_handlerThe particle handler whose particle motion we wish to integrate
body_forceA constant volumetric body force applied to all particles
time_stepThe value of the time step used for the integration
torqueTorque acting on particles. It is reset to zero at the end of the integration
forceForce acting on particles. It is reset to zero at the end of the integration
MOIA container of moment of inertia of particles
triangulationThe triangulation of the background mesh
sparse_contacts_objectThe object that stores the mobility status of the cells

Implements Integrator< dim, PropertiesIndex >.

Definition at line 119 of file velocity_verlet_integrator.cc.

References DEMActionManager::get_action_manager(), AdaptiveSparseContacts< dim, PropertiesIndex >::get_mobility_status(), integrate_end(), and AdaptiveSparseContacts< dim, PropertiesIndex >::mobile.

◆ integrate_start()

template<int dim, typename PropertiesIndex>
void VelocityVerletIntegrator< dim, PropertiesIndex >::integrate_start ( Particles::ParticleHandler< dim > & particle_handler,
const Tensor< 1, 3 > & body_force,
const double time_step,
std::vector< Tensor< 1, 3 > > & torque,
std::vector< Tensor< 1, 3 > > & force,
const std::vector< double > & MOI )
overridevirtual

Integrate the opening half step of the Velocity Verlet scheme, which starts the staggering. The velocities are advanced by half a time step, from v(0) to v(1/2), whereas the positions are advanced by a full time step, from x(0) to x(1). No time is therefore lost by the opening step: it consumes a full time step of the simulation, only the velocity is lagging by dt/2.

Parameters
particle_handlerThe particle handler whose particle motion we wish to integrate
body_forceA constant volumetric body force applied to all particles
time_stepThe value of the time step used for the integration
torqueTorque acting on particles. It is reset to zero at the end of the integration
forceForce acting on particles. It is reset to zero at the end of the integration
MOIA container of moment of inertia of particles

Implements Integrator< dim, PropertiesIndex >.

Definition at line 14 of file velocity_verlet_integrator.cc.

◆ integrate_with_advected_particles()

template<int dim, typename PropertiesIndex>
void VelocityVerletIntegrator< dim, PropertiesIndex >::integrate_with_advected_particles ( Particles::ParticleHandler< dim > & particle_handler,
const Tensor< 1, 3 > & body_force,
const double time_step,
std::vector< Tensor< 1, 3 > > & torque,
std::vector< Tensor< 1, 3 > > & force,
const std::vector< double > & MOI,
const parallel::distributed::Triangulation< dim > & triangulation,
AdaptiveSparseContacts< dim, PropertiesIndex > & sparse_contacts_object )

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