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

#include <insertion_plane.h>

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

Public Member Functions

 InsertionPlane (const std::vector< std::shared_ptr< Distribution > > &size_distribution_object_container, const parallel::distributed::Triangulation< dim > &triangulation, const DEMSolverParameters< dim > &dem_parameters)
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 find_inplane_cells (const parallel::distributed::Triangulation< dim > &triangulation, const Point< 3 > &plane_point, const Tensor< 1, 3 > &plane_normal_vector)
void find_centers_of_inplane_cells ()

Private Attributes

std::set< typename Triangulation< dim >::active_cell_iterator > plane_cells_for_insertion
double maximum_range_for_randomness
int particles_of_each_type_remaining
unsigned int current_inserting_particle_type
std::unordered_map< unsigned int, Point< dim > > cells_centers

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

Insertion of particles using cells cut by a plane. Particle insertion using cells cut by a plane. Locally owned cells that are cut by the plane are flagged. From those flagged cells, we insert a particle at their centroids if they are individually empty (contain no particle). This way, no significant overlap is occurring on the insertion of new particle which can occur with other insertion method.

Definition at line 18 of file insertion_plane.h.

Constructor & Destructor Documentation

◆ InsertionPlane()

template<int dim, typename PropertiesIndex>
InsertionPlane< dim, PropertiesIndex >::InsertionPlane ( const std::vector< std::shared_ptr< Distribution > > & size_distribution_object_container,
const parallel::distributed::Triangulation< dim > & triangulation,
const DEMSolverParameters< dim > & dem_parameters )

The plane insertion class insert particles using a plane define by a point and a normal vector. This method of insertion can be useful when dealing with a domain close to be fully filled with particle. In this situation, other insertion method have a high risk to create a big overlap between particles on insertion. The plane insertion method mitigate this risk by insertion at the center of empty cells.

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 16 of file insertion_plane.cc.

References current_inserting_particle_type, find_centers_of_inplane_cells(), find_inplane_cells(), Insertion< dim, PropertiesIndex >::Insertion(), DEMSolverParameters< dim >::insertion_info, maximum_range_for_randomness, and particles_of_each_type_remaining.

Member Function Documentation

◆ deserialize()

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

Deserialize an input archive to the plane insertion object.

Parameters
arInput archive where the attributes are stored.

Implements Insertion< dim, PropertiesIndex >.

Definition at line 72 of file insertion_plane.h.

References current_inserting_particle_type, and particles_of_each_type_remaining.

◆ find_centers_of_inplane_cells()

template<int dim, typename PropertiesIndex>
void InsertionPlane< dim, PropertiesIndex >::find_centers_of_inplane_cells ( )
private

Store the location of the centers of all the cells that are in the plane.

Definition at line 97 of file insertion_plane.cc.

References cells_centers, and plane_cells_for_insertion.

◆ find_inplane_cells()

template<int dim, typename PropertiesIndex>
void InsertionPlane< dim, PropertiesIndex >::find_inplane_cells ( const parallel::distributed::Triangulation< dim > & triangulation,
const Point< 3 > & plane_point,
const Tensor< 1, 3 > & plane_normal_vector )
private

Store the cells that are cut by the plane.

Parameters
triangulationTriangulation to access the cells in which the particles are inserted
plane_pointPoint which define the plane
plane_normal_vectorVector which define the normal direction of the plane.

Definition at line 47 of file insertion_plane.cc.

References plane_cells_for_insertion, and point_nd_to_3d().

◆ insert()

template<int dim, typename PropertiesIndex>
void InsertionPlane< 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 InsertionPlane< dim, PropertiesIndex >::serialize ( boost::archive::text_oarchive & ar)
inlineoverridevirtual

Serialize the plane insertion object to an output archive.

Parameters
arOutput archive where the attributes are stored.

Implements Insertion< dim, PropertiesIndex >.

Definition at line 60 of file insertion_plane.h.

References current_inserting_particle_type, and particles_of_each_type_remaining.

Member Data Documentation

◆ cells_centers

template<int dim, typename PropertiesIndex>
std::unordered_map<unsigned int, Point<dim> > InsertionPlane< dim, PropertiesIndex >::cells_centers
private

Definition at line 105 of file insertion_plane.h.

◆ current_inserting_particle_type

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

Definition at line 104 of file insertion_plane.h.

◆ maximum_range_for_randomness

template<int dim, typename PropertiesIndex>
double InsertionPlane< dim, PropertiesIndex >::maximum_range_for_randomness
private

Definition at line 102 of file insertion_plane.h.

◆ particles_of_each_type_remaining

template<int dim, typename PropertiesIndex>
int InsertionPlane< dim, PropertiesIndex >::particles_of_each_type_remaining
private

Definition at line 103 of file insertion_plane.h.

◆ plane_cells_for_insertion

template<int dim, typename PropertiesIndex>
std::set<typename Triangulation<dim>::active_cell_iterator> InsertionPlane< dim, PropertiesIndex >::plane_cells_for_insertion
private

Definition at line 101 of file insertion_plane.h.


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