Gyselalib++
 
Loading...
Searching...
No Matches
MatchingIdxSlice< Interface > Class Template Reference

Store the conforming indexes of each patch of a given interface. More...

Public Member Functions

 MatchingIdxSlice (IdxRange1D_1 const &idx_range_1, IdxRange1D_2 const &idx_range_2)
 Instantiate the class from 1D index ranges.
 
 MatchingIdxSlice (IdxRange2D_1 const &idx_range_1, IdxRange2D_2 const &idx_range_2)
 Instantiate the class from 2D index ranges.
 
template<class ParallelGrid , std::enable_if_t<(std::is_same_v< ParallelGrid, EdgeGrid1 >)||(std::is_same_v< ParallelGrid, EdgeGrid2 >), bool > = true>
IdxRangeSlice< ParallelGrid > get () const
 Get the IdxRangeSlice containing the conforming indexes.
 
template<class PerpendicularGrid , std::enable_if_t<(std::is_same_v< PerpendicularGrid, PerpEdgeGrid1 >)||(std::is_same_v< PerpendicularGrid, PerpEdgeGrid2 >), bool > = true>
auto get_from_perp () const
 Get the IdxRangeSlice containing the conforming indexes.
 

Detailed Description

template<class Interface>
class MatchingIdxSlice< Interface >

Store the conforming indexes of each patch of a given interface.

The conforming indexes are the indexes with an equivalent index on the parallel grid of the other edge of a given interface. The conforming indexes are stored in an IdxRangeSlice. The index step between two indexes in the IdxRangeSlice are supposed to be uniform. If they are not, the instantiation of the class fails.

If the grids are uniform, the index steps between the conforming indexes are uniform. The uniform index steps can be deduced from the greatest common divisor.

E.g. for a first grid of N cells and a second grid of M cells, gcd = gcd(M, N) idx_step on the first grid: N / gcd idx_step on the second grid: M / gcd

Template Parameters
InterfaceInterface type between two edges of patches (Interface with OutsideEdge not allowed).

Constructor & Destructor Documentation

◆ MatchingIdxSlice() [1/2]

template<class Interface >
MatchingIdxSlice< Interface >::MatchingIdxSlice ( IdxRange1D_1 const &  idx_range_1,
IdxRange1D_2 const &  idx_range_2 
)
inline

Instantiate the class from 1D index ranges.

To define the IdxRangeSlices containing the conforming indexes, we first check that the index steps between two conforming indexes are uniform, for the 1D grid of each edge of the interface.

If true, the index step of the patch is applied to instantiate the associated IdxRangeSlice.

If the grids are uniform, it is true and we can use the greatest common divisor between the two number of cells to compute the index steps of each IdxRangeSlice.

Parameters
idx_range_11D IdxRange of the first Edge of the Interface.
idx_range_21D IdxRange of the second Edge of the Interface.

◆ MatchingIdxSlice() [2/2]

template<class Interface >
MatchingIdxSlice< Interface >::MatchingIdxSlice ( IdxRange2D_1 const &  idx_range_1,
IdxRange2D_2 const &  idx_range_2 
)
inline

Instantiate the class from 2D index ranges.

To define the IdxRangeSlices containing the conforming indexes, we first check that the index steps between two conforming indexes are uniform, for the 1D grid of each edge of the interface.

If true, the index step of the patch is applied to instantiate the associated IdxRangeSlice.

If the grids are uniform, it is true and we can use the greatest common divisor between the two number of cells to compute the index steps of each IdxRangeSlice.

Parameters
idx_range_12D IdxRange of the first Edge of the Interface.
idx_range_22D IdxRange of the second Edge of the Interface.

Member Function Documentation

◆ get()

template<class Interface >
template<class ParallelGrid , std::enable_if_t<(std::is_same_v< ParallelGrid, EdgeGrid1 >)||(std::is_same_v< ParallelGrid, EdgeGrid2 >), bool > = true>
IdxRangeSlice< ParallelGrid > MatchingIdxSlice< Interface >::get ( ) const
inline

Get the IdxRangeSlice containing the conforming indexes.

Template Parameters
ParallelGridThe parallel grid to the edge.
Returns
IdxRangeSlice of conforming indexes on the given ParallelGrid.

◆ get_from_perp()

template<class Interface >
template<class PerpendicularGrid , std::enable_if_t<(std::is_same_v< PerpendicularGrid, PerpEdgeGrid1 >)||(std::is_same_v< PerpendicularGrid, PerpEdgeGrid2 >), bool > = true>
auto MatchingIdxSlice< Interface >::get_from_perp ( ) const
inline

Get the IdxRangeSlice containing the conforming indexes.

Template Parameters
PerpendicularGridThe perpendicular grid to the edge.
Returns
IdxRangeSlice of conforming indexes on the perpendicular grid to the given PerpendicularGrid.

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