2#define BOOST_TEST_DYN_LINK
3#include <boost/test/unit_test.hpp>
4#include "Space/Shape/Box.hpp"
5#include "Decomposition/Domain_icells_cart.hpp"
6#include "VCluster/VCluster.hpp"
7#include "VTKWriter/VTKWriter.hpp"
8#include "Grid/iterators/grid_skin_iterator.hpp"
10BOOST_AUTO_TEST_SUITE( domain_icells_cart )
12BOOST_AUTO_TEST_CASE( domain_icells_use )
23 domain_proc.add(box1);
24 domain_proc.add(box2);
66 auto & v_cl = create_vcluster<CudaMemory>();
75 ic.template deviceToHost<0>();
76 dc.template deviceToHost<0>();
85 size_t bc[3] = {NON_PERIODIC,NON_PERIODIC,NON_PERIODIC};
89 while (it_skin.isNext())
91 auto p = it_skin.get();
93 if (p.get(0) == 6 && p.get(1) == 5 && p.get(2) == 5)
96 {icheck.add(gr.
LinId(p));}
104 while (it_sub.isNext())
106 auto p = it_sub.get();
108 icheck.add(gr.
LinId(p));
118 while (it_sub2.isNext())
120 auto p = it_sub2.get();
122 dcheck.add(gr.
LinId(p));
128 dcheck.add(gr.
LinId(kk));
133 for (
size_t i = 0 ; i < icheck.
size() ; i++)
134 {BOOST_REQUIRE_EQUAL(icheck.template get<0>(i),ic.template get<0>(i));}
136 for (
size_t i = 0 ; i < dcheck.
size() ; i++)
137 {BOOST_REQUIRE_EQUAL(dcheck.template get<0>(i),dc.template get<0>(i));}
143BOOST_AUTO_TEST_SUITE_END()
This class represent an N-dimensional box.
openfpm::vector< aggregate< ids_type >, Memory, layout_base > & getIcells()
Return the list of the internal cells.
void CalculateInternalCells(VCluster_type &v_cl, openfpm::vector< Box< dim, T >, Memory, layout_base > &ig_box, openfpm::vector< SpaceBox< dim, T >, Memory, layout_base > &domain, Box< dim, T > &pbox, T r_cut, const Ghost< dim, T > &enlarge)
Calculate the subdomain that are in the skin part of the domain.
openfpm::vector< aggregate< ids_type >, Memory, layout_base > & getDcells()
Return the list of the internal cells.
const grid_sm< dim, void > & getGrid()
Get the grid base information about this cell decomposition.
Declaration grid_key_dx_iterator_sub.
grid_key_dx is the key to access any element in the grid
mem_id LinId(const grid_key_dx< N, ids_type > &gk, const signed char sum_id[N]) const
Linearization of the grid_key_dx with a specified shift.
structure that store and compute the internal and external local ghost box
Implementation of 1-D std::vector like structure.