8 #ifndef OPENFPM_IO_SRC_HDF5_XDMFWRITER_HDF5_XDMFWRITER_POINT_SET_HPP_
9 #define OPENFPM_IO_SRC_HDF5_XDMFWRITER_HDF5_XDMFWRITER_POINT_SET_HPP_
11 #include "HDF5_XdmfWriter_util.hpp"
12 #include "Vector/map_vector.hpp"
13 #include "VCluster.hpp"
27 template<
typename ele_v,
bool has_name>
45 :file_id(file_id),vv(vv),stop(stop)
52 typedef typename boost::mpl::at<typename ele_v::value_type::value_type::type,boost::mpl::int_<T::value>>::type ptype;
71 template<
typename ele_v>
89 :file_id(file_id),vv(vv),stop(stop)
96 typedef typename boost::mpl::at<typename ele_v::value_type::type,boost::mpl::int_<T::value>>::type ptype;
136 template<
typename VPos,
typename VPrp,
int ... prp >
bool write(
const std::string & file, openfpm::vector<VPos> & v_pos, openfpm::vector<VPrp> & v_prp,
size_t stop)
138 Vcluster & v_cl = *global_v_cluster;
142 hid_t plist_id = H5Pcreate(H5P_FILE_ACCESS);
143 H5Pset_fapl_mpio(plist_id, v_cl.getMPIComm(), MPI_INFO_NULL);
144 file_id = H5Fcreate(file.c_str(), H5F_ACC_TRUNC, H5P_DEFAULT, plist_id);
148 openfpm::vector<typename VPos::coord_type> x_n;
152 for (
size_t i = 0 ; i < VPos::dims ; i++)
155 for (
size_t j = 0 ; j < stop ; j++)
156 x_n.get(j) = v_pos.template get<0>(j)[i];
158 std::stringstream str;
161 HDF5CreateDataSet<typename VPos::coord_type>(file_id,str.str(),x_n.getPointer(),stop*
sizeof(
typename VPos::coord_type));
166 typedef typename to_boost_vmpl<prp ... >::type v_prp_seq;
169 boost::mpl::for_each_ref<v_prp_seq>(f);
H5_prop_out(hid_t file_id, ele_v &vv, size_t stop)
constructor
bool write(const std::string &file, openfpm::vector< VPos > &v_pos, openfpm::vector< VPrp > &v_prp, size_t stop)
Write a set of particle position and properties into HDF5.
void operator()(T &t) const
It produce an output for each property.
H5_prop_out(hid_t file_id, ele_v &vv, size_t stop)
constructor
this class is a functor for "for_each" algorithm
void operator()(T &t) const
It produce an output for each property.
static void write(hid_t file_id, const std::string &str, V &v, size_t stop)
write