8#ifndef SRC_DECOMPOSITION_SHIFT_VECT_CONVERTER_HPP_
9#define SRC_DECOMPOSITION_SHIFT_VECT_CONVERTER_HPP_
11#include "Space/Shape/HyperCube.hpp"
19template<
unsigned int dim,
typename T,
typename Memory,
template<
typename>
class layout_base>
39 shifts.resize(openfpm::math::pow(3,dim));
43 for (
long int i = dim ; i >= 0 ; i--)
47 for (
size_t j = 0 ; j < cmbs.size() ; j++)
49 for (
size_t k = 0 ; k < dim ; k++)
54 shifts.get(cmbs[j].lin()).template get<0>()[k] = -(domain.getHigh(k) - domain.getLow(k));
57 shifts.get(cmbs[j].lin()).
template get<0>()[k] = 0;
60 shifts.get(cmbs[j].lin()).
template get<0>()[k] = (domain.getHigh(k) - domain.getLow(k));
77 for (
size_t i = 0 ; i < dim ; i++)
79 if (bc[i] == PERIODIC)
90 for (
long int i = dim-1 ; i >= 0 ; i--)
94 for (
long int i = dim-1 ; i >= 0 ; i--)
98 for (
size_t j = 0 ; j < cmbs.size() ; j++)
102 for (
size_t k = 0 ; k < dim ; k++)
107 shifts.get(lin_cmb).template get<0>()[k] = -(domain.getHigh(k) - domain.getLow(k));
110 shifts.get(lin_cmb).template get<0>()[k] = 0;
113 shifts.get(lin_cmb).template get<0>()[k] = (domain.getHigh(k) - domain.getLow(k));
145 for (
size_t i = 0 ; i < dim ; i++)
147 if (bc[i] == PERIODIC)
164 for (
long int i = 0 ; i < dim_r ; i++)
This class represent an N-dimensional box.
This class calculate elements of the hyper-cube.
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])
This class implement the point shape in an N-dimensional space.
Implementation of 1-D std::vector like structure.
in case of high dimensions shift vector converter
void generateShiftVectors_ld(const Box< dim, T > &domain, size_t(&bc)[dim], openfpm::vector< Point< dim, T >, Memory, layout_base > &shifts)
Here we generare the shift vectors for the low dimension case.
void generateShiftVectors_hd(const Box< dim, T > &domain, size_t(&bc)[dim], openfpm::vector< Point< dim, T >, Memory, layout_base > &shifts)
Here we generare the shift vectors for the high dimension case.
void generateShiftVectors(const Box< dim, T > &domain, size_t(&bc)[dim], openfpm::vector< Point< dim, T >, Memory, layout_base > &shifts)
Here we generare the shift vectors for the low dimension case.
size_t linId(const comb< dim > &cmb)
linearize the combination in case of high dimensions
size_t red_shift_v[dim]
Indicate which indexes are non_periodic.
size_t linId_hd(const comb< dim > &cmb)
linearize the combination in case of high dimension
size_t linId_ld(const comb< dim > &cmb)
linearize the combination in case of low dimensions
void Initialize(size_t(&bc)[dim])
Initialize.
Position of the element of dimension d in the hyper-cube of dimension dim.
signed char c[dim]
Array that store the combination.
size_t lin() const
Linearization.