48Foam::extrudePatchMesh::extrudePatchMesh
63 IOobject::READ_IF_PRESENT,
70 extrudedPatch_(
p.patch()),
75Foam::extrudePatchMesh::extrudePatchMesh
86 extrudeMesh(regionPatches);
90Foam::extrudePatchMesh::extrudePatchMesh
108Foam::extrudePatchMesh::extrudePatchMesh
123 dicts[bottomPatchID] = dict_.
subDict(
"bottomCoeffs");
124 dicts[sidePatchID] = dict_.
subDict(
"sideCoeffs");
125 dicts[topPatchID] = dict_.
subDict(
"topCoeffs");
130 dicts[patchi].readEntry(
"type",
patchTypes[patchi]);
133 forAll(regionPatches, patchi)
136 patchDict.set(
"nFaces", 0);
137 patchDict.set(
"startFace", 0);
152 extrudeMesh(regionPatches);
156void Foam::extrudePatchMesh::extrudeMesh(
const polyPatchList& regionPatches)
160 const bool columnCells = dict_.get<
bool>(
"columnCells");
161 scalar featAngleCos = -GREAT;
162 scalar featAngle = -1;
163 if (dict_.readIfPresent(
"featureAngle", featAngle))
168 bitSet nonManifoldEdge(extrudedPatch_.nEdges());
169 for (label edgeI = 0; edgeI < extrudedPatch_.nInternalEdges(); edgeI++)
173 nonManifoldEdge.set(edgeI);
177 const auto& fcs = extrudedPatch_.edgeFaces()[edgeI];
183 nonManifoldEdge.set(edgeI);
185 else if (fcs.size() == 2 && featAngleCos >= -1)
187 const auto&
n = extrudedPatch_.faceNormals();
188 if ((
n[fcs[0]] &
n[fcs[1]]) < featAngleCos)
190 nonManifoldEdge.set(edgeI);
204 extrudedPatch_, extrudedPatch_.points()
221 labelList localRegionPoints(localToGlobalRegion.size());
222 forAll(pointLocalRegions, facei)
224 const face&
f = extrudedPatch_.localFaces()[facei];
225 const face& pRegions = pointLocalRegions[facei];
228 localRegionPoints[pRegions[fp]] =
f[fp];
233 pointField localRegionNormals(localToGlobalRegion.size());
237 forAll(pointLocalRegions, facei)
239 const face& pRegions = pointLocalRegions[facei];
242 label localRegionI = pRegions[fp];
243 localSum[localRegionI] +=
244 extrudedPatch_.faceNormals()[facei];
248 Map<point> globalSum(2*localToGlobalRegion.size());
250 forAll(localSum, localRegionI)
252 label globalRegionI = localToGlobalRegion[localRegionI];
253 globalSum.insert(globalRegionI, localSum[localRegionI]);
259 forAll(localToGlobalRegion, localRegionI)
261 label globalRegionI = localToGlobalRegion[localRegionI];
262 localRegionNormals[localRegionI] = globalSum[globalRegionI];
264 localRegionNormals /=
mag(localRegionNormals);
270 forAll(firstDisp, regionI)
273 const point& regionPt = extrudedPatch_.points()
275 extrudedPatch_.meshPoints()
277 localRegionPoints[regionI]
280 const vector&
n = localRegionNormals[regionI];
281 firstDisp[regionI] = model_()(regionPt,
n, 1) - regionPt;
284 const label nNewPatches = regionPatches.size();
294 this->removeFvBoundary();
297 forAll(regionPatches, patchi)
305 this->addFvPatches(newRegionPatches,
true);
313 forAll(edgePatches, edgeI)
315 const labelList& eFaces = extrudedPatch_.edgeFaces()[edgeI];
317 if (eFaces.size() != 2 || nonManifoldEdge.test(edgeI))
319 edgePatches[edgeI].setSize(eFaces.size(), sidePatchID);
325 extruder.setRefinement
328 model_().expansionRatio(),
330 labelList(extrudedPatch_.size(), topPatchID),
331 labelList(extrudedPatch_.size(), bottomPatchID),
343 extruder.updateMesh(map());
345 this->setInstance(this->thisDb().time().
constant());
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
bool set(const label i, bool val=true)
A bitSet::set() method for a list of bool.
A HashTable to objects of type <T> with a label key.
static void mapCombineReduce(Container &values, CombineOp cop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Forwards to Pstream::mapReduce with an in-place cop.
const T * set(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie,...
void size(const label n)
Older name for setAddressableSize.
label size() const noexcept
The number of entries in the list.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
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....
Creates mesh by extruding a patch.
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.
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, IOobjectOption::readOption readOpt=IOobjectOption::MUST_READ) const
Find entry and assign to T val. FatalIOError if it is found and the number of tokens is incorrect,...
dictionary()
Default construct, a top-level empty dictionary.
entry * set(entry *entryPtr)
Assign a new entry, overwriting any existing entry.
static autoPtr< extrudeModel > New(const dictionary &dict)
Select null constructed.
Mesh at a patch created on the fly. The following entry should be used on the field boundary dictiona...
A face is a list of labels corresponding to mesh vertices.
Mesh data needed to do the Finite Volume discretisation.
fvMesh(const fvMesh &)=delete
No copy construct.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
static const word & regionName(const word ®ion)
The mesh region name or word::null if polyMesh::defaultRegion.
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.
Direct mesh changes based on v1.3 polyTopoChange syntax.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Foam::word regionName(args.getOrDefault< word >("region", Foam::polyMesh::defaultRegion))
Different types of constants.
PtrList< polyPatch > polyPatchList
Store lists of polyPatch as a PtrList.
List< labelList > labelListList
List of labelList.
List< label > labelList
A List of labels.
List< face > faceList
List of faces.
constexpr scalar degToRad() noexcept
Multiplication factor for degrees to radians conversion.
PrimitivePatch< List< face >, const pointField & > primitiveFacePatch
A PrimitivePatch with List storage for the faces, const reference for the point field.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Field< vector > vectorField
Specialisation of Field<T> for vector.
vector point
Point is a vector.
static constexpr const zero Zero
Global zero (0).
vectorField pointField
pointField is a vectorField.
dimensionedScalar cos(const dimensionedScalar &ds)
wordList patchTypes(nPatches)
wordList patchNames(nPatches)
#define forAll(list, i)
Loop across all elements in list.
Unit conversion functions.