8#ifndef SRC_GRID_ITERATORS_GRID_DIST_ID_ITERATOR_DEC_SKIN_HPP_
9#define SRC_GRID_ITERATORS_GRID_DIST_ID_ITERATOR_DEC_SKIN_HPP_
12#include "grid_dist_id_iterator.hpp"
13#include "Grid/grid_dist_util.hpp"
14#include "grid_dist_id_iterator_util.hpp"
23template<
typename Decomposition>
62 typename Decomposition::stype
spacing[Decomposition::dims];
88 for (
size_t i = 0 ; i < 2*Decomposition::dims; i++)
98 if (compute_subset<Decomposition,false>(
gdb_ext,gc,start,stop,start_c,stop_c) ==
true)
102 size_t sz[Decomposition::dims];
103 for (
size_t j = 0 ; j < Decomposition::dims ; j++)
104 {sz[j] =
gdb_ext.get(gc).GDbox.getHigh(j) + 1;}
154 const size_t (& bc)[Decomposition::dims])
158 create_gdb_ext<Decomposition::dims,Decomposition>(
gdb_ext,dec,g_sm.
getSize(),dec.getDomain(),
spacing);
161 if (A.isContained(B) ==
false)
162 std::cout << __FILE__ <<
":" << __LINE__ <<
", Error Box A must be contained into box B" << std::endl;
239 size_t sub_id = k.getSub();
244 k_glob = k_glob +
gdb_ext.get(sub_id).origin;
273 for (
size_t i = 0 ; i < Decomposition::dims ; i++)
295 for (
size_t i = 0 ; i < Decomposition::dims ; i++)
This class represent an N-dimensional box.
This class define the domain decomposition interface.
Given the decomposition it create an iterator.
void construct_sub_it()
construct sub-iterators
bool isNext()
Check if there is the next element.
grid_dist_id_iterator_dec_skin(Decomposition &dec, const grid_sm< Decomposition::dims, void > &g_sm, const Box< Decomposition::dims, size_t > &A, const Box< Decomposition::dims, size_t > &B, const size_t(&bc)[Decomposition::dims])
Constructor of the distributed grid iterator.
openfpm::vector< GBoxes< Decomposition::dims > > gdb_ext
Extension of each grid: domain and ghost + domain.
grid_key_dx< Decomposition::dims > get()
Get the actual global key of the grid.
openfpm::vector< gp_sub > a_its
Actual sub-iterators.
grid_dist_id_iterator_dec_skin(grid_dist_id_iterator_dec_skin< Decomposition > &&tmp)
Copy constructor.
grid_dist_id_iterator_dec_skin< Decomposition > & operator=(grid_dist_id_iterator_dec_skin< Decomposition > &&tmp)
Copy operator=.
Decomposition::stype spacing[Decomposition::dims]
Spacing.
size_t g_c
grid list counter
grid_key_dx_iterator_sub< Decomposition::dims > a_it
Internal grid sub-iterator.
grid_dist_id_iterator_dec_skin< Decomposition > & operator=(const grid_dist_id_iterator_dec_skin< Decomposition > &tmp)
Copy operator=.
grid_dist_key_dx< Decomposition::dims > get_int()
Get the actual key.
void selectValidGrid()
from g_c increment g_c until you find a valid grid
size_t a_its_p
a_its element in this moment selected
grid_dist_id_iterator_dec_skin(const grid_dist_id_iterator_dec_skin< Decomposition > &tmp)
Copy constructor.
grid_dist_id_iterator_dec_skin< Decomposition > & operator++()
Get the next element.
~grid_dist_id_iterator_dec_skin()
Destructor.
Decomposition::stype getSpacing(size_t i)
Get the spacing of the grid.
Grid key for a distributed grid.
Declaration grid_key_dx_iterator_sub.
grid_key_dx< dim > get() const
Return the actual grid key iterator.
bool isNext()
Check if there is the next element.
void reinitialize(const grid_key_dx_iterator_sub< dim > &g_s_it)
Reinitialize the iterator.
grid_key_dx is the key to access any element in the grid
grid_key_dx_iterator_sub_bc< dim > sub_it[2 *dim]
Internal iterator for each faces.
__device__ __host__ const size_t(& getSize() const)[N]
Return the size of the grid as an array.
Implementation of 1-D std::vector like structure.
size_t gc
from which grid this iterator come from
grid_key_dx_iterator_sub< Decomposition::dims > it
Iterator.
gp_sub(size_t gc, grid_key_dx_iterator_sub< Decomposition::dims > &&it)
constructor