Commit df1388cf authored by Pietro Incardona's avatar Pietro Incardona

Last changes Not working

parent 6eb93e39
......@@ -205,11 +205,14 @@ private:
SpaceBox<dim,T> sub_d(sub_dc);
sub_d.mul(spacing);
sub_d.expand(spacing);
sub_d += domain.getP1();
// we add the
// Fixing sub-domains to cover all the domain
// Fixing sub_d
// if (loc_box) is a the boundary we have to ensure that the box span the full
// if (loc_box) is at the boundary we have to ensure that the box span the full
// domain (avoiding rounding off error)
for (size_t i = 0 ; i < dim ; i++)
{
......@@ -217,6 +220,10 @@ private:
{
sub_d.setHigh(i,domain.getHigh(i));
}
if (sub_dc.getLow(i) == 0)
{
sub_d.setLow(i,domain.getLow(i));
}
}
// add the sub-domain
......@@ -227,6 +234,10 @@ private:
bbox = sub_d;
}
/* if (loc_box.size())
bbox.zero();
ss_box = domain;*/
// convert into sub-domain
for (size_t s = 1 ; s < loc_box.size() ; s++)
{
......@@ -236,6 +247,7 @@ private:
// re-scale and add spacing (the end is the starting point of the next domain + spacing)
sub_d.mul(spacing);
sub_d.expand(spacing);
sub_d += domain.getP1();
// Fixing sub-domains to cover all the domain
......@@ -245,9 +257,9 @@ private:
for (size_t i = 0 ; i < dim ; i++)
{
if (sub_dc.getHigh(i) == cd.getGrid().size(i) - 1)
{
sub_d.setHigh(i,domain.getHigh(i));
}
if (sub_dc.getLow(i) == 0)
sub_d.setLow(i,domain.getLow(i));
}
// add the sub-domain
......
......@@ -440,7 +440,7 @@ class grid_dist_id
* \param ext extension of the domain
*
*/
inline void InitializeCellDecomposer(CellDecomposer_sm<dim,St> & cd_old, Ghost<dim,size_t> ext)
inline void InitializeCellDecomposer(const CellDecomposer_sm<dim,St> & cd_old, const Box<dim,size_t> & ext)
{
// Initialize the cell decomposer
cd_sm.setDimensions(cd_old,ext);
......@@ -609,14 +609,13 @@ public:
for (size_t i = 0 ; i < dim ; i++)
{
g_sz[i] = g_sz[i] + ext.getLow(i);
g_sz[i] = g_sz[i] + ext.getHigh(i);
g_sz[i] = g.g_sz[i] + ext.getLow(i) + ext.getHigh(i);
this->domain.getLow(i) = g.domain.getLow(i) - ext.getLow(i) * g.spacing(i);
this->domain.getHigh(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));
this->domain.setHigh(i,g.domain.getHigh(i) + ext.getHigh(i) * g.spacing(i));
}
InitializeStructures(g.g_sz,exp);
InitializeStructures(g_sz);
}
//! constructor
......
......@@ -5,6 +5,7 @@
#include "data_type/scalar.hpp"
#include "data_type/aggregate.hpp"
BOOST_AUTO_TEST_SUITE( grid_dist_id_test )
void print_test(std::string test, size_t sz)
......@@ -1267,6 +1268,8 @@ void Test3D_decit(const Box<3,float> & domain, long int k)
}
}
#include "grid_dist_id_unit_test_ext_dom.hpp"
BOOST_AUTO_TEST_CASE( grid_dist_id_iterator_test_use)
{
// Domain
......@@ -1375,6 +1378,20 @@ BOOST_AUTO_TEST_CASE( grid_dist_id_domain_test_use)
Test3D_domain(domain3,k);
}
BOOST_AUTO_TEST_CASE( grid_dist_id_extended )
{
// Initialize the global VCluster
init_global_v_cluster(&boost::unit_test::framework::master_test_suite().argc,&boost::unit_test::framework::master_test_suite().argv);
// Domain
Box<3,float> domain3({0.1,0.1,0.1},{1.1,1.1,1.1});
long int k = 128*128*128*global_v_cluster->getProcessingUnits();
k = std::pow(k, 1/3.);
Test3D_extended_grid(domain3,k);
}
BOOST_AUTO_TEST_SUITE_END()
#endif
......@@ -12,7 +12,10 @@
/*! \brief Create the gdb_ext
*
* \param gdb_ext Vector of Boxes that define the local grids extension
* It is a fundamental function, because it create the structure that store the information of the local grids. In
* particular from the continuous decomposed domain it calculate the grid that each sub-domain store
*
* \param gdb_ext output Vector of Boxes that define the local grids extension
* \param dec Decomposition
* \param cd_sm CellDecomposer the size of cell is equal to the distance between grid points
*
......
......@@ -39,7 +39,7 @@ int main(int argc, char ** argv)
// Write the decomposition
VTKWriter<Graph_CSR<nm_v,nm_e>,GRAPH> vtk(g);
VTKWriter<Graph_CSR<nm_v,nm_e>,VTK_GRAPH> vtk(g);
vtk.write("Metis/vtk_partition.vtk");
}
......
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