mergePatchPairs.H
Go to the documentation of this file.
1  if (mergePatchPairs.size())
2  {
3  Info<< "Creating merge patch pairs" << nl << endl;
4 
5  // Create and add point and face zones and mesh modifiers
6  List<pointZone*> pz(mergePatchPairs.size());
7  List<faceZone*> fz(3*mergePatchPairs.size());
8  List<cellZone*> cz(0);
9 
10  forAll(mergePatchPairs, pairI)
11  {
12  const word mergeName
13  (
14  mergePatchPairs[pairI].first()
15  + mergePatchPairs[pairI].second()
16  + name(pairI)
17  );
18 
19  pz[pairI] = new pointZone
20  (
21  mergeName + "CutPointZone",
22  labelList(0),
23  0,
24  mesh.pointZones()
25  );
26 
27  // Master patch
28  const word masterPatchName(mergePatchPairs[pairI].first());
29  const polyPatch& masterPatch =
30  mesh.boundaryMesh()[masterPatchName];
31 
32  labelList isf(masterPatch.size());
33 
34  forAll(isf, i)
35  {
36  isf[i] = masterPatch.start() + i;
37  }
38 
39  fz[3*pairI] = new faceZone
40  (
41  mergeName + "MasterZone",
42  isf,
43  boolList(masterPatch.size(), false),
44  0,
45  mesh.faceZones()
46  );
47 
48  // Slave patch
49  const word slavePatchName(mergePatchPairs[pairI].second());
50  const polyPatch& slavePatch =
51  mesh.boundaryMesh()[slavePatchName];
52 
53  labelList osf(slavePatch.size());
54 
55  forAll(osf, i)
56  {
57  osf[i] = slavePatch.start() + i;
58  }
59 
60  fz[3*pairI + 1] = new faceZone
61  (
62  mergeName + "SlaveZone",
63  osf,
64  boolList(slavePatch.size(), false),
65  1,
66  mesh.faceZones()
67  );
68 
69  // Add empty zone for cut faces
70  fz[3*pairI + 2] = new faceZone
71  (
72  mergeName + "CutFaceZone",
73  labelList(0),
74  boolList(0, false),
75  2,
76  mesh.faceZones()
77  );
78  } // end of all merge pairs
79 
80  Info<< "Adding point and face zones" << endl;
81  mesh.addZones(pz, fz, cz);
82 
83 
84  Info<< "Creating attachPolyTopoChanger" << endl;
85  attachPolyTopoChanger polyMeshAttacher(mesh);
86  polyMeshAttacher.setSize(mergePatchPairs.size());
87 
88  forAll(mergePatchPairs, pairI)
89  {
90  const word mergeName
91  (
92  mergePatchPairs[pairI].first()
93  + mergePatchPairs[pairI].second()
94  + name(pairI)
95  );
96 
97  // Add the sliding interface mesh modifier
98  polyMeshAttacher.set
99  (
100  pairI,
101  new slidingInterface
102  (
103  "couple" + name(pairI),
104  pairI,
105  polyMeshAttacher,
106  mergeName + "MasterZone",
107  mergeName + "SlaveZone",
108  mergeName + "CutPointZone",
109  mergeName + "CutFaceZone",
110  mergePatchPairs[pairI].first(),
111  mergePatchPairs[pairI].second(),
112  slidingInterface::INTEGRAL, // always integral
113  false,
114  intersection::algorithm::visible
115  )
116  );
117  }
118 
119  polyMeshAttacher.attach(true);
120  }
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:434
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:256
List< bool > boolList
Bool container classes.
Definition: boolList.H:50
dynamicFvMesh & mesh
List< label > labelList
A List of labels.
Definition: labelList.H:56
static const char nl
Definition: Ostream.H:265
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
messageStream Info