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);
178 extrudedPatch_, extrudedPatch_.points()
195 labelList localRegionPoints(localToGlobalRegion.size());
196 forAll(pointLocalRegions, facei)
198 const face&
f = extrudedPatch_.localFaces()[facei];
199 const face& pRegions = pointLocalRegions[facei];
202 localRegionPoints[pRegions[fp]] =
f[fp];
207 pointField localRegionNormals(localToGlobalRegion.size());
211 forAll(pointLocalRegions, facei)
213 const face& pRegions = pointLocalRegions[facei];
216 label localRegionI = pRegions[fp];
217 localSum[localRegionI] +=
218 extrudedPatch_.faceNormals()[facei];
222 Map<point> globalSum(2*localToGlobalRegion.size());
224 forAll(localSum, localRegionI)
226 label globalRegionI = localToGlobalRegion[localRegionI];
227 globalSum.insert(globalRegionI, localSum[localRegionI]);
233 forAll(localToGlobalRegion, localRegionI)
235 label globalRegionI = localToGlobalRegion[localRegionI];
236 localRegionNormals[localRegionI] = globalSum[globalRegionI];
238 localRegionNormals /=
mag(localRegionNormals);
244 forAll(firstDisp, regionI)
247 const point& regionPt = extrudedPatch_.points()
249 extrudedPatch_.meshPoints()
251 localRegionPoints[regionI]
254 const vector&
n = localRegionNormals[regionI];
255 firstDisp[regionI] = model_()(regionPt,
n, 1) - regionPt;
258 const label nNewPatches = regionPatches.size();
261 createShellMesh extruder
268 this->removeFvBoundary();
269 this->addFvPatches(regionPatches,
true);
277 forAll(edgePatches, edgeI)
279 const labelList& eFaces = extrudedPatch_.edgeFaces()[edgeI];
281 if (eFaces.size() != 2 || nonManifoldEdge.test(edgeI))
283 edgePatches[edgeI].
setSize(eFaces.size(), sidePatchID);
287 polyTopoChange meshMod(nNewPatches);
289 extruder.setRefinement
292 model_().expansionRatio(),
294 labelList(extrudedPatch_.size(), topPatchID),
295 labelList(extrudedPatch_.size(), bottomPatchID),
300 autoPtr<mapPolyMesh> map = meshMod.changeMesh
307 extruder.updateMesh(map());
309 this->setInstance(this->thisDb().time().constant());
List< labelList > labelListList
A List of labelList.
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)
List< face > faceList
A List of faces.
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...
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.
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)
Foam::word regionName(Foam::polyMesh::defaultRegion)
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.
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...
static constexpr const zero Zero
Global zero (0)