MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / readCells

Function readCells

src/conversion/meshReader/starcd/STARCDMeshReader.C:242–610  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

240\*---------------------------------------------------------------------------*/
241
242void Foam::meshReaders::STARCD::readCells(const fileName& inputName)
243{
244 const word fileSignature = "PROSTAR_CELL";
245 label nFluids = 0, nSolids = 0, nBaffles = 0, nShells = 0;
246 label maxId = 0;
247
248 bool unknownVertices = false;
249
250
251 // Pass 1:
252 // count nFluids, nSolids, nBaffle, nShell and maxId
253 // also see if polyhedral cells were used
254 {
255 IFstream is(inputName);
256 readHeader(is, fileSignature);
257
258 label lineLabel, shapeId, nLabels, cellTableId, typeId;
259
260 while ((is >> lineLabel).good())
261 {
262 label starCellId = lineLabel;
263 is >> shapeId
264 >> nLabels
265 >> cellTableId
266 >> typeId;
267
268 // skip the rest of the line
269 readToNewline(is);
270
271 // max 8 indices per line
272 while (nLabels > 0)
273 {
274 readToNewline(is);
275 nLabels -= 8;
276 }
277
278 if (typeId == starcdFluidType)
279 {
280 nFluids++;
281 maxId = max(maxId, starCellId);
282
283 if (!cellTable_.found(cellTableId))
284 {
285 cellTable_.setName(cellTableId);
286 cellTable_.setMaterial(cellTableId, "fluid");
287 }
288 }
289 else if (typeId == starcdSolidType)
290 {
291 nSolids++;
292 if (keepSolids)
293 {
294 maxId = max(maxId, starCellId);
295 }
296
297 if (!cellTable_.found(cellTableId))
298 {
299 cellTable_.setName(cellTableId);

Callers 1

readGeometryFunction · 0.70

Calls 12

readToNewlineFunction · 0.85
maxFunction · 0.85
collapseMethod · 0.80
readHeaderFunction · 0.70
abortFunction · 0.50
cellShapeClass · 0.50
goodMethod · 0.45
foundMethod · 0.45
setSizeMethod · 0.45
sizeMethod · 0.45
facesMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected