VTK input output for Unstructured Meshes. More...
Classes | |
class | HomogeneousInfoStreamer |
Public Member Functions | |
VTKUnstructuredGrid (const std::string &, const std::string &, VTKElementType elementType=VTKElementType::UNDEFINED) | |
VTKUnstructuredGrid (VTKElementType elementType=VTKElementType::UNDEFINED) | |
uint64_t | calcConnectivityEntries () const |
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 (uint64_t, uint64_t, uint64_t nconn=0, uint64_t nfacestream=0) |
void | setGeomData (VTKField &&field) |
template<class T > | |
void | setGeomData (VTKUnstructuredField, std::vector< T > &) |
void | setGeomData (VTKUnstructuredField, VTKBaseStreamer *=nullptr) |
template<class T > | |
void | setGeomData (VTKUnstructuredField, VTKBaseStreamer *=nullptr) |
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 |
uint64_t | readConnectivityEntries () |
uint64_t | readFaceStreamEntries () |
void | setElementType (VTKElementType) |
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 | |
VTKElementType | m_elementType |
HomogeneousInfoStreamer | m_homogeneousInfoStreamer |
uint64_t | m_nConnectivityEntries |
uint64_t | m_nFaceStreamEntries |
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 Unstructured Meshes.
VTKUnstructuredGrid provides methods to read and write parallel and serial unstructured meshes and data. The class is agnostic with respect to the container used for the data and provides an interface through the CRTP mechanism.
bitpit::VTKUnstructuredGrid::VTKUnstructuredGrid | ( | VTKElementType | elementType = VTKElementType::UNDEFINED | ) |
Default constructor. Allocates four geometry fields called "Points"(Float64), "offsets"(Int32), "types"(Int32) and "connectivity"(Int32).
[in] | elementType | Type of elements in the grid |
Definition at line 133 of file VTKUnstructured.cpp.
bitpit::VTKUnstructuredGrid::VTKUnstructuredGrid | ( | const std::string & | dir, |
const std::string & | name, | ||
VTKElementType | elementType = VTKElementType::UNDEFINED ) |
Constructor. sets input parameters and calls default constructor
[in] | dir | Directory of vtk file with final "/" |
[in] | name | Name of vtk file without suffix |
[in] | elementType | Type of elements in the grid |
Definition at line 176 of file VTKUnstructured.cpp.
uint64_t bitpit::VTKUnstructuredGrid::calcConnectivityEntries | ( | ) | const |
Returns the size of the connectivity information
Definition at line 632 of file VTKUnstructured.cpp.
|
overridevirtual |
Calculates the compnents of a field
[in] | field | field |
Implements bitpit::VTK.
Definition at line 705 of file VTKUnstructured.cpp.
|
overridevirtual |
Calculates the number of entries of a field
[in] | field | field |
Implements bitpit::VTK.
Definition at line 656 of file VTKUnstructured.cpp.
|
overridevirtual |
Calculates the size (in bytes) of a field
[in] | field | field |
Implements bitpit::VTK.
Definition at line 642 of file VTKUnstructured.cpp.
|
overrideprotectedvirtual |
Gets the extension of the VTK file.
Implements bitpit::VTK.
Definition at line 758 of file VTKUnstructured.cpp.
|
protected |
Reads "type" information of existing grid and calculates the correspondng connectivity size.
Definition at line 289 of file VTKUnstructured.cpp.
|
protected |
Reading the total number of entries in the face stream of the vtu file
Definition at line 370 of file VTKUnstructured.cpp.
|
overridevirtual |
Reads meta data of VTU file (grid size, data fields, codex, position of data within file). Calls setDimension.
Implements bitpit::VTK.
Definition at line 564 of file VTKUnstructured.cpp.
void bitpit::VTKUnstructuredGrid::setDimensions | ( | uint64_t | ncells, |
uint64_t | npoints, | ||
uint64_t | nconn = 0, | ||
uint64_t | nfacestream = 0 ) |
Sets the size of the unstructured grid.
If VTKUnstructuredGrid::setElementType(VTKElelementType) has been called the size of the connectivity can be omitted and the connectivity size will be calculated within the method.
When writing a parallel mesh, even if there is just a single process that needs to write the face stream information, than all the processes need to write the face stream as well (even the processes whose local cells don't require the face steam). It's up to the caller of this function to ensure that all processes will provide the correct size of the face stream.
[in] | ncells | number of cells |
[in] | npoints | number of points |
[in] | nconn | size of the connectivity information; |
[in] | nfacestream | size of the face stream information; |
Definition at line 227 of file VTKUnstructured.cpp.
|
protected |
Tell VTKUnstructuredGrid that grid is made homogeously of one element type; Consequently type and offset information are handled directly in class and need not to be provided via interface
[in] | elementType | Type of elements in the grid |
Definition at line 187 of file VTKUnstructured.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::VTKUnstructuredGrid::setGeomData | ( | VTKUnstructuredField | fieldEnum, |
std::vector< T > & | data ) |
void bitpit::VTKUnstructuredGrid::setGeomData | ( | VTKUnstructuredField | fieldEnum, |
VTKBaseStreamer * | streamer = nullptr ) |
Associates streamer to a geometrical field
[in] | fieldEnum | which geometrical field |
[in] | streamer | VTKBaseStreamer |
Definition at line 276 of file VTKUnstructured.cpp.
void bitpit::VTKUnstructuredGrid::setGeomData | ( | VTKUnstructuredField | fieldEnum, |
VTKBaseStreamer * | streamer = nullptr ) |
|
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 501 of file VTKUnstructured.cpp.
|
overridevirtual |
Writes entire VTU but the data.
Implements bitpit::VTK.
Definition at line 441 of file VTKUnstructured.cpp.
|
protected |
|
protected |
|
protected |
|
protected |