47 Foam::extrudePatchMesh::extrudePatchMesh
52 const dictionary&
dict 62 IOobject::READ_IF_PRESENT,
74 Foam::extrudePatchMesh::extrudePatchMesh
85 extrudeMesh(regionPatches);
89 Foam::extrudePatchMesh::extrudePatchMesh
107 Foam::extrudePatchMesh::extrudePatchMesh
122 dicts[bottomPatchID] = dict_.
subDict(
"bottomCoeffs");
123 dicts[sidePatchID] = dict_.
subDict(
"sideCoeffs");
124 dicts[topPatchID] = dict_.
subDict(
"topCoeffs");
128 dicts[patchi].readEntry(
"name",
patchNames[patchi]);
129 dicts[patchi].readEntry(
"type",
patchTypes[patchi]);
132 forAll(regionPatches, patchi)
135 patchDict.
set(
"nFaces", 0);
136 patchDict.set(
"startFace", 0);
151 extrudeMesh(regionPatches);
155 void Foam::extrudePatchMesh::extrudeMesh(
polyPatchList& regionPatches)
157 if (this->boundaryMesh().empty())
159 const bool columnCells = dict_.get<
bool>(
"columnCells");
161 bitSet nonManifoldEdge(extrudedPatch_.nEdges());
162 for (label edgeI = 0; edgeI < extrudedPatch_.nInternalEdges(); edgeI++)
166 nonManifoldEdge.set(edgeI);
168 else if (extrudedPatch_.edgeFaces()[edgeI].size() > 2)
172 nonManifoldEdge.set(edgeI);
184 extrudedPatch_, extrudedPatch_.points()
201 labelList localRegionPoints(localToGlobalRegion.size());
202 forAll(pointLocalRegions, facei)
204 const face&
f = extrudedPatch_.localFaces()[facei];
205 const face& pRegions = pointLocalRegions[facei];
208 localRegionPoints[pRegions[fp]] =
f[fp];
213 pointField localRegionNormals(localToGlobalRegion.size());
217 forAll(pointLocalRegions, facei)
219 const face& pRegions = pointLocalRegions[facei];
222 label localRegionI = pRegions[fp];
223 localSum[localRegionI] +=
224 extrudedPatch_.faceNormals()[facei];
228 Map<point> globalSum(2*localToGlobalRegion.size());
230 forAll(localSum, localRegionI)
232 label globalRegionI = localToGlobalRegion[localRegionI];
233 globalSum.insert(globalRegionI, localSum[localRegionI]);
239 forAll(localToGlobalRegion, localRegionI)
241 label globalRegionI = localToGlobalRegion[localRegionI];
242 localRegionNormals[localRegionI] = globalSum[globalRegionI];
244 localRegionNormals /=
mag(localRegionNormals);
250 forAll(firstDisp, regionI)
253 const point& regionPt = extrudedPatch_.points()
255 extrudedPatch_.meshPoints()
257 localRegionPoints[regionI]
260 const vector&
n = localRegionNormals[regionI];
261 firstDisp[regionI] = model_()(regionPt,
n, 1) - regionPt;
264 const label nNewPatches = regionPatches.size();
267 createShellMesh extruder
274 this->removeFvBoundary();
275 this->addFvPatches(regionPatches,
true);
283 forAll(edgePatches, edgeI)
285 const labelList& eFaces = extrudedPatch_.edgeFaces()[edgeI];
287 if (eFaces.size() != 2 || nonManifoldEdge.test(edgeI))
289 edgePatches[edgeI].
setSize(eFaces.size(), sidePatchID);
293 polyTopoChange meshMod(nNewPatches);
295 extruder.setRefinement
298 model_().expansionRatio(),
300 labelList(extrudedPatch_.size(), topPatchID),
301 labelList(extrudedPatch_.size(), bottomPatchID),
306 autoPtr<mapPolyMesh> map = meshMod.changeMesh
313 extruder.updateMesh(map());
315 this->setInstance(this->thisDb().time().constant());
void size(const label n)
Older name for setAddressableSize.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type set(const label i, bool val=true)
A bitSet::set() method for a list of bool.
wordList patchTypes(nPatches)
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Mesh at a patch created on the fly. The following entry should be used on the field boundary dictiona...
List< labelList > labelListList
List of labelList.
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
#define forAll(list, i)
Loop across all elements in list.
dictionary()
Default construct, a top-level empty dictionary.
List< face > faceList
List of faces.
PtrList< polyPatch > polyPatchList
Store lists of polyPatch as a PtrList.
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
vectorField pointField
pointField is a vectorField.
void setSize(const label n)
Alias for resize()
A class for handling words, derived from Foam::string.
wordList patchNames(nPatches)
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.
defineTypeNameAndDebug(combustionModel, 0)
static autoPtr< extrudeModel > New(const dictionary &dict)
Select null constructed.
PrimitivePatch< List< face >, const pointField & > primitiveFacePatch
A PrimitivePatch with List storage for the faces, const reference for the point field.
vector point
Point is a vector.
Foam::word regionName(args.getOrDefault< word >("region", Foam::polyMesh::defaultRegion))
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
Mesh data needed to do the Finite Volume discretisation.
const std::string patch
OpenFOAM patch number as a std::string.
Field< vector > vectorField
Specialisation of Field<T> for vector.
static autoPtr< polyPatch > New(const word &patchType, const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm)
Return pointer to a new patch created on freestore from components.
List< label > labelList
A List of labels.
static void mapCombineReduce(Container &values, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce) applying cop to inplace combine map values from different processo...
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
static constexpr const zero Zero
Global zero (0)