KASKADE 7 development version
|
A class to create a grid and load coefficients from a VTK file. More...
#include <vtkreader.hh>
A class to create a grid and load coefficients from a VTK file.
A low-level interface to load VTK files. VTKReader will create a grid for you. From this grid you need to construct an appropriate space and variables yourself. Then you can copy the data from the VTK file into your variables. Example:
Currently supported: 2D and 3D simplical grids, Orders 0, 1, 2, continuous and discontinuous data. DataArrays must be in ascii or binary format.
Definition at line 93 of file vtkreader.hh.
Classes | |
struct | FunctionInfo |
Information about a data set loaded from a file. More... | |
Public Types | |
enum | Flags { noInterpolation = 0 , allowOrderMismatch = 0x1 , allowContinuityMismatch = 0x2 , allowCoefficientDimensionMismatch = 0x4 , allowEverything = allowOrderMismatch | allowContinuityMismatch | allowCoefficientDimensionMismatch } |
Options for getCoefficients() . More... | |
Public Member Functions | |
VTKReader ()=default | |
Default constructor. More... | |
VTKReader (std::string const &filename) | |
Constructor that loads a VTK file. More... | |
void | load (std::string const &filename) |
Loads a VTK file. More... | |
void | loadOnlyData (std::string const &filename) |
Loads only coefficient data, omitting the grid. This can be used for time series. More... | |
template<class Grid > | |
std::unique_ptr< Grid > | createGrid () |
Create a grid from a previously loaded VTK file. More... | |
template<class Grid , class Deformation > | |
std::unique_ptr< Grid > | createGrid (Deformation const &deformation) |
template<class VariableSet > | |
void | getCoefficients (VariableSet &varSet, int interpolationFlags=noInterpolation) const |
Copy the data from the current VTK file into the coefficients of your FEFunctions. More... | |
template<class FSE > | |
void | getCoefficients (std::string const &functionName, FSE &fse, int interpolationFlags=noInterpolation) const |
Copy to the coefficients of a single FSE. More... | |
File contents information | |
std::vector< std::string > | functionNames () const |
Lists the functions stored in the file by their name. More... | |
FunctionInfo | getFunctionInfo (std::string const &functionName) const |
Information about the expected type of function. Meet these criteria to copy values into your variable without interpolation. More... | |
Options for getCoefficients()
.
Enumerator | |
---|---|
noInterpolation | |
allowOrderMismatch | |
allowContinuityMismatch | |
allowCoefficientDimensionMismatch | |
allowEverything |
Definition at line 99 of file vtkreader.hh.
|
default |
Default constructor.
Kaskade::VTKReader::VTKReader | ( | std::string const & | filename | ) |
Constructor that loads a VTK file.
filename | The filename including the ending. |
std::unique_ptr< Grid > Kaskade::VTKReader::createGrid |
Create a grid from a previously loaded VTK file.
Grid | The type of grid to be created. The grid's dimension must match the dimension of shapes in the file. Note that the right dimension is not necessarily the dimension of points in the VTK file. Only cell types matter: triangles mean 2D, tetrahedrons mean 3D. |
unique_ptr
that can be used to construct a GridManager
. Definition at line 659 of file vtkreader.hh.
std::unique_ptr< Grid > Kaskade::VTKReader::createGrid | ( | Deformation const & | deformation | ) |
Definition at line 667 of file vtkreader.hh.
std::vector< std::string > Kaskade::VTKReader::functionNames | ( | ) | const |
Lists the functions stored in the file by their name.
void Kaskade::VTKReader::getCoefficients | ( | std::string const & | functionName, |
FSE & | fse, | ||
int | interpolationFlags = noInterpolation |
||
) | const |
Copy to the coefficients of a single FSE.
functionName | The name of the data set to be copied (as in the VTK file). |
Definition at line 785 of file vtkreader.hh.
void Kaskade::VTKReader::getCoefficients | ( | VariableSet & | varSet, |
int | interpolationFlags = noInterpolation |
||
) | const |
Copy the data from the current VTK file into the coefficients of your FEFunctions.
The following heuristics are used to determine if coefficients can be copied:
You can circumvent these restrictions by passing
interpolationFlags. | If you are trying to load a file written by writeVTK() , specify order and set data mode to inferred when saving the file. |
varSet | A VariableSet to receive the data. Variables are assumed to live on the grid created by createGrid() . This is not checked. |
Definition at line 770 of file vtkreader.hh.
FunctionInfo Kaskade::VTKReader::getFunctionInfo | ( | std::string const & | functionName | ) | const |
Information about the expected type of function. Meet these criteria to copy values into your variable without interpolation.
functionName | The name of the data set as in the VTK file. |
FunctionInfo
object that can be printed by cout
. void Kaskade::VTKReader::load | ( | std::string const & | filename | ) |
Loads a VTK file.
filename | The filename including the ending. |
void Kaskade::VTKReader::loadOnlyData | ( | std::string const & | filename | ) |
Loads only coefficient data, omitting the grid. This can be used for time series.
filename | The filename including the ending. |