VTK input output for Rectilinear Meshes. More...
Public Member Functions | |
VTKRectilinearGrid () | |
VTKRectilinearGrid (const std::string &, const std::string &) | |
VTKRectilinearGrid (const std::string &, const std::string &, VTKFormat, int, int) | |
VTKRectilinearGrid (const std::string &, const std::string &, VTKFormat, int, int, int) | |
VTKRectilinearGrid (const std::string &, const std::string &, VTKFormat, int, int, int, int) | |
VTKRectilinearGrid (const std::string &, const std::string &, VTKFormat, int, int, int, int, int, int) | |
uint8_t | calcFieldComponents (const VTKField &) const override |
uint64_t | calcFieldEntries (const VTKField &) const override |
uint64_t | calcFieldSize (const VTKField &) const override |
void | readMetaInformation () override |
void | setDimensions (int, int) |
void | setDimensions (int, int, int) |
void | setDimensions (int, int, int, int) |
void | setDimensions (int, int, int, int, int, int) |
void | setGeomData (VTKField &&field) |
template<class T > | |
void | setGeomData (VTKRectilinearField, std::vector< T > &) |
void | setGeomData (VTKRectilinearField, VTKBaseStreamer *=nullptr) |
template<class T > | |
void | setGeomData (VTKRectilinearField, VTKBaseStreamer *=nullptr) |
void | setGlobalDimensions (int, int) |
void | setGlobalDimensions (int, int, int) |
void | setGlobalIndex (const std::vector< extension2D_t > &) |
void | setGlobalIndex (const std::vector< extension3D_t > &) |
void | writeCollection (const std::string &outputName, const std::string &collectionName) const override |
void | writeMetaInformation () const override |
Public Member Functions inherited from bitpit::VTK | |
VTK () | |
VTK (const std::string &, const std::string &) | |
template<class T > | |
VTKField & | addData (const std::string &, std::vector< T > &) |
VTKField & | addData (const std::string &, VTKBaseStreamer *=nullptr) |
template<class T > | |
VTKField & | addData (const std::string &, VTKFieldType, VTKLocation, std::vector< T > &) |
template<class T > | |
VTKField & | addData (const std::string &, VTKFieldType, VTKLocation, VTKBaseStreamer *=nullptr) |
VTKField & | addData (VTKField &&field) |
void | disableData (const std::string &) |
void | enableData (const std::string &) |
const VTKField * | findData (const std::string &name) const |
const VTKField * | findGeomData (const std::string &name) const |
int | getCounter () const |
std::vector< VTKField >::const_iterator | getDataBegin () const |
std::size_t | getDataCount () const |
std::vector< VTKField >::const_iterator | getDataEnd () const |
std::string | getDirectory () const |
std::vector< VTKField >::const_iterator | getGeomDataBegin () const |
std::size_t | getGeomDataCount () const |
std::vector< VTKField >::const_iterator | getGeomDataEnd () const |
const std::string & | getHeaderType () const |
std::string | getName () const |
bool | hasData (const std::string &) const |
void | incrementCounter () |
void | read () |
void | readData () |
void | removeData (const std::string &) |
void | setCodex (VTKFormat) |
void | setCounter (int c_=0) |
void | setDataCodex (VTKFormat) |
void | setDirectory (const std::string &) |
void | setGeomCodex (VTKFormat) |
void | setHeaderType (const std::string &) |
void | setName (const std::string &) |
void | setNames (const std::string &, const std::string &) |
void | setParallel (uint16_t, uint16_t) |
int | unsetCounter () |
void | write (const std::string &, VTKWriteMode writeMode, double time) |
void | write (const std::string &, VTKWriteMode writeMode=VTKWriteMode::NO_INCREMENT) |
void | write (VTKWriteMode writeMode, double time) |
void | write (VTKWriteMode writeMode=VTKWriteMode::DEFAULT) |
void | writeCollection () const |
void | writeCollection (const std::string &outputName) const |
void | writeTimeSeries (const std::string &outputName, const std::string &seriesName, double time) const |
void | writeTimeSeries (const std::string &outputName, double time) const |
void | writeTimeSeries (double time) const |
Protected Member Functions | |
std::string | getExtension () const override |
Protected Member Functions inherited from bitpit::VTK | |
VTKField * | _findData (const std::string &name) |
int | _findFieldIndex (const std::string &name, const std::vector< VTKField > &fields) const |
VTKField * | _findGeomData (const std::string &name) |
void | calcAppendedOffsets () |
void | checkAllFields () |
FileHandler | createCollectionHandler (const std::string &collectionName) const |
virtual std::string | getCollectionExtension () const |
VTKField * | getData (std::size_t id) |
const VTKField * | getData (std::size_t id) const |
std::vector< std::string > | getFieldNames (const std::vector< VTKField > &fields) const |
VTKField * | getGeomData (std::size_t id) |
const VTKField * | getGeomData (std::size_t id) const |
bool | isAppendedActive () const |
bool | isASCIIActive () const |
bool | readDataArray (std::fstream &, VTKField &) const |
void | readDataHeader (std::fstream &) |
void | writeData () |
void | writeDataArray (std::fstream &, const VTKField &) const |
void | writeDataHeader (std::fstream &, bool parallel=false) const |
void | writePDataArray (std::fstream &, const VTKField &) const |
Protected Attributes | |
int | m_dimensions |
extension3D_t | m_globalIndex |
extension3D_t | m_localIndex |
std::vector< extension3D_t > | m_procIndex |
Protected Attributes inherited from bitpit::VTK | |
uint64_t | m_cells |
std::vector< VTKField > | m_data |
VTKFormat | m_dataCodex |
FileHandler | m_fh |
VTKFormat | m_geomCodex |
std::vector< VTKField > | m_geometry |
std::string | m_headerType |
VTKNativeStreamer | m_nativeStreamer |
uint64_t | m_points |
uint16_t | m_procs |
uint16_t | m_rank |
VTK input output for Rectilinear Meshes.
VTKRectilinearGrid provides methods to read and write parallel and serial rectlinear meshes and data. The class is agnostic with respect to the container used for the data and provides an interface through the CRTP mechanism. The numbering of nodes start with 0. Different numbering scheme is not supported.
bitpit::VTKRectilinearGrid::VTKRectilinearGrid | ( | ) |
Default constructor. Allocates three geometry fields called "x_Coord", "y_Coord" and "z_Coord".
Definition at line 46 of file VTKRectilinear.cpp.
bitpit::VTKRectilinearGrid::VTKRectilinearGrid | ( | const std::string & | dir, |
const std::string & | name ) |
Constructor for parallel 3D grid. Calls default constructor and sets provided input information.
Definition at line 76 of file VTKRectilinear.cpp.
bitpit::VTKRectilinearGrid::VTKRectilinearGrid | ( | const std::string & | dir, |
const std::string & | name, | ||
VTKFormat | codex, | ||
int | n1, | ||
int | n2, | ||
int | m1, | ||
int | m2, | ||
int | l1, | ||
int | l2 ) |
Constructor for parallel 3D grid. Calls default constructor and sets provided input information.
[in] | dir | directory of VTK file with final "/" |
[in] | name | name of VTK without suffix |
[in] | codex | codex of data [VTKFormat::ASCII/VTKFormatAPPENDED] |
[in] | n1 | min node index in first direction |
[in] | n2 | max node index in first direction |
[in] | m1 | min node index in second direction |
[in] | m2 | max node index in second direction |
[in] | l1 | min node index in third direction |
[in] | l2 | max node index in third direction |
Definition at line 95 of file VTKRectilinear.cpp.
bitpit::VTKRectilinearGrid::VTKRectilinearGrid | ( | const std::string & | dir, |
const std::string & | name, | ||
VTKFormat | codex, | ||
int | n, | ||
int | m, | ||
int | l ) |
Constructor for serial 3D grids. Min index is set automatically to zero. Calls default constructor and sets provided input information.
[in] | dir | directory of VTK file with final "/" |
[in] | name | name of VTK without suffix |
[in] | codex | codex of data [VTKFormat::ASCII/VTKFormatAPPENDED] |
[in] | n | number of nodes in first direction |
[in] | m | number of nodes in second direction |
[in] | l | number of nodes in third direction |
Definition at line 115 of file VTKRectilinear.cpp.
bitpit::VTKRectilinearGrid::VTKRectilinearGrid | ( | const std::string & | dir, |
const std::string & | name, | ||
VTKFormat | codex, | ||
int | n1, | ||
int | n2, | ||
int | m1, | ||
int | m2 ) |
Constructor for parallel 2D grid. Calls default constructor and sets provided input information.
[in] | dir | directory of VTK file with final "/" |
[in] | name | name of VTK without suffix |
[in] | codex | codex of data [VTKFormat::ASCII/VTKFormatAPPENDED] |
[in] | n1 | min node index in first direction |
[in] | n2 | max node index in first direction |
[in] | m1 | min node index in second direction |
[in] | m2 | max node index in second direction |
Definition at line 135 of file VTKRectilinear.cpp.
bitpit::VTKRectilinearGrid::VTKRectilinearGrid | ( | const std::string & | dir, |
const std::string & | name, | ||
VTKFormat | codex, | ||
int | n, | ||
int | m ) |
Constructor for serial 2D grid. Calls default constructor and sets provided input information.
[in] | dir | directory of VTK file with final "/" |
[in] | name | name of VTK without suffix |
[in] | codex | codex of data [VTKFormat::ASCII/VTKFormatAPPENDED] |
[in] | n | number of nodes in first direction |
[in] | m | number of nodes in second direction |
Definition at line 153 of file VTKRectilinear.cpp.
|
overridevirtual |
Calculates the compnents of a field
[in] | field | field |
Implements bitpit::VTK.
Definition at line 558 of file VTKRectilinear.cpp.
|
overridevirtual |
Calculates the number of entries of a field
[in] | field | field |
Implements bitpit::VTK.
Definition at line 518 of file VTKRectilinear.cpp.
|
overridevirtual |
Calculates the size (in bytes) of a field
[in] | field | field |
Implements bitpit::VTK.
Definition at line 504 of file VTKRectilinear.cpp.
|
overrideprotectedvirtual |
Gets the extension of the VTK file.
Implements bitpit::VTK.
Definition at line 580 of file VTKRectilinear.cpp.
|
overridevirtual |
Reads meta data of VTR file (grid size, data fields, codex, position of data within file). Calls setDimension.
Implements bitpit::VTK.
Definition at line 166 of file VTKRectilinear.cpp.
void bitpit::VTKRectilinearGrid::setDimensions | ( | int | n, |
int | m ) |
sets the dimension for 2D serial grids.
[in] | n | number of nodes in first direction |
[in] | m | number of nodes in second direction |
Definition at line 411 of file VTKRectilinear.cpp.
void bitpit::VTKRectilinearGrid::setDimensions | ( | int | n, |
int | m, | ||
int | l ) |
sets the dimension for 3D serial grids.
[in] | n | number of nodes in first direction |
[in] | m | number of nodes in second direction |
[in] | l | number of nodes in third direction |
Definition at line 387 of file VTKRectilinear.cpp.
void bitpit::VTKRectilinearGrid::setDimensions | ( | int | n1, |
int | n2, | ||
int | m1, | ||
int | m2 ) |
sets the dimension for 2D parallel grids.
[in] | n1 | min node index in first direction |
[in] | n2 | max node index in first direction |
[in] | m1 | min node index in second direction |
[in] | m2 | max node index in second direction |
Definition at line 400 of file VTKRectilinear.cpp.
void bitpit::VTKRectilinearGrid::setDimensions | ( | int | n1, |
int | n2, | ||
int | m1, | ||
int | m2, | ||
int | l1, | ||
int | l2 ) |
sets the dimension for 3D parallel grids.
[in] | n1 | min node index in first direction |
[in] | n2 | max node index in first direction |
[in] | m1 | min node index in second direction |
[in] | m2 | max node index in second direction |
[in] | l1 | min node index in third direction |
[in] | l2 | max node index in third direction |
Definition at line 357 of file VTKRectilinear.cpp.
void bitpit::VTK::setGeomData | ( | VTKField && | field | ) |
Set the specified geometry field.
[in] | field | is the field that will be set |
Implements bitpit::VTK.
void bitpit::VTKRectilinearGrid::setGeomData | ( | VTKRectilinearField | fieldEnum, |
std::vector< T > & | data ) |
void bitpit::VTKRectilinearGrid::setGeomData | ( | VTKRectilinearField | fieldEnum, |
VTKBaseStreamer * | streamer = nullptr ) |
Associates streamer to a geometrical field
[in] | fieldEnum | which geometrical field |
[in] | streamer | VTKBaseStreamer |
Definition at line 440 of file VTKRectilinear.cpp.
void bitpit::VTKRectilinearGrid::setGeomData | ( | VTKRectilinearField | fieldEnum, |
VTKBaseStreamer * | streamer = nullptr ) |
Associates streamer to a geometrical field
T | type of data to be written or read |
[in] | fieldEnum | which geometrical field |
[in] | streamer | VTKBaseStreamer |
void bitpit::VTKRectilinearGrid::setGlobalDimensions | ( | int | I, |
int | J ) |
sets the global 2D grid information for parallel output. Needs to be called by all processes
[in] | I | numer of nodes in first direction |
[in] | J | numer of nodes in second direction |
Definition at line 455 of file VTKRectilinear.cpp.
void bitpit::VTKRectilinearGrid::setGlobalDimensions | ( | int | I, |
int | J, | ||
int | K ) |
sets the global 3D grid information for parallel output. Needs to be called by all processes
[in] | I | numer of nodes in first direction |
[in] | J | numer of nodes in second direction |
[in] | K | numer of nodes in third direction |
Definition at line 424 of file VTKRectilinear.cpp.
void bitpit::VTKRectilinearGrid::setGlobalIndex | ( | const std::vector< extension2D_t > & | loc | ) |
sets the global 2D grid information for parallel output. Needs to be called only by rank 0.
[in] | loc | min I-index, max I-index, min J-index, max J-index for each process |
Definition at line 485 of file VTKRectilinear.cpp.
void bitpit::VTKRectilinearGrid::setGlobalIndex | ( | const std::vector< extension3D_t > & | loc | ) |
sets the global 3D grid information for parallel output. Needs to be called only by rank 0.
[in] | loc | min I-index, max I-index, min J-index, max J-index, min K-index, max K-index for each process |
Definition at line 471 of file VTKRectilinear.cpp.
|
overridevirtual |
Writes collection file for parallel output.
outputName | filename to be set for this output only |
collectionName | collection filename to be set for this output only |
Implements bitpit::VTK.
Definition at line 285 of file VTKRectilinear.cpp.
|
overridevirtual |
Writes entire VTR but the data.
Implements bitpit::VTK.
Definition at line 224 of file VTKRectilinear.cpp.
|
protected |
|
protected |
|
protected |
|
protected |