|
| Agglomerator_Anisotropic (std::shared_ptr< Dual_Graph< CoMMAIndexType, CoMMAWeightType, CoMMAIntType > > graph, std::shared_ptr< Coarse_Cell_Container< CoMMAIndexType, CoMMAWeightType, CoMMAIntType > > cc_graph, std::shared_ptr< Seeds_Pool< CoMMAIndexType, CoMMAWeightType, CoMMAIntType > > seeds_pool, CoMMAIntType dimension, const CoMMAWeightType threshold_anisotropy, const std::vector< CoMMAIndexType > &agglomerationLines_Idx, const std::vector< CoMMAIndexType > &agglomerationLines, const std::vector< CoMMAWeightType > &priority_weights, const bool build_lines, const bool odd_line_length, const std::optional< CoMMAIndexType > max_cells_in_line, CoMMACellCouplingT cell_coupling=CoMMACellCouplingT::MAX_WEIGHT, const bool force_line_direction=true) |
| Constructor. More...
|
|
| ~Agglomerator_Anisotropic () override=default |
| Destructor. More...
|
|
void | agglomerate_one_level (const CoMMAIntType goal_card, const CoMMAIntType min_card, const CoMMAIntType max_card, const std::vector< CoMMAWeightType > &priority_weights, bool correction_steps) override |
| Specialization of the pure virtual function to the class Agglomerator_Anisotropic. We add the override key as a guard to possible mistakes: https://stackoverflow.com/questions/46446652/is-there-any-point-in-using-override-when-overriding-a-pure-virtual-function. More...
|
|
void | update_seeds_pool () |
| Update the seeds pool with the neighbours of the anisotropic cells agglomerated so far. More...
|
|
void | export_anisotropic_lines (CoMMAIntType level, std::vector< CoMMAIndexType > &aniso_lines_idx, std::vector< CoMMAIndexType > &aniso_lines) const |
| Function that prepares the anisotropic lines for output. More...
|
|
| Agglomerator (std::shared_ptr< Dual_Graph< CoMMAIndexType, CoMMAWeightType, CoMMAIntType > > graph, std::shared_ptr< Coarse_Cell_Container< CoMMAIndexType, CoMMAWeightType, CoMMAIntType > > cc_graph, std::shared_ptr< Seeds_Pool< CoMMAIndexType, CoMMAWeightType, CoMMAIntType > > seeds_pool, CoMMAIntType dimension) |
| The constructor of the interface. More...
|
|
virtual | ~Agglomerator ()=default |
| The destructor of the class. More...
|
|
std::vector< CoMMAIndexType > | get_fc_2_cc () const |
| Accessor to retrieve the fine cells to coarse cells from the coarse cell graphs class. More...
|
|
virtual void | agglomerate_one_level (const CoMMAIntType goal_card, const CoMMAIntType min_card, const CoMMAIntType max_card, const std::vector< CoMMAWeightType > &priority_weights, bool correction_steps)=0 |
| Pure virtual function which implementation is specified in the related child classes and that defines the agglomeration of one level. More...
|
|
|
bool | build_anisotropic_lines (const std::vector< CoMMAWeightType > &priority_weights, const CoMMAWeightType threshold_anisotropy) |
| Build the anisotropic lines at the first level (only called at the first level of agglomeration). Two main steps are performed:
. More...
|
|
bool | is_high_coupling (const CoMMAWeightType weight, const CoMMAWeightType ref_weight) |
| Tell whether a weight should be considered as high coupling between two cells. More...
|
|
void | find_cell_candidates_for_line_max_weight (const CoMMAIndexType seed, const std::vector< bool > &to_treat, const std::vector< CoMMAWeightType > &weights, const std::vector< CoMMAWeightType > &max_weights, CoMMASetOfPairType &candidates) |
| Find cells which are good candidates to be added to the anisotropic line. In order to identify the candidate, the weights are considered. More...
|
|
void | find_cell_candidates_for_line_direction (const CoMMAIndexType seed, const std::vector< bool > &to_treat, const std::vector< CoMMAWeightType > &weights, const std::vector< CoMMAWeightType > &max_weights, const std::vector< CoMMAWeightType > &prev_dir, const bool check_weight, CoMMASetOfPairType &candidates) |
| Find cells which are good candidates to be added to the anisotropic line. In order to identify the candidate, the direction is compared to the last reported one; additionally, if requested, the weights can also be considered. More...
|
|
|
std::deque< CoMMAIndexType > | _aniso_neighbours |
| Neighbours of the anisotropic cells agglomerated. They are used to update the seeds pool. More...
|
|
bool | _odd_line_length |
| Whether anisotropic lines with odd length are allowed. More...
|
|
std::optional< CoMMAIndexType > | _max_cells_in_line |
| Maximum number of cells in an anisotropic line; when this value is reached, all reaming cells are discarded, hence considered as isotropic. More...
|
|
CoMMACellCouplingT | _cell_coupling |
|
bool | _force_line_direction |
|
CoMMAIntType | _dimension |
| Dimensionality of the problem (_dimension = 2 -> 2D, _dimension = 3 -> 3D) More...
|
|
CoMMAIntType | _min_neighbourhood = 3 |
| Minimum number of neighbourhood we extend to search the neighbourhood in the greedy algorithm. Set as default to 3. More...
|
|
CoMMAIntType | _min_card = 0 |
| Minimum cardinality (default = 0, meaning, equal to the dimension) More...
|
|
CoMMAIntType | _max_card = 0 |
| Maximum cardinality (default = 0, meaning, 5 or 10 for, resp., 2- and 3D. More...
|
|
CoMMAIntType | _goal_card = 0 |
| Goal cardinality (default = 0, meaning, 4 or 8 for, resp., 2- and 3D. More...
|
|
CoMMAIntType | _threshold_card = 0 |
| Threshold cardinality (default = 0, meaning, equal to the dimension) More...
|
|
std::vector< CoMMAIndexType > | _l_nb_of_cells |
| List of number of cells per coarse cell created. More...
|
|
std::shared_ptr< Dual_Graph< CoMMAIndexType, CoMMAWeightType, CoMMAIntType > > | _fc_graph |
| Dual_Graph object determining Fine cells graph and hence the connectivity. More...
|
|
std::shared_ptr< Coarse_Cell_Container< CoMMAIndexType, CoMMAWeightType, CoMMAIntType > > | _cc_graph |
| pointer to Coarse_Cell_Container element More...
|
|
std::shared_ptr< Seeds_Pool< CoMMAIndexType, CoMMAWeightType, CoMMAIntType > > | _seeds_pool |
| Seeds_Pool object giving the order in which the fine cells should be considered when agglomerating. More...
|
|
template<typename CoMMAIndexType, typename CoMMAWeightType, typename CoMMAIntType>
class comma::Agglomerator_Anisotropic< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >
Agglomerator_Anisotropic class is a child class of the Agglomerator class that specializes the implementation to the case of Anisotropic agglomeration.
- Template Parameters
-
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 |
template<typename CoMMAIndexType , typename CoMMAWeightType , typename CoMMAIntType >
void comma::Agglomerator_Anisotropic< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::find_cell_candidates_for_line_direction |
( |
const CoMMAIndexType |
seed, |
|
|
const std::vector< bool > & |
to_treat, |
|
|
const std::vector< CoMMAWeightType > & |
weights, |
|
|
const std::vector< CoMMAWeightType > & |
max_weights, |
|
|
const std::vector< CoMMAWeightType > & |
prev_dir, |
|
|
const bool |
check_weight, |
|
|
CoMMASetOfPairType & |
candidates |
|
) |
| |
|
inlineprotected |
Find cells which are good candidates to be added to the anisotropic line. In order to identify the candidate, the direction is compared to the last reported one; additionally, if requested, the weights can also be considered.
- Parameters
-
[in] | seed | Last cell to be added to the line. |
[in] | to_treat | Vector of booleans telling whether a cell should be considered. |
[in] | weights | Weights of the graph. |
[in] | max_weights | Vector holding for each cell the maximum weight among its neighbours. |
[in] | prev_dir | Previous direction. |
[in] | check_weight | Whether to check weight of the potential candidate |
[out] | candidates | Set of the candidates, which are pairs of cell ID and related priority. |