dune-grid 2.9.0
|
Writer for the output of subsampled grid functions in the vtk format. More...
#include <dune/grid/io/file/vtk/subsamplingvtkwriter.hh>
Public Types | |
typedef Dune::VTKFunction< GridView > | VTKFunction |
Public Member Functions | |
SubsamplingVTKWriter (const GridView &gridView, Dune::RefinementIntervals intervals_, bool coerceToSimplex_=false, VTK::Precision coordPrecision=VTK::Precision::float32) | |
Construct a SubsamplingVTKWriter working on a specific GridView. More... | |
void | addVertexData (const std::shared_ptr< const VTKFunction > &p) |
Add a grid function that lives on the vertices of the grid to the visualization. More... | |
template<typename F > | |
void | addVertexData (F &&f, VTK::FieldInfo vtkFieldInfo) |
Add a function by sampling it on the grid vertices. More... | |
template<class Container > | |
void | addVertexData (const Container &v, const std::string &name, int ncomps=1, VTK::Precision prec=VTK::Precision::float32) |
Add a grid function (represented by container) that lives on the vertices of the grid to the visualization output. More... | |
void | addCellData (const std::shared_ptr< const VTKFunction > &p) |
Add a grid function that lives on the cells of the grid to the visualization. More... | |
template<typename F > | |
void | addCellData (F &&f, VTK::FieldInfo vtkFieldInfo) |
Add a function by sampling it on the element centers. More... | |
template<class Container > | |
void | addCellData (const Container &v, const std::string &name, int ncomps=1, VTK::Precision prec=VTK::Precision::float32) |
Add a grid function (represented by container) that lives on the cells of the grid to the visualization. More... | |
void | clear () |
clear list of registered functions More... | |
VTK::Precision | coordPrecision () const |
get the precision with which coordinates are written out More... | |
std::string | write (const std::string &name, VTK::OutputType type=VTK::ascii) |
write output (interface might change later) More... | |
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) More... | |
Protected Member Functions | |
virtual void | countEntities (int &nvertices_, int &ncells_, int &ncorners_) |
count the vertices, cells and corners More... | |
virtual void | writeCellData (VTK::VTUWriter &writer) |
write cell data More... | |
virtual void | writeVertexData (VTK::VTUWriter &writer) |
write vertex data More... | |
virtual void | writeGridPoints (VTK::VTUWriter &writer) |
write the positions of vertices More... | |
virtual void | writeGridCells (VTK::VTUWriter &writer) |
write the connectivity array More... | |
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) More... | |
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 More... | |
std::string | getParallelPieceName (const std::string &name, const std::string &path, int commRank, int commSize) const |
return name of a parallel piece file (or header name) More... | |
std::string | getParallelHeaderName (const std::string &name, const std::string &path, int commSize) 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 | getFormatString () const |
std::string | getTypeString () const |
template<typename T > | |
std::tuple< std::string, std::string > | getDataNames (const T &data) const |
template<typename Data , typename Iterator > | |
void | writeData (VTK::VTUWriter &writer, const Data &data, const Iterator begin, const Iterator end, int nentries) |
bool | checkForPolyhedralCells () const |
virtual void | writeCellFaces (VTK::VTUWriter &writer) |
write the connectivity array More... | |
template<class CornerIterator , class IndexSet , class T > | |
void | fillFaceVertices (CornerIterator it, const CornerIterator end, const IndexSet &indexSet, std::vector< T > &faces, std::vector< T > &faceOffsets) |
Static Protected Member Functions | |
template<class Entity , class IndexSet , class T > | |
static void | fillFacesForElement (const Entity &element, const IndexSet &indexSet, const std::vector< T > &vertices, T &offset, std::vector< T > &faces, std::vector< T > &faceOffsets) |
Protected Attributes | |
GridView | gridView_ |
Writer for the output of subsampled grid functions in the vtk format.
Writes arbitrary grid functions (living on cells or vertices of a grid) to a file suitable for easy visualization with The Visualization Toolkit (VTK). In contrast to the regular VTKWriter, this Writer allows subsampling of the elements via VirtualRefinement. The SubSamplingVTKWriter always writes nonconforming data.
|
inherited |
|
inlineexplicit |
Construct a SubsamplingVTKWriter working on a specific GridView.
gridView | The gridView the grid functions live on. (E. g. a LevelGridView.) |
intervals_ | A wrapper for the number of refined intervals on one axis as returned by either refinementIntervals() or refinementLevels(). |
coerceToSimplex_ | Set this to true to always triangulate elements into simplices, even where it's not necessary (i.e. for hypercubes). |
coordPrecision | the precision in which to write out coordinates |
The datamode is always nonconforming.
|
inline |
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 to the index from the MGMC mapper on the grid view) of the element. For vector valued data all components for an element are assumed to be consecutive.
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). |
|
inline |
Add a grid function that lives on the cells of the grid to the visualization.
p | std::shared_ptr to the function to visualize |
|
inline |
Add a function by sampling it on the element centers.
f | The function to be written to the file |
The object f can be one of several things. Depending on what it is exactly, its object life-time is influenced in different ways:
The previous paragraph actually refers to parts of the dune-functions interface, and you may want to read up on that if you want to write functions to VTK.
|
inline |
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 index from the MGMC mapper on the grid view) of the vertex. For vector valued data all components for a vertex are assumed to be consecutive.
v | The container with the values of the grid function for each vertex. |
name | A name to identify the grid function. |
ncomps | Number of components (default is 1). |
|
inline |
Add a grid function that lives on the vertices of the grid to the visualization.
p | std::shared_ptr to the function to visualize |
|
inline |
Add a function by sampling it on the grid vertices.
f | The function to be written to the file |
The object f can be one of several things. Depending on what it is exactly, its object life-time is influenced in different ways:
The previous paragraph actually refers to parts of the dune-functions interface, and you may want to read up on that if you want to write functions to VTK.
|
inlineprotectedinherited |
|
inlineinherited |
clear list of registered functions
|
inlineinherited |
get the precision with which coordinates are written out
|
inlineprotectedinherited |
|
inlineprotectedinherited |
|
protectedvirtual |
count the vertices, cells and corners
Reimplemented from Dune::VTKWriter< GridView >.
|
inlinestaticprotectedinherited |
|
inlineprotectedinherited |
|
inlineprotectedinherited |
|
inlineprotectedinherited |
|
inlineprotectedinherited |
return name of a parallel header file
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. |
|
inlineprotectedinherited |
return name of a parallel piece file (or header name)
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. if (-1) then the header is created. |
commSize | Number of processes writing a parallel vtk output. |
|
inlineprotectedinherited |
return name of a serial piece file
This is similar to getParallelPieceName, but skips the prefixes for commSize ("s####-") and commRank ("p####-").
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. |
|
inlineprotectedinherited |
|
inlineprotectedinherited |
write output; interface might change later
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. |
NotImplemented | Extendpath is absolute but path is relative. |
IOError | Failed to open a file. |
|
inlineinherited |
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.
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 relative 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. |
NotImplemented | Extendpath is absolute but path is relative. |
IOError | Failed to open a file. |
|
inlineprotectedinherited |
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 name and path constructed from a given filename possibly containing a path, and extendpath="".
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. |
|
inlineinherited |
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 name and path constructed from a given filename possibly containing a path, and extendpath="".
[in] | name | basic name to write (may not contain a path) |
[in] | type | type of output (e.g,, ASCII) (optional) |
|
protectedvirtual |
write cell data
Reimplemented from Dune::VTKWriter< GridView >.
|
inlineprotectedvirtualinherited |
write the connectivity array
|
inlineprotectedinherited |
|
protectedvirtual |
write the connectivity array
Reimplemented from Dune::VTKWriter< GridView >.
|
protectedvirtual |
write the positions of vertices
Reimplemented from Dune::VTKWriter< GridView >.
|
protectedvirtual |
write vertex data
Reimplemented from Dune::VTKWriter< GridView >.
|
protectedinherited |