dune-grid
2.4.1-rc2
|
Dump a .vtu/.vtp files contents to a stream. More...
#include <dune/grid/io/file/vtk/vtuwriter.hh>
Public Types | |
enum | Phase { main, appended } |
Public Member Functions | |
VTUWriter (std::ostream &stream_, OutputType outputType, FileType fileType_) | |
create a VTUWriter object More... | |
~VTUWriter () | |
write footer More... | |
void | beginPointData (const std::string &scalars="", const std::string &vectors="") |
start PointData section More... | |
void | endPointData () |
finish PointData section More... | |
void | beginCellData (const std::string &scalars="", const std::string &vectors="") |
start CellData section More... | |
void | endCellData () |
finish CellData section More... | |
void | beginPoints () |
start section for the point coordinates More... | |
void | endPoints () |
finish section for the point coordinates More... | |
void | beginCells () |
start section for the grid cells/PolyData lines More... | |
void | endCells () |
start section for the grid cells/PolyData lines More... | |
void | beginMain (unsigned ncells, unsigned npoints) |
start the main PolyData/UnstructuredGrid section More... | |
void | endMain () |
finish the main PolyData/UnstructuredGrid section More... | |
bool | beginAppended () |
start the appended data section More... | |
void | endAppended () |
finish the appended data section More... | |
template<typename T > | |
DataArrayWriter< T > * | makeArrayWriter (const std::string &name, unsigned ncomps, unsigned nitems) |
aquire a DataArrayWriter More... | |
Public Attributes | |
std::ostream & | stream |
enum Dune::VTK::VTUWriter::Phase | phase |
Dump a .vtu/.vtp files contents to a stream.
This will help generating a .vtu/.vtp file. Typical use is like this:
The method dumpEverything() then looks something like this:
|
inline |
create a VTUWriter object
stream_ | Stream to write to. |
outputType | How to encode data. |
fileType_ | Whether to write PolyData (1D) or UnstructuredGrid (nD) format. |
Create object and write header.
References Dune::VTK::getEndiannessString(), Dune::VTK::polyData, and Dune::VTK::unstructuredGrid.
|
inline |
write footer
|
inline |
start the appended data section
If this function returns true, an appended section is actually required. In this case, inbetween the call to this method and to endAppended(), there should be literally the same calls (including the same arguments) as between the calls to beginMain() and endMain(). The only exception is, that if a DataArrayWriter in the main section indicated that the calls to write could be skipped, this is not neccessarily true in the appended section also (you will have to ask the DataArrayWriter again).
If this function returns false, no appended section is required and a call to endAppeded() should immediately follow the call to this function.
References appended, Dune::VTK::DataArrayWriterFactory::appendedEncoding(), and Dune::VTK::DataArrayWriterFactory::beginAppended().
Referenced by Dune::VTKWriter< GridView >::pwrite(), and Dune::VTK::BasicWriter< NonConformingBoundaryIteratorFactory< GV > >::writePiece().
|
inline |
start CellData section
scalars | Name of field to which should be marked as default scalars field. If this is the empty string, don't set any default. |
vectors | Name of field to which should be marked as default vectors field. If this is the empty string, don't set any default. |
If there are no CellData fields, the call to this function may be skipped, together with the corresponding call to endCellData().
References appended, and main.
Referenced by Dune::VTK::BasicWriter< NonConformingBoundaryIteratorFactory< GV > >::writeCellData(), Dune::SubsamplingVTKWriter< GridView >::writeCellData(), and Dune::VTKWriter< GridView >::writeCellData().
|
inline |
start section for the grid cells/PolyData lines
Between the call to this method an the following call to the endCells(), there must be two or three fields written:
References appended, and main.
Referenced by Dune::VTK::BasicWriter< NonConformingBoundaryIteratorFactory< GV > >::writeGrid(), Dune::SubsamplingVTKWriter< GridView >::writeGridCells(), and Dune::VTKWriter< GridView >::writeGridCells().
|
inline |
start the main PolyData/UnstructuredGrid section
ncells | Number of cells/lines. |
npoints | Number of points. |
Inbetween the call to this method and to endMain(), there should be calls to dump the actual data:
References main.
Referenced by Dune::VTKWriter< GridView >::pwrite(), and Dune::VTK::BasicWriter< NonConformingBoundaryIteratorFactory< GV > >::writePiece().
|
inline |
start PointData section
scalars | Name of field to which should be marked as default scalars field. If this is the empty string, don't set any default. |
vectors | Name of field to which should be marked as default vectors field. If this is the empty string, don't set any default. |
If there are no PointData fields, the call to this function may be skipped, together with the corresponding call to endPointData().
References appended, and main.
Referenced by Dune::VTK::BasicWriter< NonConformingBoundaryIteratorFactory< GV > >::writePointData(), Dune::SubsamplingVTKWriter< GridView >::writeVertexData(), and Dune::VTKWriter< GridView >::writeVertexData().
|
inline |
start section for the point coordinates
Between the call to this method an the following call to the endPoints(), there must be a single field written. The name must be "Coordinates", it must have 3 components, and the number of items must be the number of points.
References appended, and main.
Referenced by Dune::VTK::BasicWriter< NonConformingBoundaryIteratorFactory< GV > >::writeGrid(), Dune::SubsamplingVTKWriter< GridView >::writeGridPoints(), and Dune::VTKWriter< GridView >::writeGridPoints().
|
inline |
finish the appended data section
Referenced by Dune::VTKWriter< GridView >::pwrite(), and Dune::VTK::BasicWriter< NonConformingBoundaryIteratorFactory< GV > >::writePiece().
|
inline |
finish CellData section
References appended, and main.
Referenced by Dune::VTK::BasicWriter< NonConformingBoundaryIteratorFactory< GV > >::writeCellData(), Dune::SubsamplingVTKWriter< GridView >::writeCellData(), and Dune::VTKWriter< GridView >::writeCellData().
|
inline |
start section for the grid cells/PolyData lines
References appended, and main.
Referenced by Dune::VTK::BasicWriter< NonConformingBoundaryIteratorFactory< GV > >::writeGrid(), Dune::SubsamplingVTKWriter< GridView >::writeGridCells(), and Dune::VTKWriter< GridView >::writeGridCells().
|
inline |
finish the main PolyData/UnstructuredGrid section
Referenced by Dune::VTKWriter< GridView >::pwrite(), and Dune::VTK::BasicWriter< NonConformingBoundaryIteratorFactory< GV > >::writePiece().
|
inline |
finish PointData section
References appended, and main.
Referenced by Dune::VTK::BasicWriter< NonConformingBoundaryIteratorFactory< GV > >::writePointData(), Dune::SubsamplingVTKWriter< GridView >::writeVertexData(), and Dune::VTKWriter< GridView >::writeVertexData().
|
inline |
finish section for the point coordinates
References appended, and main.
Referenced by Dune::VTK::BasicWriter< NonConformingBoundaryIteratorFactory< GV > >::writeGrid(), Dune::SubsamplingVTKWriter< GridView >::writeGridPoints(), and Dune::VTKWriter< GridView >::writeGridPoints().
|
inline |
aquire a DataArrayWriter
T | Type of the data to write. |
name | Name of the array to write. |
ncomps | Number of components of the vectors in the array. |
nitems | Number of vectors in the array (number of cells/number of points/number of corners). |
There should never be more than one DataArrayWriter created by the same VTUWriter around. The returned object should be freed with delete.
References Dune::VTK::DataArrayWriterFactory::make().
Referenced by Dune::VTK::SkeletonFunctionWriter< Func >::beginWrite(), Dune::VTK::VTKFunctionWriter< Func >::beginWrite(), Dune::VTK::CoordinatesWriter< Cell >::beginWrite(), Dune::VTK::ConformingConnectivityWriter< IteratorFactory >::beginWrite(), Dune::VTK::NonConformingConnectivityWriter< Cell >::beginWrite(), Dune::VTK::OffsetsWriter< Cell >::beginWrite(), Dune::VTK::TypesWriter< Cell >::beginWrite(), Dune::SubsamplingVTKWriter< GridView >::SubsamplingVTKWriter(), Dune::VTKWriter< GridView >::writeData(), Dune::SubsamplingVTKWriter< GridView >::writeGridCells(), Dune::VTKWriter< GridView >::writeGridCells(), Dune::SubsamplingVTKWriter< GridView >::writeGridPoints(), and Dune::VTKWriter< GridView >::writeGridPoints().
enum Dune::VTK::VTUWriter::Phase Dune::VTK::VTUWriter::phase |
std::ostream& Dune::VTK::VTUWriter::stream |