VTKWriter on a given level grid. More...

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

Inheritance diagram for Dune::LevelVTKWriter< Grid >:
Inheritance graph

List of all members.

Public Types

typedef Dune::VTKFunction< Grid > VTKFunction
typedef shared_ptr
< Dune::VTKFunction< Grid > > 
VTKFunctionPtr

Public Member Functions

 LevelVTKWriter (const Grid &grid, int level, VTK::DataMode dm=VTK::conforming)
 Construct a VTK writer for a certain level of a given grid.
void addCellData (const VTKFunctionPtr &p)
 Add a grid function that lives on the cells of the grid to the visualization.
void addCellData (VTKFunction *p)
 Add a grid function that lives on the cells of the grid to the visualization.
void addCellData (const V &v, const std::string &name, int ncomps=1)
 Add a grid function (represented by container) that lives on the cells of the grid to the visualization.
void addVertexData (VTKFunction *p)
 Add a grid function that lives on the vertices of the grid to the visualization.
void addVertexData (const VTKFunctionPtr &p)
 Add a grid function that lives on the vertices of the grid to the visualization.
void addVertexData (const V &v, const std::string &name, int ncomps=1)
 Add a grid function (represented by container) that lives on the vertices of the grid to the visualization output.
void clear ()
 clear list of registered functions
std::string write (const std::string &name, VTK::OutputType type=VTK::ascii)
 write output (interface might change later)
std::string pwrite (const std::string &name, const std::string &path, const std::string &extendpath, VTK::OutputType type=VTK::ascii)
 write output (interface might change later)

Protected Types

typedef std::list
< VTKFunctionPtr >
::const_iterator 
FunctionIterator

Protected Member Functions

CellIterator cellBegin () const
CellIterator cellEnd () const
VertexIterator vertexBegin () const
VertexIterator vertexEnd () const
CornerIterator cornerBegin () const
CornerIterator cornerEnd () const
std::string write (const std::string &name, VTK::OutputType type, const int commRank, const int commSize)
 write output (interface might change later)
std::string pwrite (const std::string &name, const std::string &path, const std::string &extendpath, VTK::OutputType ot, const int commRank, const int commSize)
 write output; interface might change later
std::string getParallelPieceName (const std::string &name, const std::string &path, int commRank, int commSize) const
 return name of a parallel piece file
std::string getParallelHeaderName (const std::string &name, const std::string &path, int commSize) const
 return name of a parallel header file
std::string getSerialPieceName (const std::string &name, const std::string &path) const
 return name of a serial piece file
std::string getFormatString () const
std::string getTypeString () const
virtual void countEntities (int &nvertices, int &ncells, int &ncorners)
 count the vertices, cells and corners
virtual void writeCellData (VTK::VTUWriter &writer)
 write cell data
virtual void writeVertexData (VTK::VTUWriter &writer)
 write vertex data
virtual void writeGridPoints (VTK::VTUWriter &writer)
 write the positions of vertices
virtual void writeGridCells (VTK::VTUWriter &writer)
 write the connectivity array

Protected Attributes

std::list< VTKFunctionPtrcelldata
std::list< VTKFunctionPtrvertexdata
int ncells
int nvertices
int ncorners
VTK::OutputType outputtype

Detailed Description

template<class Grid>
class Dune::LevelVTKWriter< Grid >

VTKWriter on a given level grid.


Member Typedef Documentation

typedef std::list<VTKFunctionPtr>::const_iterator Dune::VTKWriter< Grid::LevelGridView >::FunctionIterator [protected, inherited]
typedef shared_ptr< Dune::VTKFunction<Grid> > Dune::VTKWriter< Grid::LevelGridView >::VTKFunctionPtr [inherited]

Constructor & Destructor Documentation

template<class Grid >
Dune::LevelVTKWriter< Grid >::LevelVTKWriter ( const Grid &  grid,
int  level,
VTK::DataMode  dm = VTK::conforming 
) [inline]

Construct a VTK writer for a certain level of a given grid.

Deprecated:

Member Function Documentation

void Dune::VTKWriter< Grid::LevelGridView >::addCellData ( const VTKFunctionPtr p  )  [inline, inherited]

Add a grid function that lives on the cells of the grid to the visualization.

Parameters:
p Dune::shared_ptr to the function to visualize
void Dune::VTKWriter< Grid::LevelGridView >::addCellData ( VTKFunction p  )  [inline, inherited]

Add a grid function that lives on the cells of the grid to the visualization.

Parameters:
p The function to visualize. The VTKWriter object will take ownership of the VTKFunction *p and delete it when it's done.
void Dune::VTKWriter< Grid::LevelGridView >::addCellData ( const V &  v,
const std::string &  name,
int  ncomps = 1 
) [inline, inherited]

Add a grid function (represented by container) that lives on the cells of the grid to the visualization.

The container has to have random access via operator[] (e. g. std::vector). The value of the grid function for an arbitrary element will be accessed by calling operator[] with the index (corresponding with the grid view) of the element. For vector valued data all components for an element are assumed to be consecutive.

Parameters:
v The container with the values of the grid function for each cell.
name A name to identify the grid function.
ncomps Number of components (default is 1).
void Dune::VTKWriter< Grid::LevelGridView >::addVertexData ( VTKFunction p  )  [inline, inherited]

Add a grid function that lives on the vertices of the grid to the visualization.

Parameters:
p The function to visualize. The VTKWriter object will take ownership of the VTKFunction *p and delete it when it's done.
void Dune::VTKWriter< Grid::LevelGridView >::addVertexData ( const VTKFunctionPtr p  )  [inline, inherited]

Add a grid function that lives on the vertices of the grid to the visualization.

Parameters:
p Dune::shared_ptr to the function to visualize
void Dune::VTKWriter< Grid::LevelGridView >::addVertexData ( const V &  v,
const std::string &  name,
int  ncomps = 1 
) [inline, inherited]

Add a grid function (represented by container) that lives on the vertices of the grid to the visualization output.

The container has to have random access via operator[] (e. g. std::vector). The value of the grid function for an arbitrary element will be accessed by calling operator[] with the index (corresponding to the grid view) of the vertex. For vector valued data all components for a vertex are assumed to be consecutive.

Parameters:
v The container with the values of the grid function for each cell.
name A name to identify the grid function.
ncomps Number of components (default is 1).
CellIterator Dune::VTKWriter< Grid::LevelGridView >::cellBegin (  )  const [inline, protected, inherited]
CellIterator Dune::VTKWriter< Grid::LevelGridView >::cellEnd (  )  const [inline, protected, inherited]
void Dune::VTKWriter< Grid::LevelGridView >::clear (  )  [inline, inherited]

clear list of registered functions

CornerIterator Dune::VTKWriter< Grid::LevelGridView >::cornerBegin (  )  const [inline, protected, inherited]
CornerIterator Dune::VTKWriter< Grid::LevelGridView >::cornerEnd (  )  const [inline, protected, inherited]
virtual void Dune::VTKWriter< Grid::LevelGridView >::countEntities ( int &  nvertices,
int &  ncells,
int &  ncorners 
) [inline, protected, virtual, inherited]

count the vertices, cells and corners

std::string Dune::VTKWriter< Grid::LevelGridView >::getFormatString (  )  const [inline, protected, inherited]
std::string Dune::VTKWriter< Grid::LevelGridView >::getParallelHeaderName ( const std::string &  name,
const std::string &  path,
int  commSize 
) const [inline, protected, inherited]

return name of a parallel header file

Parameters:
name Base name of the VTK output. This should be without any directory parts and without a filename extension.
path Directory 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.
commSize Number of processes writing a parallel vtk output.
std::string Dune::VTKWriter< Grid::LevelGridView >::getParallelPieceName ( const std::string &  name,
const std::string &  path,
int  commRank,
int  commSize 
) const [inline, protected, inherited]

return name of a parallel piece file

Parameters:
name Base name of the VTK output. This should be without any directory parts and without a filename extension.
path Directory 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.
commRank Rank of the process to generate a piece name for.
commSize Number of processes writing a parallel vtk output.
std::string Dune::VTKWriter< Grid::LevelGridView >::getSerialPieceName ( const std::string &  name,
const std::string &  path 
) const [inline, protected, inherited]

return name of a serial piece file

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

Parameters:
name Base name of the VTK output. This should be without any directory parts and without a filename extension.
path Directory 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.
std::string Dune::VTKWriter< Grid::LevelGridView >::getTypeString (  )  const [inline, protected, inherited]
std::string Dune::VTKWriter< Grid::LevelGridView >::pwrite ( const std::string &  name,
const std::string &  path,
const std::string &  extendpath,
VTK::OutputType  type = VTK::ascii 
) [inline, inherited]

write output (interface might change later)

"pwrite" means "path write" (i.e. write somewhere else than the current directory). The "p" does not mean this method has a monopoly on parallel writing, the regular write(const std::string &, VTK::OutputType) method can do that just fine.

Parameters:
name Base 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.
path Directory where to put the parallel collection (.pvtu/.pvtp) file. If it is relative, it is taken realtive to the current directory.
extendpath Directory 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.
type How 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:
NotImplemented Extendpath is absolute but path is relative.
IOError Failed to open a file.
std::string Dune::VTKWriter< Grid::LevelGridView >::pwrite ( const std::string &  name,
const std::string &  path,
const std::string &  extendpath,
VTK::OutputType  ot,
const int  commRank,
const int  commSize 
) [inline, protected, inherited]

write output; interface might change later

Parameters:
name Base 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.
path Directory where to put the parallel collection (.pvtu/.pvtp) file. If it is relative, it is taken realtive to the current directory.
extendpath Directory 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.
ot How to encode the data in the file.
commRank Rank of the current process.
commSize Number of processes taking part in this write operation.
Note:
Currently, extendpath may not be absolute unless path is absolute, because that would require the value of the current directory.
Exceptions:
NotImplemented Extendpath is absolute but path is relative.
IOError Failed to open a file.
VertexIterator Dune::VTKWriter< Grid::LevelGridView >::vertexBegin (  )  const [inline, protected, inherited]
VertexIterator Dune::VTKWriter< Grid::LevelGridView >::vertexEnd (  )  const [inline, protected, inherited]
std::string Dune::VTKWriter< Grid::LevelGridView >::write ( const std::string &  name,
VTK::OutputType  type,
const int  commRank,
const int  commSize 
) [inline, protected, inherited]

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:
name Base name of the output files. This should not contain any directory part and no filename extensions.
type How to encode the data in the file.
commRank Rank of the current process.
commSize Number of processes taking part in this write operation.
std::string Dune::VTKWriter< Grid::LevelGridView >::write ( const std::string &  name,
VTK::OutputType  type = VTK::ascii 
) [inline, inherited]

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:
[in] name basic name to write (may not contain a path)
[in] type type of output (e.g,, ASCII) (optional)
virtual void Dune::VTKWriter< Grid::LevelGridView >::writeCellData ( VTK::VTUWriter writer  )  [inline, protected, virtual, inherited]

write cell data

virtual void Dune::VTKWriter< Grid::LevelGridView >::writeGridCells ( VTK::VTUWriter writer  )  [inline, protected, virtual, inherited]

write the connectivity array

virtual void Dune::VTKWriter< Grid::LevelGridView >::writeGridPoints ( VTK::VTUWriter writer  )  [inline, protected, virtual, inherited]

write the positions of vertices

virtual void Dune::VTKWriter< Grid::LevelGridView >::writeVertexData ( VTK::VTUWriter writer  )  [inline, protected, virtual, inherited]

write vertex data


Member Data Documentation

std::list<VTKFunctionPtr> Dune::VTKWriter< Grid::LevelGridView >::celldata [protected, inherited]
int Dune::VTKWriter< Grid::LevelGridView >::ncells [protected, inherited]
int Dune::VTKWriter< Grid::LevelGridView >::ncorners [protected, inherited]
int Dune::VTKWriter< Grid::LevelGridView >::nvertices [protected, inherited]
std::list<VTKFunctionPtr> Dune::VTKWriter< Grid::LevelGridView >::vertexdata [protected, inherited]

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

Generated on Fri Apr 29 2011 with Doxygen (ver 1.7.1) [doxygen-log,error-log].