Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
explicit_euler_integrator.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) 2020-2026 The Lethe Authors
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
3
4#ifndef lethe_explicit_euler_integrator_h
5#define lethe_explicit_euler_integrator_h
6
7#include <dem/integrator.h>
8
9using namespace dealii;
10
11/**
12 * @brief Implementation of a classical explicit euler scheme for the integration
13 * of the particle motion. Note that reinitialization of force and torque is
14 * also integrated into integration class
15 *
16 * @note Euler is a first-order integration scheme. Calculation proceudre:
17 * @tparam dim An integer that denotes the number of spatial dimensions.
18 * @tparam PropertiesIndex Index of the properties used within the ParticleHandler.
19 *
20 * x(n+1) = x(n) + v(n) * dt
21 * v(n+1) = v(n) + a(n) * dt
22 * a(n+1) = F(n+1) / m
23 */
24template <int dim, typename PropertiesIndex>
25class ExplicitEulerIntegrator : public Integrator<dim, PropertiesIndex>
26{
27public:
29
30 /**
31 * @brief Integrate the opening step of the scheme. The explicit Euler scheme is
32 * self-starting and keeps the velocities synchronized with the positions, so
33 * the first time step needs no special treatment: this function simply
34 * carries out a regular step.
35 *
36 * @param particle_handler The particle handler whose particle motion we wish
37 * to integrate
38 * @param body_force A constant volumetric body force applied to all particles
39 * @param time_step The value of the time step used for the integration
40 * @param torque Torque acting on particles
41 * @param force Force acting on particles
42 * @param MOI A container of moment of inertia of particles
43 */
44 virtual void
45 integrate_start(Particles::ParticleHandler<dim> &particle_handler,
46 const Tensor<1, 3> &body_force,
47 const double time_step,
48 std::vector<Tensor<1, 3>> &torque,
49 std::vector<Tensor<1, 3>> &force,
50 const std::vector<double> &MOI) override;
51
52 /**
53 * @brief Integrate the closing step of the scheme. The velocities of the explicit
54 * Euler scheme are already synchronized with the positions, so they are left
55 * untouched. The force and the torque containers are still reset, since they
56 * have been filled by the force evaluation that precedes this call and would
57 * otherwise be accumulated into by the next time step.
58 *
59 * @param particle_handler The particle handler whose particle motion we wish
60 * to integrate
61 * @param body_force A constant volumetric body force applied to all particles
62 * @param time_step The value of the time step used for the integration
63 * @param torque Torque acting on particles. It is reset to zero
64 * @param force Force acting on particles. It is reset to zero
65 * @param MOI A container of moment of inertia of particles
66 */
67 virtual void
68 integrate_end(Particles::ParticleHandler<dim> &particle_handler,
69 const Tensor<1, 3> &body_force,
70 const double time_step,
71 std::vector<Tensor<1, 3>> &torque,
72 std::vector<Tensor<1, 3>> &force,
73 const std::vector<double> &MOI) override;
74
75 /**
76 * @brief Integrate the closing step of the scheme when the adaptive sparse
77 * contacts are enabled. The velocities of the explicit Euler scheme are
78 * already synchronized with the positions, so they are left untouched and
79 * only the force and the torque containers are reset. Note that the adaptive
80 * sparse contacts are not supported by the explicit Euler scheme in the first
81 * place.
82 *
83 * @param particle_handler The particle handler whose particle motion we wish
84 * to integrate
85 * @param body_force A constant volumetric body force applied to all particles
86 * @param time_step The value of the time step used for the integration
87 * @param torque Torque acting on particles. It is reset to zero
88 * @param force Force acting on particles. It is reset to zero
89 * @param MOI A container of moment of inertia of particles
90 * @param triangulation The triangulation of the background mesh
91 * @param sparse_contacts_object The object that stores the mobility status of
92 * the cells
93 */
94 virtual void
95 integrate_end(Particles::ParticleHandler<dim> &particle_handler,
96 const Tensor<1, 3> &body_force,
97 const double time_step,
98 std::vector<Tensor<1, 3>> &torque,
99 std::vector<Tensor<1, 3>> &force,
100 const std::vector<double> &MOI,
101 const parallel::distributed::Triangulation<dim> &triangulation,
103 &sparse_contacts_object) override;
104
105 /**
106 * @brief Integrate motion of all particles by using the acceleration with
107 * the explicit Euler method.
108 *
109 * @param particle_handler The particle handler whose particle motion we wish
110 * to integrate
111 * @param body_force A constant volumetric body force applied to all particles
112 * @param time_step The value of the time step used for the integration
113 * @param torque Torque acting on particles
114 * @param force Force acting on particles
115 * @param MOI A container of moment of inertia of particles
116 */
117 virtual void
118 integrate(Particles::ParticleHandler<dim> &particle_handler,
119 const Tensor<1, 3> &body_force,
120 const double time_step,
121 std::vector<Tensor<1, 3>> &torque,
122 std::vector<Tensor<1, 3>> &force,
123 const std::vector<double> &MOI) override;
124
125 virtual void
126 integrate(Particles::ParticleHandler<dim> &particle_handler,
127 const Tensor<1, 3> &body_force,
128 const double time_step,
129 std::vector<Tensor<1, 3>> &torque,
130 std::vector<Tensor<1, 3>> &force,
131 const std::vector<double> &MOI,
132 const parallel::distributed::Triangulation<dim> &triangulation,
134 &sparse_contacts_object) override;
135};
136
137#endif
Mechanism that disables contacts computation through mobility status of cells based on granular tempe...
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
Integrate the opening step of the scheme. The explicit Euler scheme is self-starting and keeps the ve...
ExplicitEulerIntegrator()=default
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
Integrate the closing step of the scheme. The velocities of the explicit Euler scheme are already syn...
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
Integrate motion of all particles by using the acceleration with the explicit Euler method.
Integrator()=default
The constructor to the integrator class is currently blank Eventually it might be a good idea to have...