![]() |
Lethe Open-Source Library version 1.2.0
Developer Guide
|
#include <insertion_volume.h>
Public Member Functions | |
| InsertionVolume (const std::vector< std::shared_ptr< Distribution > > &size_distribution_object_container, const parallel::distributed::Triangulation< dim > &triangulation, const DEMSolverParameters< dim > &dem_parameters, const double maximum_particle_diameter) | |
| virtual void | insert (Particles::ParticleHandler< dim > &particle_handler, const parallel::distributed::Triangulation< dim > &triangulation, const DEMSolverParameters< dim > &dem_parameters) override |
| virtual void | serialize (boost::archive::text_oarchive &ar) override |
| virtual void | deserialize (boost::archive::text_iarchive &ar) override |
| Public Member Functions inherited from Insertion< dim, PropertiesIndex > | |
| Insertion (const std::vector< std::shared_ptr< Distribution > > &size_distribution_object_container, const parallel::distributed::Triangulation< dim > &triangulation, const DEMSolverParameters< dim > &dem_parameters) | |
| virtual | ~Insertion () |
Private Member Functions | |
| void | adjust_insertion_count_by_insertion_box_capacity (const InsertionInfo< dim > &insertion_information, const ConditionalOStream &pcout, unsigned int &inserted_this_step) |
| void | find_insertion_location (Point< dim > &insertion_location, const unsigned int id, const double random_number1, const double random_number2, const InsertionInfo< dim > &insertion_information) |
| void | set_filtered_index (const InsertionInfo< dim > &insertion_information) |
Private Attributes | |
| unsigned int | current_inserting_particle_type |
| unsigned int | particles_of_each_type_remaining |
| std::vector< int > | number_of_particles_directions |
| std::vector< double > | axis_min |
| std::vector< double > | axis_max |
| std::shared_ptr< Function< dim > > | acceptance_fct |
| std::vector< unsigned int > | filted_box_index |
| unsigned int | first_index_this_proc |
| unsigned int | last_index_this_proc |
| unsigned int | number_of_valid_insertion_point_global |
| const double | maximum_diameter |
Additional Inherited Members | |
| Protected Member Functions inherited from Insertion< dim, PropertiesIndex > | |
| void | print_insertion_info (const unsigned int &inserted_this_step, const unsigned int &remained_particles, const unsigned int &particle_type, const ConditionalOStream &pcout) |
| void | assign_particle_properties (const DEMSolverParameters< dim > &dem_parameters, const unsigned int &inserted_this_step_this_proc, const unsigned int ¤t_inserting_particle_type, const std::vector< Point< dim > > &insertion_points, std::vector< std::vector< double > > &particle_properties) |
| void | find_cells_in_removing_box (const parallel::distributed::Triangulation< dim > &triangulation) |
| void | remove_particles_in_box (Particles::ParticleHandler< dim > &particle_handler) |
| Protected Attributes inherited from Insertion< dim, PropertiesIndex > | |
| std::vector< std::shared_ptr< Distribution > > | distributions_objects |
| const bool | removing_particles_in_region |
| Point< dim > | p_min |
| Point< dim > | p_max |
| std::set< typename Triangulation< dim >::active_cell_iterator > | in_removal_box |
| std::set< typename Triangulation< dim >::active_cell_iterator > | edge_of_removal_box |
| bool | mark_for_update |
| boost::signals2::connection | change_to_triangulation |
Definition at line 12 of file insertion_volume.h.
| InsertionVolume< dim, PropertiesIndex >::InsertionVolume | ( | const std::vector< std::shared_ptr< Distribution > > & | size_distribution_object_container, |
| const parallel::distributed::Triangulation< dim > & | triangulation, | ||
| const DEMSolverParameters< dim > & | dem_parameters, | ||
| const double | maximum_particle_diameter ) |
The constructor investigates if the insertion box is large enough to handle the desired number of particles with the specified insertion parameters. If the insertion box is not adequately large, the number of inserted particles at each insertion step is updated. It also finds the insertion points in each direction (number_of_particles_x_direction, number_of_particles_y_direction and number_of_particles_z_direction).
| [in] | size_distribution_object_container | Contains all distribution for each particle type |
| [in] | triangulation | Triangulation to access the cells in which the particles are inserted |
| [in] | dem_parameters | DEM parameters declared in the .prm file |
| [in] | maximum_particle_diameter | Maximum particle diameter based on values defined in the parameter handler |
Definition at line 16 of file insertion_volume.cc.
References acceptance_fct, current_inserting_particle_type, Insertion< dim, PropertiesIndex >::Insertion(), DEMSolverParameters< dim >::insertion_info, maximum_diameter, particles_of_each_type_remaining, and set_filtered_index().
|
private |
Adjust the number of inserted particles for this insertion time step if the number required by the used is larger than what is allowed by the insertion box and the acceptance function.
| [in] | insertion_information | DEM insertion parameters declared in the .prm |
| [in] | pcout | Printing in parallel |
| [in] | inserted_this_step | Number of particle to insert at the current insertion step. This value is updated if the requested number of particles for insertion in the current insertion step is larger than the maximum number of inserted particles based on the insertion box size. |
Definition at line 355 of file insertion_volume.cc.
References Parameters::Lagrangian::InsertionInfo< dim >::inserted_this_step, number_of_valid_insertion_point_global, and particles_of_each_type_remaining.
|
inlineoverridevirtual |
Deserialize an input archive to the volume insertion object.
| [in] | ar | Input archive where the attributes are stored. |
Implements Insertion< dim, PropertiesIndex >.
Definition at line 74 of file insertion_volume.h.
References current_inserting_particle_type, and particles_of_each_type_remaining.
|
private |
Converts id of particles to volume insertion location.
| [out] | insertion_location | Insertion location of the particle |
| [in] | id | Particle_id |
| [in] | random_number1 | A random number to create randomness in volume insertion |
| [in] | random_number2 | A random number to create randomness in volume insertion |
| [in] | insertion_information | DEM insertion parameters declared in the .prm file |
Definition at line 149 of file insertion_volume.cc.
References axis_min, Parameters::Lagrangian::InsertionInfo< dim >::direction_sequence, Parameters::Lagrangian::InsertionInfo< dim >::distance_threshold, maximum_diameter, and number_of_particles_directions.
|
overridevirtual |
Carries out the volume insertion of particles.
| [in] | particle_handler | The particle handler of particles which are being inserted |
| [in] | triangulation | Triangulation to access the cells in which the particles are inserted |
| [in] | dem_parameters | DEM parameters declared in the .prm file |
Implements Insertion< dim, PropertiesIndex >.
Definition at line 44 of file insertion_volume.cc.
References adjust_insertion_count_by_insertion_box_capacity(), Insertion< dim, PropertiesIndex >::assign_particle_properties(), create_random_number_container(), current_inserting_particle_type, filted_box_index, Insertion< dim, PropertiesIndex >::find_cells_in_removing_box(), find_insertion_location(), first_index_this_proc, DEMSolverParameters< dim >::insertion_info, DEMSolverParameters< dim >::lagrangian_physical_properties, last_index_this_proc, Insertion< dim, PropertiesIndex >::mark_for_update, Parameters::Lagrangian::LagrangianPhysicalProperties::number, Parameters::Lagrangian::LagrangianPhysicalProperties::particle_type_number, particles_of_each_type_remaining, Insertion< dim, PropertiesIndex >::print_insertion_info(), Insertion< dim, PropertiesIndex >::remove_particles_in_box(), and Insertion< dim, PropertiesIndex >::removing_particles_in_region.
|
inlineoverridevirtual |
Serialize the volume insertion object to an output archive.
| [out] | ar | Output archive where the attributes are stored. |
Implements Insertion< dim, PropertiesIndex >.
Definition at line 62 of file insertion_volume.h.
References current_inserting_particle_type, and particles_of_each_type_remaining.
|
private |
Fills the filted_box_index vector. Also finds how many insertion points are valid inside the insertion box after applying the acceptance function.
| [in] | insertion_information | DEM insertion parameters declared in the .prm |
Definition at line 209 of file insertion_volume.cc.
References acceptance_fct, axis_max, axis_min, Parameters::Lagrangian::InsertionInfo< dim >::direction_sequence, Parameters::Lagrangian::InsertionInfo< dim >::distance_threshold, filted_box_index, find_insertion_location(), first_index_this_proc, Parameters::Lagrangian::InsertionInfo< dim >::inserted_this_step, Parameters::Lagrangian::InsertionInfo< dim >::insertion_box_point_1, Parameters::Lagrangian::InsertionInfo< dim >::insertion_box_point_2, last_index_this_proc, maximum_diameter, number_of_particles_directions, and number_of_valid_insertion_point_global.
|
private |
Function used to insert particle inside our outside an arbitrary shape.
Definition at line 144 of file insertion_volume.h.
|
private |
Definition at line 141 of file insertion_volume.h.
|
private |
Minimum and maximum boundaries of the insertion box in the direction order It means that axis 0 is not necessarily x, since it depends on the order of the insertion direction.
Definition at line 141 of file insertion_volume.h.
|
private |
Definition at line 129 of file insertion_volume.h.
|
private |
Map used to transfer from the filtered to the pre-filted numbering of the insertion point inside the insertion box.
Definition at line 148 of file insertion_volume.h.
|
private |
The first and last index that will get inserted by this process following the filtered numeration.
Definition at line 152 of file insertion_volume.h.
|
private |
Definition at line 152 of file insertion_volume.h.
|
private |
Maximum particle diameter based on the values defined in the parameter.
Definition at line 159 of file insertion_volume.h.
|
private |
Definition at line 136 of file insertion_volume.h.
|
private |
The total number of valid points inside the box on all processes after applying the acceptance function.
Definition at line 156 of file insertion_volume.h.
|
private |
Number of particles of each type that remain to be inserted in the upcoming insertion steps
Definition at line 133 of file insertion_volume.h.