CoMMA 1.3.2
A geometric agglomerator for unstructured meshes
Loading...
Searching...
No Matches
comma::CellFeatures< IndexT, RealT, IntT > Class Template Reference

Convenient class containing salient features of a cell. According to to the chosen AR computation (see ARComputer), some features may be outdated. More...

#include <ARComputer.h>

Public Member Functions

 CellFeatures (const RealT measure=std::numeric_limits< RealT >::min(), const RealT external_weights=0.0, const RealT internal_weights=0.0, const IntT n_internal_faces=0, const RealT min_edge=std::numeric_limits< RealT >::max(), const RealT diam=std::numeric_limits< RealT >::min(), const std::vector< RealT > sum_centers=std::vector< RealT >{}, const std::unordered_map< IndexT, IntT > external_facets=std::unordered_map< IndexT, IntT >{})
 Constructor. More...
 
 CellFeatures (const IndexT index, std::shared_ptr< Dual_Graph< IndexT, RealT, IntT > > graph)
 Constructor. More...
 
 CellFeatures (const CellFeatures< IndexT, RealT, IntT > &other)=default
 Copy constructor. More...
 
 CellFeatures (CellFeatures< IndexT, RealT, IntT > &&other) noexcept=default
 Move constructor. More...
 
CellFeaturesoperator= (CellFeatures< IndexT, RealT, IntT > &&other) noexcept=default
 Move assignment. More...
 
CellFeaturesoperator= (const CellFeatures< IndexT, RealT, IntT > &other)=default
 Copy assignment. More...
 
template<unsigned int dim>
RealT constexpr get_radius () const
 Compute the radius of a cell. More...
 

Public Attributes

RealT _measure
 
RealT _external_weights
 
RealT _internal_weights
 
IntT _n_internal_faces
 
RealT _sq_min_edge
 
RealT _sq_diam
 
std::vector< RealT > _sum_centers
 
std::unordered_map< IndexT, IntT > _external_facets
 

Detailed Description

template<typename IndexT, typename RealT, typename IntT>
class comma::CellFeatures< IndexT, RealT, IntT >

Convenient class containing salient features of a cell. According to to the chosen AR computation (see ARComputer), some features may be outdated.

Template Parameters
IndexTtype used for indices
RealTtype used for features
IntTtype used for integers (e.g., number of cells, faces,...)

Constructor & Destructor Documentation

◆ CellFeatures() [1/4]

template<typename IndexT , typename RealT , typename IntT >
comma::CellFeatures< IndexT, RealT, IntT >::CellFeatures ( const RealT  measure = std::numeric_limits<RealT>::min(),
const RealT  external_weights = 0.0,
const RealT  internal_weights = 0.0,
const IntT  n_internal_faces = 0,
const RealT  min_edge = std::numeric_limits<RealT>::max(),
const RealT  diam = std::numeric_limits<RealT>::min(),
const std::vector< RealT >  sum_centers = std::vector<RealT>{},
const std::unordered_map< IndexT, IntT >  external_facets = std::unordered_map<IndexT, IntT>{} 
)
inlineexplicit

Constructor.

Parameters
[in]measureMeasure of the cell
[in]external_weightsExternal weights, i.e., the area of external faces
[in]internal_weightsInternal weights, i.e., the area of internal faces
[in]n_internal_facesNumber of internal faces
[in]min_edge(Approximation of) The minimum edge of the cell
[in]diam(Approximation of) The diameter of the cell
[in]sum_centersSum of the coordinates of the centers weighted by the mesures, useful to compute barycenter
[in]external_facetsNumber of external facets (not shared with other cells) by cell
Note
All the arguments are optional and defaults are available.

◆ CellFeatures() [2/4]

template<typename IndexT , typename RealT , typename IntT >
comma::CellFeatures< IndexT, RealT, IntT >::CellFeatures ( const IndexT  index,
std::shared_ptr< Dual_Graph< IndexT, RealT, IntT > >  graph 
)
inline

Constructor.

◆ CellFeatures() [3/4]

template<typename IndexT , typename RealT , typename IntT >
comma::CellFeatures< IndexT, RealT, IntT >::CellFeatures ( const CellFeatures< IndexT, RealT, IntT > &  other)
default

Copy constructor.

Parameters
[in]otherFeatures to move

◆ CellFeatures() [4/4]

template<typename IndexT , typename RealT , typename IntT >
comma::CellFeatures< IndexT, RealT, IntT >::CellFeatures ( CellFeatures< IndexT, RealT, IntT > &&  other)
defaultnoexcept

Move constructor.

Parameters
[in]otherFeatures to move

Member Function Documentation

◆ get_radius()

template<typename IndexT , typename RealT , typename IntT >
template<unsigned int dim>
RealT constexpr comma::CellFeatures< IndexT, RealT, IntT >::get_radius ( ) const
inlineconstexpr

Compute the radius of a cell.

Template Parameters
dimdimension of the problem (e.g., 1-, 2-, 3D,...)

◆ operator=() [1/2]

template<typename IndexT , typename RealT , typename IntT >
CellFeatures & comma::CellFeatures< IndexT, RealT, IntT >::operator= ( CellFeatures< IndexT, RealT, IntT > &&  other)
defaultnoexcept

Move assignment.

Parameters
[in]otherFeatures to move

◆ operator=() [2/2]

template<typename IndexT , typename RealT , typename IntT >
CellFeatures & comma::CellFeatures< IndexT, RealT, IntT >::operator= ( const CellFeatures< IndexT, RealT, IntT > &  other)
default

Copy assignment.

Parameters
[in]otherFeatures to copy

Member Data Documentation

◆ _external_facets

template<typename IndexT , typename RealT , typename IntT >
std::unordered_map<IndexT, IntT> comma::CellFeatures< IndexT, RealT, IntT >::_external_facets

Number of external facets (not shared with other cells) by cell

◆ _external_weights

template<typename IndexT , typename RealT , typename IntT >
RealT comma::CellFeatures< IndexT, RealT, IntT >::_external_weights

Sum of all external weights (i.e., the area of external faces)

◆ _internal_weights

template<typename IndexT , typename RealT , typename IntT >
RealT comma::CellFeatures< IndexT, RealT, IntT >::_internal_weights

Sum of all internal weights (i.e., the area of internal faces)

◆ _measure

template<typename IndexT , typename RealT , typename IntT >
RealT comma::CellFeatures< IndexT, RealT, IntT >::_measure

Measure of the cell: area in 2D or volume in 3D

◆ _n_internal_faces

template<typename IndexT , typename RealT , typename IntT >
IntT comma::CellFeatures< IndexT, RealT, IntT >::_n_internal_faces

Number of internal faces

◆ _sq_diam

template<typename IndexT , typename RealT , typename IntT >
RealT comma::CellFeatures< IndexT, RealT, IntT >::_sq_diam

Square of the approximation of the diameter of the cell, that is, the maximum distance between two cell centers.

◆ _sq_min_edge

template<typename IndexT , typename RealT , typename IntT >
RealT comma::CellFeatures< IndexT, RealT, IntT >::_sq_min_edge

Square of the approximation of the minimum edge of the cell, that is, the minimum distance between two cell centers.

◆ _sum_centers

template<typename IndexT , typename RealT , typename IntT >
std::vector<RealT> comma::CellFeatures< IndexT, RealT, IntT >::_sum_centers

Sum of the coordinates of the centers weighted by the measures, useful to compute barycenter


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