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

#include <insertion.h>

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

Public Member Functions

 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 ()
virtual void insert (Particles::ParticleHandler< dim > &particle_handler, const parallel::distributed::Triangulation< dim > &triangulation, const DEMSolverParameters< dim > &dem_parameters)=0
virtual void serialize (boost::archive::text_oarchive &ar)=0
virtual void deserialize (boost::archive::text_iarchive &ar)=0

Protected Member Functions

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

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 Insertion< dim, PropertiesIndex >

Base interface for classes that carry out the insertion of particles in the system.

Template Parameters
dimAn integer that denotes the number of spatial dimensions.
PropertiesIndexIndex of the properties used within the ParticleHandler.

Definition at line 32 of file insertion.h.

Constructor & Destructor Documentation

◆ Insertion()

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

Carries out the insertion of particles. This is the base class of volume_insertion, plane_insertion, list_insertion and file_insertion classes.

Parameters
size_distribution_object_containerContains all distribution for each particle type
triangulationTriangulation to access the cells in which the particles are inserted
dem_parametersDEM parameters declared in the .prm file

Definition at line 10 of file insertion.cc.

References change_to_triangulation, distributions_objects, DEMSolverParameters< dim >::insertion_info, mark_for_update, p_max, p_min, and removing_particles_in_region.

◆ ~Insertion()

template<int dim, typename PropertiesIndex>
virtual Insertion< dim, PropertiesIndex >::~Insertion ( )
inlinevirtual

Carries out the destruction of the insertion class.

Definition at line 54 of file insertion.h.

References change_to_triangulation.

Member Function Documentation

◆ assign_particle_properties()

template<int dim, typename PropertiesIndex>
void Insertion< dim, PropertiesIndex >::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 )
protected

Carries out assigning the properties of inserted particles.

Parameters
dem_parametersDEM parameters declared in the prm file.
inserted_this_step_this_procNumber of particles that are inserted at each insertion step on each processor. This value can change in the last insertion step to reach the desired number of particles.
current_inserting_particle_typeType of inserting particles.
insertion_pointsInsertion points of all inserted particles at this insertion step.
particle_propertiesProperties of all inserted particles at this insertion step.

Definition at line 63 of file insertion.cc.

References distributions_objects, DEM::has_thermal_properties, DEMSolverParameters< dim >::insertion_info, and DEMSolverParameters< dim >::lagrangian_physical_properties.

◆ deserialize()

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

Deserialize an input archive to the insertion object. Is being used when restarting a simulation. This function is overridden by volume_insertion, plane_insertion, list_insertion and from_file_insertion classes.

Parameters
arInput archive where the attributes are stored.

Implemented in InsertionFile< dim, PropertiesIndex >, InsertionList< dim, PropertiesIndex >, InsertionPacked< dim, PropertiesIndex >, InsertionPlane< dim, PropertiesIndex >, and InsertionVolume< dim, PropertiesIndex >.

◆ find_cells_in_removing_box()

template<int dim, typename PropertiesIndex>
void Insertion< dim, PropertiesIndex >::find_cells_in_removing_box ( const parallel::distributed::Triangulation< dim > & triangulation)
protected

Find all cells that are completely and partially inside de the clearing box. For the cell completely inside the box, all the particles will be deleted. For those partially inside, fine verification is required.

Parameters
triangulationTriangulation to access the cells in which the particles deleted.

Definition at line 134 of file insertion.cc.

References edge_of_removal_box, in_removal_box, p_max, p_min, and point_nd_to_3d().

◆ insert()

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

This function is overridden by the volume_insertion, plane_insertion, list_insertion and file_insertion classes.

Parameters
particle_handlerThe particle handler of particles which are being inserted
triangulationTriangulation to access the cells in which the particles are inserted
dem_parametersDEM parameters declared in the .prm file

Implemented in InsertionFile< dim, PropertiesIndex >, InsertionList< dim, PropertiesIndex >, InsertionPacked< dim, PropertiesIndex >, InsertionPlane< dim, PropertiesIndex >, and InsertionVolume< dim, PropertiesIndex >.

◆ print_insertion_info()

template<int dim, typename PropertiesIndex>
void Insertion< dim, PropertiesIndex >::print_insertion_info ( const unsigned int & inserted_this_step,
const unsigned int & remained_particles,
const unsigned int & particle_type,
const ConditionalOStream & pcout )
protected

Print information about the particles that have been inserted during an insertion time step.

Parameters
inserted_this_stepNumber of particles that are inserted at each insertion step.
remained_particlesNumber of remained particles going to be inserted in future insertions
particle_typeInserted particle type
pcoutPrinting in parallel

Definition at line 44 of file insertion.cc.

References announce_string().

◆ remove_particles_in_box()

template<int dim, typename PropertiesIndex>
void Insertion< dim, PropertiesIndex >::remove_particles_in_box ( Particles::ParticleHandler< dim > & particle_handler)
protected

Remove every particle located inside a predefined zone. Currently, the zone is defined by a box.

Parameters
particle_handlerThe particle handler of particles which are being removed.

Definition at line 186 of file insertion.cc.

References edge_of_removal_box, in_removal_box, p_max, p_min, and point_nd_to_3d().

◆ serialize()

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

Serialize the insertion object to an output archive. Is being used when checkpointing a simulation. This function is overridden by volume_insertion, plane_insertion, list_insertion and file_insertion classes.

Parameters
arOutput archive where the attributes are stored.

Implemented in InsertionFile< dim, PropertiesIndex >, InsertionList< dim, PropertiesIndex >, InsertionPacked< dim, PropertiesIndex >, InsertionPlane< dim, PropertiesIndex >, and InsertionVolume< dim, PropertiesIndex >.

Member Data Documentation

◆ change_to_triangulation

template<int dim, typename PropertiesIndex>
boost::signals2::connection Insertion< dim, PropertiesIndex >::change_to_triangulation
protected

Definition at line 182 of file insertion.h.

◆ distributions_objects

template<int dim, typename PropertiesIndex>
std::vector<std::shared_ptr<Distribution> > Insertion< dim, PropertiesIndex >::distributions_objects
protected

Definition at line 167 of file insertion.h.

◆ edge_of_removal_box

template<int dim, typename PropertiesIndex>
std::set<typename Triangulation<dim>::active_cell_iterator> Insertion< dim, PropertiesIndex >::edge_of_removal_box
protected

Definition at line 178 of file insertion.h.

◆ in_removal_box

template<int dim, typename PropertiesIndex>
std::set<typename Triangulation<dim>::active_cell_iterator> Insertion< dim, PropertiesIndex >::in_removal_box
protected

Definition at line 176 of file insertion.h.

◆ mark_for_update

template<int dim, typename PropertiesIndex>
bool Insertion< dim, PropertiesIndex >::mark_for_update
protected

Definition at line 181 of file insertion.h.

◆ p_max

template<int dim, typename PropertiesIndex>
Point<dim> Insertion< dim, PropertiesIndex >::p_max
protected

Definition at line 173 of file insertion.h.

◆ p_min

template<int dim, typename PropertiesIndex>
Point<dim> Insertion< dim, PropertiesIndex >::p_min
protected

Definition at line 173 of file insertion.h.

◆ removing_particles_in_region

template<int dim, typename PropertiesIndex>
const bool Insertion< dim, PropertiesIndex >::removing_particles_in_region
protected

Definition at line 170 of file insertion.h.


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