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

Function attachInterface

src/dynamicMesh/attachDetach/attachInterface.C:41–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
40
41void 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]

Callers 1

setRefinementFunction · 0.85

Calls 13

polyRemovePointClass · 0.85
polyRemoveFaceClass · 0.85
polyModifyFaceClass · 0.85
reverseFaceMethod · 0.80
faceRemovedMethod · 0.80
whichFaceMethod · 0.80
nameFunction · 0.50
forAllFunction · 0.50
facesMethod · 0.45
indexMethod · 0.45
startMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected