|
dune-vtk 2.12
|
Base class for file writers for the Vtk XML file formats. More...
#include <dune/vtk/vtkwriterbase.hh>

Public Types | |
| using | GridView = GV |
| using | DataCollector = DC |
Public Member Functions | |
| VtkWriterBase (GridView const &gridView, Vtk::FormatTypes format=Vtk::FormatTypes::BINARY, Vtk::DataTypes datatype=Vtk::DataTypes::FLOAT32, Vtk::DataTypes headertype=Vtk::DataTypes::UINT32) | |
| Constructor, passes the gridView to the DataCollector. | |
| VtkWriterBase (DataCollector &dataCollector, Vtk::FormatTypes format=Vtk::FormatTypes::BINARY, Vtk::DataTypes datatype=Vtk::DataTypes::FLOAT32, Vtk::DataTypes headertype=Vtk::DataTypes::UINT32) | |
| Constructor, wraps the passed DataCollector in a non-destroying shared_ptr. | |
| VtkWriterBase (DataCollector &&dataCollector, Vtk::FormatTypes format=Vtk::FormatTypes::BINARY, Vtk::DataTypes datatype=Vtk::DataTypes::FLOAT32, Vtk::DataTypes headertype=Vtk::DataTypes::UINT32) | |
| Constructor, stores the passed DataCollector. | |
| VtkWriterBase (std::shared_ptr< DataCollector > dataCollector, Vtk::FormatTypes format=Vtk::FormatTypes::BINARY, Vtk::DataTypes datatype=Vtk::DataTypes::FLOAT32, Vtk::DataTypes headertype=Vtk::DataTypes::UINT32) | |
| Constructor, stores the passed DataCollector. | |
| virtual std::string | write (std::string const &fn, std::optional< std::string > dir={}) const override |
| Write the attached data to the file. | |
| template<class Function > | |
| VtkWriterBase & | addPointData (Function &&fct, const Vtk::FieldInfo &info) |
| Attach point data to the writer. | |
| template<class Function , class R = RangeType<ResolveRef_t<Function>,Domain>> | |
| VtkWriterBase & | addPointData (Function &&fct, std::string name, int size=dimRange< R >()) |
| VtkWriterBase & | addPointData (const std::shared_ptr< VTKFunction< GridView > const > &fct) |
| VtkWriterBase & | addPointData (const Vtk::GridFunction< GridView > &fct) |
| template<class Function > | |
| VtkWriterBase & | addCellData (Function &&fct, const Vtk::FieldInfo &info) |
| Attach cell data to the writer. | |
| template<class Function , class R = RangeType<ResolveRef_t<Function>,Domain>> | |
| VtkWriterBase & | addCellData (Function &&fct, std::string name, int size=dimRange< R >()) |
| VtkWriterBase & | addCellData (const std::shared_ptr< VTKFunction< GridView > const > &fct) |
| VtkWriterBase & | addCellData (const Vtk::GridFunction< GridView > &fct) |
| void | setFormat (Vtk::FormatTypes format) |
| void | setDatatype (Vtk::DataTypes datatype) |
| Sets the global datatype used for coordinates and other global float values. | |
| void | setHeadertype (Vtk::DataTypes datatype) |
| Sets the integer type used in binary data headers. | |
| void | setCompressor (Vtk::CompressorTypes compressor, int level=-1) |
Protected Types | |
| enum | PositionTypes { POINT_DATA , CELL_DATA } |
| using | VtkFunction = Dune::Vtk::GridFunction< GridView > |
| using | Domain = typename GridView::template Codim< 0 >::Entity::Geometry::GlobalCoordinate |
| using | pos_type = typename std::ostream::pos_type |
Protected Member Functions | |
| void | writeData (std::ofstream &out, std::vector< pos_type > &offsets, VtkFunction const &fct, PositionTypes type, std::optional< std::size_t > timestep={}) const |
| void | writeDataAppended (std::ofstream &out, std::vector< std::uint64_t > &blocks) const |
| void | writePoints (std::ofstream &out, std::vector< pos_type > &offsets, std::optional< std::size_t > timestep={}) const |
| void | writeAppended (std::ofstream &out, std::vector< pos_type > const &offsets) const |
| template<class HeaderType , class FloatType > | |
| std::uint64_t | writeValuesAppended (std::ofstream &out, std::vector< FloatType > const &values) const |
| template<class T > | |
| void | writeValuesAscii (std::ofstream &out, std::vector< T > const &values) const |
| void | writeHeader (std::ofstream &out, std::string const &type) const |
| std::string | getNames (std::vector< VtkFunction > const &data) const |
| Return PointData/CellData attributes for the name of the first scalar/vector/tensor DataArray. | |
| std::string | getEndian () const |
| std::string | getFileExtension () const |
| Vtk::FormatTypes | getFormat () const |
| Vtk::DataTypes | getDatatype () const |
| auto | comm () const |
Protected Attributes | |
| std::shared_ptr< DataCollector > | dataCollector_ |
| Vtk::FormatTypes | format_ |
| Vtk::DataTypes | datatype_ |
| Vtk::DataTypes | headertype_ |
| Vtk::CompressorTypes | compressor_ = Vtk::CompressorTypes::NONE |
| std::vector< VtkFunction > | pointData_ |
| std::vector< VtkFunction > | cellData_ |
| std::size_t const | block_size = 1024*32 |
| int | compression_level = -1 |
Friends | |
| template<class > | |
| class | TimeseriesWriter |
| template<class > | |
| class | PvdWriter |
Detailed Description
class Dune::Vtk::VtkWriterBase< GV, DC >
Base class for file writers for the Vtk XML file formats.
- Template Parameters
-
GV Model of Dune::GridView DC Model of DataCollectorInterface
Member Typedef Documentation
◆ DataCollector
| using Dune::Vtk::VtkWriterBase< GV, DC >::DataCollector = DC |
◆ Domain
|
protected |
◆ GridView
| using Dune::Vtk::VtkWriterBase< GV, DC >::GridView = GV |
◆ pos_type
|
protected |
◆ VtkFunction
|
protected |
Member Enumeration Documentation
◆ PositionTypes
|
protected |
Constructor & Destructor Documentation
◆ VtkWriterBase() [1/4]
|
inline |
Constructor, passes the gridView to the DataCollector.
Creates a new VtkWriterBase for the provided GridView. Initializes a DataCollector that is used to collect point coordinates, cell connectivity and data values.
This constructor assumes, that the DataCollector can be constructed from a single argument, the passed gridView.
- Parameters
-
gridView Implementation of Dune::GridView format Format of the VTK file, either Vtk::FormatTypes::BINARY, Vtk::FormatTypes::ASCII, or Vtk::COMPRESSED datatype Data type of a single component of the point coordinates [Vtk::DataTypes::FLOAT32] headertype Integer type used in binary data headers [Vtk::DataTypes::UINT32]
◆ VtkWriterBase() [2/4]
|
inline |
Constructor, wraps the passed DataCollector in a non-destroying shared_ptr.
◆ VtkWriterBase() [3/4]
|
inline |
Constructor, stores the passed DataCollector.
◆ VtkWriterBase() [4/4]
|
inline |
Constructor, stores the passed DataCollector.
Member Function Documentation
◆ addCellData() [1/4]
|
inline |
◆ addCellData() [2/4]
|
inline |
◆ addCellData() [3/4]
|
inline |
Attach cell data to the writer.
Attach a global function to the writer that will be evaluated at cell centers. The global function must be assignable to the function wrapper Vtk::GridFunction. Additional argument for output datatype and number of components can be passed. See Vtk::GridFunction Constructor for possible arguments.
- Parameters
-
fct A GridFunction or Dune::VTKFunction info Additional arguments, like name,numComponents,dataTypeorrangeType
◆ addCellData() [4/4]
|
inline |
◆ addPointData() [1/4]
|
inline |
◆ addPointData() [2/4]
|
inline |
◆ addPointData() [3/4]
|
inline |
Attach point data to the writer.
Attach a global function to the writer that will be evaluated at grid points (vertices and higher order points). The global function must be assignable to the function wrapper Vtk::GridFunction. Additional argument for output datatype and number of components can be passed. See Vtk::GridFunction Constructor for possible arguments.
- Parameters
-
fct A GridFunction or Dune::VTKFunction inf Additional arguments, like name,numComponents,dataTypeorrangeType
◆ addPointData() [4/4]
|
inline |
◆ comm()
|
inlineprotected |
◆ getDatatype()
|
inlineprotected |
◆ getEndian()
|
inlineprotected |
◆ getFileExtension()
|
inlineprotected |
◆ getFormat()
|
inlineprotected |
◆ getNames()
|
protected |
Return PointData/CellData attributes for the name of the first scalar/vector/tensor DataArray.
◆ setCompressor()
|
inline |
Sets the compressor type used in binary data headers, Additionally a compression level can be passed with level = -1 means: default compression level. Level must be in [0-9]
◆ setDatatype()
|
inline |
Sets the global datatype used for coordinates and other global float values.
◆ setFormat()
|
inline |
◆ setHeadertype()
|
inline |
Sets the integer type used in binary data headers.
◆ write()
|
overridevirtual |
Write the attached data to the file.
- Parameters
-
fn Filename of the VTK file. May contain a directory and any file extension. dir The optional parameter specifies the directory of the partition files for parallel writes.
- Returns
- File name that is actually written.
Implements Dune::Vtk::FileWriter.
◆ writeAppended()
|
protected |
◆ writeData()
|
protected |
◆ writeDataAppended()
|
protected |
◆ writeHeader()
|
protected |
◆ writePoints()
|
protected |
◆ writeValuesAppended()
|
protected |
◆ writeValuesAscii()
|
protected |
Friends And Related Symbol Documentation
◆ PvdWriter
◆ TimeseriesWriter
Member Data Documentation
◆ block_size
|
protected |
◆ cellData_
|
protected |
◆ compression_level
|
protected |
◆ compressor_
|
protected |
◆ dataCollector_
|
protected |
◆ datatype_
|
protected |
◆ format_
|
protected |
◆ headertype_
|
protected |
◆ pointData_
|
protected |
The documentation for this class was generated from the following files:
Legal Statements / Impressum | Hosted by TU Dresden & Uni Heidelberg | Generated by
1.9.8