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

Detailed Description

template<typename pair>
class VTKWriter< pair, VECTOR_ST_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 202 of file VTKWriter_grids_st.hpp.

#include <VTKWriter_grids_st.hpp>

Public Member Functions

 VTKWriter ()
 
void add (size_t i, 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, const comb< pair::first::dims > &cmb)
 Add grid dataset.
 
template<int prp = -1>
bool write (std::string file, std::string g_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 ()
 Create the VTK point definition.
 
std::string get_prop_components (size_t k)
 It generate a name for the property cell component.
 
std::string get_properties_output (size_t k, std::string prop_name)
 Create the VTK properties output.
 
std::string lastProp ()
 Return the output of the domain property.
 
size_t getMaxFused ()
 Get the maximum number of fused grid.
 
std::string get_vertex_list ()
 Create the VTK vertex definition.
 
std::string get_point_data_header ()
 Get the point data header.
 
void append_grid (size_t id, const typename pair::first &g, const comb< pair::first::dims > &cmb)
 Append the grid to the sub-domain, if for a sub-domain we have a grid that is overlapping fuse them, otherwise create a new combination and grid.
 

Private Attributes

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

Constructor & Destructor Documentation

◆ VTKWriter()

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

VTKWriter constructor

Definition at line 604 of file VTKWriter_grids_st.hpp.

Member Function Documentation

◆ add()

template<typename pair >
void VTKWriter< pair, VECTOR_ST_GRIDS >::add ( size_t  i,
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,
const comb< pair::first::dims > &  cmb 
)
inline

Add grid dataset.

Parameters
isub-domain id
gGrid to add
offsetgrid offset
spacingspacing of the grid
dompart of the spacethat is the domain
cmbposition of the grid

Increase the size

Definition at line 617 of file VTKWriter_grids_st.hpp.

◆ append_grid()

template<typename pair >
void VTKWriter< pair, VECTOR_ST_GRIDS >::append_grid ( size_t  id,
const typename pair::first &  g,
const comb< pair::first::dims > &  cmb 
)
inlineprivate

Append the grid to the sub-domain, if for a sub-domain we have a grid that is overlapping fuse them, otherwise create a new combination and grid.

Parameters
idsub-domain id
ggrid to output
cmbposition of the grid
Returns
a valid slot, if does not exist it append the grid at the end with the new combination

Definition at line 579 of file VTKWriter_grids_st.hpp.

◆ get_point_data_header()

template<typename pair >
std::string VTKWriter< pair, VECTOR_ST_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 560 of file VTKWriter_grids_st.hpp.

◆ get_point_list()

template<typename pair >
std::string VTKWriter< pair, VECTOR_ST_GRIDS >::get_point_list ( )
inlineprivate

Create the VTK point definition.

Returns
the list of points

vertex node output string

For each sub-domain

Get the iterator

Where the grid is defined

Definition at line 273 of file VTKWriter_grids_st.hpp.

◆ get_point_properties_list()

template<typename pair >
std::string VTKWriter< pair, VECTOR_ST_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 256 of file VTKWriter_grids_st.hpp.

◆ get_prop_components()

template<typename pair >
std::string VTKWriter< pair, VECTOR_ST_GRIDS >::get_prop_components ( size_t  k)
inlineprivate

It generate a name for the property cell component.

Parameters
kcomponent in the cell
Returns
property name

For each sub-domain

Definition at line 330 of file VTKWriter_grids_st.hpp.

◆ get_properties_output()

template<typename pair >
std::string VTKWriter< pair, VECTOR_ST_GRIDS >::get_properties_output ( size_t  k,
std::string  prop_name 
)
inlineprivate

Create the VTK properties output.

Parameters
kcomponent
prop_nameproperty name
Returns
the property output string for the grid

vertex node output string

For each sub-domain

Get the iterator

Where the grid is defined

Get the iterator

Where the grid is defined

Definition at line 359 of file VTKWriter_grids_st.hpp.

◆ get_total()

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

Get the total number of points.

Returns
the total number

Calculate the full number of vertices

Definition at line 212 of file VTKWriter_grids_st.hpp.

◆ get_vertex_list()

template<typename pair >
std::string VTKWriter< pair, VECTOR_ST_GRIDS >::get_vertex_list ( )
inlineprivate

Create the VTK vertex definition.

Returns
the string with the vertices as string

vertex node output string

For each sub-domain

For each grid point create a vertex

Definition at line 522 of file VTKWriter_grids_st.hpp.

◆ get_vertex_properties_list()

template<typename pair >
std::string VTKWriter< pair, VECTOR_ST_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 236 of file VTKWriter_grids_st.hpp.

◆ getMaxFused()

template<typename pair >
size_t VTKWriter< pair, VECTOR_ST_GRIDS >::getMaxFused ( )
inlineprivate

Get the maximum number of fused grid.

Returns
the maximum number of fused grids

For each sub-domain

Definition at line 498 of file VTKWriter_grids_st.hpp.

◆ lastProp()

template<typename pair >
std::string VTKWriter< pair, VECTOR_ST_GRIDS >::lastProp ( )
inlineprivate

Return the output of the domain property.

Returns
vtk output

vertex node output string

For each sub-domain

Get the iterator

Definition at line 452 of file VTKWriter_grids_st.hpp.

◆ write()

template<typename pair >
template<int prp = -1>
bool VTKWriter< pair, VECTOR_ST_GRIDS >::write ( std::string  file,
std::string  g_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
g_nameof the set of grids
ftspecify if it is a VTK BINARY or ASCII file [default = ASCII]
Returns
true if the file is succeful written

Definition at line 648 of file VTKWriter_grids_st.hpp.

Field Documentation

◆ vg

template<typename pair >
openfpm::vector< ele_g_st<typename pair::first,typename pair::second> > VTKWriter< pair, VECTOR_ST_GRIDS >::vg
private

Vector of grids.

Definition at line 205 of file VTKWriter_grids_st.hpp.


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