Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
insertion_list.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) 2021-2026 The Lethe Authors
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
3
4#ifndef lethe_insertion_list_h
5#define lethe_insertion_list_h
6
7#include <dem/insertion.h>
8
9template <int dim, typename PropertiesIndex>
10class InsertionList : public Insertion<dim, PropertiesIndex>
11{
12public:
13 /**
14 * @brief Insert particles using a list of specific positions. This allows the
15 * insertion of a low number of particles at a well-controlled location, which
16 * is especially useful from a testing perspective. The code ensures that the
17 * number of positions provided in the x,y (and possibly z) direction is
18 * coherent. If more particles than the number of positions in the list are
19 * requested, the class will continue inserting particles at the insertion
20 * frequency using the list of positions. There is no mechanism in place that
21 * prevents the overlap of these new particles with previous ones.
22 *
23 * @param size_distribution_object_container Contains all distribution for each
24 * particle type
25 * @param triangulation Triangulation to access the cells in which the
26 * particles are inserted
27 * @param dem_parameters DEM parameters declared in the .prm file
28 */
29 InsertionList(const std::vector<std::shared_ptr<Distribution>>
30 &size_distribution_object_container,
31 const parallel::distributed::Triangulation<dim> &triangulation,
32 const DEMSolverParameters<dim> &dem_parameters);
33
34 /**
35 * @brief The InsertionList class inserts particles using a list of specific
36 * position. This allows the insertion of any number of particles at a
37 * well-controlled location, which is especially useful from a testing
38 * perspective. The code ensures that the number of positions provided in the
39 * x,y (and possibly z) direction is coherent. If more particles than the
40 * number of positions in the list are requested, the class will continue
41 * inserting particles at the insertion frequency using the list of positions.
42 * There is no mechanism in place that prevents the overlap of these new
43 * particles with previous ones.
44 *
45 * @param particle_handler The particle handler of particles which are being
46 * inserted
47 * @param triangulation Triangulation to access the cells in which the
48 * particles are inserted
49 * @param dem_parameters DEM parameters declared in the .prm file
50 */
51 virtual void
52 insert(Particles::ParticleHandler<dim> &particle_handler,
53 const parallel::distributed::Triangulation<dim> &triangulation,
54 const DEMSolverParameters<dim> &dem_parameters) override;
55
56
57
58 /**
59 * @brief Carries out assigning the properties of inserted particles
60 * specifically for the list insertion method. In this method, the initial
61 * translation and angular velocities, the temperature and the diameter of
62 * each particle are set.
63 *
64 * @param dem_parameters DEM parameters declared in the .prm file
65 * @param inserted_this_step_this_proc Number of particles that are inserted
66 * at each insertion step on each processor. This value can change in the last
67 * insertion step to reach the desired number of particles
68 * @param particle_properties Properties of all inserted particles at each
69 * insertion step
70 */
71 void
73 const DEMSolverParameters<dim> &dem_parameters,
74 const unsigned int &inserted_this_step_this_proc,
75 std::vector<std::vector<double>> &particle_properties);
76
77
78 /**
79 * @brief Serialize the list insertion object to an output archive.
80 *
81 * @param ar Output archive where the attributes are stored.
82 */
83 virtual void
84 serialize(boost::archive::text_oarchive &ar) override
85 {
87 }
88
89 /**
90 * @brief Deserialize an input archive to the list insertion object.
91 *
92 * @param ar Input archive where the attributes are stored.
93 *
94 */
95 virtual void
96 deserialize(boost::archive::text_iarchive &ar) override
97 {
99 }
100
101 // Number of remaining particles of each type that should be inserted in the
102 // upcoming insertion steps
105
106 // Vector of the location, velocity and angular velocity, diameter and
107 // temperature used to insert the particles
108 std::vector<Point<dim>> insertion_points;
109 std::vector<Tensor<1, 3>> velocities;
110 std::vector<Tensor<1, 3>> angular_velocities;
111 std::vector<double> diameters;
112 std::vector<double> temperatures;
113};
114
115#endif /* lethe_insertion_list_h */
Handles all the parameters declared in the parameter handler file.
std::vector< Tensor< 1, 3 > > velocities
std::vector< Tensor< 1, 3 > > angular_velocities
unsigned int remaining_particles_of_each_type
std::vector< double > diameters
virtual void insert(Particles::ParticleHandler< dim > &particle_handler, const parallel::distributed::Triangulation< dim > &triangulation, const DEMSolverParameters< dim > &dem_parameters) override
The InsertionList class inserts particles using a list of specific position. This allows the insertio...
virtual void deserialize(boost::archive::text_iarchive &ar) override
Deserialize an input archive to the list insertion object.
InsertionList(const std::vector< std::shared_ptr< Distribution > > &size_distribution_object_container, const parallel::distributed::Triangulation< dim > &triangulation, const DEMSolverParameters< dim > &dem_parameters)
Insert particles using a list of specific positions. This allows the insertion of a low number of par...
virtual void serialize(boost::archive::text_oarchive &ar) override
Serialize the list insertion object to an output archive.
unsigned int current_inserting_particle_type
std::vector< double > temperatures
void assign_particle_properties_for_list_insertion(const DEMSolverParameters< dim > &dem_parameters, const unsigned int &inserted_this_step_this_proc, std::vector< std::vector< double > > &particle_properties)
Carries out assigning the properties of inserted particles specifically for the list insertion method...
std::vector< Point< dim > > insertion_points
Insertion(const std::vector< std::shared_ptr< Distribution > > &size_distribution_object_container, const parallel::distributed::Triangulation< dim > &triangulation, const DEMSolverParameters< dim > &dem_parameters)
Carries out the insertion of particles. This is the base class of volume_insertion,...
Definition insertion.cc:10