diff --git a/src/CSVWriter.hpp b/src/CSVWriter.hpp index ad1f87c9b6005d7a00fde430d5c9e304ba3953b8..eb90d6702b636782b420ca26a0926680f8f7fd6b 100644 --- a/src/CSVWriter.hpp +++ b/src/CSVWriter.hpp @@ -181,9 +181,10 @@ class CSVWriter * * \param v_pos vector that contain the positional information * \param v_prp vector that contain the property information + * \param offset from where to start * */ - std::string get_csv_data(v_pos & vp, v_prp & vpr) + std::string get_csv_data(v_pos & vp, v_prp & vpr, size_t offset) { std::stringstream str; @@ -195,7 +196,7 @@ class CSVWriter } // Write the data - for (size_t i = 0 ; i < vp.size() ; i++) + for (size_t i = offset ; i < vp.size() ; i++) { for (size_t j = 0 ; j < v_pos::value_type::dims ; j++) { @@ -228,10 +229,11 @@ public: * \param file path where to write * \param v_pos positional vector * \param v_prp properties vector + * \param offset from where to start to write * */ - bool write(std::string file, v_pos & v , v_prp & prp) + bool write(std::string file, v_pos & v , v_prp & prp, size_t offset=0) { // Header for csv (colums name) std::string csv_header; @@ -242,7 +244,7 @@ public: csv_header = get_csv_colums(); // For each property in the vertex type produce a point data - point_data = get_csv_data(v,prp); + point_data = get_csv_data(v,prp,offset); // write the file std::ofstream ofs(file); diff --git a/src/GraphMLWriter_unit_tests.hpp b/src/GraphMLWriter_unit_tests.hpp index 17922d61ca7fbfd07563f51ebb68b76b75966ea5..2f9a011f4a8e2a42e00467ad4cc7045ac508ea64 100644 --- a/src/GraphMLWriter_unit_tests.hpp +++ b/src/GraphMLWriter_unit_tests.hpp @@ -131,7 +131,10 @@ BOOST_AUTO_TEST_CASE( graphml_writer_use) // Box Box<3,float> box({0.0,0.0,0.0},{1.0,1.0,1.0}); - Graph_CSR g_csr = g_factory.construct<5,float,2,ne_cp::x,ne_cp::y,ne_cp::z>(sz,box); + // Boundary conditions, non periodic + size_t bc[] = {NON_PERIODIC,NON_PERIODIC,NON_PERIODIC}; + + Graph_CSR g_csr = g_factory.construct<5,float,2,ne_cp::x,ne_cp::y,ne_cp::z>(sz,box,bc); // Create a graph ML GraphMLWriter> gw(g_csr);