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

#include <insertion_packed.h>

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

Public Member Functions

 InsertionPacked (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 ()

Static Public Member Functions

static void apply_shift_displacement (Particles::ParticleHandler< dim > &particle_handler, const double max_displacement, ParticleInteractionOutcomes< PropertiesIndex > &contact_outcome, std::vector< double > &displacements)

Private Member Functions

void generate_insertion_location (Point< dim > &insertion_location, std::mt19937 &rng, const InsertionInfo< dim > &insertion_information)

Private Attributes

std::vector< double > axis_min
std::vector< double > axis_max
std::shared_ptr< Function< dim > > acceptance_fct

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

Definition at line 16 of file insertion_packed.h.

Constructor & Destructor Documentation

◆ InsertionPacked()

template<int dim, typename PropertiesIndex>
InsertionPacked< dim, PropertiesIndex >::InsertionPacked ( 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 the packed insertion method.

Particles are inserted by randomly generating points inside the insertion region and assigning them particle properties (such as their diameter). Because the generated configuration may contain particle-particle and particle-wall overlaps, particles are iteratively displaced along the corresponding contact normal directions until all overlaps are resolved.

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 17 of file insertion_packed.cc.

References acceptance_fct, axis_max, axis_min, Parameters::Lagrangian::InsertionInfo< dim >::direction_sequence, Insertion< dim, PropertiesIndex >::Insertion(), Parameters::Lagrangian::InsertionInfo< dim >::insertion_box_point_1, Parameters::Lagrangian::InsertionInfo< dim >::insertion_box_point_2, and DEMSolverParameters< dim >::insertion_info.

Member Function Documentation

◆ apply_shift_displacement()

template<int dim, typename PropertiesIndex>
void InsertionPacked< dim, PropertiesIndex >::apply_shift_displacement ( Particles::ParticleHandler< dim > & particle_handler,
const double max_displacement,
ParticleInteractionOutcomes< PropertiesIndex > & contact_outcome,
std::vector< double > & displacements )
static

Displace the locally owned particles by the displacements accumulated by the shift contact models.

Each contact of a particle adds a displacement to the entry of that particle in the force container of the contact outcomes. Each particle is moved by the sum of the displacements of its contacts, limited to a maximum norm, and the norm of the applied displacement is added to the displacement used by the dynamic contact detection. The force container is then reset to zero for the next pseudo-time step.

Parameters
[in,out]particle_handlerThe particle handler of particles which are being inserted.
[in]max_displacementMaximum displacement of a particle during a single pseudo-time step.
[in,out]contact_outcomeContact outcomes holding the accumulated displacements of the particles.
[in,out]displacementsDisplacement of each particle since the last contact detection step. The norm of the applied displacement is added.

Definition at line 186 of file insertion_packed.cc.

References ParticleInteractionOutcomes< PropertiesIndex >::force, and tensor_nd_to_2d().

◆ deserialize()

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

Deserialize an input archive to the packed insertion object. For the packing insertion, nothing needs to be stored.

Parameters
arInput archive where the attributes are stored.

Implements Insertion< dim, PropertiesIndex >.

Definition at line 76 of file insertion_packed.h.

◆ generate_insertion_location()

template<int dim, typename PropertiesIndex>
void InsertionPacked< dim, PropertiesIndex >::generate_insertion_location ( Point< dim > & insertion_location,
std::mt19937 & rng,
const InsertionInfo< dim > & insertion_information )
private

Generate an insertion point inside an insertion box.

Parameters
insertion_locationGenerated insertion location.
rngRandom number generator.
insertion_informationInsertion parameters read from the .prm file.

Definition at line 228 of file insertion_packed.cc.

References acceptance_fct, axis_max, axis_min, and Parameters::Lagrangian::InsertionInfo< dim >::direction_sequence.

◆ insert()

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

Carries out the packed insertion of particles.

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

Implements Insertion< dim, PropertiesIndex >.

Definition at line 56 of file insertion_packed.cc.

References Insertion< dim, PropertiesIndex >::assign_particle_properties(), generate_insertion_location(), DEMSolverParameters< dim >::insertion_info, DEMSolverParameters< dim >::lagrangian_physical_properties, Parameters::Lagrangian::LagrangianPhysicalProperties::number, Parameters::Lagrangian::LagrangianPhysicalProperties::particle_type_number, and Insertion< dim, PropertiesIndex >::print_insertion_info().

◆ serialize()

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

Serialize the packed insertion object to an output archive. For the packing insertion, nothing needs to be stored.

Parameters
arOutput archive where the attributes are stored.

Implements Insertion< dim, PropertiesIndex >.

Definition at line 63 of file insertion_packed.h.

Member Data Documentation

◆ acceptance_fct

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

Function used to insert particles inside or outside an arbitrary shape.

Definition at line 128 of file insertion_packed.h.

◆ axis_max

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

Definition at line 125 of file insertion_packed.h.

◆ axis_min

template<int dim, typename PropertiesIndex>
std::vector<double> InsertionPacked< dim, PropertiesIndex >::axis_min
private

Definition at line 125 of file insertion_packed.h.


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