A base class for VTK input output. More...


Public Member Functions | |
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 () |
virtual void | readMetaInformation ()=0 |
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 | setGeomData (VTKField &&field) |
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 |
virtual void | writeCollection (const std::string &outputName, const std::string &collectionName) const =0 |
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 | |
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 () |
virtual uint8_t | calcFieldComponents (const VTKField &) const =0 |
virtual uint64_t | calcFieldEntries (const VTKField &) const =0 |
virtual uint64_t | calcFieldSize (const VTKField &) const =0 |
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 |
virtual std::string | getExtension () const =0 |
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 |
virtual void | writeMetaInformation () const =0 |
void | writePDataArray (std::fstream &, const VTKField &) const |
Protected Attributes | |
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 |
Detailed Description
A base class for VTK input output.
VTK provides all basic methods for reading and writing VTK files. ASCII and APPENDED mode are supported.
Constructor & Destructor Documentation
◆ VTK() [1/2]
bitpit::VTK::VTK | ( | ) |
◆ VTK() [2/2]
bitpit::VTK::VTK | ( | const std::string & | dir, |
const std::string & | name ) |
Member Function Documentation
◆ _findData()
|
protected |
◆ _findFieldIndex()
|
protected |
◆ _findGeomData()
|
protected |
◆ addData() [1/5]
VTKField & bitpit::VTK::addData | ( | const std::string & | name, |
std::vector< T > & | data ) |
◆ addData() [2/5]
VTKField & bitpit::VTK::addData | ( | const std::string & | name, |
VTKBaseStreamer * | streamer = nullptr ) |
Add user data for input or output. Codification will be set according to default value [appended] or to value set by VTK::setDataCodex( VTKFormat ) or VTK::setCodex( VTKFormat )
- Parameters
-
[in] name name of field [in] streamer data streamer
◆ addData() [3/5]
VTKField & bitpit::VTK::addData | ( | const std::string & | name, |
VTKFieldType | comp, | ||
VTKLocation | loc, | ||
std::vector< T > & | data ) |
Add user data for input or output. Codification will be set according to default value [appended] or to value set by VTK::setDataCodex( VTKFormat ) or VTK::setCodex( VTKFormat )
- Template Parameters
-
T type of std::vector<>
- Parameters
-
[in] name name of field [in] comp type of data field [ VTKFieldType::SCALAR/VECTOR/TENSOR ] [in] loc location of data [VTKLocation::CELL/VTKLocationPOINT] [in] data data
◆ addData() [4/5]
VTKField & bitpit::VTK::addData | ( | const std::string & | name, |
VTKFieldType | comp, | ||
VTKLocation | loc, | ||
VTKBaseStreamer * | streamer = nullptr ) |
Add user data for input or output. Codification will be set according to default value [appended] or to value set by VTK::setDataCodex( VTKFormat ) or VTK::setCodex( VTKFormat )
- Template Parameters
-
T type of data to be written or read
- Parameters
-
[in] name name of field [in] comp type of data field [ VTKFieldType::SCALAR/VECTOR/TENSOR ] [in] loc location of data [VTKLocation::CELL/VTKLocationPOINT] [in] streamer data streamer
◆ addData() [5/5]
Add user data for input or output. Codification will be set according to default value [appended] or to value set by VTK::setDataCodex( VTKFormat ) or VTK::setCodex( VTKFormat )
- Parameters
-
[in] field is the field that will be added
◆ calcAppendedOffsets()
|
protected |
◆ calcFieldComponents()
|
protectedpure virtual |
Implemented in bitpit::VTKRectilinearGrid, and bitpit::VTKUnstructuredGrid.
◆ calcFieldEntries()
|
protectedpure virtual |
Implemented in bitpit::VTKRectilinearGrid, and bitpit::VTKUnstructuredGrid.
◆ calcFieldSize()
|
protectedpure virtual |
Implemented in bitpit::VTKRectilinearGrid, and bitpit::VTKUnstructuredGrid.
◆ checkAllFields()
|
protected |
◆ createCollectionHandler()
|
protected |
◆ disableData()
void bitpit::VTK::disableData | ( | const std::string & | name | ) |
◆ enableData()
void bitpit::VTK::enableData | ( | const std::string & | name | ) |
◆ findData()
const VTKField * bitpit::VTK::findData | ( | const std::string & | name | ) | const |
◆ findGeomData()
const VTKField * bitpit::VTK::findGeomData | ( | const std::string & | name | ) | const |
◆ getCollectionExtension()
|
protectedvirtual |
◆ getCounter()
int bitpit::VTK::getCounter | ( | ) | const |
◆ getData() [1/2]
|
protected |
◆ getData() [2/2]
|
protected |
◆ getDataBegin()
std::vector< VTKField >::const_iterator bitpit::VTK::getDataBegin | ( | ) | const |
◆ getDataCount()
std::size_t bitpit::VTK::getDataCount | ( | ) | const |
◆ getDataEnd()
std::vector< VTKField >::const_iterator bitpit::VTK::getDataEnd | ( | ) | const |
◆ getDirectory()
std::string bitpit::VTK::getDirectory | ( | ) | const |
◆ getExtension()
|
protectedpure virtual |
Implemented in bitpit::VTKRectilinearGrid, and bitpit::VTKUnstructuredGrid.
◆ getFieldNames()
|
protected |
◆ getGeomData() [1/2]
|
protected |
◆ getGeomData() [2/2]
|
protected |
◆ getGeomDataBegin()
std::vector< VTKField >::const_iterator bitpit::VTK::getGeomDataBegin | ( | ) | const |
◆ getGeomDataCount()
std::size_t bitpit::VTK::getGeomDataCount | ( | ) | const |
◆ getGeomDataEnd()
std::vector< VTKField >::const_iterator bitpit::VTK::getGeomDataEnd | ( | ) | const |
◆ getHeaderType()
const std::string & bitpit::VTK::getHeaderType | ( | ) | const |
◆ getName()
std::string bitpit::VTK::getName | ( | ) | const |
◆ hasData()
bool bitpit::VTK::hasData | ( | const std::string & | name | ) | const |
◆ incrementCounter()
void bitpit::VTK::incrementCounter | ( | ) |
◆ isAppendedActive()
|
protected |
◆ isASCIIActive()
|
protected |
◆ read()
void bitpit::VTK::read | ( | ) |
◆ readData()
void bitpit::VTK::readData | ( | ) |
◆ readDataArray()
|
protected |
◆ readDataHeader()
|
protected |
◆ readMetaInformation()
|
pure virtual |
Implemented in bitpit::VTKRectilinearGrid, and bitpit::VTKUnstructuredGrid.
◆ removeData()
void bitpit::VTK::removeData | ( | const std::string & | name | ) |
◆ setCodex()
void bitpit::VTK::setCodex | ( | VTKFormat | cod | ) |
◆ setCounter()
void bitpit::VTK::setCounter | ( | int | counter = 0 | ) |
◆ setDataCodex()
void bitpit::VTK::setDataCodex | ( | VTKFormat | cod | ) |
◆ setDirectory()
void bitpit::VTK::setDirectory | ( | const std::string & | dir | ) |
◆ setGeomCodex()
void bitpit::VTK::setGeomCodex | ( | VTKFormat | cod | ) |
◆ setGeomData()
void bitpit::VTK::setGeomData | ( | VTKField && | field | ) |
Set the specified geometry field.
- Parameters
-
[in] field is the field that will be set
Implemented in bitpit::VTKRectilinearGrid, and bitpit::VTKUnstructuredGrid.
◆ setHeaderType()
void bitpit::VTK::setHeaderType | ( | const std::string & | st | ) |
◆ setName()
void bitpit::VTK::setName | ( | const std::string & | name | ) |
set name for VTK file
- Parameters
-
[in] name file name without suffix
- Examples
- volcartesian_example_00001.cpp.
◆ setNames()
void bitpit::VTK::setNames | ( | const std::string & | dir, |
const std::string & | name ) |
◆ setParallel()
void bitpit::VTK::setParallel | ( | uint16_t | procs, |
uint16_t | rank ) |
◆ unsetCounter()
int bitpit::VTK::unsetCounter | ( | ) |
◆ write() [1/4]
void bitpit::VTK::write | ( | const std::string & | name, |
VTKWriteMode | writeMode, | ||
double | time ) |
Writes entire VTK file (headers and data).
- Parameters
-
[in] name filename to be set for this output only [in] writeMode if writeMode == VTKWriteMode::DEFAULT the default write setting will be used according to setCounter(); if writeMode == VTKWriteMode::NO_SERIES no time stamp will be added and the counter will not be increased; if writeMode == VTKWriteMode::NO_INCREMENT the output file will have the same time stamp like the previous one ; [in] time is the time associated with the file
◆ write() [2/4]
void bitpit::VTK::write | ( | const std::string & | name, |
VTKWriteMode | writeMode = VTKWriteMode::NO_INCREMENT ) |
Writes entire VTK file (headers and data).
- Parameters
-
[in] name filename to be set for this output only [in] writeMode if writeMode == VTKWriteMode::DEFAULT the default write setting will be used according to setCounter(); if writeMode == VTKWriteMode::NO_SERIES no time stamp will be added and the counter will not be increased; if writeMode == VTKWriteMode::NO_INCREMENT the output file will have the same time stamp like the previous one ;
◆ write() [3/4]
void bitpit::VTK::write | ( | VTKWriteMode | writeMode, |
double | time ) |
Writes entire VTK file (headers and data).
- Parameters
-
[in] writeMode if writeMode == VTKWriteMode::DEFAULT the default write setting will be used according to setCounter(); if writeMode == VTKWriteMode::NO_SERIES no time stamp will be added and the counter will not be increased; if writeMode == VTKWriteMode::NO_INCREMENT the output file will have the same time stamp like the previous one ; [in] time is the time associated with the file
◆ write() [4/4]
void bitpit::VTK::write | ( | VTKWriteMode | writeMode = VTKWriteMode::DEFAULT | ) |
Writes entire VTK file (headers and data).
- Parameters
-
[in] writeMode if writeMode == VTKWriteMode::DEFAULT the default write setting will be used according to setCounter(); if writeMode == VTKWriteMode::NO_SERIES no time stamp will be added and the counter will not be increased; if writeMode == VTKWriteMode::NO_INCREMENT the output file will have the same time stamp like the previous one ;
◆ writeCollection() [1/3]
void bitpit::VTK::writeCollection | ( | ) | const |
◆ writeCollection() [2/3]
void bitpit::VTK::writeCollection | ( | const std::string & | outputName | ) | const |
◆ writeCollection() [3/3]
|
pure virtual |
Implemented in bitpit::VTKRectilinearGrid, and bitpit::VTKUnstructuredGrid.
◆ writeData()
|
protected |
◆ writeDataArray()
|
protected |
◆ writeDataHeader()
|
protected |
◆ writeMetaInformation()
|
protectedpure virtual |
Implemented in bitpit::VTKRectilinearGrid, and bitpit::VTKUnstructuredGrid.
◆ writePDataArray()
|
protected |
◆ writeTimeSeries() [1/3]
void bitpit::VTK::writeTimeSeries | ( | const std::string & | outputName, |
const std::string & | seriesName, | ||
double | time ) const |
Writes time series file.
If the file doesn't exists or if this is the first data set of the series (i.e., the counter is equal to zero), the time series will be written from scratch and will contain only the current data set. Otherwise, the existing time series will be inspected and the current data set will be either added at the end of the series or will it will replace the entry with the same file name it such an entry exists.
- Parameters
-
outputName filename to be set for this output only seriesName series filename to be set for this output only time is the time associated with the data set
◆ writeTimeSeries() [2/3]
void bitpit::VTK::writeTimeSeries | ( | const std::string & | outputName, |
double | time ) const |
Writes time series file.
If the file doesn't exists or if this is the first data set of the series (i.e., the counter is equal to zero), the time series will be written from scratch and will contain only the current data set. Otherwise, the existing time series will be inspected and the current data set will be either added at the end of the series or will it will replace the entry with the same file name it such an entry exists.
- Parameters
-
outputName filename to be set for this output only time is the time associated with the data set
◆ writeTimeSeries() [3/3]
void bitpit::VTK::writeTimeSeries | ( | double | time | ) | const |
Writes time series file.
If the file doesn't exists or if this is the first data set of the series (i.e., the counter is equal to zero), the time series will be written from scratch and will contain only the current data set. Otherwise, the existing time series will be inspected and the current data set will be either added at the end of the series or will it will replace the entry with the same file name it such an entry exists.
- Parameters
-
time is the time associated with the data set
Member Data Documentation
◆ m_cells
◆ m_data
|
protected |
◆ m_dataCodex
◆ m_fh
|
protected |
◆ m_geomCodex
◆ m_geometry
|
protected |
◆ m_headerType
|
protected |
◆ m_nativeStreamer
|
protected |
◆ m_points
◆ m_procs
|
protected |
◆ m_rank
The documentation for this interface was generated from the following files:
