| 39 | // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // |
| 40 | |
| 41 | void Foam::attachDetach::attachInterface |
| 42 | ( |
| 43 | polyTopoChange& ref |
| 44 | ) const |
| 45 | { |
| 46 | // Algorithm: |
| 47 | // 1. Create the reverse patch out of the slave faces. |
| 48 | // 2. Go through all the mesh points from the master and slave patch. |
| 49 | // If the point labels are different, insert them into the point |
| 50 | // renumbering list and remove them from the mesh. |
| 51 | // 3. Remove all faces from the slave patch |
| 52 | // 4. Modify all the faces from the master patch by making them internal |
| 53 | // between the faceCell cells for the two patches. If the master owner |
| 54 | // is higher than the slave owner, turn the face around |
| 55 | // 5. Get all the faces attached to the slave patch points. |
| 56 | // If they have not been removed, renumber them using the |
| 57 | // point renumbering list. |
| 58 | |
| 59 | if (debug) |
| 60 | { |
| 61 | Pout<< "void attachDetach::attachInterface(" |
| 62 | << "polyTopoChange& ref) const " |
| 63 | << " for object " << name() << " : " |
| 64 | << "Attaching interface" << endl; |
| 65 | } |
| 66 | |
| 67 | const polyMesh& mesh = topoChanger().mesh(); |
| 68 | const faceList& faces = mesh.faces(); |
| 69 | const labelList& own = mesh.faceOwner(); |
| 70 | const labelList& nei = mesh.faceNeighbour(); |
| 71 | |
| 72 | const polyPatch& masterPatch = mesh.boundaryMesh()[masterPatchID_.index()]; |
| 73 | const polyPatch& slavePatch = mesh.boundaryMesh()[slavePatchID_.index()]; |
| 74 | |
| 75 | const label masterPatchStart = masterPatch.start(); |
| 76 | const label slavePatchStart = slavePatch.start(); |
| 77 | |
| 78 | const labelList& slaveMeshPoints = slavePatch.meshPoints(); |
| 79 | |
| 80 | const Map<label>& removedPointMap = pointMatchMap(); |
| 81 | |
| 82 | const labelList removedPoints = removedPointMap.toc(); |
| 83 | |
| 84 | forAll(removedPoints, pointi) |
| 85 | { |
| 86 | //Pout<< "Removing point:" << removedPoints[pointi] |
| 87 | // << " currently at:" << ref.points()[removedPoints[pointi]] |
| 88 | // << endl; |
| 89 | |
| 90 | ref.setAction(polyRemovePoint(removedPoints[pointi])); |
| 91 | } |
| 92 | |
| 93 | // Pout<< "Points to be mapped: " << removedPoints << endl; |
| 94 | // Remove all faces from the slave patch |
| 95 | forAll(slavePatch, i) |
| 96 | { |
| 97 | //Pout<< "Removing face " << i + slavePatchStart |
| 98 | // << " with verts:" << ref.faces()[i + slavePatchStart] |
no test coverage detected