A vtk file reader using tinyxml2 as xml backend.
More...
#include <dumux/io/vtk/vtkreader.hh>
A vtk file reader using tinyxml2 as xml backend.
|
enum class | DataType { cellData
, pointData
} |
| The data array types. More...
|
|
using | Data = std::unordered_map< std::string, std::vector< double > > |
| the cell / point data type for point data read from a grid file More...
|
|
|
| VTKReader (const std::string &fileName) |
| The contructor creates a tinyxml2::XMLDocument from file. More...
|
|
template<class Container > |
Container | readData (const std::string &name, const DataType &type) const |
| read data from the vtk file to a container, e.g. std::vector<double> More...
|
|
template<class Grid > |
std::unique_ptr< Grid > | readGrid (bool verbose=false) const |
| Read a grid from a vtk/vtu/vtp file, ignoring cell and point data. More...
|
|
template<class Grid > |
std::unique_ptr< Grid > | readGrid (Dune::GridFactory< Grid > &factory, bool verbose=false) const |
| Read a grid from a vtk/vtu/vtp file, ignoring cell and point data. More...
|
|
template<class Grid > |
std::unique_ptr< Grid > | readGrid (Dune::GridFactory< Grid > &factory, Data &cellData, Data &pointData, bool verbose=false) const |
| Read a grid from a vtk/vtu/vtp file, reading all cell and point data. More...
|
|
◆ Data
the cell / point data type for point data read from a grid file
◆ DataType
The data array types.
Enumerator |
---|
cellData | |
pointData | |
◆ VTKReader()
Dumux::VTKReader::VTKReader |
( |
const std::string & |
fileName | ) |
|
|
inlineexplicit |
The contructor creates a tinyxml2::XMLDocument from file.
◆ readData()
template<class Container >
Container Dumux::VTKReader::readData |
( |
const std::string & |
name, |
|
|
const DataType & |
type |
|
) |
| const |
|
inline |
read data from the vtk file to a container, e.g. std::vector<double>
- Template Parameters
-
Container | a container type that has begin(), end(), push_back(), e.g. std::vector<> |
- Parameters
-
name | the name attribute of the data array to read |
type | the data array type |
◆ readGrid() [1/3]
template<class Grid >
std::unique_ptr< Grid > Dumux::VTKReader::readGrid |
( |
bool |
verbose = false | ) |
const |
|
inline |
Read a grid from a vtk/vtu/vtp file, ignoring cell and point data.
- Parameters
-
verbose | if the output should be verbose |
◆ readGrid() [2/3]
template<class Grid >
std::unique_ptr< Grid > Dumux::VTKReader::readGrid |
( |
Dune::GridFactory< Grid > & |
factory, |
|
|
bool |
verbose = false |
|
) |
| const |
|
inline |
Read a grid from a vtk/vtu/vtp file, ignoring cell and point data.
- Note
- use this signature if the factory might be needed outside to interpret the data via the factory's insertion indices
- Parameters
-
verbose | if the output should be verbose |
factory | the (emtpy) grid factory |
◆ readGrid() [3/3]
template<class Grid >
std::unique_ptr< Grid > Dumux::VTKReader::readGrid |
( |
Dune::GridFactory< Grid > & |
factory, |
|
|
Data & |
cellData, |
|
|
Data & |
pointData, |
|
|
bool |
verbose = false |
|
) |
| const |
|
inline |
Read a grid from a vtk/vtu/vtp file, reading all cell and point data.
- Note
- the factory will be needed outside to interpret the data via the factory's insertion indices
- Parameters
-
factory | the (emtpy) grid factory |
cellData | the cell data arrays to be filled |
pointData | the point data arrays to be filled |
verbose | if the output should be verbose |
The documentation for this class was generated from the following file: