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

Method GetExodusEntityDataSet

IO/IOSS/vtkIOSSReaderInternal.cxx:1226–1308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1224}
1225
1226vtkSmartPointer<vtkDataSet> vtkIOSSReaderInternal::GetExodusEntityDataSet(
1227 const std::vector<std::string>& blockNames, vtkIOSSReader::EntityType vtk_entity_type,
1228 const DatabaseHandle& handle, int timestep, vtkIOSSReader* self)
1229{
1230 const auto ioss_entity_type = vtkIOSSUtilities::GetIOSSEntityType(vtk_entity_type);
1231 auto region = this->GetRegion(handle.first, handle.second);
1232 if (!region)
1233 {
1234 return nullptr;
1235 }
1236
1237 vtkNew<vtkUnstructuredGrid> entityGrid;
1238 if (!this->GetEntityMesh(entityGrid, blockNames, vtk_entity_type, handle))
1239 {
1240 return {};
1241 }
1242 vtkPointData* entityPD = entityGrid->GetPointData();
1243 vtkCellData* entityCD = entityGrid->GetCellData();
1244
1245 auto fieldSelection = self->GetFieldSelection(vtk_entity_type);
1246 assert(fieldSelection != nullptr);
1247 auto nodeFieldSelection = self->GetNodeBlockFieldSelection();
1248 assert(nodeFieldSelection != nullptr);
1249
1250 size_t numberOfValidBlocks = 0;
1251 for (const auto& blockName : blockNames)
1252 {
1253 auto group_entity = region->get_entity(blockName, ioss_entity_type);
1254 if (!group_entity)
1255 {
1256 continue;
1257 }
1258
1259 // get the connectivity of the block of the entity
1260 const auto blockCellArrayAndType = this->GetTopology(blockName, vtk_entity_type, handle);
1261 if (blockCellArrayAndType.empty())
1262 {
1263 continue;
1264 }
1265 ++numberOfValidBlocks;
1266
1267 // compute number of cells in this block
1268 vtkIdType blockNumberOfCells = 0;
1269 for (const auto& cellArrayAndType : blockCellArrayAndType)
1270 {
1271 blockNumberOfCells += cellArrayAndType.second->GetNumberOfCells();
1272 }
1273
1274 // handle all point data once
1275 if (numberOfValidBlocks == 1)
1276 {
1277 this->GetNodeFields(entityPD, nodeFieldSelection, region, group_entity, handle, timestep,
1278 self->GetReadIds(), true);
1279 if (self->GetApplyDisplacements())
1280 {
1281 this->ApplyDisplacements(entityGrid, region, group_entity, handle, timestep, true);
1282 }
1283 }

Callers 1

ReadMeshMethod · 0.80

Calls 15

GetRegionMethod · 0.95
GetEntityMeshMethod · 0.95
GetTopologyMethod · 0.95
GetNodeFieldsMethod · 0.95
ApplyDisplacementsMethod · 0.95
GetFieldsMethod · 0.95
GenerateFileIdMethod · 0.95
GenerateEntityIdArrayMethod · 0.95
GetIOSSEntityTypeFunction · 0.85
GetApplyDisplacementsMethod · 0.80
assertFunction · 0.50
GetPointDataMethod · 0.45

Tested by

no test coverage detected