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

Function classify

src/conversion/ensight/part/ensightPartCells.C:54–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
53
54void Foam::ensightPartCells::classify
55(
56 const polyMesh& mesh,
57 const labelUList& idList
58)
59{
60 // References to cell shape models
61 const cellModel& tet = *(cellModeller::lookup("tet"));
62 const cellModel& pyr = *(cellModeller::lookup("pyr"));
63 const cellModel& prism = *(cellModeller::lookup("prism"));
64 const cellModel& hex = *(cellModeller::lookup("hex"));
65
66 const cellShapeList& cellShapes = mesh.cellShapes();
67
68 offset_ = 0;
69 size_ = mesh.nCells();
70
71 bool limited = false;
72 if (notNull(idList))
73 {
74 limited = true;
75 size_ = idList.size();
76 }
77
78 // count the shapes
79 label nTet = 0;
80 label nPyr = 0;
81 label nPrism = 0;
82 label nHex = 0;
83 label nPoly = 0;
84
85 for (label listI = 0; listI < size_; ++listI)
86 {
87 label cellId = listI;
88 if (limited)
89 {
90 cellId = idList[listI];
91 }
92
93 const cellShape& cellShape = cellShapes[cellId];
94 const cellModel& cellModel = cellShape.model();
95
96 if (cellModel == tet)
97 {
98 nTet++;
99 }
100 else if (cellModel == pyr)
101 {
102 nPyr++;
103 }
104 else if (cellModel == prism)
105 {
106 nPrism++;
107 }
108 else if (cellModel == hex)
109 {
110 nHex++;
111 }

Callers 1

ensightPartCells.CFile · 0.70

Calls 5

lookupFunction · 0.85
nCellsMethod · 0.45
sizeMethod · 0.45
setSizeMethod · 0.45
transferMethod · 0.45

Tested by

no test coverage detected