Commit 252c073c authored by Pietro Incardona's avatar Pietro Incardona
Browse files

Add test files

parent 7de7ccaf
openfpm_vcluster @ b9c14fad
Subproject commit b3cffbf7e1dc64466fd38342d696da8b6d494acd
Subproject commit b9c14fadf0d9f5c5f53b4a9e57f29499f50652d9
......@@ -1001,9 +1001,9 @@ public:
*/
CartDecomposition<dim,T,Memory> & operator=(CartDecomposition && cart)
{
static_cast<ie_loc_ghost<dim,T>*>(this)->operator=(static_cast<ie_loc_ghost<dim,T>*>(cart));
static_cast<nn_prcs<dim,T>*>(this)->operator=(static_cast<nn_prcs<dim,T>*>(cart));
static_cast<ie_ghost<dim,T>*>(this)->operator=(static_cast<ie_ghost<dim,T>*>(cart));
static_cast<ie_loc_ghost<dim,T>*>(this)->operator=(static_cast<ie_loc_ghost<dim,T>>(cart));
static_cast<nn_prcs<dim,T>*>(this)->operator=(static_cast<nn_prcs<dim,T>>(cart));
static_cast<ie_ghost<dim,T>*>(this)->operator=(static_cast<ie_ghost<dim,T>>(cart));
sub_domains.swap(cart.sub_domains);
box_nn_processor.swap(cart.box_nn_processor);
......
......@@ -69,7 +69,7 @@ class grid_dist_id
size_t g_sz[dim];
//! Structure that divide the space into cells
CellDecomposer_sm<dim,St> cd_sm;
CellDecomposer_sm<dim,St,shift<dim,St>> cd_sm;
//! Communicator class
Vcluster & v_cl;
......@@ -440,7 +440,7 @@ class grid_dist_id
* \param ext extension of the domain
*
*/
inline void InitializeCellDecomposer(const CellDecomposer_sm<dim,St> & cd_old, const Box<dim,size_t> & ext)
inline void InitializeCellDecomposer(const CellDecomposer_sm<dim,St,shift<dim,St>> & cd_old, const Box<dim,size_t> & ext)
{
// Initialize the cell decomposer
cd_sm.setDimensions(cd_old,ext);
......@@ -566,7 +566,7 @@ public:
return ginfo_v.size(i);
}
static inline Ghost<dim,float> convert_ghost(const Ghost<dim,long int> & gd,const CellDecomposer_sm<dim,St> & cd_sm)
static inline Ghost<dim,float> convert_ghost(const Ghost<dim,long int> & gd,const CellDecomposer_sm<dim,St,shift<dim,St>> & cd_sm)
{
Ghost<dim,float> gc;
......@@ -596,7 +596,7 @@ public:
*
*/
grid_dist_id(const grid_dist_id<dim,St,T,Decomposition,Memory,device_grid> & g, Box<dim,size_t> ext)
:ghost(g.ghost),dec(g.dec),v_cl(*global_v_cluster)
:ghost(g.ghost),dec(*global_v_cluster),v_cl(*global_v_cluster)
{
#ifdef SE_CLASS2
check_new(this,8,GRID_DIST_EVENT,4);
......@@ -612,10 +612,12 @@ public:
{
g_sz[i] = g.g_sz[i] + ext.getLow(i) + ext.getHigh(i);
this->domain.setLow(i,g.domain.getLow(i) - ext.getLow(i) * g.spacing(i));
this->domain.setHigh(i,g.domain.getHigh(i) + ext.getHigh(i) * g.spacing(i));
this->domain.setLow(i,g.domain.getLow(i) - ext.getLow(i) * g.spacing(i) - g.spacing(i) / 2.0);
this->domain.setHigh(i,g.domain.getHigh(i) + ext.getHigh(i) * g.spacing(i) + g.spacing(i) / 2.0);
}
dec = g.dec.duplicate(g.ghost,this->domain);
InitializeStructures(g_sz);
}
......@@ -807,7 +809,7 @@ public:
* \return the cell decomposer
*
*/
const CellDecomposer_sm<dim,St> & getCellDecomposer()
const CellDecomposer_sm<dim,St,shift<dim,St>> & getCellDecomposer()
{
#ifdef SE_CLASS2
check_valid(this,8);
......
......@@ -20,7 +20,7 @@
* \param cd_sm CellDecomposer the size of cell is equal to the distance between grid points
*
*/
template<int dim, typename Decomposition> inline void create_gdb_ext(openfpm::vector<GBoxes<Decomposition::dims>> & gdb_ext, Decomposition & dec, CellDecomposer_sm<Decomposition::dims,typename Decomposition::stype> & cd_sm)
template<int dim, typename Decomposition> inline void create_gdb_ext(openfpm::vector<GBoxes<Decomposition::dims>> & gdb_ext, Decomposition & dec, CellDecomposer_sm<Decomposition::dims,typename Decomposition::stype,shift<dim,typename Decomposition::stype>> & cd_sm)
{
Box<Decomposition::dims, typename Decomposition::stype> g_rnd_box;
for (size_t i = 0 ; i < Decomposition::dims ; i++) {g_rnd_box.setHigh(i,0.5); g_rnd_box.setLow(i,-0.5);}
......@@ -33,9 +33,12 @@ template<int dim, typename Decomposition> inline void create_gdb_ext(openfpm::ve
{
gdb_ext.add();
// Get the local hyper-cube
// Get the local sub-domain (Grid conversion must be done with the domain P1 equivalent to 0.0)
// consider that the sub-domain with point P1 equivalent to the domain P1 is a (0,0,0) in grid unit
SpaceBox<Decomposition::dims, typename Decomposition::stype> sp = dec.getLocalHyperCube(i);
sp -= cd_sm.getOrig();
SpaceBox<Decomposition::dims, typename Decomposition::stype> sp_g = dec.getSubDomainWithGhost(i);
sp_g -= cd_sm.getOrig();
// Convert from SpaceBox<dim,St> to SpaceBox<dim,long int>
SpaceBox<Decomposition::dims,long int> sp_t = cd_sm.convertDomainSpaceIntoGridUnits(sp);
......@@ -67,7 +70,7 @@ template<int dim, typename Decomposition> inline void create_gdb_ext(openfpm::ve
{
// Create the cell decomposer
CellDecomposer_sm<Decomposition::dims,typename Decomposition::stype> cd_sm;
CellDecomposer_sm<Decomposition::dims,typename Decomposition::stype, shift<Decomposition::dims,typename Decomposition::stype>> cd_sm;
size_t sz_cell[Decomposition::dims];
for (size_t i = 0 ; i < dim ; i++)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment