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

Method WriteSumSteps

IO/HDF/vtkHDFWriterImplementation.cxx:1261–1291  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1259}
1260//------------------------------------------------------------------------------
1261bool vtkHDFWriter::Implementation::WriteSumSteps(hid_t group, const char* name)
1262{
1263 vtkDebugWithObjectMacro(this->Writer,
1264 "Creating steps sum " << name << " in " << this->GetGroupName(group) << "with base "
1265 << this->GetBasePath(this->GetGroupName(group)));
1266
1267 vtkHDF::ScopedH5DHandle dataset = this->OpenDataset(group, name);
1268 if (dataset == H5I_INVALID_HID)
1269 {
1270 return false;
1271 }
1272
1273 // For each timestep, collect the sum of values in subfiles,
1274 // and append it to the meta-file array.
1275 for (int step = 0; step < this->Writer->NumberOfTimeSteps; step++)
1276 {
1277 vtkIdType totalForTimeStep = 0;
1278 for (std::size_t part = 0; part < this->Subfiles.size(); part++)
1279 {
1280 totalForTimeStep += this->GetSubfileNumberOf(this->GetBasePath(this->GetGroupName(group)),
1281 PATH::STEPS + "/" + std::string(name), part, step);
1282 }
1283
1284 if (!this->AddSingleValueToDataset(dataset, totalForTimeStep, false, false))
1285 {
1286 return false;
1287 }
1288 }
1289
1290 return true;
1291}
1292
1293//------------------------------------------------------------------------------
1294bool vtkHDFWriter::Implementation::WriteSumStepsPolyData(hid_t group, const char* name)

Callers 1

CreateVirtualDatasetMethod · 0.95

Calls 7

GetGroupNameMethod · 0.95
GetBasePathMethod · 0.95
OpenDatasetMethod · 0.95
GetSubfileNumberOfMethod · 0.95
stringClass · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected