48 const word& pType =
p.type();
49 const word& pName =
p.name();
51 bool nameFound =
false;
74 patchDicts_.append(dictionary(IStringStream(os.str())()));
81 const word&
caseName =
p.boundaryMesh().mesh().time().caseName();
85 Info<<
"label patchIndex(const polyPatch& p) : "
86 <<
"Patch " <<
p.index() <<
" named "
88 <<
" already exists, but patch types "
89 <<
" do not match.\nCreating a composite name as "
103 DynamicList<word>& names,
109 if (names[zoneI] == curName)
116 names.append(curName);
118 return names.size() - 1;
128 patchNames_(2*boundaryMesh().size()),
129 patchDicts_(2*boundaryMesh().size()),
135 wordList curPatchNames = boundaryMesh().names();
137 forAll(boundaryMesh(), patchI)
139 patchNames_.append(boundaryMesh()[patchI].
name());
142 boundaryMesh()[patchI].write(os);
143 patchDicts_.append(dictionary(IStringStream(os.str())()));
149 wordList curPointZoneNames = pointZones().names();
150 if (curPointZoneNames.size())
152 pointZoneNames_.setCapacity(2*curPointZoneNames.size());
155 forAll(curPointZoneNames, zoneI)
157 pointZoneNames_.append(curPointZoneNames[zoneI]);
161 wordList curFaceZoneNames = faceZones().names();
163 if (curFaceZoneNames.size())
165 faceZoneNames_.setCapacity(2*curFaceZoneNames.size());
167 forAll(curFaceZoneNames, zoneI)
169 faceZoneNames_.append(curFaceZoneNames[zoneI]);
173 wordList curCellZoneNames = cellZones().names();
175 if (curCellZoneNames.size())
177 cellZoneNames_.setCapacity(2*curCellZoneNames.size());
179 forAll(curCellZoneNames, zoneI)
181 cellZoneNames_.append(curCellZoneNames[zoneI]);
213 zoneID = pz.whichZone(pointI);
218 zoneID = pointZoneIndices[zoneID];
221 renumberPoints[pointI] =
250 zoneID = cz.whichZone(cellI);
255 zoneID = cellZoneIndices[zoneID];
258 renumberCells[cellI] =
273 const polyBoundaryMesh& bm = m.boundaryMesh();
278 forAll(patchIndices, patchI)
280 patchIndices[patchI] =
patchIndex(bm[patchI]);
301 const labelList& nei = m.faceNeighbour();
303 label newOwn, newNei, newPatch, newZone;
308 const face& curFace =
f[faceI];
310 face newFace(curFace.size());
314 newFace[pointI] = renumberPoints[curFace[pointI]];
320 if (
min(newFace) < 0)
323 <<
"Error in point mapping for face " << faceI
324 <<
". Old face: " << curFace <<
" New face: " << newFace
329 if (faceI < m.nInternalFaces() || faceI >= m.nFaces())
335 newPatch = patchIndices[bm.whichPatch(faceI)];
339 if (newOwn > -1) newOwn = renumberCells[newOwn];
348 newNei = renumberCells[newNei];
352 newZone = fz.whichZone(faceI);
357 newZoneFlip = fz[newZone].flipMap()[fz[newZone].whichFace(faceI)];
360 newZone = faceZoneIndices[newZone];
363 renumberFaces[faceI] =
387 Info<<
"patch names: " << patchNames_ <<
nl
388 <<
"patch dicts: " << patchDicts_ <<
nl
389 <<
"point zone names: " << pointZoneNames_ <<
nl
390 <<
"face zone names: " << faceZoneNames_ <<
nl
391 <<
"cell zone names: " << cellZoneNames_ <<
endl;
394 if (patchNames_.size() != boundaryMesh().size())
396 Info<<
"Copying old patches" <<
endl;
400 const polyBoundaryMesh& oldPatches = boundaryMesh();
405 for (patchI = 0; patchI < oldPatches.size(); patchI++)
407 newPatches[patchI] = oldPatches[patchI].clone(oldPatches).ptr();
410 Info<<
"Adding new patches. " <<
endl;
412 label endOfLastPatch =
413 oldPatches[patchI - 1].start() + oldPatches[patchI - 1].size();
415 for (; patchI < patchNames_.size(); patchI++)
418 dictionary
dict(patchDicts_[patchI]);
420 dict.
set(
"startFace", endOfLastPatch);
435 addPatches(newPatches);
439 if (pointZoneNames_.size() > pointZones().size())
441 Info<<
"Adding new pointZones. " <<
endl;
442 label nZones = pointZones().size();
444 pointZones().setSize(pointZoneNames_.size());
446 for (
label zoneI = nZones; zoneI < pointZoneNames_.size(); zoneI++)
453 pointZoneNames_[zoneI],
461 if (cellZoneNames_.size() > cellZones().size())
463 Info<<
"Adding new cellZones. " <<
endl;
465 label nZones = cellZones().size();
467 cellZones().setSize(cellZoneNames_.size());
469 for (
label zoneI = nZones; zoneI < cellZoneNames_.size(); zoneI++)
476 cellZoneNames_[zoneI],
484 if (faceZoneNames_.size() > faceZones().size())
486 Info<<
"Adding new faceZones. " <<
endl;
488 label nZones = faceZones().size();
490 faceZones().setSize(faceZoneNames_.size());
492 for (
label zoneI = nZones; zoneI < faceZoneNames_.size(); zoneI++)
499 faceZoneNames_[zoneI],
510 meshMod_.changeMesh(*
this,
false);