CoMMA 1.3.2
A geometric agglomerator for unstructured meshes
Loading...
Searching...
No Matches
comma::Agglomerator_Isotropic< CoMMAIndexType, CoMMAWeightType, CoMMAIntType > Class Template Referenceabstract

Agglomerator_Isotropic class is a child class of the Agglomerator class that specializes the implementation to the case of Isotropic agglomeration. More...

#include <Agglomerator.h>

Inheritance diagram for comma::Agglomerator_Isotropic< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >:
comma::Agglomerator< CoMMAIndexType, CoMMAWeightType, CoMMAIntType > comma::Agglomerator_Biconnected< CoMMAIndexType, CoMMAWeightType, CoMMAIntType > comma::Agglomerator_Iterative< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >

Public Types

using NeighbourhoodCreatorBaseType = NeighbourhoodCreator< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >
 NeighbourhoodCreator type (base class) More...
 
using NeighbourhoodCreatorExtType = NeighbourhoodExtendedCreator< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >
 NeighbourhoodExtendedCreator type (derived class) More...
 
using NeighbourhoodCreatorPFType = NeighbourhoodPureFrontCreator< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >
 NeighbourhoodPureFrontCreator type (derived class) More...
 

Public Member Functions

 Agglomerator_Isotropic (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, CoMMAAspectRatioT aspect_ratio, CoMMANeighbourhoodT neighbourhood_type, CoMMAIntType fc_iter)
 Constructor. The constructor takes as arguments the same arguments of the father and in this way activates also the constructor of the base class. More...
 
 ~Agglomerator_Isotropic () override=default
 Destructor. More...
 
void set_agglomeration_parameter (CoMMAIntType goal_card=0, CoMMAIntType min_card=0, CoMMAIntType max_card=0)
 The task of the function is to set the parameters of determine the cardinality limits with respect to the parameters passed. 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_Isotropic. 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
The function calls function choose_optimal_cc_and_update_seeds_pool of the derived class. For further information about the structure, have a look at: http://www.cplusplus.com/forum/general/31851/
The pseudo-code considers the while function and the agglomeration process is not completed until all the cells are not agglomerated. Hence, while there are still non agglomerate fine cells, repeat the following steps: More...
 
virtual std::unordered_set< CoMMAIndexType > choose_optimal_cc_and_update_seeds_pool (const CoMMAIndexType seed, const std::vector< CoMMAWeightType > &priority_weights, CoMMAIntType &compactness)=0
 Pure virtual function that must be implemented in child classes to define the optimal coarse cell. More...
 
- Public Member Functions inherited from comma::Agglomerator< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >
 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...
 

Public Attributes

CoMMAIntType _fc_iter
 Number of iterations allowed for the algorithm choosing which fine cell to add next. More...
 
std::shared_ptr< NeighbourhoodCreatorBaseType_neigh_crtor
 Creator responsible for neighborhood objects. More...
 
std::shared_ptr< ARComputer< CoMMAIndexType, CoMMAWeightType, CoMMAIntType > > _ar_computer
 Object computing the aspect-ratio of a coarse cell. More...
 

Additional Inherited Members

- Protected Attributes inherited from comma::Agglomerator< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >
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...
 

Detailed Description

template<typename CoMMAIndexType, typename CoMMAWeightType, typename CoMMAIntType>
class comma::Agglomerator_Isotropic< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >

Agglomerator_Isotropic class is a child class of the Agglomerator class that specializes the implementation to the case of Isotropic agglomeration.

Template Parameters
CoMMAIndexTypethe CoMMA index type for the global index of the mesh
CoMMAWeightTypethe CoMMA weight type for the weights (volume or area) of the nodes or edges of the Mesh
CoMMAIntTypethe CoMMA type for integers

Member Typedef Documentation

◆ NeighbourhoodCreatorBaseType

template<typename CoMMAIndexType , typename CoMMAWeightType , typename CoMMAIntType >
using comma::Agglomerator_Isotropic< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::NeighbourhoodCreatorBaseType = NeighbourhoodCreator<CoMMAIndexType, CoMMAWeightType, CoMMAIntType>

NeighbourhoodCreator type (base class)

◆ NeighbourhoodCreatorExtType

template<typename CoMMAIndexType , typename CoMMAWeightType , typename CoMMAIntType >
using comma::Agglomerator_Isotropic< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::NeighbourhoodCreatorExtType = NeighbourhoodExtendedCreator<CoMMAIndexType, CoMMAWeightType, CoMMAIntType>

NeighbourhoodExtendedCreator type (derived class)

◆ NeighbourhoodCreatorPFType

template<typename CoMMAIndexType , typename CoMMAWeightType , typename CoMMAIntType >
using comma::Agglomerator_Isotropic< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::NeighbourhoodCreatorPFType = NeighbourhoodPureFrontCreator< CoMMAIndexType, CoMMAWeightType, CoMMAIntType>

NeighbourhoodPureFrontCreator type (derived class)

Constructor & Destructor Documentation

◆ Agglomerator_Isotropic()

template<typename CoMMAIndexType , typename CoMMAWeightType , typename CoMMAIntType >
comma::Agglomerator_Isotropic< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::Agglomerator_Isotropic ( 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,
CoMMAAspectRatioT  aspect_ratio,
CoMMANeighbourhoodT  neighbourhood_type,
CoMMAIntType  fc_iter 
)
inline

Constructor. The constructor takes as arguments the same arguments of the father and in this way activates also the constructor of the base class.

Parameters
[in]graphDual_Graph object that determines the connectivity of the matrix
[in]cc_graphContainer for the coarse cells
[in]seeds_poolSeeds_Pool object giving the order in which the fine cells should be considered when agglomerating
[in]dimensionDimension of the problem
[in]aspect_ratioType of aspect-ratio (see CoMMAAspectRatioT)
[in]neighbourhood_typeType of neighbourhood to use when growing a coarse cell. See CoMMANeighbourhoodT for more details.
[in]fc_iterNumber of iterations allowed for the algorithm choosing which fine cell to add next. The cost grows exponentially, hence use small values.

◆ ~Agglomerator_Isotropic()

template<typename CoMMAIndexType , typename CoMMAWeightType , typename CoMMAIntType >
comma::Agglomerator_Isotropic< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::~Agglomerator_Isotropic ( )
overridedefault

Destructor.

Member Function Documentation

◆ agglomerate_one_level()

template<typename CoMMAIndexType , typename CoMMAWeightType , typename CoMMAIntType >
void comma::Agglomerator_Isotropic< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::agglomerate_one_level ( const CoMMAIntType  goal_card,
const CoMMAIntType  min_card,
const CoMMAIntType  max_card,
const std::vector< CoMMAWeightType > &  priority_weights,
bool  correction_steps 
)
inlineoverridevirtual

Specialization of the pure virtual function to the class Agglomerator_Isotropic. 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
The function calls function choose_optimal_cc_and_update_seeds_pool of the derived class. For further information about the structure, have a look at: http://www.cplusplus.com/forum/general/31851/
The pseudo-code considers the while function and the agglomeration process is not completed until all the cells are not agglomerated. Hence, while there are still non agglomerate fine cells, repeat the following steps:

  1. Choose a new seed
  2. Check with a specific algorithm the neighbouring cells to agglomerate to the seed
  3. Create a new coarse cell (using the apposite method in cc_graph)
    Parameters
    [in]goal_cardgoal cardinality of the coarse cell
    [in]min_cardminimum cardinality of the coarse cell
    [in]max_cardmaximum cardinality of the coarse cell
    [in]priority_weightsWeights used to set the order telling where to start agglomerating. The higher the weight, the higher the priority
    [in]correction_stepsit defines if corrections for the isotropic algorithm are activated or not, for anisotropic algorithm not taken into account.

Implements comma::Agglomerator< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >.

◆ choose_optimal_cc_and_update_seeds_pool()

template<typename CoMMAIndexType , typename CoMMAWeightType , typename CoMMAIntType >
virtual std::unordered_set< CoMMAIndexType > comma::Agglomerator_Isotropic< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::choose_optimal_cc_and_update_seeds_pool ( const CoMMAIndexType  seed,
const std::vector< CoMMAWeightType > &  priority_weights,
CoMMAIntType &  compactness 
)
pure virtual

Pure virtual function that must be implemented in child classes to define the optimal coarse cell.

Parameters
[in]seedCell from which the agglomeration of the CC starts
[in]priority_weightsWeights used to set the order telling where to start agglomerating. The higher the weight, the higher the priority
[out]compactnessCompactness of the final CC, that is, the minimum number of neighbours of a fine cell inside a coarse cell
Returns
the (unordered) set of the fine cells composing the coarse cell

Implemented in comma::Agglomerator_Biconnected< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >.

◆ set_agglomeration_parameter()

template<typename CoMMAIndexType , typename CoMMAWeightType , typename CoMMAIntType >
void comma::Agglomerator_Isotropic< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::set_agglomeration_parameter ( CoMMAIntType  goal_card = 0,
CoMMAIntType  min_card = 0,
CoMMAIntType  max_card = 0 
)
inline

The task of the function is to set the parameters of determine the cardinality limits with respect to the parameters passed.

Parameters
[in]goal_cardgoal cardinality of the coarse cell (set as default to 0 indicating in our case the maximum value)
[in]min_cardminimum cardinality of the coarse cell(set as default to 0 indicating in our case the maximum value)
[in]max_cardmaximum cardinality of the coarse cell(set as default to 0 indicating in our case the maximum value)

Member Data Documentation

◆ _ar_computer

template<typename CoMMAIndexType , typename CoMMAWeightType , typename CoMMAIntType >
std::shared_ptr<ARComputer<CoMMAIndexType, CoMMAWeightType, CoMMAIntType> > comma::Agglomerator_Isotropic< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::_ar_computer

Object computing the aspect-ratio of a coarse cell.

◆ _fc_iter

template<typename CoMMAIndexType , typename CoMMAWeightType , typename CoMMAIntType >
CoMMAIntType comma::Agglomerator_Isotropic< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::_fc_iter

Number of iterations allowed for the algorithm choosing which fine cell to add next.

◆ _neigh_crtor

template<typename CoMMAIndexType , typename CoMMAWeightType , typename CoMMAIntType >
std::shared_ptr<NeighbourhoodCreatorBaseType> comma::Agglomerator_Isotropic< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::_neigh_crtor

Creator responsible for neighborhood objects.


The documentation for this class was generated from the following file: