MCPcopy Create free account
hub / github.com/Kitware/VTK / InitializeTemporalUnstructuredGrid

Method InitializeTemporalUnstructuredGrid

IO/HDF/vtkHDFWriter.cxx:751–798  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

749
750//------------------------------------------------------------------------------
751bool vtkHDFWriter::InitializeTemporalUnstructuredGrid(hid_t group)
752{
753 if (!this->IsTemporal)
754 {
755 return true;
756 }
757
758 vtkDebugMacro("Initialize Temporal UG for file " << this->FileName);
759
760 if (!this->Impl->CreateStepsGroup(group))
761 {
762 vtkErrorMacro("Could not create steps group");
763 return false;
764 }
765 hid_t stepsGroup = this->Impl->GetStepsGroup(group);
766 if (!this->AppendTimeValues(stepsGroup))
767 {
768 return false;
769 }
770
771 // Create empty offsets arrays, where a value is appended every step
772 bool initResult = true;
773 initResult &= this->Impl->InitDynamicDataset(
774 stepsGroup, "PointOffsets", H5T_STD_I64LE, SINGLE_COLUMN, SMALL_CHUNK);
775 initResult &= this->Impl->InitDynamicDataset(
776 stepsGroup, "PartOffsets", H5T_STD_I64LE, SINGLE_COLUMN, SMALL_CHUNK);
777 initResult &= this->Impl->InitDynamicDataset(
778 stepsGroup, "CellOffsets", H5T_STD_I64LE, SINGLE_COLUMN, SMALL_CHUNK);
779 initResult &= this->Impl->InitDynamicDataset(
780 stepsGroup, "ConnectivityIdOffsets", H5T_STD_I64LE, SINGLE_COLUMN, SMALL_CHUNK);
781
782 // Add an initial 0 value in the offset arrays, only when not writing the meta file
783 if (!this->Impl->GetSubFilesReady())
784 {
785 initResult &= this->Impl->AddOrCreateSingleValueDataset(stepsGroup, "PointOffsets", 0);
786 initResult &= this->Impl->AddOrCreateSingleValueDataset(stepsGroup, "CellOffsets", 0);
787 initResult &= this->Impl->AddOrCreateSingleValueDataset(stepsGroup, "ConnectivityIdOffsets", 0);
788 initResult &= this->Impl->AddOrCreateSingleValueDataset(stepsGroup, "PartOffsets", 0);
789 }
790
791 if (!initResult)
792 {
793 vtkErrorMacro(<< "Could not initialize steps offset arrays when creating: " << this->FileName);
794 return false;
795 }
796
797 return true;
798}
799
800//------------------------------------------------------------------------------
801bool vtkHDFWriter::InitializeTemporalPolyData(hid_t group)

Callers 1

WriteDatasetToFileMethod · 0.95

Calls 5

AppendTimeValuesMethod · 0.95
CreateStepsGroupMethod · 0.80
GetStepsGroupMethod · 0.80
InitDynamicDatasetMethod · 0.80

Tested by

no test coverage detected