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

Method AppendBlocks

IO/HDF/vtkHDFWriter.cxx:1368–1413  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1366
1367//------------------------------------------------------------------------------
1368bool vtkHDFWriter::AppendBlocks(hid_t group, vtkPartitionedDataSetCollection* pdc)
1369{
1370 for (unsigned int datasetId = 0; datasetId < pdc->GetNumberOfPartitionedDataSets(); datasetId++)
1371 {
1372 vtkHDF::ScopedH5GHandle datasetGroup;
1373 vtkPartitionedDataSet* currentBlock = pdc->GetPartitionedDataSet(datasetId);
1374 const std::string currentName = ::getBlockName(pdc, datasetId);
1375
1376 if (this->UseExternalComposite)
1377 {
1378 if (!this->AppendExternalBlock(currentBlock, currentName))
1379 {
1380 return false;
1381 }
1382 datasetGroup = this->Impl->OpenExistingGroup(group, currentName.c_str());
1383 }
1384 else
1385 {
1386 if (this->CurrentTimeIndex == 0)
1387 {
1388 datasetGroup = this->Impl->CreateHdfGroup(group, currentName.c_str());
1389 }
1390 else
1391 {
1392 datasetGroup = this->Impl->OpenExistingGroup(group, currentName.c_str());
1393 }
1394 this->PreviousStepMeshMTime = this->CompositeMeshMTime[datasetId];
1395 this->DispatchDataObject(datasetGroup, currentBlock);
1396 if (auto ds = vtkDataSet::SafeDownCast(currentBlock->GetPartition(0)))
1397 {
1398 this->CompositeMeshMTime[datasetId] = ds->GetMeshMTime();
1399 }
1400 else
1401 {
1402 this->CompositeMeshMTime[datasetId] = this->CurrentTimeIndex + 1;
1403 }
1404 }
1405
1406 if (this->CurrentTimeIndex == 0)
1407 {
1408 this->Impl->CreateScalarAttribute(datasetGroup, "Index", datasetId);
1409 }
1410 }
1411
1412 return true;
1413}
1414
1415//------------------------------------------------------------------------------
1416bool vtkHDFWriter::AppendExternalBlock(vtkDataObject* block, const std::string& blockName)

Callers 1

WriteDatasetToFileMethod · 0.95

Calls 11

AppendExternalBlockMethod · 0.95
DispatchDataObjectMethod · 0.95
getBlockNameFunction · 0.85
GetPartitionedDataSetMethod · 0.80
OpenExistingGroupMethod · 0.80
CreateHdfGroupMethod · 0.80
CreateScalarAttributeMethod · 0.80
c_strMethod · 0.45
GetPartitionMethod · 0.45
GetMeshMTimeMethod · 0.45

Tested by

no test coverage detected