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

Method AppendCompositeSubfilesDataObject

IO/HDF/vtkHDFWriter.cxx:1601–1634  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1599
1600//------------------------------------------------------------------------------
1601void vtkHDFWriter::AppendCompositeSubfilesDataObject(const std::string& uniqueSubTreeName)
1602{
1603 // In multi-piece/distributed, it is possible that one piece is null for the rank 0
1604 // writing the virtual structure. We try to infer the actual type of the current
1605 // non-composite dataset, create array structures, and write all non-null pieces to the
1606 // main file.
1607
1608 const std::string blockPath = vtkHDFUtilities::VTKHDF_ROOT_PATH + "/" +
1609 uniqueSubTreeName; // All blocks are located on root group and have the same name
1610 // for all subfiles
1611 int type = -1;
1612
1613 vtkHDF::ScopedH5GHandle nonNullPart = this->Impl->GetSubfileNonNullPart(blockPath, type);
1614 if (nonNullPart == H5I_INVALID_HID)
1615 {
1616 return; // Leaf is null for every subfile
1617 }
1618
1619 if (type == VTK_UNSTRUCTURED_GRID)
1620 {
1621 // Get all arrays from the non null part
1622 vtkNew<vtkUnstructuredGrid> ug;
1623 this->Impl->CreateArraysFromNonNullPart(nonNullPart, ug);
1624 this->DispatchDataObject(
1625 this->Impl->OpenExistingGroup(this->Impl->GetRoot(), uniqueSubTreeName.c_str()), ug);
1626 }
1627 else if (type == VTK_POLY_DATA)
1628 {
1629 vtkNew<vtkPolyData> pd;
1630 this->Impl->CreateArraysFromNonNullPart(nonNullPart, pd);
1631 this->DispatchDataObject(
1632 this->Impl->OpenExistingGroup(this->Impl->GetRoot(), uniqueSubTreeName.c_str()), pd);
1633 }
1634}
1635
1636//------------------------------------------------------------------------------
1637bool vtkHDFWriter::AppendTimeValues(hid_t group)

Callers 1

AppendMultiblockMethod · 0.95

Calls 6

DispatchDataObjectMethod · 0.95
GetSubfileNonNullPartMethod · 0.80
OpenExistingGroupMethod · 0.80
GetRootMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected