CoMMA 1.3.2
A geometric agglomerator for unstructured meshes
|
Class representing the pool of all the seeds for creating a coarse cell. This derived class gives higher priority to cells that are on the border. More...
#include <Seeds_Pool.h>
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_Boundary_Priority (const std::vector< CoMMAIntType > &n_bnd_faces, const std::vector< CoMMAWeightType > &priority_weights, const bool one_point_init) | |
Constructor. More... | |
~Seeds_Pool_Boundary_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. It updates the current top queue if necessary. 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. It updates the top queue if necessary. 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... | |
Class representing the pool of all the seeds for creating a coarse cell. This derived class gives higher priority to cells that are on the border.
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 >::CoMMASetOfPairType = std::set<CoMMAPairType, CustomPairGreaterFunctor<CoMMAPairType> > |
Type of set of pairs.
using comma::Seeds_Pool_Boundary_Priority< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::SeedsPoolBaseType = Seeds_Pool<CoMMAIndexType, CoMMAWeightType, CoMMAIntType> |
Base class.
|
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 |
|
overridedefault |
Destructor.
|
inlineoverridevirtual |
Choose a new seed in the pool.
[in] | is_agglomerated | Vector of booleans telling whether fine cells are agglomerated |
Implements comma::Seeds_Pool< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >.
|
inlineoverridevirtual |
Whether the seeds pool need to be initialized. It updates the top queue if necessary.
[in] | is_agglomerated | Vector of booleans telling whether fine cells are agglomerated |
Implements comma::Seeds_Pool< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >.
|
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.
[in] | new_seeds | Vector of seeds to add |
Implements comma::Seeds_Pool< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >.
|
inlineoverridevirtual |
Add the provided seeds to a seeds pool queue according to the number of boundary faces. It updates the current top queue if necessary.
[in] | new_seeds | Seeds to add |
Implements comma::Seeds_Pool< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >.