Go to the documentation of this file.00001 if (mergePatchPairs.size())
00002 {
00003 Info<< "Creating merge patch pairs" << nl << endl;
00004
00005
00006 List<pointZone*> pz(mergePatchPairs.size());
00007 List<faceZone*> fz(3*mergePatchPairs.size());
00008 List<cellZone*> cz(0);
00009
00010 forAll (mergePatchPairs, pairI)
00011 {
00012 const word mergeName
00013 (
00014 mergePatchPairs[pairI].first()
00015 + mergePatchPairs[pairI].second()
00016 + name(pairI)
00017 );
00018
00019 pz[pairI] = new pointZone
00020 (
00021 mergeName + "CutPointZone",
00022 labelList(0),
00023 0,
00024 mesh.pointZones()
00025 );
00026
00027
00028 const word masterPatchName(mergePatchPairs[pairI].first());
00029 const polyPatch& masterPatch =
00030 mesh.boundaryMesh()
00031 [
00032 mesh.boundaryMesh().findPatchID(masterPatchName)
00033 ];
00034
00035 labelList isf(masterPatch.size());
00036
00037 forAll (isf, i)
00038 {
00039 isf[i] = masterPatch.start() + i;
00040 }
00041
00042 fz[3*pairI] = new faceZone
00043 (
00044 mergeName + "MasterZone",
00045 isf,
00046 boolList(masterPatch.size(), false),
00047 0,
00048 mesh.faceZones()
00049 );
00050
00051
00052 const word slavePatchName(mergePatchPairs[pairI].second());
00053 const polyPatch& slavePatch =
00054 mesh.boundaryMesh()
00055 [
00056 mesh.boundaryMesh().findPatchID(slavePatchName)
00057 ];
00058
00059 labelList osf(slavePatch.size());
00060
00061 forAll (osf, i)
00062 {
00063 osf[i] = slavePatch.start() + i;
00064 }
00065
00066 fz[3*pairI + 1] = new faceZone
00067 (
00068 mergeName + "SlaveZone",
00069 osf,
00070 boolList(slavePatch.size(), false),
00071 1,
00072 mesh.faceZones()
00073 );
00074
00075
00076 fz[3*pairI + 2] = new faceZone
00077 (
00078 mergeName + "CutFaceZone",
00079 labelList(0),
00080 boolList(0, false),
00081 2,
00082 mesh.faceZones()
00083 );
00084 }
00085
00086 Info << "Adding point and face zones" << endl;
00087 mesh.addZones(pz, fz, cz);
00088
00089
00090 Info << "Creating attachPolyTopoChanger" << endl;
00091 attachPolyTopoChanger polyMeshAttacher(mesh);
00092 polyMeshAttacher.setSize(mergePatchPairs.size());
00093
00094 forAll (mergePatchPairs, pairI)
00095 {
00096 const word mergeName
00097 (
00098 mergePatchPairs[pairI].first()
00099 + mergePatchPairs[pairI].second()
00100 + name(pairI)
00101 );
00102
00103
00104 polyMeshAttacher.set
00105 (
00106 pairI,
00107 new slidingInterface
00108 (
00109 "couple" + name(pairI),
00110 pairI,
00111 polyMeshAttacher,
00112 mergeName + "MasterZone",
00113 mergeName + "SlaveZone",
00114 mergeName + "CutPointZone",
00115 mergeName + "CutFaceZone",
00116 mergePatchPairs[pairI].first(),
00117 mergePatchPairs[pairI].second(),
00118 slidingInterface::INTEGRAL,
00119 intersection::VISIBLE
00120 )
00121 );
00122 }
00123
00124 polyMeshAttacher.attach(true);
00125 }
00126
00127