Starting from cut edge start walking.
| 47 | |
| 48 | // Starting from cut edge start walking. |
| 49 | bool Foam::hexCellLooper::walkHex |
| 50 | ( |
| 51 | const label celli, |
| 52 | const label startFacei, |
| 53 | const label startEdgeI, |
| 54 | |
| 55 | labelList& loop, |
| 56 | scalarField& loopWeights |
| 57 | ) const |
| 58 | { |
| 59 | label facei = startFacei; |
| 60 | |
| 61 | label edgeI = startEdgeI; |
| 62 | |
| 63 | label cutI = 0; |
| 64 | |
| 65 | do |
| 66 | { |
| 67 | if (debug & 2) |
| 68 | { |
| 69 | Pout<< " walkHex : inserting cut onto edge:" << edgeI |
| 70 | << " vertices:" << mesh().edges()[edgeI] << endl; |
| 71 | } |
| 72 | |
| 73 | // Store cut through edge. For now cut edges halfway. |
| 74 | loop[cutI] = edgeToEVert(edgeI); |
| 75 | loopWeights[cutI] = 0.5; |
| 76 | cutI++; |
| 77 | |
| 78 | facei = meshTools::otherFace(mesh(), celli, facei, edgeI); |
| 79 | |
| 80 | const edge& e = mesh().edges()[edgeI]; |
| 81 | |
| 82 | // Walk two edges further |
| 83 | edgeI = meshTools::walkFace(mesh(), facei, edgeI, e.end(), 2); |
| 84 | |
| 85 | if (edgeI == startEdgeI) |
| 86 | { |
| 87 | break; |
| 88 | } |
| 89 | } |
| 90 | while (true); |
| 91 | |
| 92 | // Checks. |
| 93 | if (cutI > 4) |
| 94 | { |
| 95 | Pout<< "hexCellLooper::walkHex" << "Problem : cell:" << celli |
| 96 | << " collected loop:"; |
| 97 | writeCuts(Pout, loop, loopWeights); |
| 98 | Pout<< "loopWeights:" << loopWeights << endl; |
| 99 | |
| 100 | return false; |
| 101 | } |
| 102 | else |
| 103 | { |
| 104 | return true; |
| 105 | } |
| 106 | } |