Commit d5d69140 authored by Pietro Incardona's avatar Pietro Incardona

Merge branch 'Antonio_DLB' of ssh://ppmcore.mpi-cbg.de/incardon/openfpm_io into Antonio_DLB

parents 199dec5f 6406c98f
......@@ -96,7 +96,7 @@ fi
####### include openfpm_devices include path
INCLUDES_PATH+="-I. -Iconfig -I../../openfpm_vcluster/src -I../../openfpm_data/src -I../../openfpm_devices/src -I$pdata_dir "
INCLUDES_PATH+="-I. -Iconfig -I../../openfpm_data/src -I../../openfpm_devices/src -I../../openfpm_vcluster/src -I$pdata_dir "
########
......
......@@ -8,6 +8,8 @@
#ifndef VTKWRITER_DIST_GRAPH_HPP_
#define VTKWRITER_DIST_GRAPH_HPP_
#include "VCluster.hpp"
/*! Property data store for scalar and vector
*
*/
......@@ -881,7 +883,7 @@ struct dist_prop_out_edge
template<typename Graph>
class VTKWriter<Graph, DIST_GRAPH>
{
const Graph & g;
Graph & g;
/*! \brief It get the vertex properties list
*
......@@ -996,7 +998,7 @@ class VTKWriter<Graph, DIST_GRAPH>
vtk_dist_vertex_node<Graph, attr> vn(v_out, obj, x);
// Iterate through all the vertex and create the vertex list
boost::mpl::for_each<boost::mpl::range_c<int, 0, Graph::V_type::max_prop - 1> >(vn);
boost::mpl::for_each<boost::mpl::range_c<int, 0, Graph::V_type::max_prop> >(vn);
// write the node string
vn.write();
......@@ -1100,7 +1102,7 @@ public:
* \param g Graph to write
*
*/
VTKWriter(const Graph & g) :
VTKWriter(Graph & g) :
g(g)
{
}
......@@ -1116,6 +1118,23 @@ public:
*/
template<int prp = -1> bool write(std::string file, std::string graph_name = "Graph", file_type ft = file_type::ASCII)
{
Vcluster & v_cl = *global_v_cluster;
g.deleteGhosts();
if (v_cl.getProcessUnitID() == 0)
{
for (size_t i = 0; i < g.getTotNVertex(); ++i)
{
g.reqVertex(i);
}
}
g.sync();
if (v_cl.getProcessUnitID() == 0)
{
// Check that the Vertex type define x y and z attributes
......@@ -1228,6 +1247,10 @@ public:
ofs.close();
}
g.deleteGhosts();
// Completed succefully
return true;
}
......
......@@ -6,6 +6,7 @@
#define BOOST_TEST_MODULE "C++ test module for OpenFPM_io project"
#include <boost/test/included/unit_test.hpp>
#include "VCluster.hpp"
#include "CSVWriter/CSVWriter_unit_tests.hpp"
#include "GraphMLWriter/GraphMLWriter_unit_tests.hpp"
#include "VTKWriter/VTKWriter_unit_tests.hpp"
......
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