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

Function isStructuredCell

src/meshTools/meshStructure/meshStructure.C:42–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
41
42bool Foam::meshStructure::isStructuredCell
43(
44 const polyMesh& mesh,
45 const label layerI,
46 const label celli
47) const
48{
49 const cell& cFaces = mesh.cells()[celli];
50
51 // Count number of side faces
52 label nSide = 0;
53 forAll(cFaces, i)
54 {
55 if (faceToPatchEdgeAddressing_[cFaces[i]] != -1)
56 {
57 nSide++;
58 }
59 }
60
61 if (nSide != cFaces.size()-2)
62 {
63 return false;
64 }
65
66 // Check that side faces have correct point layers
67 forAll(cFaces, i)
68 {
69 if (faceToPatchEdgeAddressing_[cFaces[i]] != -1)
70 {
71 const face& f = mesh.faces()[cFaces[i]];
72
73 label nLayer = 0;
74 label nLayerPlus1 = 0;
75 forAll(f, fp)
76 {
77 label pointi = f[fp];
78 if (pointLayer_[pointi] == layerI)
79 {
80 nLayer++;
81 }
82 else if (pointLayer_[pointi] == layerI+1)
83 {
84 nLayerPlus1++;
85 }
86 }
87
88 if (f.size() != 4 || (nLayer+nLayerPlus1 != 4))
89 {
90 return false;
91 }
92 }
93 }
94
95 return true;
96}
97
98
99void Foam::meshStructure::correct

Callers 1

correctFunction · 0.85

Calls 3

forAllFunction · 0.50
sizeMethod · 0.45
facesMethod · 0.45

Tested by

no test coverage detected