52 const dictionary&
dict
62 IOobject::READ_IF_PRESENT,
69 extrudedPatch_(
p.patch()),
85 extrudeMesh(regionPatches);
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);
141void 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]);
219 forAll(localToGlobalRegion, localRegionI)
221 label globalRegionI = localToGlobalRegion[localRegionI];
222 localRegionNormals[localRegionI] = globalSum[globalRegionI];
224 localRegionNormals /=
mag(localRegionNormals);
230 forAll(firstDisp, regionI)
233 const point& regionPt = extrudedPatch_.points()
235 extrudedPatch_.meshPoints()
237 localRegionPoints[regionI]
240 const vector&
n = localRegionNormals[regionI];
241 firstDisp[regionI] = model_()(regionPt,
n, 1) - regionPt;
244 const label nNewPatches = regionPatches.
size();
247 createShellMesh extruder
254 this->removeFvBoundary();
255 this->addFvPatches(regionPatches,
true);
263 forAll(edgePatches, edgeI)
265 const labelList& eFaces = extrudedPatch_.edgeFaces()[edgeI];
267 if (eFaces.size() != 2 || nonManifoldEdge.test(edgeI))
269 edgePatches[edgeI].
setSize(eFaces.size(), sidePatchID);
273 polyTopoChange meshMod(nNewPatches);
275 extruder.setRefinement
278 model_().expansionRatio(),
280 labelList(extrudedPatch_.size(), topPatchID),
281 labelList(extrudedPatch_.size(), bottomPatchID),
286 autoPtr<mapPolyMesh> map = meshMod.changeMesh
293 extruder.updateMesh(map());
295 this->setInstance(this->thisDb().time().
constant());
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void setSize(const label n)
Alias for resize()
static void mapCombineAllGather(const List< commsStruct > &comms, Container &values, const CombineOp &cop, const int tag, const label comm)
After completion all processors have the same data.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
const T * set(const label i) const
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
void size(const label n)
Older name for setAddressableSize.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
static void calcPointRegions(const globalMeshData &globalData, const primitiveFacePatch &patch, const bitSet &nonManifoldEdge, const bool syncNonCollocated, faceList &pointGlobalRegions, faceList &pointLocalRegions, labelList &localToGlobalRegion)
Helper: calculate point regions. The point region is the.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
entry * set(entry *entryPtr)
Assign a new entry, overwriting any existing entry.
Mesh at a patch created on the fly. The following entry should be used on the field boundary dictiona...
Mesh data needed to do the Finite Volume discretisation.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
constant condensation/saturation model.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Foam::word regionName(Foam::polyMesh::defaultRegion)
List< label > labelList
A List of labels.
vectorField pointField
pointField is a vectorField.
vector point
Point is a vector.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
List< labelList > labelListList
A List of labelList.
Field< vector > vectorField
Specialisation of Field<T> for vector.
static constexpr const zero Zero
Global zero (0)
PrimitivePatch< List< face >, const pointField & > primitiveFacePatch
A PrimitivePatch with List storage for the faces, const reference for the point field.
List< face > faceList
A List of faces.
wordList patchTypes(nPatches)
wordList patchNames(nPatches)
#define forAll(list, i)
Loop across all elements in list.