OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
VTKWriter< pair, VECTOR_GRIDS > Class Template Reference

Detailed Description

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

It write a VTK format file in case of grids defined on a space

Template Parameters
boost::mpl::pair<G,S>

where G is the type of grid S is the type of space, float, double ...

Definition at line 168 of file VTKWriter_grids.hpp.

#include <VTKWriter_grids.hpp>

Public Member Functions

 VTKWriter ()
 
void add (const typename pair::first &g, const Point< pair::first::dims, typename pair::second > &offset, const Point< pair::first::dims, typename pair::second > &spacing, const Box< pair::first::dims, typename pair::second > &dom)
 Add grid dataset.
 
template<int prp = -1>
bool write (std::string file, const openfpm::vector< std::string > &prop_names, std::string f_name="grids", file_type ft=file_type::ASCII)
 It write a VTK file from a graph.
 

Private Member Functions

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

Private Attributes

openfpm::vector< ele_g< typename pair::first, typename pair::second > > vg
 Vector of grids.
 

Constructor & Destructor Documentation

◆ VTKWriter()

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

VTKWriter constructor

Definition at line 328 of file VTKWriter_grids.hpp.

Member Function Documentation

◆ add()

template<typename pair >
void VTKWriter< pair, VECTOR_GRIDS >::add ( const typename pair::first &  g,
const Point< pair::first::dims, typename pair::second > &  offset,
const Point< pair::first::dims, typename pair::second > &  spacing,
const Box< pair::first::dims, typename pair::second > &  dom 
)
inline

Add grid dataset.

Parameters
gGrid to add
offsetgrid offset
spacingspacing of the grid
dompart of the space that is the domain

Definition at line 339 of file VTKWriter_grids.hpp.

◆ get_point_data_header()

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

Get the point data header.

Returns
a string with the point data header for VTK format

Definition at line 312 of file VTKWriter_grids.hpp.

◆ get_point_list()

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

Create the VTK point definition.

Parameters
ftfile type
Returns
the string with the point list

vertex node output string

For each defined grid

Get the iterator

Where the grid is defined

Definition at line 239 of file VTKWriter_grids.hpp.

◆ get_point_properties_list()

template<typename pair >
std::string VTKWriter< pair, VECTOR_GRIDS >::get_point_properties_list ( )
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 217 of file VTKWriter_grids.hpp.

◆ get_total()

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

Get the total number of points.

Returns
the total number

Calculate the full number of vertices

Definition at line 178 of file VTKWriter_grids.hpp.

◆ get_vertex_list()

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

Create the VTK vertex definition.

Parameters
ftfile type

vertex node output string

For each grid point create a vertex

Definition at line 282 of file VTKWriter_grids.hpp.

◆ get_vertex_properties_list()

template<typename pair >
std::string VTKWriter< pair, VECTOR_GRIDS >::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 198 of file VTKWriter_grids.hpp.

◆ write()

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

It write a VTK file from a graph.

Template Parameters
prp_outwhich properties to output [default = -1 (all)]
Parameters
filepath where to write
nameof the graph
prop_namesproperties name (can also be a vector of size 0)
ftspecify if it is a VTK BINARY or ASCII file [default = ASCII]
Returns
true if the function write successfully

Definition at line 361 of file VTKWriter_grids.hpp.

Field Documentation

◆ vg

template<typename pair >
openfpm::vector< ele_g<typename pair::first,typename pair::second> > VTKWriter< pair, VECTOR_GRIDS >::vg
private

Vector of grids.

Definition at line 172 of file VTKWriter_grids.hpp.


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