|
dune-vtk
0.2
|
File-Reader for Vtk unstructured .vtu files. More...
#include <dune/vtk/vtkreader.hh>

Public Types | |
| using | GridCreator = GC |
| using | PointGridFunction = GridFunction< Vtk::PointContext > |
| GridFunction representing the data stored on the points in the file. More... | |
| using | CellGridFunction = GridFunction< Vtk::CellContext > |
| GridFunction representing the data stored on the cells in the file. More... | |
Public Member Functions | |
| template<class... Args, std::enable_if_t< std::is_constructible< GridCreator, Args... >::value, int > = 0> | |
| VtkReader (Args &&... args) | |
| Constructor. Creates a new GridCreator with the passed factory. More... | |
| VtkReader (GridCreator &creator) | |
| Constructor. Stores the references in a non-destroying shared_ptr. More... | |
| VtkReader (std::shared_ptr< GridCreator > creator) | |
| Constructor. Stores the shared_ptr. More... | |
| void | read (std::string const &filename, bool fillCreator=true) |
Read the grid from file with filename into the GridCreator. More... | |
| GridCreator & | gridCreator () |
| Obtains the creator of the reader. More... | |
| std::unique_ptr< Grid > | createGrid () const |
| GridFunction< Vtk::PointContext > | getPointData (std::string const &name) const |
| std::vector< DataArrayAttributes > | getPointDataAttributes () const |
| GridFunction< Vtk::CellContext > | getCellData (std::string const &name) const |
| std::vector< DataArrayAttributes > | getCellDataAttributes () const |
| std::vector< std::string > const & | pieces () const |
| Return the filenames of parallel pieces. More... | |
| template<class FloatType , class HeaderType > | |
| void | readCellDataAppended (MetaType< FloatType >, MetaType< HeaderType >, std::ifstream &input, std::string id) |
| template<class FloatType , class HeaderType > | |
| void | readPointDataAppended (MetaType< FloatType >, MetaType< HeaderType >, std::ifstream &input, std::string id) |
| template<class FloatType , class HeaderType > | |
| void | readPointsAppended (MetaType< FloatType >, MetaType< HeaderType >, std::ifstream &input) |
| template<class HeaderType > | |
| void | readCellsAppended (MetaType< HeaderType >, std::ifstream &input) |
| void | readSerialFileFromStream (std::ifstream &input, bool create=true) |
| Read the grid from an input stream, referring to a .vtu file, into the GridFactory factory_. More... | |
| void | readParallelFileFromStream (std::ifstream &input, int rank, int size, bool create=true) |
| Read the grid from and input stream, referring to a .pvtu file, into the GridFactory factory_. More... | |
| void | fillGridCreator (bool insertPieces=true) |
Static Public Member Functions | |
| static std::unique_ptr< Grid > | createGridFromFile (const std::string &filename, Args &&... args) |
| static void | fillFactory (GridFactory< Grid > &factory, const std::string &filename, Args &&... args) |
Static Protected Member Functions | |
| static std::unique_ptr< Grid > | createGridFromFileImpl (const std::string &filename, Args &&... args) |
| static void | fillFactoryImpl (GridFactory< Grid > &, const std::string &, Args &&...) |
File-Reader for Vtk unstructured .vtu files.
Reads .vtu files and constructs a grid from the cells stored in the file Additionally, stored data can be read.
NOTE: Assumption on the file structure: Each XML tag must be on a separate line.
| Grid | The type of the grid to construct. |
| GC | GridCreator policy type to control what to pass to a grid factory with data given from the file. [ContinuousGridCreator] |
| FieldType | Type of the components of the data to extract from the file [default: double] |
| using Dune::VtkReader< Grid, GC, FieldType >::CellGridFunction = GridFunction<Vtk::CellContext> |
GridFunction representing the data stored on the cells in the file.
| using Dune::VtkReader< Grid, GC, FieldType >::GridCreator = GC |
| using Dune::VtkReader< Grid, GC, FieldType >::PointGridFunction = GridFunction<Vtk::PointContext> |
GridFunction representing the data stored on the points in the file.
|
inlineexplicit |
Constructor. Creates a new GridCreator with the passed factory.
| args... | Either pass a GridFactory by reference or shared_ptr, or a list of arguments passed to the constructor of a Dune::GridFactory (typically and empty parameter list). See the constructor of GridCreatorInterface and the GridCreator passed to this reader. |
|
inlineexplicit |
Constructor. Stores the references in a non-destroying shared_ptr.
|
inlineexplicit |
Constructor. Stores the shared_ptr.
|
inline |
Construct the actual grid using the GridCreator [[expects: read_ == true]]
|
inlinestaticinherited |
Reads the grid from a file with filename and returns a unique_ptr to the created grid. Redirects to concrete implementation of derivated class.
|
inlinestaticprotectedinherited |
|
inlinestaticinherited |
Reads the grid from a file with filename into a grid-factory. Redirects to concrete implementation of derivated class.
|
inlinestaticprotectedinherited |
| void Dune::VtkReader< Grid, Creator, Field >::fillGridCreator | ( | bool | insertPieces = true | ) |
Insert all internal data to the GridCreator NOTE: requires an aforegoing call to read()
|
inline |
Construct a grid-function representing the cell-data with the given name [[expects: read_ == true]]
|
inline |
Return a vector of DataArrayAttributes for all CELL_DATA blocks [[expects: read_ == true]]
|
inline |
Construct a grid-function representing the point-data with the given name [[expects: read_ == true]]
|
inline |
Return a vector of DataArrayAttributes for all POINT_DATA blocks [[expects: read_ == true]]
|
inline |
Obtains the creator of the reader.
|
inline |
Return the filenames of parallel pieces.
| void Dune::VtkReader< Grid, Creator, Field >::read | ( | std::string const & | filename, |
| bool | fillCreator = true |
||
| ) |
Read the grid from file with filename into the GridCreator.
This function fills internal data containers representing the information from the passed file.
| filename | The name of the input file |
| fillCreator | If false, only fill internal data structures, if true, pass the internal data to the GridCreator. [true] |
| void Dune::VtkReader< Grid, GC, FieldType >::readCellDataAppended | ( | MetaType< FloatType > | , |
| MetaType< HeaderType > | , | ||
| std::ifstream & | input, | ||
| std::string | id | ||
| ) |
| void Dune::VtkReader< Grid, GC, FieldType >::readCellsAppended | ( | MetaType< HeaderType > | , |
| std::ifstream & | input | ||
| ) |
| void Dune::VtkReader< Grid, Creator, Field >::readParallelFileFromStream | ( | std::ifstream & | input, |
| int | rank, | ||
| int | size, | ||
| bool | create = true |
||
| ) |
Read the grid from and input stream, referring to a .pvtu file, into the GridFactory factory_.
| input | A STL input stream to read the VTK file from. |
| create | If false, only fill internal data structures, if true, also create the grid. [true] |
| void Dune::VtkReader< Grid, GC, FieldType >::readPointDataAppended | ( | MetaType< FloatType > | , |
| MetaType< HeaderType > | , | ||
| std::ifstream & | input, | ||
| std::string | id | ||
| ) |
| void Dune::VtkReader< Grid, GC, FieldType >::readPointsAppended | ( | MetaType< FloatType > | , |
| MetaType< HeaderType > | , | ||
| std::ifstream & | input | ||
| ) |
| void Dune::VtkReader< Grid, Creator, Field >::readSerialFileFromStream | ( | std::ifstream & | input, |
| bool | create = true |
||
| ) |
Read the grid from an input stream, referring to a .vtu file, into the GridFactory factory_.
Advanced read methods
| input | A STL input stream to read the VTK file from. |
| create | If false, only fill internal data structures, if true, also create the grid. [true] |