8 #ifndef OPENFPM_DATA_SRC_GRID_ITERATORS_GRID_KEY_DX_ITERATOR_SUB_BC_HPP_
9 #define OPENFPM_DATA_SRC_GRID_ITERATORS_GRID_KEY_DX_ITERATOR_SUB_BC_HPP_
18 template<
unsigned int dim,
typename warn=pr
int_warning_on_adjustment<dim>>
28 std::vector<Box<dim,size_t>>
boxes;
37 for (
size_t i = 0 ; i < dim ; i++)
39 if (bc[i] == NON_PERIODIC && key.
get(i) != 1)
61 for (
size_t i = 0 ; i < dim ; i++)
66 typedef typename generate_array<size_t,dim, Fill_zero>::result NNzero;
67 typedef typename generate_array<size_t,dim, Fill_two>::result NNtwo;
68 typedef typename generate_array<size_t,dim, Fill_three>::result NNthree;
95 for (
size_t i = 0 ; i < dim ; i++)
101 intersect = base_b.
Intersect(b_int,b_out);
104 for (
size_t i = 0 ; i < dim ; i++)
106 if (bc[i] == PERIODIC)
114 if (intersect ==
true)
115 boxes.push_back(b_out);
121 if (
boxes.size() > 0)
144 if (act <
boxes.size())
161 return act <
boxes.size();
void reinitialize(const grid_key_dx_iterator_sub< dim, warn > &g_s_it)
Reinitialize the iterator.
bool isNext()
Check if there is the next element.
bool check_invalid(const grid_key_dx< dim > &key, const size_t(&bc)[dim])
Check if the position is valid with the actual boundary conditions.
T getLow(int i) const
get the i-coordinate of the low bound interval of the box
grid_key_dx is the key to access any element in the grid
size_t size() const
Return the size of the grid.
grid_key_dx_iterator< dim > & operator++()
Get the next element.
T getHigh(int i) const
get the high interval of the box
void setHigh(int i, T val)
set the high interval of the box
bool isNext()
Check if there is the next element.
const grid_sm< dim, void > & getGridInfo()
Return the grid information related to this grid.
grid_key_dx_iterator_sub_bc< dim, warn > & operator++()
Get the next element.
mem_id get(size_t i) const
Get the i index.
bool Intersect(const Box< dim, T > &b, Box< dim, T > &b_out) const
Intersect.
The same as grid_key_dx_iterator_sub_p but with periodic boundary.
grid_key_dx< dim > get()
Return the actual grid key iterator.
const size_t(& getSize() const)[N]
Return the size of the grid as an array.
void setLow(int i, T val)
set the low interval of the box
This class represent an N-dimensional box.
This class is a trick to indicate the compiler a specific specialization pattern. ...
std::vector< Box< dim, size_t > > boxes
Here we have all the boxes that this iterator produce.
void reset()
Reset the iterator (it restart from the beginning)
grid_key_dx_iterator_sub_bc(const grid_sm< dim, T > &g, const grid_key_dx< dim > &start, const grid_key_dx< dim > &stop, const size_t(&bc)[dim])
Constructor.