...
 
Commits (4)
......@@ -103,6 +103,7 @@ enum file_type
#define VTK_WRITER 0x10000
#define FORMAT_ASCII 0x0
#define FORMAT_BINARY 0x10000000
#define PRINT_GHOST 1
template <typename Object, unsigned int imp>
class VTKWriter
......@@ -114,7 +115,9 @@ class VTKWriter
#include "VTKWriter_vector_box.hpp"
#include "VTKWriter_grids.hpp"
#include "VTKWriter_grids_st.hpp"
#ifndef NO_PARALLEL
#include "VTKWriter_dist_graph.hpp"
#endif
#include "VTKWriter_point_set.hpp"
#endif /* VTKWRITER_HPP_ */
......@@ -65,14 +65,13 @@ struct vtk_vertex_node_array_scalar_selector<true>
static inline void move(typename G::V_container &vo, s_type (&x)[3], bool &z_set)
{
if (G::V_type::attributes::name[T::value] != "x")
return;
{return;}
if (std::extent<ele_v>::value == 3)
z_set = true;
{z_set = true;}
for (size_t i = 0; i < std::extent<ele_v>::value; i++)
x[i] = convert<typename boost::remove_reference<decltype(vo.template get<T::value>()[i])>::type>::template to<s_type>(vo.template get<T::value>()[i]);
{x[i] = convert<typename boost::remove_reference<decltype(vo.template get<T::value>()[i])>::type>::template to<s_type>(vo.template get<T::value>()[i]);}
}
};
......
......@@ -200,17 +200,17 @@ public:
*/
template<typename vector, typename iterator, typename I> static void write(std::string & v_out, vector & vg, size_t k, iterator & it, file_type ft)
{
typedef decltype(vg.get(k).g.get_o(it.get()).template get<I::value>()) ctype_;
typedef typename std::remove_reference<ctype_>::type ctype;
typedef decltype(vg.get(k).g.template get<I::value>(it.get())) ctype_;
typedef typename std::remove_const<typename std::remove_reference<ctype_>::type>::type ctype;
if (ft == file_type::ASCII)
{
// Print the property
v_out += std::to_string(vg.get(k).g.get_o(it.get()).template get<I::value>()) + "\n";
v_out += std::to_string(vg.get(k).g.template get<I::value>(it.get())) + "\n";
}
else
{
typename is_vtk_writable<ctype>::base tmp = vg.get(k).g.get_o(it.get()).template get<I::value>();
typename is_vtk_writable<ctype>::base tmp = vg.get(k).g.template get<I::value>(it.get());
tmp = swap_endian_lt(tmp);
v_out.append((const char *)&tmp,sizeof(tmp));
}
......@@ -310,7 +310,7 @@ struct meta_prop<I, ele_g,St,T[N1],is_writable>
// Print the properties
for (size_t i1 = 0 ; i1 < N1 ; i1++)
{
v_out += std::to_string(vg.get(k).g.get_o(it.get()).template get<I::value>()[i1]) + " ";
v_out += std::to_string(vg.get(k).g.template get<I::value>(it.get())[i1]) + " ";
}
if (N1 == 2)
{
......@@ -325,7 +325,7 @@ struct meta_prop<I, ele_g,St,T[N1],is_writable>
// Print the properties
for (size_t i1 = 0 ; i1 < N1 ; i1++)
{
tmp = vg.get(k).g.get_o(it.get()).template get<I::value>()[i1];
tmp = vg.get(k).g.template get<I::value>(it.get())[i1];
tmp = swap_endian_lt(tmp);
v_out.append((const char *)&tmp,sizeof(T));
}
......@@ -390,11 +390,11 @@ struct meta_prop<I, ele_g,St, T[N1][N2],is_writable>
if (ft == file_type::ASCII)
{
// Print the property
v_out += std::to_string(vg.get(k).g.get_o(it.get()).template get<I::value>()[i1][i2]) + "\n";
v_out += std::to_string(vg.get(k).g.template get<I::value>(it.get())[i1][i2]) + "\n";
}
else
{
tmp = vg.get(k).g.get_o(it.get()).template get<I::value>()[i1][i2];
tmp = vg.get(k).g.template get<I::value>(it.get())[i1][i2];
tmp = swap_endian_lt(tmp);
v_out.append((const char *)&tmp,sizeof(tmp));
}
......@@ -435,7 +435,9 @@ template<unsigned int dims,typename T> inline void output_point(Point<dims,T> &
{
if (ft == file_type::ASCII)
{
if (dims == 2)
if (dims == 1)
v_out << p.toString() << " 0.0" << " 0.0" << "\n";
else if (dims == 2)
v_out << p.toString() << " 0.0" << "\n";
else
v_out << p.toString() << "\n";
......
......@@ -45,6 +45,10 @@ struct GBoxes
//! origin of GDbox in global grid coordinates
Point<dim,long int> origin;
//! In case the grid is not defined everywhere but is defined by a set of boxes
//! indicate from which box it come from
size_t k;
/*! \brief Indicate that this structure has no pointers inside
*
* \return true
......