| 2314 | } |
| 2315 | |
| 2316 | bool vtkIOSSReaderInternal::GetNodeFields(vtkDataSetAttributes* dsa, |
| 2317 | vtkDataArraySelection* selection, Ioss::Region* region, Ioss::GroupingEntity* group_entity, |
| 2318 | const DatabaseHandle& handle, int timestep, bool read_ioss_ids, bool mergeExodusEntityBlocks) |
| 2319 | { |
| 2320 | if (group_entity->type() == Ioss::EntityType::STRUCTUREDBLOCK) |
| 2321 | { |
| 2322 | // CGNS |
| 2323 | // node fields are stored under nested node block. So use that. |
| 2324 | auto sb = dynamic_cast<Ioss::StructuredBlock*>(group_entity); |
| 2325 | auto& nodeBlock = sb->get_node_block(); |
| 2326 | if (!this->GetFields( |
| 2327 | dsa, selection, region, &nodeBlock, handle, timestep, /*read_ioss_ids=*/false)) |
| 2328 | { |
| 2329 | return false; |
| 2330 | } |
| 2331 | |
| 2332 | // for STRUCTUREDBLOCK, the node ids are read from the SB itself, and not |
| 2333 | // the nested nodeBlock. |
| 2334 | return read_ioss_ids |
| 2335 | ? this->GetFields(dsa, nullptr, region, sb, handle, timestep, /*read_ioss_ids=*/true) |
| 2336 | : true; |
| 2337 | } |
| 2338 | else |
| 2339 | { |
| 2340 | // Exodus |
| 2341 | const auto& blockname = group_entity->name(); |
| 2342 | auto& cache = this->Cache; |
| 2343 | vtkIdTypeArray* vtk_raw_ids_array = !mergeExodusEntityBlocks |
| 2344 | ? vtkIdTypeArray::SafeDownCast(cache.Find(group_entity, "__vtk_mesh_original_pt_ids__")) |
| 2345 | : nullptr; |
| 2346 | const std::string cache_key_suffix = vtk_raw_ids_array != nullptr ? blockname : std::string(); |
| 2347 | |
| 2348 | auto nodeblock = GetNodeBlock(region, "nodeblock_1"); |
| 2349 | |
| 2350 | return this->GetFields(dsa, selection, region, nodeblock, handle, timestep, read_ioss_ids, |
| 2351 | vtk_raw_ids_array, cache_key_suffix); |
| 2352 | } |
| 2353 | } |
| 2354 | |
| 2355 | bool vtkIOSSReaderInternal::GenerateFileId(vtkDataSetAttributes* cellData, vtkIdType numberOfCells, |
| 2356 | Ioss::GroupingEntity* group_entity, const DatabaseHandle& handle) |
no test coverage detected