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

#include <insertion_volume.h>

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

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 &current_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

Detailed Description

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

Definition at line 12 of file insertion_volume.h.

Constructor & Destructor Documentation

◆ InsertionVolume()

template<int dim, typename PropertiesIndex>
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).

Parameters
[in]size_distribution_object_containerContains all distribution for each particle type
[in]triangulationTriangulation to access the cells in which the particles are inserted
[in]dem_parametersDEM parameters declared in the .prm file
[in]maximum_particle_diameterMaximum 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().

Member Function Documentation

◆ adjust_insertion_count_by_insertion_box_capacity()

template<int dim, typename PropertiesIndex>
void InsertionVolume< dim, PropertiesIndex >::adjust_insertion_count_by_insertion_box_capacity ( const InsertionInfo< dim > & insertion_information,
const ConditionalOStream & pcout,
unsigned int & inserted_this_step )
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.

Parameters
[in]insertion_informationDEM insertion parameters declared in the .prm
[in]pcoutPrinting in parallel
[in]inserted_this_stepNumber 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.

◆ deserialize()

template<int dim, typename PropertiesIndex>
virtual void InsertionVolume< dim, PropertiesIndex >::deserialize ( boost::archive::text_iarchive & ar)
inlineoverridevirtual

Deserialize an input archive to the volume insertion object.

Parameters
[in]arInput 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.

◆ find_insertion_location()

template<int dim, typename PropertiesIndex>
void InsertionVolume< dim, PropertiesIndex >::find_insertion_location ( Point< dim > & insertion_location,
const unsigned int id,
const double random_number1,
const double random_number2,
const InsertionInfo< dim > & insertion_information )
private

Converts id of particles to volume insertion location.

Parameters
[out]insertion_locationInsertion location of the particle
[in]idParticle_id
[in]random_number1A random number to create randomness in volume insertion
[in]random_number2A random number to create randomness in volume insertion
[in]insertion_informationDEM 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.

◆ insert()

template<int dim, typename PropertiesIndex>
void InsertionVolume< dim, PropertiesIndex >::insert ( Particles::ParticleHandler< dim > & particle_handler,
const parallel::distributed::Triangulation< dim > & triangulation,
const DEMSolverParameters< dim > & dem_parameters )
overridevirtual

◆ serialize()

template<int dim, typename PropertiesIndex>
virtual void InsertionVolume< dim, PropertiesIndex >::serialize ( boost::archive::text_oarchive & ar)
inlineoverridevirtual

Serialize the volume insertion object to an output archive.

Parameters
[out]arOutput 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.

◆ set_filtered_index()

template<int dim, typename PropertiesIndex>
void InsertionVolume< dim, PropertiesIndex >::set_filtered_index ( const InsertionInfo< dim > & insertion_information)
private

Member Data Documentation

◆ acceptance_fct

template<int dim, typename PropertiesIndex>
std::shared_ptr<Function<dim> > InsertionVolume< dim, PropertiesIndex >::acceptance_fct
private

Function used to insert particle inside our outside an arbitrary shape.

Definition at line 144 of file insertion_volume.h.

◆ axis_max

template<int dim, typename PropertiesIndex>
std::vector<double> InsertionVolume< dim, PropertiesIndex >::axis_max
private

Definition at line 141 of file insertion_volume.h.

◆ axis_min

template<int dim, typename PropertiesIndex>
std::vector<double> InsertionVolume< dim, PropertiesIndex >::axis_min
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.

◆ current_inserting_particle_type

template<int dim, typename PropertiesIndex>
unsigned int InsertionVolume< dim, PropertiesIndex >::current_inserting_particle_type
private

Definition at line 129 of file insertion_volume.h.

◆ filted_box_index

template<int dim, typename PropertiesIndex>
std::vector<unsigned int> InsertionVolume< dim, PropertiesIndex >::filted_box_index
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.

◆ first_index_this_proc

template<int dim, typename PropertiesIndex>
unsigned int InsertionVolume< dim, PropertiesIndex >::first_index_this_proc
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.

◆ last_index_this_proc

template<int dim, typename PropertiesIndex>
unsigned int InsertionVolume< dim, PropertiesIndex >::last_index_this_proc
private

Definition at line 152 of file insertion_volume.h.

◆ maximum_diameter

template<int dim, typename PropertiesIndex>
const double InsertionVolume< dim, PropertiesIndex >::maximum_diameter
private

Maximum particle diameter based on the values defined in the parameter.

Definition at line 159 of file insertion_volume.h.

◆ number_of_particles_directions

template<int dim, typename PropertiesIndex>
std::vector<int> InsertionVolume< dim, PropertiesIndex >::number_of_particles_directions
private

Definition at line 136 of file insertion_volume.h.

◆ number_of_valid_insertion_point_global

template<int dim, typename PropertiesIndex>
unsigned int InsertionVolume< dim, PropertiesIndex >::number_of_valid_insertion_point_global
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.

◆ particles_of_each_type_remaining

template<int dim, typename PropertiesIndex>
unsigned int InsertionVolume< dim, PropertiesIndex >::particles_of_each_type_remaining
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.


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