OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
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 264 of file VTKWriter_point_set.hpp.

#include <VTKWriter_point_set.hpp>

Data Structures

struct  doubleint
 

Public Member Functions

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

Private Member Functions

size_t get_total ()
 Get the total number of points.
 
std::string get_vertex_properties_list (file_type &opt)
 It get the vertex properties list.
 
std::string get_point_properties_list (file_type ft)
 It get the point position header string.
 
std::string get_point_list (file_type &opt)
 Create the VTK point list.
 
std::string get_vertex_list (file_type ft)
 Create the VTK vertex list.
 
std::string get_point_data_header ()
 Get the point data header.
 
std::string add_meta_data (std::string &meta_data, file_type &opt)
 return the meta data string
 

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

◆ VTKWriter()

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

VTKWriter constructor

Definition at line 593 of file VTKWriter_point_set.hpp.

Member Function Documentation

◆ add()

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 604 of file VTKWriter_point_set.hpp.

◆ add_meta_data()

template<typename pair >
std::string VTKWriter< pair, VECTOR_POINTS >::add_meta_data ( std::string &  meta_data,
file_type &  opt 
)
inlineprivate

return the meta data string

Parameters
meta_datastring with the meta-data to add

Definition at line 537 of file VTKWriter_point_set.hpp.

◆ get_point_data_header()

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 520 of file VTKWriter_point_set.hpp.

◆ get_point_list()

template<typename pair >
std::string VTKWriter< pair, VECTOR_POINTS >::get_point_list ( file_type &  opt)
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 344 of file VTKWriter_point_set.hpp.

◆ get_point_properties_list()

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

It get the point position header string.

It get the vertex position header of the vertex defined as a VTK header

Returns
a string that define the vertex position format

vertex property output string

Definition at line 324 of file VTKWriter_point_set.hpp.

◆ get_total()

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 276 of file VTKWriter_point_set.hpp.

◆ get_vertex_list()

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

For each grid point create a vertex

Definition at line 435 of file VTKWriter_point_set.hpp.

◆ get_vertex_properties_list()

template<typename pair >
std::string VTKWriter< pair, VECTOR_POINTS >::get_vertex_properties_list ( file_type &  opt)
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 295 of file VTKWriter_point_set.hpp.

◆ write()

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",
std::string  meta_data = "",
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 682 of file VTKWriter_point_set.hpp.

◆ write_pvtp()

template<typename pair >
bool VTKWriter< pair, VECTOR_POINTS >::write_pvtp ( std::string  file,
const openfpm::vector< std::string > &  prop_names,
size_t  n,
long int  timestamp = -1,
double  time = -1 
)
inline

It write a Merged VTP type file from a vector of points.

Template Parameters
prp_outwhich properties to output [default = -1 (all)]
Returns
true if the write complete successfully

Definition at line 622 of file VTKWriter_point_set.hpp.

Field Documentation

◆ vpp

template<typename pair >
openfpm::vector< ele_vpp<typename pair::second> > VTKWriter< pair, VECTOR_POINTS >::vpp
private

Vector of properties.

Definition at line 269 of file VTKWriter_point_set.hpp.

◆ vps

template<typename pair >
openfpm::vector< ele_vps<typename pair::first > > VTKWriter< pair, VECTOR_POINTS >::vps
private

Vector of position.

Definition at line 267 of file VTKWriter_point_set.hpp.


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