47 Foam::extrudePatchMesh::extrudePatchMesh
52 const dictionary&
dict
62 IOobject::READ_IF_PRESENT,
74 Foam::extrudePatchMesh::extrudePatchMesh
85 extrudeMesh(regionPatches);
89 Foam::extrudePatchMesh::extrudePatchMesh
106 if (!dicts.set(patchi))
112 dicts[bottomPatchID] = dict_.subDict(
"bottomCoeffs");
113 dicts[sidePatchID] = dict_.subDict(
"sideCoeffs");
114 dicts[topPatchID] = dict_.subDict(
"topCoeffs");
118 dicts[patchi].readEntry(
"name",
patchNames[patchi]);
119 dicts[patchi].readEntry(
"type",
patchTypes[patchi]);
122 forAll(regionPatches, patchi)
125 patchDict.
set(
"nFaces", 0);
126 patchDict.
set(
"startFace", 0);
137 extrudeMesh(regionPatches);
141 void Foam::extrudePatchMesh::extrudeMesh(
const List<polyPatch*>& regionPatches)
145 const bool columnCells = dict_.get<
bool>(
"columnCells");
147 bitSet nonManifoldEdge(extrudedPatch_.nEdges());
148 for (label edgeI = 0; edgeI < extrudedPatch_.nInternalEdges(); edgeI++)
152 nonManifoldEdge.
set(edgeI);
164 extrudedPatch_, extrudedPatch_.points()
181 labelList localRegionPoints(localToGlobalRegion.size());
182 forAll(pointLocalRegions, facei)
184 const face&
f = extrudedPatch_.localFaces()[facei];
185 const face& pRegions = pointLocalRegions[facei];
188 localRegionPoints[pRegions[fp]] =
f[fp];
193 pointField localRegionNormals(localToGlobalRegion.size());
197 forAll(pointLocalRegions, facei)
199 const face& pRegions = pointLocalRegions[facei];
202 label localRegionI = pRegions[fp];
203 localSum[localRegionI] +=
204 extrudedPatch_.faceNormals()[facei];
208 Map<point> globalSum(2*localToGlobalRegion.size());
210 forAll(localSum, localRegionI)
212 label globalRegionI = localToGlobalRegion[localRegionI];
213 globalSum.insert(globalRegionI, localSum[localRegionI]);
220 forAll(localToGlobalRegion, localRegionI)
222 label globalRegionI = localToGlobalRegion[localRegionI];
223 localRegionNormals[localRegionI] = globalSum[globalRegionI];
225 localRegionNormals /=
mag(localRegionNormals);
231 forAll(firstDisp, regionI)
234 const point& regionPt = extrudedPatch_.points()
236 extrudedPatch_.meshPoints()
238 localRegionPoints[regionI]
241 const vector&
n = localRegionNormals[regionI];
242 firstDisp[regionI] = model_()(regionPt,
n, 1) - regionPt;
245 const label nNewPatches = regionPatches.size();
248 createShellMesh extruder
255 this->removeFvBoundary();
256 this->addFvPatches(regionPatches,
true);
264 forAll(edgePatches, edgeI)
266 const labelList& eFaces = extrudedPatch_.edgeFaces()[edgeI];
268 if (eFaces.size() != 2 || nonManifoldEdge.test(edgeI))
270 edgePatches[edgeI].
setSize(eFaces.size(), sidePatchID);
274 polyTopoChange meshMod(nNewPatches);
276 extruder.setRefinement
279 model_().expansionRatio(),
281 labelList(extrudedPatch_.size(), topPatchID),
282 labelList(extrudedPatch_.size(), bottomPatchID),
287 autoPtr<mapPolyMesh> map = meshMod.changeMesh
294 extruder.updateMesh(map());
296 this->setInstance(this->thisDb().time().
constant());