8 #ifndef SRC_DECOMPOSITION_SHIFT_VECT_CONVERTER_HPP_
9 #define SRC_DECOMPOSITION_SHIFT_VECT_CONVERTER_HPP_
11 #include "Space/Shape/HyperCube.hpp"
19 template<
unsigned int dim,
typename T>
38 shifts.resize(openfpm::math::pow(3,dim));
42 for (
long int i = dim-1 ; i >= 0 ; i--)
46 for (
size_t j = 0 ; j < cmbs.size() ; j++)
48 for (
size_t k = 0 ; k < dim ; k++)
53 shifts.get(cmbs[j].lin()).template get<0>()[k] = -(domain.
getHigh(k) - domain.
getLow(k));
56 shifts.get(cmbs[j].lin()).template get<0>()[k] = 0;
59 shifts.get(cmbs[j].lin()).template get<0>()[k] = (domain.
getHigh(k) - domain.
getLow(k));
75 for (
size_t i = 0 ; i < dim ; i++)
77 if (bc[i] == PERIODIC)
88 for (
long int i = dim-1 ; i >= 0 ; i--)
92 for (
long int i = dim-1 ; i >= 0 ; i--)
96 for (
size_t j = 0 ; j < cmbs.size() ; j++)
100 for (
size_t k = 0 ; k < dim ; k++)
105 shifts.get(lin_cmb).template get<0>()[k] = -(domain.
getHigh(k) - domain.
getLow(k));
108 shifts.get(lin_cmb).template get<0>()[k] = 0;
111 shifts.get(lin_cmb).template get<0>()[k] = (domain.
getHigh(k) - domain.
getLow(k));
142 for (
size_t i = 0 ; i < dim ; i++)
144 if (bc[i] == PERIODIC)
161 for (
long int i = 0 ; i < dim_r ; i++)
size_t linId(const comb< dim > &cmb)
linearize the combination in case of high dimensions
static std::vector< comb< dim > > getCombinations_R(size_t d)
void generateShiftVectors_ld(const Box< dim, T > &domain, size_t(&bc)[dim], openfpm::vector< Point< dim, T >> &shifts)
Here we generare the shift vectors for the low dimension case.
T getLow(int i) const
get the i-coordinate of the low bound interval of the box
Position of the element of dimension d in the hyper-cube of dimension dim.
size_t linId_ld(const comb< dim > &cmb)
linearize the combination in case of low dimensions
void generateShiftVectors_hd(const Box< dim, T > &domain, size_t(&bc)[dim], openfpm::vector< Point< dim, T >> &shifts)
Here we generare the shift vectors for the high dimension case.
T getHigh(int i) const
get the high interval of the box
void Initialize(size_t(&bc)[dim])
Initialize.
This class implement the point shape in an N-dimensional space.
static std::vector< comb< dim > > getCombinations_R_bc(size_t d, const size_t(&bc)[dim])
size_t lin() const
Linearization.
void generateShiftVectors(const Box< dim, T > &domain, size_t(&bc)[dim], openfpm::vector< Point< dim, T >> &shifts)
Here we generare the shift vectors for the low dimension case.
size_t red_shift_v[dim]
Indicate which indexes are non_periodic.
This class represent an N-dimensional box.
in case of high dimensions shift vector converter
This class calculate elements of the hyper-cube.
Implementation of 1-D std::vector like structure.
size_t linId_hd(const comb< dim > &cmb)
linearize the combination in case of high dimension
char c[dim]
Array that store the combination.