OpenFPM_pdata  1.1.0
Project that contain the implementation of distributed structures
 All Data Structures Namespaces Functions Variables Typedefs Enumerations Friends Pages
VTKWriter< pair, VECTOR_POINTS > Class Template Reference

Detailed Description

template<typename pair>
class VTKWriter< pair, VECTOR_POINTS >

It write a VTK format file for a list of grids defined on a space

Template Parameters
boost::mpl::pair<G,S>where G is the type of the vector containing the properties, S is the type of vector containing the particle positions

Definition at line 183 of file VTKWriter_point_set.hpp.

#include <VTKWriter_point_set.hpp>

Public Member Functions

 VTKWriter ()
 
void add (const typename pair::first &vps, const typename pair::second &vpp, size_t mark)
 Add a vector dataset. More...
 
template<int prp = -1>
bool write (std::string file, const openfpm::vector< std::string > &prop_names, std::string f_name="points", file_type ft=file_type::ASCII)
 It write a VTK file from a vector of points. More...
 

Private Member Functions

size_t get_total ()
 Get the total number of points. More...
 
std::string get_vertex_properties_list ()
 It get the vertex properties list. More...
 
std::string get_point_properties_list (file_type ft)
 It get the vertex properties list. More...
 
std::string get_point_list (file_type ft)
 Create the VTK point list. More...
 
std::string get_vertex_list (file_type ft)
 Create the VTK vertex list. More...
 
std::string get_point_data_header ()
 Get the point data header. More...
 

Private Attributes

openfpm::vector< ele_vps
< typename pair::first > > 
vps
 Vector of position.
 
openfpm::vector< ele_vpp
< typename pair::second > > 
vpp
 Vector of properties.
 

Constructor & Destructor Documentation

template<typename pair >
VTKWriter< pair, VECTOR_POINTS >::VTKWriter ( )
inline

VTKWriter constructor

Definition at line 347 of file VTKWriter_point_set.hpp.

Member Function Documentation

template<typename pair >
void VTKWriter< pair, VECTOR_POINTS >::add ( const typename pair::first &  vps,
const typename pair::second &  vpp,
size_t  mark 
)
inline

Add a vector dataset.

Parameters
vpsvector of positions
vppvector of properties
markadditional information that divide the dataset into 2 (in general is used to mark real from ghost information)
opt_namesoptional parameter that indicate the names of the properties

Definition at line 358 of file VTKWriter_point_set.hpp.

template<typename pair >
std::string VTKWriter< pair, VECTOR_POINTS >::get_point_data_header ( )
inlineprivate

Get the point data header.

Returns
a string with the point data header for VTK format

Definition at line 331 of file VTKWriter_point_set.hpp.

template<typename pair >
std::string VTKWriter< pair, VECTOR_POINTS >::get_point_list ( file_type  ft)
inlineprivate

Create the VTK point list.

Parameters
ftfile_type
Returns
the list of points

vertex node output string

For each defined grid

write the particle position

In case of binary we have to add a new line at the end of the list

Definition at line 257 of file VTKWriter_point_set.hpp.

template<typename pair >
std::string VTKWriter< pair, VECTOR_POINTS >::get_point_properties_list ( file_type  ft)
inlineprivate

It get the vertex properties list.

It get the vertex properties list of the vertex defined as a VTK header

Returns
a string that define the vertex properties in graphML format

vertex property output string

Definition at line 234 of file VTKWriter_point_set.hpp.

template<typename pair >
size_t VTKWriter< pair, VECTOR_POINTS >::get_total ( )
inlineprivate

Get the total number of points.

Returns
the total number

Calculate the full number of vertices

Definition at line 195 of file VTKWriter_point_set.hpp.

template<typename pair >
std::string VTKWriter< pair, VECTOR_POINTS >::get_vertex_list ( file_type  ft)
inlineprivate

Create the VTK vertex list.

Parameters
ftfile_type
Returns
the list of vertices

For each grid point create a vertex

In case of binary we have to add a new line at the end of the list

Definition at line 297 of file VTKWriter_point_set.hpp.

template<typename pair >
std::string VTKWriter< pair, VECTOR_POINTS >::get_vertex_properties_list ( )
inlineprivate

It get the vertex properties list.

It get the vertex properties list of the vertex defined as VTK header

Returns
a string that define the vertex properties in graphML format

vertex property output string

Definition at line 214 of file VTKWriter_point_set.hpp.

template<typename pair >
template<int prp = -1>
bool VTKWriter< pair, VECTOR_POINTS >::write ( std::string  file,
const openfpm::vector< std::string > &  prop_names,
std::string  f_name = "points",
file_type  ft = file_type::ASCII 
)
inline

It write a VTK file from a vector of points.

Template Parameters
prp_outwhich properties to output [default = -1 (all)]
Parameters
filepath where to write
f_namename of the dataset
prop_namesproperties names
ftspecify if it is a VTK BINARY or ASCII file [default = ASCII]
Returns
true if the write complete successfully

Definition at line 381 of file VTKWriter_point_set.hpp.


The documentation for this class was generated from the following file: