Skip to content
Snippets Groups Projects
Commit 863d65e6 authored by Pietro Incardona's avatar Pietro Incardona
Browse files

Fixing io in SE_CLASS3

parent e4b2a896
No related branches found
No related tags found
No related merge requests found
......@@ -58,8 +58,12 @@ BOOST_AUTO_TEST_CASE( csv_writer_particles )
// Write the CSV
csv_writer.write("csv_out_unk.csv",v_pos,v_prp);
// In case of SE_CLASS3 enabled the number of properties change
#ifndef SE_CLASS3
bool test = compare("csv_out_unk.csv","test_data/csv_out_unk_test.csv");
BOOST_REQUIRE_EQUAL(true,test);
#endif
}
}
......
......@@ -23,6 +23,9 @@ BOOST_AUTO_TEST_CASE( raw_reader_read_test )
grid_cpu<3,aggregate<float,float[3]>> read_bin_test;
GridRawReader<3,aggregate<float,float[3]>,int> rr;
#ifndef SE_CLASS3
rr.read("test_data/raw_read_sv_test.bin",read_bin_test,FORTRAN_STYLE | STRUCT_OF_ARRAY,12);
auto it = read_bin_test.getIterator();
......@@ -39,6 +42,8 @@ BOOST_AUTO_TEST_CASE( raw_reader_read_test )
++it;
}
#endif
}
......
......@@ -15,10 +15,9 @@
BOOST_AUTO_TEST_SUITE( vtk_writer_test )
/* \brief Sub-domain vertex graph node
/*! \brief Sub-domain vertex graph node
*
*/
struct vertex
{
//! The node contain 3 unsigned long integer for communication computation memory and id
......@@ -35,13 +34,22 @@ struct vertex
//! The data
type data;
//! x
static const unsigned int x = 0;
//! y
static const unsigned int y = 1;
//! z
static const unsigned int z = 2;
//! property 1
static const unsigned int prp1 = 3;
//! property 2
static const unsigned int prp2 = 4;
//! property 3
static const unsigned int prp3 = 5;
//! property 4
static const unsigned int prp4 = 6;
//! property 5
static const unsigned int prp5 = 7;
//! total number of properties boost::fusion::vector
......@@ -58,7 +66,9 @@ struct vertex
/*! \brief Initialize the VTKVertex
*
* \param
* \param x coordinate x
* \param y coordinate y
* \param z coordinate z
*
*/
vertex(float x, float y, float z)
......@@ -107,7 +117,9 @@ struct vertex2
/*! \brief Initialize the VTKVertex
*
* \param
* \param x coordinate x
* \param y coordinate y
* \param z coordinate z
*
*/
vertex2(float x, float y, float z)
......@@ -671,9 +683,13 @@ BOOST_AUTO_TEST_CASE( vtk_writer_use_grids)
openfpm::vector<std::string> prp_names;
vtk_g.write("vtk_grids.vtk",prp_names);
#ifndef SE_CLASS3
// Check that match
bool test = compare("vtk_grids.vtk","test_data/vtk_grids_test.vtk");
BOOST_REQUIRE_EQUAL(test,true);
#endif
}
{
......@@ -826,9 +842,14 @@ BOOST_AUTO_TEST_CASE( vtk_writer_use_grids)
openfpm::vector<std::string> prp_names;
vtk_g.write("vtk_grids_unk.vtk",prp_names);
#ifndef SE_CLASS3
// Check that match
bool test = compare("vtk_grids_unk.vtk","test_data/vtk_grids_test.vtk");
BOOST_REQUIRE_EQUAL(test,true);
#endif
}
// Try
......@@ -924,10 +945,15 @@ BOOST_AUTO_TEST_CASE( vtk_writer_use_point_set )
openfpm::vector<std::string> prp_names;
vtk_v.write("vtk_points.vtk",prp_names);
#ifndef SE_CLASS3
bool test = true;
// Check that match
bool test = compare("vtk_points.vtk","test_data/vtk_points_test.vtk");
test = compare("vtk_points.vtk","test_data/vtk_points_test.vtk");
BOOST_REQUIRE_EQUAL(test,true);
#endif
// Create a writer and write
VTKWriter<boost::mpl::pair<openfpm::vector<Point<3,double>>,openfpm::vector<aggregate<float,Point<3,float>>>>,VECTOR_POINTS> vtk_v2;
......@@ -935,10 +961,14 @@ BOOST_AUTO_TEST_CASE( vtk_writer_use_point_set )
vtk_v2.write("vtk_points_pp.vtk",prp_names);
#ifndef SE_CLASS3
// Check that match
test = compare("vtk_points_pp.vtk","test_data/vtk_points_pp_test.vtk");
BOOST_REQUIRE_EQUAL(test,true);
#endif
}
}
......@@ -983,10 +1013,14 @@ BOOST_AUTO_TEST_CASE( vtk_writer_use_point_set_properties )
openfpm::vector<std::string> prp_names({"scalar","vector"});
vtk_v.write("vtk_points_with_prp_names.vtk",prp_names);
#ifndef SE_CLASS3
// Check that match
bool test = compare("vtk_points_with_prp_names.vtk","test_data/vtk_points_with_prp_names_test.vtk");
BOOST_REQUIRE_EQUAL(test,true);
#endif
}
}
......@@ -1066,23 +1100,32 @@ BOOST_AUTO_TEST_CASE( vtk_writer_use_point_set_binary )
vtk_v.write("vtk_points_bin.vtk",prp_names,"vtk output",file_type::BINARY);
vtk_v.write("vtk_points_bin2.vtk",prp_names,"vtk output",file_type::BINARY);
#ifndef SE_CLASS3
bool test = true;
// Check that match
bool test = compare("vtk_points_bin.vtk","test_data/vtk_points_bin_test.vtk");
test = compare("vtk_points_bin.vtk","test_data/vtk_points_bin_test.vtk");
BOOST_REQUIRE_EQUAL(test,true);
test = compare("vtk_points_bin2.vtk","test_data/vtk_points_bin_test.vtk");
BOOST_REQUIRE_EQUAL(test,true);
#endif
// Create a writer and write
VTKWriter<boost::mpl::pair<openfpm::vector<Point<3,double>>,openfpm::vector<aggregate<float,Point<3,float>>>>,VECTOR_POINTS> vtk_v2;
vtk_v2.add(v1ps,v4pp,75);
vtk_v2.write("vtk_points_pp_bin.vtk",prp_names,"vtk output",file_type::BINARY);
#ifndef SE_CLASS3
// Check that match
test = compare("vtk_points_pp_bin.vtk","test_data/vtk_points_pp_bin_test.vtk");
BOOST_REQUIRE_EQUAL(test,true);
#endif
}
......@@ -1174,10 +1217,15 @@ BOOST_AUTO_TEST_CASE( vtk_writer_use_point_set_binary )
vtk_v.write("vtk_points_2d_bin.vtk",stub,"vtk output",file_type::BINARY);
#ifndef SE_CLASS3
bool test = true;
// Check that match
bool test = compare("vtk_points_2d_bin.vtk","test_data/vtk_points_2d_bin_test.vtk");
test = compare("vtk_points_2d_bin.vtk","test_data/vtk_points_2d_bin_test.vtk");
BOOST_REQUIRE_EQUAL(test,true);
#endif
// Create a writer and write
VTKWriter<boost::mpl::pair<openfpm::vector<Point<2,double>>,openfpm::vector<aggregate<float[3],double[2]>>>,VECTOR_POINTS> vtk_v2;
......@@ -1185,9 +1233,13 @@ BOOST_AUTO_TEST_CASE( vtk_writer_use_point_set_binary )
vtk_v2.write("vtk_points_2d_pp_bin.vtk",stub,"vtk output",file_type::BINARY);
#ifndef SE_CLASS3
// Check that match
test = compare("vtk_points_2d_pp_bin.vtk","test_data/vtk_points_2d_pp_bin_test.vtk");
BOOST_REQUIRE_EQUAL(test,true);
#endif
}
}
......
......@@ -44,6 +44,16 @@ struct GBoxes
Box<dim,long int> Dbox;
//! origin of GDbox in global grid coordinates
Point<dim,long int> origin;
/*! \brief Indicate that this structure has no pointers inside
*
* \return true
*
*/
static bool noPointers()
{
return true;
}
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment