dune-grid 2.9.0
Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
Dune::VTK::BasicWriter< IteratorFactory > Class Template Reference

#include <dune/grid/io/file/vtk/basicwriter.hh>

Inheritance diagram for Dune::VTK::BasicWriter< IteratorFactory >:
Inheritance graph

Public Types

typedef FunctionWriterBase< Cell > FunctionWriter
 

Public Member Functions

 BasicWriter (const IteratorFactory &factory_)
 
void addCellData (const std::shared_ptr< FunctionWriter > &writer)
 
void addPointData (const std::shared_ptr< FunctionWriter > &writer)
 
void clear ()
 
void writePiece (const std::string &filename, OutputType outputType)
 
void writeCollection (const std::string name, const std::string &piecename, const std::string &piecepath)
 write header file in parallel case to stream More...
 
std::string getParallelPieceName (const std::string &name, const std::string &path, int rank) const
 return name of a parallel piece file More...
 
std::string getParallelHeaderName (const std::string &name, const std::string &path) const
 return name of a parallel header file More...
 
std::string getSerialPieceName (const std::string &name, const std::string &path) const
 return name of a serial piece file More...
 
std::string pwrite (const std::string &name, const std::string &path, const std::string &extendpath, OutputType outputType)
 write output; interface might change later More...
 
std::string write (const std::string &name, OutputType outputType)
 write output (interface might change later) More...
 

Protected Member Functions

void writeCellFunction (VTUWriter &vtuWriter, FunctionWriter &functionWriter, unsigned ncells) const
 
void writePointFunction (VTUWriter &vtuWriter, FunctionWriter &functionWriter, unsigned npoints) const
 
void writeCornerFunction (VTUWriter &vtuWriter, FunctionWriter &functionWriter, unsigned ncorners) const
 
void writeCellData (VTUWriter &vtuWriter, unsigned ncells) const
 
void writePointData (VTUWriter &vtuWriter, unsigned npoints) const
 
void writeGrid (VTUWriter &vtuWriter, unsigned ncells, unsigned npoints, unsigned ncorners)
 
void writeAll (VTUWriter &vtuWriter, unsigned ncells, unsigned npoints, unsigned ncorners)
 

Static Protected Member Functions

static std::string getFirstScalar (const WriterList &data)
 
static std::string getFirstVector (const WriterList &data)
 

Member Typedef Documentation

◆ FunctionWriter

template<typename IteratorFactory >
typedef FunctionWriterBase<Cell> Dune::VTK::BasicWriter< IteratorFactory >::FunctionWriter

Constructor & Destructor Documentation

◆ BasicWriter()

template<typename IteratorFactory >
Dune::VTK::BasicWriter< IteratorFactory >::BasicWriter ( const IteratorFactory &  factory_)
inline

Member Function Documentation

◆ addCellData()

template<typename IteratorFactory >
void Dune::VTK::BasicWriter< IteratorFactory >::addCellData ( const std::shared_ptr< FunctionWriter > &  writer)
inline

◆ addPointData()

template<typename IteratorFactory >
void Dune::VTK::BasicWriter< IteratorFactory >::addPointData ( const std::shared_ptr< FunctionWriter > &  writer)
inline

◆ clear()

template<typename IteratorFactory >
void Dune::VTK::BasicWriter< IteratorFactory >::clear ( )
inline

◆ getFirstScalar()

template<typename IteratorFactory >
static std::string Dune::VTK::BasicWriter< IteratorFactory >::getFirstScalar ( const WriterList &  data)
inlinestaticprotected

◆ getFirstVector()

template<typename IteratorFactory >
static std::string Dune::VTK::BasicWriter< IteratorFactory >::getFirstVector ( const WriterList &  data)
inlinestaticprotected

◆ getParallelHeaderName()

template<typename IteratorFactory >
std::string Dune::VTK::BasicWriter< IteratorFactory >::getParallelHeaderName ( const std::string &  name,
const std::string &  path 
) const
inline

return name of a parallel header file

Parameters
nameBase name of the VTK output. This should be without any directory parts and without a filename extension.
pathDirectory part of the resulting header name. May be empty, in which case the resulting name will not have a directory part. If non-empty, may or may not have a trailing '/'. If a trailing slash is missing, one is appended implicitly.

◆ getParallelPieceName()

template<typename IteratorFactory >
std::string Dune::VTK::BasicWriter< IteratorFactory >::getParallelPieceName ( const std::string &  name,
const std::string &  path,
int  rank 
) const
inline

return name of a parallel piece file

Parameters
nameBase name of the VTK output. This should be without any directory parts and without a filename extension.
pathDirectory part of the resulting piece name. May be empty, in which case the resulting name will not have a directory part. If non-empty, may or may not have a trailing '/'. If a trailing slash is missing, one is appended implicitly.
rankRank of the process to generate a piece name for.

◆ getSerialPieceName()

template<typename IteratorFactory >
std::string Dune::VTK::BasicWriter< IteratorFactory >::getSerialPieceName ( const std::string &  name,
const std::string &  path 
) const
inline

return name of a serial piece file

This is similar to getParallelPieceName, but skips the prefixes for commSize ("s####:") and commRank ("p####:").

Parameters
nameBase name of the VTK output. This should be without any directory parts and without a filename extension.
pathDirectory part of the resulting piece name. May be empty, in which case the resulting name will not have a directory part. If non-empty, may or may not have a trailing '/'. If a trailing slash is missing, one is appended implicitly.

◆ pwrite()

template<typename IteratorFactory >
std::string Dune::VTK::BasicWriter< IteratorFactory >::pwrite ( const std::string &  name,
const std::string &  path,
const std::string &  extendpath,
OutputType  outputType 
)
inline

write output; interface might change later

Parameters
nameBase name of the output files. This should not contain any directory part and not filename extensions. It will be used both for each processes piece as well as the parallel collection file.
pathDirectory where to put the parallel collection (.pvtu/.pvtp) file. If it is relative, it is taken realtive to the current directory.
extendpathDirectory where to put the piece file (.vtu/.vtp) of this process. If it is relative, it is taken relative to the directory denoted by path.
outputTypeHow to encode the data in the file.
Note
Currently, extendpath may not be absolute unless path is absolute, because that would require the value of the current directory.
Exceptions
NotImplementedExtendpath is absolute but path is relative.
IOErrorFailed to open a file.
MPIGuardErrorAn exception was thrown during this method in one of the other processes.

◆ write()

template<typename IteratorFactory >
std::string Dune::VTK::BasicWriter< IteratorFactory >::write ( const std::string &  name,
OutputType  outputType 
)
inline

write output (interface might change later)

This method can be used in parallel as well as in serial programs. For serial runs (commSize=1) it chooses other names without the "s####:p####:" prefix for the .vtu/.vtp files and omits writing of the .pvtu/pvtp file however. For parallel runs (commSize > 1) it is the same as a call to pwrite() with path="" and extendpath="".

Parameters
nameBase name of the output files. This should not contain any directory part and no filename extensions.
outputTypeHow to encode the data in the file.

◆ writeAll()

template<typename IteratorFactory >
void Dune::VTK::BasicWriter< IteratorFactory >::writeAll ( VTUWriter vtuWriter,
unsigned  ncells,
unsigned  npoints,
unsigned  ncorners 
)
inlineprotected

◆ writeCellData()

template<typename IteratorFactory >
void Dune::VTK::BasicWriter< IteratorFactory >::writeCellData ( VTUWriter vtuWriter,
unsigned  ncells 
) const
inlineprotected

◆ writeCellFunction()

template<typename IteratorFactory >
void Dune::VTK::BasicWriter< IteratorFactory >::writeCellFunction ( VTUWriter vtuWriter,
FunctionWriter functionWriter,
unsigned  ncells 
) const
inlineprotected

◆ writeCollection()

template<typename IteratorFactory >
void Dune::VTK::BasicWriter< IteratorFactory >::writeCollection ( const std::string  name,
const std::string &  piecename,
const std::string &  piecepath 
)
inline

write header file in parallel case to stream

Writes a .pvtu/.pvtp file for a collection of concurrently written .vtu/.vtp files.

Parameters
nameName of file to write contents to,
piecenameBase name of the pieces. Should not contain a directory part or filename extension.
piecepathDirectory part of the pieces. Since paraview does not support absolute paths in parallel collection files, this should be a path relative to the directory the collection file resides in. A trailing '/' is optional, and an empty value "" is equivalent to the value "." except it will look nicer in the collection file.

◆ writeCornerFunction()

template<typename IteratorFactory >
void Dune::VTK::BasicWriter< IteratorFactory >::writeCornerFunction ( VTUWriter vtuWriter,
FunctionWriter functionWriter,
unsigned  ncorners 
) const
inlineprotected

◆ writeGrid()

template<typename IteratorFactory >
void Dune::VTK::BasicWriter< IteratorFactory >::writeGrid ( VTUWriter vtuWriter,
unsigned  ncells,
unsigned  npoints,
unsigned  ncorners 
)
inlineprotected

◆ writePiece()

template<typename IteratorFactory >
void Dune::VTK::BasicWriter< IteratorFactory >::writePiece ( const std::string &  filename,
OutputType  outputType 
)
inline

◆ writePointData()

template<typename IteratorFactory >
void Dune::VTK::BasicWriter< IteratorFactory >::writePointData ( VTUWriter vtuWriter,
unsigned  npoints 
) const
inlineprotected

◆ writePointFunction()

template<typename IteratorFactory >
void Dune::VTK::BasicWriter< IteratorFactory >::writePointFunction ( VTUWriter vtuWriter,
FunctionWriter functionWriter,
unsigned  npoints 
) const
inlineprotected

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