------------------------------------------------------------------------------
| 1259 | } |
| 1260 | //------------------------------------------------------------------------------ |
| 1261 | bool 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 | //------------------------------------------------------------------------------ |
| 1294 | bool vtkHDFWriter::Implementation::WriteSumStepsPolyData(hid_t group, const char* name) |
no test coverage detected