CoMMA 1.3.2
A geometric agglomerator for unstructured meshes
|
A class implementing the CRS subgraph representation. It is used in the framework of CoMMA for the implementation of the CSR representation of the coarse cells. More...
#include <Dual_Graph.h>
Public Types | |
using | BaseClass = Graph< CoMMAIndexType, CoMMAWeightType, CoMMAIntType > |
Parent class. More... | |
using | ContainerIndexType = std::vector< CoMMAIndexType > |
Type for containers of indices. More... | |
using | ContainerWeightType = std::vector< CoMMAWeightType > |
Type for containers of weights. More... | |
Public Types inherited from comma::Graph< CoMMAIndexType, CoMMAWeightType, CoMMAIntType > | |
using | ContainerIndexType = std::vector< CoMMAIndexType > |
Type for containers of indices. More... | |
using | ContainerWeightType = std::vector< CoMMAWeightType > |
Type for containers of weights. More... | |
using | ContainerIndexConstIt = typename ContainerIndexType::const_iterator |
Type for constant iterators of containers of indices. More... | |
using | ContainerWeightConstIt = typename ContainerWeightType::const_iterator |
Type for constant iterators of containers of weights. More... | |
Public Member Functions | |
Subgraph (const CoMMAIndexType &nb_c, const ContainerIndexType &m_crs_row_ptr, const ContainerIndexType &m_crs_col_ind, const ContainerWeightType &m_crs_values, const ContainerWeightType &volumes, const ContainerIndexType &mapping_l_to_g, const bool &is_isotropic) | |
Constructor of the class. More... | |
~Subgraph () override=default | |
Destructor of the class. More... | |
void | insert_node (const ContainerIndexType &v_neigh, const CoMMAIndexType &i_fc, const CoMMAWeightType &volume, const ContainerWeightType &weight) |
Insert a node in the subgraph and add it to the mapping the. More... | |
void | remove_node (const CoMMAIndexType &elemento) |
Remove a node from the CRS representation and automatically adjust the mapping. More... | |
Public Member Functions inherited from comma::Graph< CoMMAIndexType, CoMMAWeightType, CoMMAIntType > | |
Graph (const CoMMAIndexType &nb_c, const ContainerIndexType &m_crs_row_ptr, const ContainerIndexType &m_crs_col_ind, const ContainerWeightType &m_crs_values, const ContainerWeightType &volumes) | |
Constructor of the class. More... | |
virtual | ~Graph ()=default |
Destructor of the class. More... | |
void | DFS (const CoMMAIndexType &i_fc) |
Depth First Search (DFS) recursive function. More... | |
void | BFS (const CoMMAIndexType &root) |
Breadth First Search (BFS) function. More... | |
CoMMAIntType | get_nb_of_neighbours (const CoMMAIndexType i_c) const |
Retrieve the number of neighbours. More... | |
ContainerIndexType | get_neighbours (const CoMMAIndexType &i_c) const |
Based on the CRS representation retrieves the neighbours of the cell given as an input. More... | |
ContainerIndexConstIt | neighbours_cbegin (const CoMMAIndexType &i_c) const |
Get constant pointer to the first neighbour of cell i_c . More... | |
ContainerIndexConstIt | neighbours_cend (const CoMMAIndexType &i_c) const |
Get constant pointer to the element following the last neighbour of cell i_c . More... | |
ContainerWeightType | get_weights (const CoMMAIndexType &i_c) const |
Based on the area of the faces composing the cell given as an input, we retrieve the faces connecting the given cell with the neighbourhood that can be described also as the weight of the graph. More... | |
ContainerWeightConstIt | weights_cbegin (const CoMMAIndexType &i_c) const |
Get constant pointer to the first neighbour of cell i_c . More... | |
ContainerWeightConstIt | weights_cend (const CoMMAIndexType &i_c) const |
Get constant pointer to the element following the last neighbour of cell i_c . More... | |
bool | check_connectivity () |
Check the connectivity of the graph. More... | |
CoMMAIntType | compute_min_fc_compactness_inside_a_cc (const std::unordered_set< CoMMAIndexType > &s_fc) const |
Compute the minimum compactness of fine cells inside a coarse cell. More... | |
std::unordered_map< CoMMAIndexType, CoMMAIntType > | compute_fc_compactness_inside_a_cc (const std::unordered_set< CoMMAIndexType > &s_fc) const |
Compute the dictionary of compactness of fine cells inside a coarse cell. More... | |
Public Attributes | |
bool | _is_isotropic |
Whether it originates from an isotropic cell. More... | |
CoMMAIntType | _cardinality |
Cardinality of the given subgraph, alias the number of nodes contained. More... | |
CoMMAIntType | _compactness |
Compactness of the given subgraph. The compactness is the minimum number of internal neighbours. More... | |
ContainerIndexType | _mapping_l_to_g |
Mapping from the local number of node to the global. Being a subgraph this variable connect the local index of the node with the global one. More... | |
Public Attributes inherited from comma::Graph< CoMMAIndexType, CoMMAWeightType, CoMMAIntType > | |
CoMMAIndexType | _number_of_cells |
Number of nodes in the Graph (it corresponds to the number of cells in the subgraph or the dual graph. More... | |
std::vector< bool > | _visited |
Helper vector for the DFS. More... | |
ContainerIndexType | _m_CRS_Row_Ptr |
Vector of row pointer of CRS representation. More... | |
ContainerIndexType | _m_CRS_Col_Ind |
Vector of column index of CRS representation. More... | |
ContainerWeightType | _m_CRS_Values |
Vector of area weight of CRS representation. More... | |
ContainerWeightType | _volumes |
Vector of volumes. More... | |
A class implementing the CRS subgraph representation. It is used in the framework of CoMMA for the implementation of the CSR representation of the coarse cells.
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::Subgraph< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::BaseClass = Graph<CoMMAIndexType, CoMMAWeightType, CoMMAIntType> |
Parent class.
using comma::Graph< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::ContainerIndexType = std::vector<CoMMAIndexType> |
Type for containers of indices.
using comma::Graph< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::ContainerWeightType = std::vector<CoMMAWeightType> |
Type for containers of weights.
|
inline |
Constructor of the class.
[in] | nb_c | Cardinality of the CC, that is the number of fine cells composing the CC |
[in] | m_crs_row_ptr | The row pointer of the CRS representation |
[in] | m_crs_col_ind | The column index of the CRS representation |
[in] | m_crs_values | The weight of the CRS representation (in CoMMA case will be the area of the faces that in the graph representation are the edges between two nodes represented by the cell centers. |
[in] | volumes | The volumes of the cells |
[in] | mapping_l_to_g | Mapping between the local (to the CC) numbering to global numbering |
[in] | is_isotropic | Whether the cell is isotropic |
|
overridedefault |
Destructor of the class.
|
inline |
Insert a node in the subgraph and add it to the mapping the.
[in] | v_neigh | Vector of the neighbours to be added. The neighbours must be given in the global indexing system. |
[in] | i_fc | Global index of the node |
[in] | volume | Volume of the cell |
[in] | weight | Vector of the area of the faces of the given cells to be added. |
|
inline |
Remove a node from the CRS representation and automatically adjust the mapping.
[in] | elemento | Global index of the node to be deleted. |
CoMMAIntType comma::Subgraph< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::_cardinality |
Cardinality of the given subgraph, alias the number of nodes contained.
CoMMAIntType comma::Subgraph< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::_compactness |
Compactness of the given subgraph. The compactness is the minimum number of internal neighbours.
bool comma::Subgraph< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::_is_isotropic |
Whether it originates from an isotropic cell.
ContainerIndexType comma::Subgraph< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::_mapping_l_to_g |
Mapping from the local number of node to the global. Being a subgraph this variable connect the local index of the node with the global one.