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

Function detachInterface

src/dynamicMesh/attachDetach/detachInterface.C:37–484  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
36
37void Foam::attachDetach::detachInterface
38(
39 polyTopoChange& ref
40) const
41{
42 // Algorithm:
43 // 1. Create new points for points of the master face zone
44 // 2. Modify all faces of the master zone, by putting them into the master
45 // patch (look for orientation) and their renumbered mirror images
46 // into the slave patch
47 // 3. Create a point renumbering list, giving a new point index for original
48 // points in the face patch
49 // 4. Grab all faces in cells on the master side and renumber them
50 // using the point renumbering list. Exclude the ones that belong to
51 // the master face zone
52 //
53 // Note on point creation:
54 // In order to take into account the issues related to partial
55 // blocking in an attach/detach mesh modifier, special treatment
56 // is required for the duplication of points on the edge of the
57 // face zone. Points which are shared only by internal edges need
58 // not to be duplicated, as this would propagate the discontinuity
59 // in the mesh beyond the face zone. Therefore, before creating
60 // the new points, check the external edge loop. For each edge
61 // check if the edge is internal (i.e. does not belong to a
62 // patch); if so, exclude both of its points from duplication.
63
64 if (debug)
65 {
66 Pout<< "void attachDetach::detachInterface("
67 << "polyTopoChange& ref) const "
68 << " for object " << name() << " : "
69 << "Detaching interface" << endl;
70 }
71
72 const polyMesh& mesh = topoChanger().mesh();
73 const faceZoneMesh& zoneMesh = mesh.faceZones();
74
75 // Check that zone is in increasing order (needed since adding faces
76 // in same order - otherwise polyTopoChange face ordering will mess up
77 // correspondence)
78 if (debug)
79 {
80 const labelList& faceLabels = zoneMesh[faceZoneID_.index()];
81 if (faceLabels.size() > 0)
82 {
83 for (label i = 1; i < faceLabels.size(); i++)
84 {
85 if (faceLabels[i] <= faceLabels[i-1])
86 {
87 FatalErrorInFunction
88 << "faceZone " << zoneMesh[faceZoneID_.index()].name()
89 << " does not have mesh face labels in"
90 << " increasing order." << endl
91 << "Face label " << faceLabels[i]
92 << " at position " << i
93 << " is smaller than the previous value "
94 << faceLabels[i-1]

Callers 1

setRefinementFunction · 0.85

Calls 15

polyAddPointClass · 0.85
polyModifyFaceClass · 0.85
polyAddFaceClass · 0.85
meshEdgesMethod · 0.80
isInternalFaceMethod · 0.80
reverseFaceMethod · 0.80
nameFunction · 0.50
exitFunction · 0.50
forAllFunction · 0.50
indexMethod · 0.45
sizeMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected