CoMMA 1.3.2
A geometric agglomerator for unstructured meshes
|
Class implementing a custom container where the coarse cells are stored. More...
#include <Coarse_Cell_Container.h>
Public Types | |
using | CoarseCellType = Coarse_Cell< CoMMAIndexType, CoMMAWeightType, CoMMAIntType > |
Type for a Coarse_Cell object. More... | |
using | CoarseCellPtr = std::shared_ptr< CoarseCellType > |
Type for a shared pointer to a Dual_Graph object. More... | |
using | DualGraphPtr = typename CoarseCellType::DualGraphPtr |
Type for a shared pointer to a Dual_Graph object. More... | |
Public Member Functions | |
Coarse_Cell_Container (DualGraphPtr &fc_graph, const CoMMAIntType singular_card_thresh) | |
Create a Coarse_Cell_Container. More... | |
~Coarse_Cell_Container ()=default | |
Destructor. More... | |
CoMMAIndexType | get_number_of_fc_agglomerated () const |
Helper to get the member variable that defines the number of agglomerated fine cells. More... | |
CoMMAIndexType | get_nb_of_cc () const |
Helper to get the number of coarse cells. More... | |
std::set< CoMMAIndexType > | get_neighs_cc (const CoMMAIndexType &i_fc, const CoMMAIndexType &i_cc) const |
Retrieve the indexes of the neighbouring coarse cells to a given fine cell in a coarse cell (excluding the given coarse cell in which the fine cell is) More... | |
void | correct (const CoMMAIntType max_card) |
Implementation of the correction. In this version it implements the correction of singular cells (if one cell is alone after the agglomeration step is agglomerated to a neighbouring cell) More... | |
std::optional< CoMMAIndexType > | select_best_cc_to_agglomerate_whole (const std::unordered_set< CoMMAIndexType > &fcs, const std::set< CoMMAIndexType > &neighs, const CoMMAIntType max_card, std::optional< CoMMAIntType > &new_compactness) const |
Choose among the neighbouring coarse cells, the one to which a singular coarse cell should be assigned to. This function is similar to select_best_cc_to_agglomerate but considers only the compactness and the cardinality. More... | |
std::optional< CoMMAIndexType > | select_best_cc_to_agglomerate (const CoMMAIndexType fc, const std::set< CoMMAIndexType > &neighs, const CoMMAIntType max_card, std::optional< CoMMAIntType > &new_compactness) const |
Choose among the neighbouring coarse cells, the one to which a fine cell should be assigned to. We prefer the coarse cell which shares the most faces with the fine cell. Otherwise, we look at the cardinality and choose the coarse cell with the smallest one. More... | |
CoMMAIntType | get_shared_faces (const CoMMAIndexType fc, const CoarseCellPtr cc) const |
Compute the number of faces shared between a fine cell and a coarse one. More... | |
CoMMAIndexType | create_cc (const std::unordered_set< CoMMAIndexType > &s_fc, const CoMMAIntType compactness, bool is_anisotropic=false, bool is_creation_delayed=false) |
It creates a coarse cell based on the set of fine cells given as input. More... | |
void | cc_create_all_delayed_cc () |
Creates all the delayed coarse cell. It works only when the delayed cell flag is activated in the agglomerator. More... | |
Public Attributes | |
std::map< CoMMAIndexType, CoarseCellPtr > | _ccs |
Map containing the CC and their ID. More... | |
DualGraphPtr | _fc_graph |
Dual graph representation. More... | |
CoMMAIndexType | _cc_counter |
Number of coarse cells. More... | |
std::vector< std::optional< CoMMAIndexType > > | _fc_2_cc |
Output vector identifying to which coarse cell the fine cell belongs. More... | |
std::vector< bool > | _is_fc_agglomerated |
Vector of boolean telling whether a fine cell has been agglomerated. More... | |
CoMMAIntType | _sing_card_thresh |
Minimum cardinality for receiver CC when correcting. More... | |
Protected Attributes | |
CoMMAIndexType | _nb_of_agglomerated_fc = 0 |
Number of agglomerated fine cells. More... | |
std::vector< std::pair< std::unordered_set< CoMMAIndexType >, CoMMAIntType > > | _delayed_cc |
Vector of the set of fine cells composing the too small coarse cells that will be built at the end of the agglomeration process and their compactness degree. More... | |
std::deque< CoMMAIndexType > | _singular_cc |
Set of singular coarse cells, that is, composed of only one fine cell. More... | |
Class implementing a custom container where the coarse cells are stored.
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::Coarse_Cell_Container< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::CoarseCellPtr = std::shared_ptr<CoarseCellType> |
Type for a shared pointer to a Dual_Graph object.
using comma::Coarse_Cell_Container< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::CoarseCellType = Coarse_Cell<CoMMAIndexType, CoMMAWeightType, CoMMAIntType> |
Type for a Coarse_Cell object.
using comma::Coarse_Cell_Container< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::DualGraphPtr = typename CoarseCellType::DualGraphPtr |
Type for a shared pointer to a Dual_Graph object.
|
inline |
Create a Coarse_Cell_Container.
[in] | fc_graph | Input element Dual_Graph to work on the seeds choice and the seeds pool |
[in] | singular_card_thresh | Threshold value below which a coarse cell is considered singular |
|
default |
Destructor.
|
inline |
Creates all the delayed coarse cell. It works only when the delayed cell flag is activated in the agglomerator.
|
inline |
Implementation of the correction. In this version it implements the correction of singular cells (if one cell is alone after the agglomeration step is agglomerated to a neighbouring cell)
max_card | Maximum cardinality allowed (CoMMA might still be beyond this value) |
|
inline |
It creates a coarse cell based on the set of fine cells given as input.
[in] | s_fc | Set of fine cells passed as a reference |
[in] | compactness | Compactness degree of the CC |
[in] | is_anisotropic | Boolean that tells if we are in an anisotropic case or not |
[in] | is_creation_delayed | Based on the agglomerator instruction we define if we delay or not the agglomeration |
|
inline |
Helper to get the number of coarse cells.
|
inline |
Retrieve the indexes of the neighbouring coarse cells to a given fine cell in a coarse cell (excluding the given coarse cell in which the fine cell is)
[in] | i_fc | index of the fine cell inside the coarse cell to be analysed |
[in] | i_cc | index of the coarse cell in which the fine cell is in |
|
inline |
Helper to get the member variable that defines the number of agglomerated fine cells.
|
inline |
Compute the number of faces shared between a fine cell and a coarse one.
[in] | fc | Index of the fine cell |
[in] | cc | Pointer to the coarse cell |
|
inline |
Choose among the neighbouring coarse cells, the one to which a fine cell should be assigned to. We prefer the coarse cell which shares the most faces with the fine cell. Otherwise, we look at the cardinality and choose the coarse cell with the smallest one.
[in] | fc | Index of the fine cell |
[in] | neighs | Neighbouring coarse cells |
[in] | max_card | Maximum cardinality allowed (CoMMA might still go beyond this value) |
[out] | new_compactness | Compactness degree of the CC if the result would to be added |
max_card
might not be honored
|
inline |
Choose among the neighbouring coarse cells, the one to which a singular coarse cell should be assigned to. This function is similar to select_best_cc_to_agglomerate but considers only the compactness and the cardinality.
[in] | fcs | Set of indices of the fine cells composing the coarse cell to be agglomerated |
[in] | neighs | Neighbouring coarse cells |
[in] | max_card | Maximum cardinality allowed (CoMMA might still go beyond this value) |
[out] | new_compactness | Compactness degree of the CC if the result would to be added |
max_card
might not be honored CoMMAIndexType comma::Coarse_Cell_Container< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::_cc_counter |
Number of coarse cells.
std::map<CoMMAIndexType, CoarseCellPtr> comma::Coarse_Cell_Container< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::_ccs |
Map containing the CC and their ID.
|
protected |
Vector of the set of fine cells composing the too small coarse cells that will be built at the end of the agglomeration process and their compactness degree.
std::vector<std::optional<CoMMAIndexType> > comma::Coarse_Cell_Container< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::_fc_2_cc |
Output vector identifying to which coarse cell the fine cell belongs.
DualGraphPtr comma::Coarse_Cell_Container< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::_fc_graph |
Dual graph representation.
std::vector<bool> comma::Coarse_Cell_Container< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::_is_fc_agglomerated |
Vector of boolean telling whether a fine cell has been agglomerated.
|
protected |
Number of agglomerated fine cells.
CoMMAIntType comma::Coarse_Cell_Container< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::_sing_card_thresh |
Minimum cardinality for receiver CC when correcting.
|
protected |
Set of singular coarse cells, that is, composed of only one fine cell.