OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
SubHyperCube< dim, subdim > Class Template Reference

This represent a sub-hyper-cube of an hyper-cube like a face or an edge of a cube. More...

Detailed Description

template<unsigned int dim, unsigned int subdim>
class SubHyperCube< dim, subdim >

This represent a sub-hyper-cube of an hyper-cube like a face or an edge of a cube.

It give a set of utility function to work with sub-hyper-cubes like the hyper-cube

Template Parameters
dimensionalityof the hyper-cube
dimensionalityof the sub-hyper-cube

First we get the surfaces of an hyper-cube

std::vector<comb<3>> sc3_2 = HyperCube<3>::getCombinations_R(2);
static std::vector< comb< dim > > getCombinations_R(size_t d)

Getting the vertices of one particular surface of the cube

std::vector<comb<3>> combs = SubHyperCube<3,2>::getCombinations_R(sc3_2[i],0);
static std::vector< comb< dim > > getCombinations_R(comb< dim > c, int d)

Getting the edges of one particular surface of the cube

Definition at line 498 of file HyperCube.hpp.

#include <HyperCube.hpp>

+ Inheritance diagram for SubHyperCube< dim, subdim >:

Static Public Member Functions

static std::vector< comb< dim > > getCombinations_R (comb< dim > c, int d)
 
- Static Public Member Functions inherited from HyperCube< subdim >
static size_t getNumberOfElements_R (size_t d)
 Get the number of Elements of dimension d.
 
static size_t getNumberOfElementsTo_R (size_t d_t)
 Get the sum of the number of elements from d to d_t (included)
 
static std::vector< comb< dim > > getCombinations_R (size_t d)
 
static std::vector< comb< dim > > getCombinations_R_bc (size_t d, const size_t(&bc)[dim])
 
static void BinPermutations (grid_key_dx_r &pos, std::vector< comb< dim > > &v)
 Binary permutations.
 
static void BinPermutationsSt (std::vector< comb< dim > > &v)
 Binary permutations.
 
static size_t LinPerm (comb< dim > &c)
 Linearize the permutation given by BinPermutationSt.
 
static size_t LinId (comb< dim > &c)
 Linearize the combination.
 
static bool isPositive (size_t d)
 isPositive return if the combination d is a positive or a negative
 
static int positiveFace (int d)
 return the combination of the positive face on direction d
 
static int negativeFace (int d)
 Return the combination of the negative face on direction d.
 

Member Function Documentation

◆ getCombinations_R()

template<unsigned int dim, unsigned int subdim>
static std::vector< comb< dim > > SubHyperCube< dim, subdim >::getCombinations_R ( comb< dim >  c,
int  d 
)
inlinestatic

brief Calculate the position (combinations) of all the elements of size d in the sub-hyper-cube

Parameters
cidentify the position of the sub-hyper-cube in the hypercube
ddimensionality of the objects
Returns
all the combinations

Definition at line 509 of file HyperCube.hpp.


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