| 40 | // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // |
| 41 | |
| 42 | bool 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 | |
| 99 | void Foam::meshStructure::correct |