Commit 2125ca91 authored by incardon's avatar incardon

Adding meta data on VTK files

parent a4d3aa63
......@@ -240,20 +240,8 @@ template<typename vector_type> void test_dlb_vector()
vd.map();
////////////// DEBUG ////////////////////////
vd.write("bug_test_init_before");
/////////////////////////////////////////////
vd.template ghost_get<>();
////////////// DEBUG ////////////////////////
vd.write("bug_test_init_after");
/////////////////////////////////////////////
// Get the neighborhood of each particles
auto VV = vd.getVerlet(0.01);
......@@ -275,22 +263,10 @@ template<typename vector_type> void test_dlb_vector()
md.factor = 10;
vd.map();
////////////// DEBUG ////////////////////////
vd.write("bug_test_before_dlb");
/////////////////////////////////////////////
vd.addComputationCosts(md);
vd.getDecomposition().decompose();
vd.map();
////////////// DEBUG ////////////////////////
vd.write("bug_test_after_dlb");
/////////////////////////////////////////////
vd.addComputationCosts(md);
openfpm::vector<size_t> loads;
......@@ -329,21 +305,8 @@ template<typename vector_type> void test_dlb_vector()
vd.map();
////////////// DEBUG ////////////////////////
vd.write_frame("bug_test_before",i);
/////////////////////////////////////////////
vd.template ghost_get<>();
////////////// DEBUG ////////////////////////
vd.getDecomposition().write("dec_test");
vd.write_frame("bug_test_after",i);
/////////////////////////////////////////////
auto VV2 = vd.getVerlet(0.01);
auto it2 = vd.getDomainIterator();
......
......@@ -2361,7 +2361,22 @@ public:
* \return true if the file has been written without error
*
*/
inline bool write(std::string out, int opt = VTK_WRITER)
inline bool write(std::string out ,int opt = VTK_WRITER)
{
write(out,"",opt);
}
/*! \brief Output particle position and properties
*
* \param out output filename
* \param meta_info meta information example ("time = 1.234" add the information time to the VTK file)
* \param opt VTK_WRITER, CSV_WRITER, it is also possible to choose the format for VTK
* FORMAT_BINARY. (the default is ASCII format)
*
* \return true if the file has been written without error
*
*/
inline bool write(std::string out, std::string meta_info ,int opt = VTK_WRITER)
{
if ((opt & 0x0FFF0000) == CSV_WRITER)
......@@ -2391,7 +2406,7 @@ public:
std::string output = std::to_string(out + "_" + std::to_string(v_cl.getProcessUnitID()) + std::to_string(".vtk"));
// Write the VTK file
return vtk_writer.write(output,prp_names,"particles",ft);
return vtk_writer.write(output,prp_names,"particles","",ft);
}
}
......@@ -2426,6 +2441,7 @@ public:
*
* \param out output
* \param iteration (we can append the number at the end of the file_name)
* \param meta_info meta information example ("time = 1.234" add the information time to the VTK file)
* \param opt VTK_WRITER, CSV_WRITER, it is also possible to choose the format for VTK
* FORMAT_BINARY. (the default is ASCII format)
*
......@@ -2433,6 +2449,22 @@ public:
*
*/
inline bool write_frame(std::string out, size_t iteration, int opt = VTK_WRITER)
{
write_frame(out,iteration,"",opt);
}
/*! \brief Output particle position and properties
*
* \param out output
* \param iteration (we can append the number at the end of the file_name)
* \param meta_info meta information example ("time = 1.234" add the information time to the VTK file)
* \param opt VTK_WRITER, CSV_WRITER, it is also possible to choose the format for VTK
* FORMAT_BINARY. (the default is ASCII format)
*
* \return if the file has been written correctly
*
*/
inline bool write_frame(std::string out, size_t iteration, std::string meta_info, int opt = VTK_WRITER)
{
if ((opt & 0x0FFF0000) == CSV_WRITER)
{
......@@ -2460,7 +2492,7 @@ public:
std::string output = std::to_string(out + "_" + std::to_string(v_cl.getProcessUnitID()) + "_" + std::to_string(iteration) + std::to_string(".vtk"));
// Write the VTK file
return vtk_writer.write(output,prp_names,"particles",ft);
return vtk_writer.write(output,prp_names,"","particles",ft);
}
}
......
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