Abstract exporter of data in the vtk format.
More...
#include </home/wojtek/Projects/BEM/bempp-sven/bempp/lib/grid/vtk_writer.hpp>
|
virtual | ~VtkWriter () |
| Destructor.
|
|
void | addCellData (const arma::Mat< double > &data, const std::string &name) |
| Add a grid function (represented by a container) that lives on the cells of the grid to the visualization output. More...
|
|
void | addCellData (const arma::Mat< float > &data, const std::string &name) |
|
void | addVertexData (const arma::Mat< double > &data, const std::string &name) |
| Add a grid function (represented by a container) that lives on the vertices of the grid to the visualization output. More...
|
|
void | addVertexData (const arma::Mat< float > &data, const std::string &name) |
|
virtual void | clear ()=0 |
| Clear the list of registered functions.
|
|
virtual std::string | write (const std::string &name, OutputType type=ASCII)=0 |
| Write output (interface might change later). More...
|
|
virtual std::string | pwrite (const std::string &name, const std::string &path, const std::string &extendpath, OutputType type=ASCII)=0 |
| Write output (interface might change later). More...
|
|
|
virtual void | addCellDataDoubleImpl (const arma::Mat< double > &data, const std::string &name)=0 |
|
virtual void | addCellDataFloatImpl (const arma::Mat< float > &data, const std::string &name)=0 |
|
virtual void | addVertexDataDoubleImpl (const arma::Mat< double > &data, const std::string &name)=0 |
|
virtual void | addVertexDataFloatImpl (const arma::Mat< float > &data, const std::string &name)=0 |
|
Abstract exporter of data in the vtk format.
Exports data (living on cells or vertices of a grid) to a file suitable for easy visualization with The Visualization Toolkit (VTK).
Instances of concrete subclasses of this class can be created by GridView::vtkWriter().
How data should be stored in a VTK file.
Enumerator |
---|
ASCII |
Output to the file is in ascii.
|
BASE_64 |
Output to the file is in inline base64 binary.
|
APPENDED_RAW |
Output to the file is in appended raw binary.
|
APPENDED_BASE_64 |
Output to the file is in appended base64 binary.
|
void Bempp::VtkWriter::addCellData |
( |
const arma::Mat< double > & |
data, |
|
|
const std::string & |
name |
|
) |
| |
|
inline |
Add a grid function (represented by a container) that lives on the cells of the grid to the visualization output.
- Parameters
-
data | Matrix whose (m, n)th entry contains the value of the mth component of the grid function in the nth cell. |
name | Name to identify the grid function. |
void Bempp::VtkWriter::addCellData |
( |
const arma::Mat< float > & |
data, |
|
|
const std::string & |
name |
|
) |
| |
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void Bempp::VtkWriter::addVertexData |
( |
const arma::Mat< double > & |
data, |
|
|
const std::string & |
name |
|
) |
| |
|
inline |
Add a grid function (represented by a container) that lives on the vertices of the grid to the visualization output.
- Parameters
-
data | Matrix whose (m, n)th entry contains the value of the mth component of the grid function at the nth vertex. |
name | Name to identify the grid function. |
void Bempp::VtkWriter::addVertexData |
( |
const arma::Mat< float > & |
data, |
|
|
const std::string & |
name |
|
) |
| |
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
virtual std::string Bempp::VtkWriter::pwrite |
( |
const std::string & |
name, |
|
|
const std::string & |
path, |
|
|
const std::string & |
extendpath, |
|
|
OutputType |
type = ASCII |
|
) |
| |
|
pure virtual |
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 &, OutputType) method can do that just fine.
- Parameters
-
name | Base name of the output files. This should not contain any directory part or filename extensions. It will be used both for the piece file of each process and 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. |
- Returns
- Name of the created file.
- Note
- Currently, extendpath may not be absolute unless path is absolute, because that would require the value of the current directory.
- Exceptions
-
Dune::NotImplemented | Extendpath is absolute but path is relative. |
Dune::IOError | Failed to open a file. |
Implemented in Bempp::ConcreteVtkWriter< DuneGridView >.
virtual std::string Bempp::VtkWriter::write |
( |
const std::string & |
name, |
|
|
OutputType |
type = ASCII |
|
) |
| |
|
pure virtual |
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). |
- Returns
- Name of the created file.
Implemented in Bempp::ConcreteVtkWriter< DuneGridView >.
The documentation for this class was generated from the following file: