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

Class representing the neighbourhood of a given cell in the graph. In this derived class the neighbourhood is extended, meaning that all the neighbours seen so far are candidates. More...

#include <Neighbourhood.h>

Inheritance diagram for comma::Neighbourhood_Extended< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >:
comma::Neighbourhood< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >

Public Types

using NeighbourhoodBaseType = Neighbourhood< 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...
 
using CoMMAPairFindFirstBasedType = PairFindFirstBasedFunctor< CoMMAPairType >
 Functor used if find-like function relying only on first element of the pair. More...
 
using ContainerIndexType = std::vector< CoMMAIndexType >
 Type for containers of indices. More...
 
using ContainerIndexConstIt = typename ContainerIndexType::const_iterator
 Type for constant iterators of containers of indices. More...
 
- Public Types inherited from comma::Neighbourhood< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >
using CoMMAPairType = std::pair< CoMMAIndexType, CoMMAWeightType >
 Type of pair. More...
 
using CoMMASetOfPairType = std::set< CoMMAPairType, CustomPairGreaterFunctor< CoMMAPairType > >
 Type of set of pairs. More...
 
using CoMMAPairFindFirstBasedType = PairFindFirstBasedFunctor< CoMMAPairType >
 Functor used if find-like function relying only on first element of the pair. More...
 
using CandidatesContainerType = std::deque< CoMMAIndexType >
 Type for container of candidates. More...
 
using ContainerIndexType = std::vector< CoMMAIndexType >
 Type for containers of indices. More...
 
using ContainerIndexConstIt = typename ContainerIndexType::const_iterator
 Type for constant iterators of containers of indices. More...
 

Public Member Functions

 Neighbourhood_Extended (const std::unordered_set< CoMMAIndexType > &s_neighbours_of_seed, const std::vector< CoMMAWeightType > &weights)
 Constructor. More...
 
 Neighbourhood_Extended (const Neighbourhood_Extended< CoMMAIndexType, CoMMAWeightType, CoMMAIntType > &other)=default
 Copy constructor. More...
 
 ~Neighbourhood_Extended () override=default
 Destructor. More...
 
void update_it (const CoMMAIndexType new_fc, ContainerIndexConstIt neighs_begin, ContainerIndexConstIt neighs_end) override
 Method that updates the neighbourhood. Given the new_fc, if is in the neighbours, it is deleted. Then, the new neighbours are added as candidates. More...
 
- Public Member Functions inherited from comma::Neighbourhood< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >
 Neighbourhood (const std::unordered_set< CoMMAIndexType > &s_neighbours_of_seed, const std::vector< CoMMAWeightType > &weights)
 Constructor. More...
 
 Neighbourhood (const Neighbourhood< CoMMAIndexType, CoMMAWeightType, CoMMAIntType > &other)=default
 Copy constructor. More...
 
virtual ~Neighbourhood ()=default
 Destructor. More...
 
void update (const CoMMAIndexType new_fc, const ContainerIndexType &new_neighbours)
 Method that updates the neighbourhood. Given the new_fc, if is in the neighbours, it is deleted. Then, the new neighbours are added as candidates. More...
 
virtual void update_it (const CoMMAIndexType new_fc, ContainerIndexConstIt neighs_begin, ContainerIndexConstIt neighs_end)=0
 Method that updates the neighbourhood. Given the new_fc, if is in the neighbours, it is deleted. Then, the new neighbours are added as candidates. More...
 
const CandidatesContainerTypeget_candidates () const
 Get candidates that should be consider in the next step of the agglomeration. More...
 

Additional Inherited Members

- Protected Member Functions inherited from comma::Neighbourhood< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >
void extract_and_update_candidates (const CoMMASetOfPairType &candidates_w_weights)
 Extract the indices from a list of index-weight pairs and add them at the back of the candidates list. More...
 
- Protected Attributes inherited from comma::Neighbourhood< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >
const std::unordered_set< CoMMAIndexType > _s_neighbours_of_seed
 Set of the neighbours of seed given as an input in the constructor. Here, we can find all the neighbours of order up to a user-defined value of the initial seed. Hence, it holds the cells allowed to be agglomerated. More...
 
const std::vector< CoMMAWeightType > & _weights
 Priority weights. More...
 
std::unordered_set< CoMMAIndexType > _s_fc
 Set of the fine cells composing the coarse cell. More...
 
CandidatesContainerType _candidates
 Candidates that should be considered when choosing the next fine cell to add to the coarse one. More...
 

Detailed Description

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

Class representing the neighbourhood of a given cell in the graph. In this derived class the neighbourhood is extended, meaning that all the neighbours seen so far are candidates.

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

◆ CoMMAPairFindFirstBasedType

template<typename CoMMAIndexType , typename CoMMAWeightType , typename CoMMAIntType >
using comma::Neighbourhood< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::CoMMAPairFindFirstBasedType = PairFindFirstBasedFunctor<CoMMAPairType>

Functor used if find-like function relying only on first element of the pair.

◆ CoMMAPairType

template<typename CoMMAIndexType , typename CoMMAWeightType , typename CoMMAIntType >
using comma::Neighbourhood< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::CoMMAPairType = std::pair<CoMMAIndexType, CoMMAWeightType>

Type of pair.

◆ CoMMASetOfPairType

template<typename CoMMAIndexType , typename CoMMAWeightType , typename CoMMAIntType >
using comma::Neighbourhood< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::CoMMASetOfPairType = std::set<CoMMAPairType, CustomPairGreaterFunctor<CoMMAPairType> >

Type of set of pairs.

◆ ContainerIndexConstIt

template<typename CoMMAIndexType , typename CoMMAWeightType , typename CoMMAIntType >
using comma::Neighbourhood< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::ContainerIndexConstIt = typename ContainerIndexType::const_iterator

Type for constant iterators of containers of indices.

◆ ContainerIndexType

template<typename CoMMAIndexType , typename CoMMAWeightType , typename CoMMAIntType >
using comma::Neighbourhood< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::ContainerIndexType = std::vector<CoMMAIndexType>

Type for containers of indices.

◆ NeighbourhoodBaseType

template<typename CoMMAIndexType , typename CoMMAWeightType , typename CoMMAIntType >
using comma::Neighbourhood_Extended< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::NeighbourhoodBaseType = Neighbourhood<CoMMAIndexType, CoMMAWeightType, CoMMAIntType>

Base class.

Constructor & Destructor Documentation

◆ Neighbourhood_Extended() [1/2]

template<typename CoMMAIndexType , typename CoMMAWeightType , typename CoMMAIntType >
comma::Neighbourhood_Extended< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::Neighbourhood_Extended ( const std::unordered_set< CoMMAIndexType > &  s_neighbours_of_seed,
const std::vector< CoMMAWeightType > &  weights 
)
inline

Constructor.

Parameters
[in]s_neighbours_of_seedSet of the neighbours of the given cell chosen as seed
[in]weightsWeights used to set up the order of the neighbours to visit

◆ Neighbourhood_Extended() [2/2]

template<typename CoMMAIndexType , typename CoMMAWeightType , typename CoMMAIntType >
comma::Neighbourhood_Extended< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::Neighbourhood_Extended ( const Neighbourhood_Extended< CoMMAIndexType, CoMMAWeightType, CoMMAIntType > &  other)
default

Copy constructor.

◆ ~Neighbourhood_Extended()

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

Destructor.

Member Function Documentation

◆ update_it()

template<typename CoMMAIndexType , typename CoMMAWeightType , typename CoMMAIntType >
void comma::Neighbourhood_Extended< CoMMAIndexType, CoMMAWeightType, CoMMAIntType >::update_it ( const CoMMAIndexType  new_fc,
ContainerIndexConstIt  neighs_begin,
ContainerIndexConstIt  neighs_end 
)
inlineoverridevirtual

Method that updates the neighbourhood. Given the new_fc, if is in the neighbours, it is deleted. Then, the new neighbours are added as candidates.

Parameters
[in]new_fcIndex of the new fine cell to be added to the set of fine cells
[in]neighs_beginConstant iterator giving the beginning of the neighbours
[in]neighs_endConstant iterator giving the end of the neighbours

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


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