Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
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_integrator_h
5#define lethe_integrator_h
6
10
11using namespace dealii;
12
13/**
14 * @brief Base interface for classes that carry out the integration of the velocity and
15 * position of particles with inertia
16 * @tparam dim An integer that denotes the number of spatial dimensions.
17 * @tparam PropertiesIndex Index of the properties used within the ParticleHandler.
18 */
19template <int dim, typename PropertiesIndex>
21{
22public:
23 /**
24 * @brief The constructor to the integrator class is currently blank
25 * Eventually it might be a good idea to have the integration class contain
26 * the index to the velocity property, the force property and the acceleration
27 * property manually
28 */
29 Integrator() = default;
30
31 virtual ~Integrator() = default;
32
33 /**
34 * @brief Integrate the opening step of the scheme, which is carried out once,
35 * at the very first time step. Whatever the scheme, this advances the
36 * positions by a full time step, exactly like integrate() does. Schemes that
37 * are not self-starting, that is, schemes that store the velocities staggered
38 * by half a time step with respect to the positions, use it to bring their
39 * velocities to t(1/2) while the positions reach t(1). Self-starting schemes
40 * simply carry out a regular step.
41 *
42 * Calling this at the first time step is unconditional: it is up to the
43 * scheme, and not to the solver, to decide what an opening step means.
44 *
45 * @param particle_handler The particle handler whose particle motion we wish
46 * to integrate
47 * @param body_force A constant volumetric body force applied to all particles
48 * @param time_step The value of the time step used for the integration
49 * @param torque Torque acting on particles. It is reset to zero at the end of
50 * the integration
51 * @param force Force acting on particles. It is reset to zero at the end of
52 * the integration
53 * @param MOI A container of moment of inertia of particles
54 */
55 virtual void
56 integrate_start(Particles::ParticleHandler<dim> &particle_handler,
57 const Tensor<1, 3> &body_force,
58 const double time_step,
59 std::vector<Tensor<1, 3>> &torque,
60 std::vector<Tensor<1, 3>> &force,
61 const std::vector<double> &MOI) = 0;
62
63 /**
64 * @brief Integrate the closing step of the scheme, which is carried out once the
65 * final position is reached. The positions are never modified. Schemes that
66 * store the velocities staggered by half a time step advance them by half a
67 * time step here, which synchronizes them with the positions. Schemes whose
68 * velocities are already synchronized leave them untouched.
69 *
70 * Whatever the scheme, the force and the torque containers are reset, since
71 * they have been filled by the force evaluation that precedes this call.
72 *
73 * @param particle_handler The particle handler whose particle motion we wish
74 * to integrate
75 * @param body_force A constant volumetric body force applied to all particles
76 * @param time_step The value of the time step used for the integration
77 * @param torque Torque acting on particles. It is reset to zero at the end of
78 * the integration
79 * @param force Force acting on particles. It is reset to zero at the end of
80 * the integration
81 * @param MOI A container of moment of inertia of particles
82 */
83 virtual void
84 integrate_end(Particles::ParticleHandler<dim> &particle_handler,
85 const Tensor<1, 3> &body_force,
86 const double time_step,
87 std::vector<Tensor<1, 3>> &torque,
88 std::vector<Tensor<1, 3>> &force,
89 const std::vector<double> &MOI) = 0;
90
91 /**
92 * @brief Integrate the closing step of the scheme when the adaptive sparse
93 * contacts are enabled. Only the particles located in mobile cells have their
94 * velocities advanced, the other ones only have their force and torque reset.
95 *
96 * @param particle_handler The particle handler whose particle motion we wish
97 * to integrate
98 * @param body_force A constant volumetric body force applied to all particles
99 * @param time_step The value of the time step used for the integration
100 * @param torque Torque acting on particles. It is reset to zero at the end of
101 * the integration
102 * @param force Force acting on particles. It is reset to zero at the end of
103 * the integration
104 * @param MOI A container of moment of inertia of particles
105 * @param triangulation The triangulation of the background mesh
106 * @param sparse_contacts_object The object that stores the mobility status of
107 * the cells
108 */
109 virtual void
111 Particles::ParticleHandler<dim> &particle_handler,
112 const Tensor<1, 3> &body_force,
113 const double time_step,
114 std::vector<Tensor<1, 3>> &torque,
115 std::vector<Tensor<1, 3>> &force,
116 const std::vector<double> &MOI,
117 const parallel::distributed::Triangulation<dim> &triangulation,
118 AdaptiveSparseContacts<dim, PropertiesIndex> &sparse_contacts_object) = 0;
119
120 /**
121 * @brief Integrate particles' velocity and position.
122 *
123 * @param particle_handler The particle handler whose particle motion we wish
124 * to integrate
125 * @param body_force A constant volumetric body force applied to all particles
126 * @param time_step The value of the time step used for the integration
127 * @param torque Torque acting on particles
128 * @param force Force acting on particles
129 * @param MOI A container of moment of inertia of particles
130 */
131 virtual void
132 integrate(Particles::ParticleHandler<dim> &particle_handler,
133 const Tensor<1, 3> &body_force,
134 const double time_step,
135 std::vector<Tensor<1, 3>> &torque,
136 std::vector<Tensor<1, 3>> &force,
137 const std::vector<double> &MOI) = 0;
138
139 virtual void
141 Particles::ParticleHandler<dim> &particle_handler,
142 const Tensor<1, 3> &body_force,
143 const double time_step,
144 std::vector<Tensor<1, 3>> &torque,
145 std::vector<Tensor<1, 3>> &force,
146 const std::vector<double> &MOI,
147 const parallel::distributed::Triangulation<dim> &triangulation,
148 AdaptiveSparseContacts<dim, PropertiesIndex> &sparse_contacts_object) = 0;
149};
150
151#endif
Mechanism that disables contacts computation through mobility status of cells based on granular tempe...
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)=0
Integrate the closing step of the scheme, which is carried out once the final position is reached....
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)=0
Integrate the closing step of the scheme when the adaptive sparse contacts are enabled....
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)=0
Integrate the opening step of the scheme, which is carried out once, at the very first time step....
virtual ~Integrator()=default
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)=0
Integrate particles' velocity and position.
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)=0
Integrator()=default
The constructor to the integrator class is currently blank Eventually it might be a good idea to have...