CoMMA 1.3.2
A geometric agglomerator for unstructured meshes
|
Class representing the pool of all the seeds for creating a coarse cell. More...
#include <Seeds_Pool.h>
Public Types | |
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 (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... | |
Public Attributes | |
const std::vector< CoMMAIntType > & | _n_bnd_faces |
Vector of number of faces on boundary per cell. More... | |
Protected Attributes | |
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... | |
Class representing the pool of all the seeds for creating a coarse cell.
CoMMAIndexType | the CoMMA index type for the global index of the mesh |
CoMMAWeightType | the CoMMA weight type for the weights (volume or area) of the nodes or edges of the Mesh |
CoMMAIntType | the CoMMA type for integers |
using comma::Seeds_Pool< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::CoMMAPairType = std::pair<CoMMAIndexType, CoMMAWeightType> |
Type of pair.
using comma::Seeds_Pool< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::CoMMAQueueType = std::deque<CoMMAIndexType> |
Type of queue which holds seeds.
using comma::Seeds_Pool< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::CoMMASetOfPairType = std::set<CoMMAPairType, CustomPairGreaterFunctor<CoMMAPairType> > |
Type of set of pairs.
|
inline |
Constructor.
[in] | n_bnd_faces | Vector telling how many boundary faces each cell has |
[in] | priority_weights | Weights used to set the order of the seed to choose |
[in] | one_point_init | Whether the initialization should be done for the highest boundary level or just for one point |
|
virtualdefault |
Destructor.
|
inline |
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.
[in] | is_fc_agglomerated | Vector of boolean telling whether a face has been agglomerated |
[in] | target | Level of the queue to build. It corresponds to the number of boundary faces |
|
pure virtual |
Choose a new seed in the pool.
[in] | is_agglomerated | Vector of booleans telling whether fine cells are agglomerated |
Implemented in comma::Seeds_Pool_Boundary_Priority< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >, and comma::Seeds_Pool_Neighbourhood_Priority< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >.
|
inline |
Compute the highest number of boundary faces of cells which are not agglomerated yet.
[in] | is_fc_agglomerated | Vector of boolean telling whether a face has been agglomerated |
[in] | expected_max | Expected value. If found, function returns immediately. Defaulted to CoMMACellT::CORNER |
|
inline |
Initialize the seeds pool via a call to its initializator.
|
inline |
Given the default levels we define if the list of the targeted level is empty.
[in] | i_level | level of the defined list |
|
pure virtual |
Whether the seeds pool need to be initialized.
[in] | is_agglomerated | Vector of booleans telling whether fine cells are agglomerated |
Implemented in comma::Seeds_Pool_Boundary_Priority< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >, and comma::Seeds_Pool_Neighbourhood_Priority< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >.
|
pure virtual |
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.
[in] | new_seeds | Vector of seeds to add |
Implemented in comma::Seeds_Pool_Boundary_Priority< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >, and comma::Seeds_Pool_Neighbourhood_Priority< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >.
|
inline |
Setter for the top queue member.
[in] | q_lvl | Level of the new top queue |
|
inline |
Spoil a queue looking for an not-yet-agglomerated seed.
[in] | is_fc_agglomerated | Vector of boolean telling whether a face has been agglomerated |
[out] | queue | The queue to spoil |
|
pure virtual |
Add the provided seeds to a seeds pool queue according to the number of boundary faces.
[in] | new_seeds | Seeds to add |
Implemented in comma::Seeds_Pool_Boundary_Priority< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >, and comma::Seeds_Pool_Neighbourhood_Priority< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >.
|
protected |
Optional possibly containing the level (0,1,2,3, see Seeds_Pool::_l_of_seeds) of the queue currently being spoiled.
|
protected |
Pointer to a SPInitializator.
|
protected |
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.
const std::vector<CoMMAIntType>& comma::Seeds_Pool< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::_n_bnd_faces |
Vector of number of faces on boundary per cell.
|
protected |
Weights used to set the order of the seed to choose.