CoMMA 1.3.2
A geometric agglomerator for unstructured meshes
Loading...
Searching...
No Matches
comma::Seeds_Pool_Neighbourhood_Priority< CoMMAIndexType, CoMMAWeightType, CoMMAIntType > Class Template Reference

Class representing the pool of all the seeds for creating a coarse cell. This derived class gives higher priority to cells that are neighbours of already existing coarse cells. More...

#include <Seeds_Pool.h>

Inheritance diagram for comma::Seeds_Pool_Neighbourhood_Priority< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >:
comma::Seeds_Pool< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >

Public Types

using SeedsPoolBaseType = Seeds_Pool< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >
 Base class. More...
 
using CoMMAPairType = std::pair< CoMMAIndexType, CoMMAWeightType >
 Type of pair. More...
 
using CoMMASetOfPairType = std::set< CoMMAPairType, CustomPairGreaterFunctor< CoMMAPairType > >
 Type of set of pairs. More...
 
- Public Types inherited from comma::Seeds_Pool< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >
using CoMMAPairType = std::pair< CoMMAIndexType, CoMMAWeightType >
 Type of pair. More...
 
using CoMMAQueueType = std::deque< CoMMAIndexType >
 Type of queue which holds seeds. More...
 
using CoMMASetOfPairType = std::set< CoMMAPairType, CustomPairGreaterFunctor< CoMMAPairType > >
 Type of set of pairs. More...
 

Public Member Functions

 Seeds_Pool_Neighbourhood_Priority (const std::vector< CoMMAIntType > &n_bnd_faces, const std::vector< CoMMAWeightType > &priority_weights, const bool one_point_init)
 Constructor. More...
 
 ~Seeds_Pool_Neighbourhood_Priority () override=default
 Destructor. More...
 
std::optional< CoMMAIndexType > choose_new_seed (const std::vector< bool > &is_agglomerated) override
 Choose a new seed in the pool. More...
 
void update (const std::deque< CoMMAIndexType > &new_seeds) override
 Add the provided seeds to a seeds pool queue according to the number of boundary faces. More...
 
void order_new_seeds_and_update (const std::unordered_set< CoMMAIndexType > &new_seeds) override
 Add the provided seeds to a seeds pool queue according to the number of boundary faces. The seeds will be ordered considering their priority weights before being added to the queue. More...
 
bool need_initialization (const std::vector< bool > &is_agglomerated) override
 Whether the seeds pool need to be initialized. More...
 
- Public Member Functions inherited from comma::Seeds_Pool< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >
 Seeds_Pool (const std::vector< CoMMAIntType > &n_bnd_faces, const std::vector< CoMMAWeightType > &priority_weights, const bool one_point_init)
 Constructor. More...
 
virtual ~Seeds_Pool ()=default
 Destructor. More...
 
std::optional< CoMMAIndexType > spoil_queue (const std::vector< bool > &is_fc_agglomerated, CoMMAQueueType &queue)
 Spoil a queue looking for an not-yet-agglomerated seed. More...
 
virtual std::optional< CoMMAIndexType > choose_new_seed (const std::vector< bool > &is_agglomerated)=0
 Choose a new seed in the pool. More...
 
virtual void update (const std::deque< CoMMAIndexType > &new_seeds)=0
 Add the provided seeds to a seeds pool queue according to the number of boundary faces. More...
 
virtual void order_new_seeds_and_update (const std::unordered_set< CoMMAIndexType > &new_seeds)=0
 Add the provided seeds to a seeds pool queue according to the number of boundary faces. The seeds will be ordered considering their priority weights before being added to the queue. More...
 
void build_queue (const std::vector< bool > &is_fc_agglomerated, const CoMMAIntType target)
 Build the weight-ordered queue of seed for a given target level. A set of (index, weight) pair with special comparator is used to enforced order, then the indices are extracted. More...
 
std::optional< CoMMAIntType > get_highest_n_bnd_yet_to_agglomerate (const std::vector< bool > &is_fc_agglomerated, const CoMMAIntType expected_max=CoMMACellT::CORNER) const
 Compute the highest number of boundary faces of cells which are not agglomerated yet. More...
 
bool is_empty (CoMMAIntType i_level=CoMMACellT::N_CELL_TYPES) const
 Given the default levels we define if the list of the targeted level is empty. More...
 
virtual bool need_initialization (const std::vector< bool > &is_agglomerated)=0
 Whether the seeds pool need to be initialized. More...
 
void initialize ()
 Initialize the seeds pool via a call to its initializator. More...
 
void set_top_queue (const CoMMAIntType q_lvl)
 Setter for the top queue member. More...
 

Additional Inherited Members

- Public Attributes inherited from comma::Seeds_Pool< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >
const std::vector< CoMMAIntType > & _n_bnd_faces
 Vector of number of faces on boundary per cell. More...
 
- Protected Attributes inherited from comma::Seeds_Pool< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >
std::vector< CoMMAQueueType_l_of_seeds
 List of deque of seeds. For each identifier we have the available seeds. We want the seed to be chosen preferably in the corner, then ridges, valleys and then interiors, see CoMMACellT. More...
 
const std::vector< CoMMAWeightType > & _priority_weights
 Weights used to set the order of the seed to choose. More...
 
std::optional< CoMMAIntType > _cur_top_queue
 Optional possibly containing the level (0,1,2,3, see Seeds_Pool::_l_of_seeds) of the queue currently being spoiled. More...
 
std::shared_ptr< SPInitializator< CoMMAIndexType, CoMMAWeightType, CoMMAIntType > > _initializator
 Pointer to a SPInitializator. More...
 

Detailed Description

template<typename CoMMAIndexType, typename CoMMAWeightType, typename CoMMAIntType>
class comma::Seeds_Pool_Neighbourhood_Priority< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >

Class representing the pool of all the seeds for creating a coarse cell. This derived class gives higher priority to cells that are neighbours of already existing coarse cells.

Template Parameters
CoMMAIndexTypethe CoMMA index type for the global index of the mesh
CoMMAWeightTypethe CoMMA weight type for the weights (volume or area) of the nodes or edges of the Mesh
CoMMAIntTypethe CoMMA type for integers

Member Typedef Documentation

◆ CoMMAPairType

template<typename CoMMAIndexType , typename CoMMAWeightType , typename CoMMAIntType >
using comma::Seeds_Pool< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::CoMMAPairType = std::pair<CoMMAIndexType, CoMMAWeightType>

Type of pair.

◆ CoMMASetOfPairType

template<typename CoMMAIndexType , typename CoMMAWeightType , typename CoMMAIntType >
using comma::Seeds_Pool< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::CoMMASetOfPairType = std::set<CoMMAPairType, CustomPairGreaterFunctor<CoMMAPairType> >

Type of set of pairs.

◆ SeedsPoolBaseType

template<typename CoMMAIndexType , typename CoMMAWeightType , typename CoMMAIntType >
using comma::Seeds_Pool_Neighbourhood_Priority< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::SeedsPoolBaseType = Seeds_Pool<CoMMAIndexType, CoMMAWeightType, CoMMAIntType>

Base class.

Constructor & Destructor Documentation

◆ Seeds_Pool_Neighbourhood_Priority()

template<typename CoMMAIndexType , typename CoMMAWeightType , typename CoMMAIntType >
comma::Seeds_Pool_Neighbourhood_Priority< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::Seeds_Pool_Neighbourhood_Priority ( const std::vector< CoMMAIntType > &  n_bnd_faces,
const std::vector< CoMMAWeightType > &  priority_weights,
const bool  one_point_init 
)
inline

Constructor.

Parameters
[in]n_bnd_facesVector telling how many boundary faces each cell has
[in]priority_weightsWeights used to set the order of the seed to choose
[in]one_point_initWhether the initialization should be done for the highest boundary level or just for one point

◆ ~Seeds_Pool_Neighbourhood_Priority()

template<typename CoMMAIndexType , typename CoMMAWeightType , typename CoMMAIntType >
comma::Seeds_Pool_Neighbourhood_Priority< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::~Seeds_Pool_Neighbourhood_Priority ( )
overridedefault

Destructor.

Member Function Documentation

◆ choose_new_seed()

template<typename CoMMAIndexType , typename CoMMAWeightType , typename CoMMAIntType >
std::optional< CoMMAIndexType > comma::Seeds_Pool_Neighbourhood_Priority< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::choose_new_seed ( const std::vector< bool > &  is_agglomerated)
inlineoverridevirtual

Choose a new seed in the pool.

Parameters
[in]is_agglomeratedVector of booleans telling whether fine cells are agglomerated
Returns
New seed

Implements comma::Seeds_Pool< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >.

◆ need_initialization()

template<typename CoMMAIndexType , typename CoMMAWeightType , typename CoMMAIntType >
bool comma::Seeds_Pool_Neighbourhood_Priority< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::need_initialization ( const std::vector< bool > &  is_agglomerated)
inlineoverridevirtual

Whether the seeds pool need to be initialized.

Parameters
[in]is_agglomeratedvector of boolean with fine cells
Returns
A bool

Implements comma::Seeds_Pool< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >.

◆ order_new_seeds_and_update()

template<typename CoMMAIndexType , typename CoMMAWeightType , typename CoMMAIntType >
void comma::Seeds_Pool_Neighbourhood_Priority< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::order_new_seeds_and_update ( const std::unordered_set< CoMMAIndexType > &  new_seeds)
inlineoverridevirtual

Add the provided seeds to a seeds pool queue according to the number of boundary faces. The seeds will be ordered considering their priority weights before being added to the queue.

Parameters
[in]new_seedsVector of seeds to add

Implements comma::Seeds_Pool< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >.

◆ update()

template<typename CoMMAIndexType , typename CoMMAWeightType , typename CoMMAIntType >
void comma::Seeds_Pool_Neighbourhood_Priority< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::update ( const std::deque< CoMMAIndexType > &  new_seeds)
inlineoverridevirtual

Add the provided seeds to a seeds pool queue according to the number of boundary faces.

Parameters
[in]new_seedsSeeds to add
Warning
new_seeds is supposed to be already ordered by the priority weight, therefore no check will be performed

Implements comma::Seeds_Pool< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >.


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