dune-vtk  0.2
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
Dune::VtkUnstructuredGridWriter< GridView, DataCollector > Class Template Reference

File-Writer for VTK .vtu files. More...

#include <dune/vtk/writers/vtkunstructuredgridwriter.hh>

Inheritance diagram for Dune::VtkUnstructuredGridWriter< GridView, DataCollector >:
Inheritance graph

Public Types

using GridView = GridView
 
using DataCollector = Vtk::ContinuousDataCollector< GridView >
 

Public Member Functions

virtual std::string write (std::string const &fn, std::optional< std::string > dir={}) const override
 Write the attached data to the file. More...
 
VtkWriterInterfaceaddPointData (Function &&fct, Args &&... args)
 Attach point data to the writer. More...
 
VtkWriterInterfaceaddCellData (Function &&fct, Args &&... args)
 Attach cell data to the writer. More...
 
void setFormat (Vtk::FormatTypes format)
 
void setDatatype (Vtk::DataTypes datatype)
 Sets the global datatype used for coordinates and other global float values. More...
 
void setHeadertype (Vtk::DataTypes datatype)
 Sets the integer type used in binary data headers. More...
 
void setCompressor (Vtk::CompressorTypes compressor, int level=-1)
 

Protected Types

enum  PositionTypes
 
using VtkFunction = Dune::Vtk::Function< GridView >
 

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
 
std::uint64_t writeValuesAppended (std::ofstream &out, std::vector< FloatType > const &values) const
 
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. More...
 
std::string getEndian () const
 
std::string getFileExtension () const
 
Vtk::FormatTypes getFormat () const
 
Vtk::DataTypes getDatatype () const
 
auto comm () const
 

Protected Attributes

Vtk::CompressorTypes compressor_
 
std::size_t const block_size
 
int compression_level
 

Detailed Description

template<class GridView, class DataCollector = Vtk::ContinuousDataCollector<GridView>>
class Dune::VtkUnstructuredGridWriter< GridView, DataCollector >

File-Writer for VTK .vtu files.

Requirement:

Member Typedef Documentation

◆ DataCollector

◆ GridView

◆ VtkFunction

Member Enumeration Documentation

◆ PositionTypes

enum Dune::VtkWriterInterface::PositionTypes
protectedinherited

Member Function Documentation

◆ addCellData()

VtkWriterInterface& Dune::VtkWriterInterface< GridView , Vtk::ContinuousDataCollector< GridView > >::addCellData ( Function &&  fct,
Args &&...  args 
)
inlineinherited

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::Function. Additional argument for output datatype and number of components can be passed. See Vtk::Function Constructor for possible arguments.

Parameters
fctA GridFunction, LocalFunction, or Dune::VTKFunction
args...Additional arguments, like name, numComponents, dataType or Vtk::FieldInfo

◆ addPointData()

VtkWriterInterface& Dune::VtkWriterInterface< GridView , Vtk::ContinuousDataCollector< GridView > >::addPointData ( Function &&  fct,
Args &&...  args 
)
inlineinherited

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::Function. Additional argument for output datatype and number of components can be passed. See Vtk::Function Constructor for possible arguments.

Parameters
fctA GridFunction, LocalFunction, or Dune::VTKFunction
args...Additional arguments, like name, numComponents, dataType or Vtk::FieldInfo

◆ comm()

auto Dune::VtkWriterInterface< GridView , Vtk::ContinuousDataCollector< GridView > >::comm ( ) const
inlineprotectedinherited

◆ getDatatype()

Vtk::DataTypes Dune::VtkWriterInterface< GridView , Vtk::ContinuousDataCollector< GridView > >::getDatatype ( ) const
inlineprotectedinherited

◆ getEndian()

std::string Dune::VtkWriterInterface< GridView , Vtk::ContinuousDataCollector< GridView > >::getEndian ( ) const
inlineprotectedinherited

◆ getFileExtension()

std::string Dune::VtkWriterInterface< GridView , Vtk::ContinuousDataCollector< GridView > >::getFileExtension ( ) const
inlineprotectedinherited

◆ getFormat()

Vtk::FormatTypes Dune::VtkWriterInterface< GridView , Vtk::ContinuousDataCollector< GridView > >::getFormat ( ) const
inlineprotectedinherited

◆ getNames()

std::string Dune::VtkWriterInterface< GridView , Vtk::ContinuousDataCollector< GridView > >::getNames ( std::vector< VtkFunction > const &  data) const
protectedinherited

Return PointData/CellData attributes for the name of the first scalar/vector/tensor DataArray.

◆ setCompressor()

void Dune::VtkWriterInterface< GridView , Vtk::ContinuousDataCollector< GridView > >::setCompressor ( Vtk::CompressorTypes  compressor,
int  level = -1 
)
inlineinherited

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()

void Dune::VtkWriterInterface< GridView , Vtk::ContinuousDataCollector< GridView > >::setDatatype ( Vtk::DataTypes  datatype)
inlineinherited

Sets the global datatype used for coordinates and other global float values.

◆ setFormat()

void Dune::VtkWriterInterface< GridView , Vtk::ContinuousDataCollector< GridView > >::setFormat ( Vtk::FormatTypes  format)
inlineinherited

◆ setHeadertype()

void Dune::VtkWriterInterface< GridView , Vtk::ContinuousDataCollector< GridView > >::setHeadertype ( Vtk::DataTypes  datatype)
inlineinherited

Sets the integer type used in binary data headers.

◆ write()

std::string Dune::VtkWriterInterface< GridView , Vtk::ContinuousDataCollector< GridView > >::write ( std::string const &  fn,
std::optional< std::string >  dir = {} 
) const
overridevirtualinherited

Write the attached data to the file.

Parameters
fnFilename of the VTK file. May contain a directory and any file extension.
dirThe optional parameter specifies the directory of the partition files for parallel writes.
Returns
File name that is actually written.

Implements Dune::Vtk::FileWriter.

◆ writeAppended()

void Dune::VtkWriterInterface< GridView , Vtk::ContinuousDataCollector< GridView > >::writeAppended ( std::ofstream &  out,
std::vector< pos_type > const &  offsets 
) const
protectedinherited

◆ writeData()

void Dune::VtkWriterInterface< GridView , Vtk::ContinuousDataCollector< GridView > >::writeData ( std::ofstream &  out,
std::vector< pos_type > &  offsets,
VtkFunction const &  fct,
PositionTypes  type,
std::optional< std::size_t >  timestep = {} 
) const
protectedinherited

◆ writeDataAppended()

void Dune::VtkWriterInterface< GridView , Vtk::ContinuousDataCollector< GridView > >::writeDataAppended ( std::ofstream &  out,
std::vector< std::uint64_t > &  blocks 
) const
protectedinherited

◆ writeHeader()

void Dune::VtkWriterInterface< GridView , Vtk::ContinuousDataCollector< GridView > >::writeHeader ( std::ofstream &  out,
std::string const &  type 
) const
protectedinherited

◆ writePoints()

void Dune::VtkWriterInterface< GridView , Vtk::ContinuousDataCollector< GridView > >::writePoints ( std::ofstream &  out,
std::vector< pos_type > &  offsets,
std::optional< std::size_t >  timestep = {} 
) const
protectedinherited

◆ writeValuesAppended()

std::uint64_t Dune::VtkWriterInterface< GridView , Vtk::ContinuousDataCollector< GridView > >::writeValuesAppended ( std::ofstream &  out,
std::vector< FloatType > const &  values 
) const
protectedinherited

◆ writeValuesAscii()

void Dune::VtkWriterInterface< GridView , Vtk::ContinuousDataCollector< GridView > >::writeValuesAscii ( std::ofstream &  out,
std::vector< T > const &  values 
) const
protectedinherited

Member Data Documentation

◆ block_size

std::size_t const Dune::VtkWriterInterface< GridView , Vtk::ContinuousDataCollector< GridView > >::block_size
protectedinherited

◆ compression_level

int Dune::VtkWriterInterface< GridView , Vtk::ContinuousDataCollector< GridView > >::compression_level
protectedinherited

◆ compressor_


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