ViennaGrid - The Vienna Grid Library  2.1.0
Public Member Functions | Protected Types | Protected Member Functions
vtk_writer< MeshType, SegmentationType > Class Template Reference

Main VTK writer class. Writes a mesh or a segment to a file. More...

#include <vtk_writer.hpp>

Public Member Functions

template<typename AccessorOrFieldType >
void add_scalar_data_on_cells (AccessorOrFieldType const accessor_or_field, std::string const &quantity_name)
 Register an accessor/field for scalar data on cells with a given quantity name.
template<typename AccessorOrFieldType >
void add_scalar_data_on_cells (segment_id_type seg_id, AccessorOrFieldType const accessor_or_field, std::string const &quantity_name)
 Register an accessor/field for scalar data on cells for a given segment ID with a given quantity name.
template<typename AccessorOrFieldType >
void add_scalar_data_on_cells (SegmentHandleType const &segment, AccessorOrFieldType const accessor_or_field, std::string const &quantity_name)
 Register an accessor/field for scalar data on cells for a given segment with a given quantity name.
template<typename AccessorOrFieldType >
void add_scalar_data_on_vertices (AccessorOrFieldType const accessor_or_field, std::string const &quantity_name)
 Register an accessor/field for scalar data on vertices with a given quantity name.
template<typename AccessorOrFieldType >
void add_scalar_data_on_vertices (segment_id_type seg_id, AccessorOrFieldType const accessor_or_field, std::string const &quantity_name)
 Register an accessor/field for scalar data on vertices for a given segment ID with a given quantity name.
template<typename AccessorOrFieldType >
void add_scalar_data_on_vertices (SegmentHandleType const &segment, AccessorOrFieldType const accessor_or_field, std::string const &quantity_name)
 Register an accessor/field for scalar data on vertices for a given segment with a given quantity name.
template<typename AccessorOrFieldType >
void add_vector_data_on_cells (AccessorOrFieldType const accessor_or_field, std::string const &quantity_name)
 Register an accessor/field for vector data on cells with a given quantity name.
template<typename AccessorOrFieldType >
void add_vector_data_on_cells (segment_id_type seg_id, AccessorOrFieldType const accessor_or_field, std::string const &quantity_name)
 Register an accessor/field for vector data on cells for a given segment ID with a given quantity name.
template<typename AccessorOrFieldType >
void add_vector_data_on_cells (SegmentHandleType const &segment, AccessorOrFieldType const accessor_or_field, std::string const &quantity_name)
 Register an accessor/field for vector data on cells for a given segment with a given quantity name.
template<typename AccessorOrFieldType >
void add_vector_data_on_vertices (AccessorOrFieldType const accessor_or_field, std::string const &quantity_name)
 Register an accessor/field for vector data on vertices with a given quantity name.
template<typename AccessorOrFieldType >
void add_vector_data_on_vertices (segment_id_type seg_id, AccessorOrFieldType const accessor_or_field, std::string const &quantity_name)
 Register an accessor/field for vector data on vertices for a given segment ID with a given quantity name.
template<typename AccessorOrFieldType >
void add_vector_data_on_vertices (SegmentHandleType const &segment, AccessorOrFieldType const accessor_or_field, std::string const &quantity_name)
 Register an accessor/field for vector data on vertices for a given segment with a given quantity name.
void operator() (MeshType const &mesh_obj, std::string const &filename)
 Triggers the write process to a XML file. Make sure that all data to be written to the file is already passed to the writer.
void operator() (MeshType const &mesh_obj, SegmentationType const &segmentation, std::string const &filename)
 Triggers the write process to a XML file. Make sure that all data to be written to the file is already passed to the writer.
 ~vtk_writer ()

Protected Types

typedef result_of::id
< CellType >::type 
CellIDType
typedef base_dynamic_field
< const double, CellType
CellScalarBaseAccesor
typedef std::map< std::string,
CellScalarBaseAccesor * > 
CellScalarOutputAccessorContainer
typedef result_of::cell_tag
< MeshType >::type 
CellTag
typedef result_of::element
< MeshType, CellTag >::type 
CellType
typedef base_dynamic_field
< const vector_data_type,
CellType
CellVectorBaseAccesor
typedef std::map< std::string,
CellVectorBaseAccesor * > 
CellVectorOutputAccessorContainer
typedef
result_of::const_handle
< MeshType, CellTag >::type 
ConstCellHandleType
typedef
result_of::const_handle
< MeshType, vertex_tag >::type 
ConstVertexHandleType
typedef result_of::coord
< PointType >::type 
CoordType
typedef result_of::point
< MeshType >::type 
PointType
typedef
SegmentationType::segment_id_type 
segment_id_type
typedef
SegmentationType::segment_handle_type 
SegmentHandleType
typedef std::vector< double > vector_data_type
typedef result_of::handle
< MeshType, vertex_tag >::type 
VertexHandleType
typedef result_of::id
< VertexType >::type 
VertexIDType
typedef base_dynamic_field
< const double, VertexType
VertexScalarBaseAccesor
typedef std::map< std::string,
VertexScalarBaseAccesor * > 
VertexScalarOutputAccessorContainer
typedef result_of::element
< MeshType, vertex_tag >::type 
VertexType
typedef base_dynamic_field
< const vector_data_type,
VertexType
VertexVectorBaseAccesor
typedef std::map< std::string,
VertexVectorBaseAccesor * > 
VertexVectorOutputAccessorContainer

Protected Member Functions

void clear ()
template<typename map_type >
void clear_map (map_type &map)
template<typename MeshSegmentHandleT >
std::size_t prepareCells (MeshSegmentHandleT const &domseg, segment_id_type seg_id)
template<typename SegmentHandleT >
std::size_t preparePoints (SegmentHandleT const &segment, segment_id_type seg_id)
template<typename SegmentHandleT , typename IOAccessorType >
void writeCellData (SegmentHandleT const &segment, std::ofstream &writer, std::string const &name, IOAccessorType const &accessor, segment_id_type seg_id)
 Writes vector-valued data defined on vertices (points) to file.
template<typename MeshSegmentHandleT >
void writeCells (MeshSegmentHandleT const &domseg, std::ofstream &writer, segment_id_type seg_id)
 Writes the cells to the mesh.
void writeFooter (std::ofstream &writer)
 Writes the XML footer.
void writeHeader (std::ofstream &writer)
 Writes the XML file header.
template<typename SegmentHandleT , typename IOAccessorType >
void writePointData (SegmentHandleT const &segment, std::ofstream &writer, std::string const &name, IOAccessorType const &accessor, segment_id_type seg_id)
 Writes vector-valued data defined on vertices (points) to file.
template<typename MeshSegmentHandleT >
void writePoints (MeshSegmentHandleT const &domseg, std::ofstream &writer, segment_id_type seg_id)
 Writes the vertices in the mesh.

Detailed Description

template<typename MeshType, typename SegmentationType = typename viennagrid::result_of::segmentation<MeshType>::type>
class viennagrid::io::vtk_writer< MeshType, SegmentationType >

Main VTK writer class. Writes a mesh or a segment to a file.

Template Parameters:
MeshTypeType of the ViennaGrid mesh. Must not be a segment!
SegmentationTypeType of the ViennaGrid segmentation. Default is the default segmentation of MeshType

Member Typedef Documentation

typedef result_of::id<CellType>::type CellIDType [protected]
typedef base_dynamic_field<const double, CellType> CellScalarBaseAccesor [protected]
typedef std::map< std::string, CellScalarBaseAccesor * > CellScalarOutputAccessorContainer [protected]
typedef result_of::cell_tag<MeshType>::type CellTag [protected]
typedef result_of::element<MeshType, CellTag>::type CellType [protected]
typedef std::map< std::string, CellVectorBaseAccesor * > CellVectorOutputAccessorContainer [protected]
typedef result_of::const_handle<MeshType, CellTag>::type ConstCellHandleType [protected]
typedef result_of::const_handle<MeshType, vertex_tag>::type ConstVertexHandleType [protected]
typedef result_of::coord<PointType>::type CoordType [protected]
typedef result_of::point<MeshType>::type PointType [protected]
typedef SegmentationType::segment_id_type segment_id_type [protected]
typedef SegmentationType::segment_handle_type SegmentHandleType [protected]
typedef std::vector<double> vector_data_type [protected]
typedef result_of::handle<MeshType, vertex_tag>::type VertexHandleType [protected]
typedef result_of::id<VertexType>::type VertexIDType [protected]
typedef base_dynamic_field<const double, VertexType> VertexScalarBaseAccesor [protected]
typedef std::map< std::string, VertexScalarBaseAccesor * > VertexScalarOutputAccessorContainer [protected]
typedef result_of::element<MeshType, vertex_tag>::type VertexType [protected]
typedef std::map< std::string, VertexVectorBaseAccesor * > VertexVectorOutputAccessorContainer [protected]

Constructor & Destructor Documentation

~vtk_writer ( ) [inline]

Member Function Documentation

void add_scalar_data_on_cells ( AccessorOrFieldType const  accessor_or_field,
std::string const &  quantity_name 
) [inline]

Register an accessor/field for scalar data on cells with a given quantity name.

void add_scalar_data_on_cells ( segment_id_type  seg_id,
AccessorOrFieldType const  accessor_or_field,
std::string const &  quantity_name 
) [inline]

Register an accessor/field for scalar data on cells for a given segment ID with a given quantity name.

void add_scalar_data_on_cells ( SegmentHandleType const &  segment,
AccessorOrFieldType const  accessor_or_field,
std::string const &  quantity_name 
) [inline]

Register an accessor/field for scalar data on cells for a given segment with a given quantity name.

void add_scalar_data_on_vertices ( AccessorOrFieldType const  accessor_or_field,
std::string const &  quantity_name 
) [inline]

Register an accessor/field for scalar data on vertices with a given quantity name.

void add_scalar_data_on_vertices ( segment_id_type  seg_id,
AccessorOrFieldType const  accessor_or_field,
std::string const &  quantity_name 
) [inline]

Register an accessor/field for scalar data on vertices for a given segment ID with a given quantity name.

void add_scalar_data_on_vertices ( SegmentHandleType const &  segment,
AccessorOrFieldType const  accessor_or_field,
std::string const &  quantity_name 
) [inline]

Register an accessor/field for scalar data on vertices for a given segment with a given quantity name.

void add_vector_data_on_cells ( AccessorOrFieldType const  accessor_or_field,
std::string const &  quantity_name 
) [inline]

Register an accessor/field for vector data on cells with a given quantity name.

void add_vector_data_on_cells ( segment_id_type  seg_id,
AccessorOrFieldType const  accessor_or_field,
std::string const &  quantity_name 
) [inline]

Register an accessor/field for vector data on cells for a given segment ID with a given quantity name.

void add_vector_data_on_cells ( SegmentHandleType const &  segment,
AccessorOrFieldType const  accessor_or_field,
std::string const &  quantity_name 
) [inline]

Register an accessor/field for vector data on cells for a given segment with a given quantity name.

void add_vector_data_on_vertices ( AccessorOrFieldType const  accessor_or_field,
std::string const &  quantity_name 
) [inline]

Register an accessor/field for vector data on vertices with a given quantity name.

void add_vector_data_on_vertices ( segment_id_type  seg_id,
AccessorOrFieldType const  accessor_or_field,
std::string const &  quantity_name 
) [inline]

Register an accessor/field for vector data on vertices for a given segment ID with a given quantity name.

void add_vector_data_on_vertices ( SegmentHandleType const &  segment,
AccessorOrFieldType const  accessor_or_field,
std::string const &  quantity_name 
) [inline]

Register an accessor/field for vector data on vertices for a given segment with a given quantity name.

void clear ( ) [inline, protected]
void clear_map ( map_type &  map) [inline, protected]
void operator() ( MeshType const &  mesh_obj,
std::string const &  filename 
) [inline]

Triggers the write process to a XML file. Make sure that all data to be written to the file is already passed to the writer.

Parameters:
mesh_objThe ViennaGrid mesh.
filenameThe file to write to
void operator() ( MeshType const &  mesh_obj,
SegmentationType const &  segmentation,
std::string const &  filename 
) [inline]

Triggers the write process to a XML file. Make sure that all data to be written to the file is already passed to the writer.

Parameters:
mesh_objThe ViennaGrid mesh.
segmentationThe ViennaGrid segmentation.
filenameThe file to write to
std::size_t prepareCells ( MeshSegmentHandleT const &  domseg,
segment_id_type  seg_id 
) [inline, protected]
std::size_t preparePoints ( SegmentHandleT const &  segment,
segment_id_type  seg_id 
) [inline, protected]
void writeCellData ( SegmentHandleT const &  segment,
std::ofstream &  writer,
std::string const &  name,
IOAccessorType const &  accessor,
segment_id_type  seg_id 
) [inline, protected]

Writes vector-valued data defined on vertices (points) to file.

void writeCells ( MeshSegmentHandleT const &  domseg,
std::ofstream &  writer,
segment_id_type  seg_id 
) [inline, protected]

Writes the cells to the mesh.

void writeFooter ( std::ofstream &  writer) [inline, protected]

Writes the XML footer.

void writeHeader ( std::ofstream &  writer) [inline, protected]

Writes the XML file header.

void writePointData ( SegmentHandleT const &  segment,
std::ofstream &  writer,
std::string const &  name,
IOAccessorType const &  accessor,
segment_id_type  seg_id 
) [inline, protected]

Writes vector-valued data defined on vertices (points) to file.

void writePoints ( MeshSegmentHandleT const &  domseg,
std::ofstream &  writer,
segment_id_type  seg_id 
) [inline, protected]

Writes the vertices in the mesh.


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