56 const Foam::scalar Foam::perfectInterface::tol_ = 1
E-3;
72 ctrs[patchFaceI] = pp[patchFaceI].centre(points);
82 Foam::perfectInterface::perfectInterface
87 const word& faceZoneName,
88 const word& masterPatchName,
89 const word& slavePatchName
100 Foam::perfectInterface::perfectInterface
111 dict.
lookup(
"faceZoneName"),
116 dict.
lookup(
"masterPatchName"),
121 dict.
lookup(
"slavePatchName"),
142 Pout<<
"bool perfectInterface::changeTopology() const "
143 <<
"for object " <<
name() <<
" : "
144 <<
"Inactive" <<
endl;
161 Pout<<
"bool perfectInterface::setRefinement(polyTopoChange&) const : "
162 <<
"for object " <<
name() <<
" : "
163 <<
"masterPatchID_:" << masterPatchID_
164 <<
" slavePatchID_:" << slavePatchID_
165 <<
" faceZoneID_:" << faceZoneID_ <<
endl;
170 masterPatchID_.active()
171 && slavePatchID_.active()
172 && faceZoneID_.active()
179 const polyPatch& pp0 = patches[masterPatchID_.index()];
180 const polyPatch& pp1 = patches[slavePatchID_.index()];
192 scalar minLen = GREAT;
196 minLen =
min(minLen, edges0[edgeI].
mag(pts0));
198 scalar typDim = tol_*minLen;
202 Pout<<
"typDim:" << typDim <<
" edges0:" << edges0.
size()
203 <<
" pts0:" << pts0.
size() <<
" pts1:" << pts1.
size()
204 <<
" pp0:" << pp0.size() <<
" pp1:" << pp1.size() <<
endl;
214 renumberPoints[i] = i;
232 "perfectInterface::setRefinement(polyTopoChange& ref) const"
233 ) <<
"Points on patches " << pp0.
name() <<
" and "
234 << pp1.
name() <<
" do not match to within tolerance "
240 renumberPoints[meshPts1[i]] = meshPts0[from1To0Points[i]];
252 calcFaceCentres(pp0),
253 calcFaceCentres(pp1),
263 "perfectInterface::setRefinement(polyTopoChange& ref) const"
264 ) <<
"Face centres of patches " << pp0.
name() <<
" and "
265 << pp1.
name() <<
" do not match to within tolerance " << typDim
280 label meshPointI = meshPts1[i];
282 if (meshPointI != renumberPoints[meshPointI])
288 affectedFaces.insert(pFaces[pFaceI]);
294 affectedFaces.erase(pp1.
start() + i);
302 if (affectedFaces.erase(pp0.
start() + i))
306 "perfectInterface::setRefinement(polyTopoChange&) const"
307 ) <<
"Found face " << pp0.
start() + i <<
" vertices "
308 << mesh.
faces()[pp0.
start() + i] <<
" whose points are"
309 <<
" used both by master patch " << pp0.
name()
310 <<
" and slave patch " << pp1.
name()
320 iter != affectedFaces.end();
324 label faceI = iter.key();
332 newFace[fp] = renumberPoints[f[fp]];
350 bool zoneFlip =
false;
380 label meshPointI = meshPts1[i];
382 if (meshPointI != renumberPoints[meshPointI])
400 mesh.
faceZones()[faceZoneID_.index()].flipMap();
404 label faceI = pp0.
start() + i;
412 newFace[fp] = renumberPoints[f[fp]];
417 label pp1FaceI = pp1.
start() + from0To1Faces[i];
445 newFace.reverseFace(),
484 << faceZoneID_.name() <<
nl
485 << masterPatchID_.name() <<
nl
486 << slavePatchID_.name() <<
endl;
494 <<
" type " <<
type()
497 <<
" active " << active()
500 <<
" faceZoneName " << faceZoneID_.name()
503 <<
" masterPatchName " << masterPatchID_.name()
506 <<
" slavePatchName " << slavePatchID_.name()