Commit 1d8b906c authored by incardon's avatar incardon

Latest pdata

parent 7c95a7ff
openfpm_data @ 5dd59a1f
Subproject commit fa6e1d93eee2226ca3547c5980601a71e0b14ae3
Subproject commit 5dd59a1f3922c2a0bb470441f6d91edd10559e45
openfpm_devices @ e15dcba6
Subproject commit 18cad2e78602aa5f55f04926c327a7864d67b756
Subproject commit e15dcba6fd73f2229b4800c8b413bc256eee10bf
openfpm_io @ 0c53d1a9
Subproject commit b7238aac71a82a304a7d455a8a62fc1149168fb5
Subproject commit 0c53d1a9b2fa96341b764ed92936207d1e62ff9b
openfpm_vcluster @ d7f92684
Subproject commit 2ce2e82e1b2b9acd6616e8eb32ec745ed16c791a
Subproject commit d7f92684da97c1e52d31b8b4b0097840d9eab5a8
......@@ -903,6 +903,47 @@ p1[0]<-----+ +----> p2[0]
}
}
}
/*! \brief Check if the CartDecomposition contain the same information
*
* \param ele Element to check
*
*/
bool is_equal(CartDecomposition<dim,T,Memory,Domain> & cart)
{
static_cast<ie_loc_ghost<dim,T>*>(this)->is_equal(static_cast<ie_loc_ghost<dim,T>&>(cart));
static_cast<nn_prcs<dim,T>*>(this)->is_equal(static_cast<nn_prcs<dim,T>&>(cart));
static_cast<ie_ghost<dim,T>*>(this)->is_equal(static_cast<ie_ghost<dim,T>&>(cart));
if (sub_domains != cart.sub_domains)
return false;
if (box_nn_processor != cart.box_nn_processor)
return false;
if (fine_s != cart.fine_s)
return false;
if (gr != cart.gr)
return false;
if (cd != cart.cd)
return false;
if (domain != cart.domain)
return false;
std::copy(cart.spacing,cart.spacing+3,spacing);
if (lgeo_cell != cart.lgeo_cell)
return false;
if (ghost != cart.ghost)
return false;
return true;
}
};
......
......@@ -78,6 +78,12 @@ BOOST_AUTO_TEST_CASE( CartDecomposition_test_use)
// We duplicate the decomposition
CartDecomposition<3,float> dec2 = dec.duplicate();
dec2.check_consistency();
// We check if the two decomposition are equal
BOOST_REQUIRE_EQUAL(dec.is_equal(dec2),true);
// check that dec and dec2 contain the same information
// We duplicate the decomposition redefining the ghost
......
......@@ -567,6 +567,58 @@ public:
return true;
}
/*! \brief Check if the ie_loc_ghosts contain the same information
*
* \param ele Element to check
*
*/
bool is_equal(ie_ghost<dim,T> & ig)
{
if (getNEGhostBox() != ig.getNEGhostBox())
return false;
if (getNIGhostBox() != ig.getNIGhostBox())
return false;
for (size_t i = 0 ; i < getNIGhostBox() ; i++)
{
if (getProcessorNIGhost(i) != ig.getProcessorNIGhost(i))
return false;
for (size_t j = 0 ; j < getProcessorNIGhost(i) ; j++)
{
if (getProcessorIGhostBox(i,j) != ig.getProcessorIGhostBox(i,j))
return false;
if (getProcessorIGhostId(i,j) != ig.getProcessorIGhostId(i,j))
return false;
if (getProcessorIGhostSub(i,j) != ig.getProcessorIGhostSub(i,j))
return false;
}
if (getIGhostBox(i) != ig.getIGhostBox(i))
return false;
if (getIGhostBoxProcessor(i) != ig.getIGhostBoxProcessor(i))
return false;
}
for (size_t i = 0 ; i < getNEGhostBox() ; i++)
{
if (getProcessorNEGhost(i) != ig.getProcessorNEGhost(i))
return false;
for (size_t j = 0 ; j < getProcessorNEGhost(i) ; j++)
{
if (getProcessorEGhostBox(i,j) != ig.getProcessorEGhostBox(i,j))
return false;
if (getProcessorEGhostId(i,j) != ig.getProcessorEGhostId(i,j))
return false;
if (getProcessorEGhostSub(i,j) != ig.getProcessorEGhostSub(i,j))
return false;
}
if (getEGhostBox(i) != ig.getEGhostBox(i))
return false;
if (getEGhostBoxProcessor(i) != ig.getEGhostBoxProcessor(i))
return false;
}
}
};
......
......@@ -327,6 +327,47 @@ public:
return true;
}
/*! \brief Check if the ie_loc_ghosts contain the same information
*
* \param ele Element to check
*
*/
bool is_equal(ie_loc_ghost<dim,T> & ilg)
{
if (ilg.loc_ghost_box.size() != loc_ghost_box.size())
return false;
// Explore all the subdomains
for (size_t i = 0 ; i < loc_ghost_box.size() ; i++)
{
if (getLocalNIGhost(i) != ilg.getLocalNIGhost(i))
return false;
if (getLocalNEGhost(i) != ilg.getLocalNEGhost(i))
return false;
for (size_t j = 0 ; j < getLocalNIGhost(i) ; j++)
{
if (getLocalIGhostE(i,j) != ilg.getLocalIGhostE(i,j))
return false;
if (getLocalIGhostBox(i,j) != ilg.getLocalIGhostBox(i,j))
return false;
if (getLocalIGhostSub(i,j) != ilg.getLocalIGhostSub(i,j))
return false;
}
for (size_t j = 0 ; j < getLocalNEGhost(i) ; j++)
{
if (getLocalEGhostBox(i,j) != ilg.getLocalEGhostBox(i,j))
return false;
if (getLocalEGhostSub(i,j) != ilg.getLocalEGhostSub(i,j))
return false;
}
}
return true;
}
};
......
......@@ -325,6 +325,31 @@ public:
return true;
}
/*! \brief Check if the nn_prcs contain the same information
*
* \param ele Element to check
*
*/
bool is_equal(nn_prcs<dim,T> & np)
{
if (np.getNNProcessors() != getNNProcessors())
return false;
for (size_t p = 0 ; p < getNNProcessors() ; p++)
{
if (getAdjacentSubdomain(p) != np.getAdjacentSubdomain(p))
return false;
if (getAdjacentProcessor(p) != np.getAdjacentProcessor(p))
return false;
if (getInternalAdjSubdomain(p) != np.getInternalAdjSubdomain(p))
return false;
if (getExternalAdjSubdomain(p) != np.getExternalAdjSubdomain(p))
return false;
}
return true;
}
};
......
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