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

Method GetNodeFields

IO/IOSS/vtkIOSSReaderInternal.cxx:2316–2353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2314}
2315
2316bool 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
2355bool vtkIOSSReaderInternal::GenerateFileId(vtkDataSetAttributes* cellData, vtkIdType numberOfCells,
2356 Ioss::GroupingEntity* group_entity, const DatabaseHandle& handle)

Callers 3

GetExodusDataSetsMethod · 0.95
GetCGNSDataSetsMethod · 0.95

Calls 5

GetFieldsMethod · 0.95
stringClass · 0.50
typeMethod · 0.45
nameMethod · 0.45
FindMethod · 0.45

Tested by

no test coverage detected