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

Method InsertBlockCells

IO/Exodus/vtkExodusIIReader.cxx:1156–1267  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1154
1155//------------------------------------------------------------------------------
1156void vtkExodusIIReaderPrivate::InsertBlockCells(
1157 int otyp, int obj, int conn_type, int timeStep, BlockInfoType* binfo)
1158{
1159 (void)timeStep;
1160 (void)otyp;
1161 if (binfo->Size == 0)
1162 {
1163 // No entries in this block.
1164 // This happens in parallel filesets when all
1165 // elements are distributed to other files.
1166 // Silently ignore.
1167 return;
1168 }
1169
1170 vtkSmartPointer<vtkIntArray> ent;
1171 if (binfo->PointsPerCell == 0)
1172 {
1173 int arrId = (conn_type == vtkExodusIIReader::ELEM_BLOCK_ELEM_CONN ? 0 : 1);
1174 ent = vtkArrayDownCast<vtkIntArray>(
1175 this->GetCacheOrRead(vtkExodusIICacheKey(-1, vtkExodusIIReader::ENTITY_COUNTS, obj, arrId)));
1176 if (!ent)
1177 {
1178 vtkErrorMacro("Entity used 0 points per cell, "
1179 "but didn't return polyhedra correctly");
1180 binfo->Status = 0;
1181 return;
1182 }
1183 }
1184
1185 // Handle 3-D polyhedra (not 2-D polygons) separately
1186 // from other cell types for simplicity.
1187 // In addition to the element block connectivity (which
1188 // lists faces bounding the polyhedra, we must load face
1189 // block connectivity (which lists corner nodes for each
1190 // face).
1191 if (binfo->CellType == VTK_POLYHEDRON)
1192 {
1193 vtkSmartPointer<vtkIdTypeArray> efconn = vtkArrayDownCast<vtkIdTypeArray>(this->GetCacheOrRead(
1194 vtkExodusIICacheKey(-1, vtkExodusIIReader::ELEM_BLOCK_FACE_CONN, obj, 0)));
1195 if (!efconn || !ent)
1196 {
1197 vtkWarningMacro(<< "Element block (" << efconn.GetPointer() << ") and "
1198 << "number of faces per poly (" << ent.GetPointer()
1199 << ") arrays are both required. "
1200 << "Skipping block id " << binfo->Id << "; expect trouble.");
1201 binfo->Status = 0;
1202 return;
1203 }
1204 this->InsertBlockPolyhedra(binfo, ent, efconn);
1205 return;
1206 }
1207
1208 vtkIdTypeArray* arr = vtkArrayDownCast<vtkIdTypeArray>(
1209 this->GetCacheOrRead(vtkExodusIICacheKey(-1, conn_type, obj, 0)));
1210 if (!arr)
1211 {
1212 vtkWarningMacro("Block wasn't present in file? Working around it. Expect trouble.");
1213 binfo->Status = 0;

Callers 1

Calls 9

GetCacheOrReadMethod · 0.95
InsertBlockPolyhedraMethod · 0.95
GetSqueezePointIdMethod · 0.95
vtkExodusIICacheKeyFunction · 0.85
GetPointerMethod · 0.45
resizeMethod · 0.45
GetValueMethod · 0.45
InsertNextCellMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected