| 97 | |
| 98 | |
| 99 | void Foam::meshStructure::correct |
| 100 | ( |
| 101 | const polyMesh& mesh, |
| 102 | const uindirectPrimitivePatch& pp |
| 103 | ) |
| 104 | { |
| 105 | // Field on cells and faces. |
| 106 | List<topoDistanceData> cellData(mesh.nCells()); |
| 107 | List<topoDistanceData> faceData(mesh.nFaces()); |
| 108 | |
| 109 | { |
| 110 | if (debug) |
| 111 | { |
| 112 | Info<< typeName << " : seeding " |
| 113 | << returnReduce(pp.size(), sumOp<label>()) << " patch faces" |
| 114 | << nl << endl; |
| 115 | } |
| 116 | |
| 117 | |
| 118 | // Start of changes |
| 119 | labelList patchFaces(pp.size()); |
| 120 | List<topoDistanceData> patchData(pp.size()); |
| 121 | forAll(pp, patchFacei) |
| 122 | { |
| 123 | patchFaces[patchFacei] = pp.addressing()[patchFacei]; |
| 124 | patchData[patchFacei] = topoDistanceData(patchFacei, 0); |
| 125 | } |
| 126 | |
| 127 | |
| 128 | // Propagate information inwards |
| 129 | FaceCellWave<topoDistanceData> distanceCalc |
| 130 | ( |
| 131 | mesh, |
| 132 | patchFaces, |
| 133 | patchData, |
| 134 | faceData, |
| 135 | cellData, |
| 136 | mesh.globalData().nTotalCells()+1 |
| 137 | ); |
| 138 | |
| 139 | |
| 140 | // Determine cells from face-cell-walk |
| 141 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 142 | |
| 143 | cellToPatchFaceAddressing_.setSize(mesh.nCells()); |
| 144 | cellLayer_.setSize(mesh.nCells()); |
| 145 | forAll(cellToPatchFaceAddressing_, celli) |
| 146 | { |
| 147 | cellToPatchFaceAddressing_[celli] = cellData[celli].data(); |
| 148 | cellLayer_[celli] = cellData[celli].distance(); |
| 149 | } |
| 150 | |
| 151 | |
| 152 | |
| 153 | // Determine faces from face-cell-walk |
| 154 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 155 | |
| 156 | faceToPatchFaceAddressing_.setSize(mesh.nFaces()); |
no test coverage detected