Go to the documentation of this file.
39 Foam::refinementParameters::refinementParameters
47 meshRefinement::get<label>(
dict,
"maxGlobalCells", dryRun)
51 meshRefinement::get<label>(
dict,
"maxLocalCells", dryRun)
55 meshRefinement::get<label>(
dict,
"minRefinementCells", dryRun)
62 dict.get<scalar>(
"resolveFeatureAngle")
67 meshRefinement::get<label>(
dict,
"nCellsBetweenLevels", dryRun)
73 "locationsOutsideMesh",
77 faceZoneControls_(
dict.subOrEmptyDict(
"faceZoneControls")),
78 allowFreeStandingZoneFaces_
80 meshRefinement::get<bool>(
dict,
"allowFreeStandingZoneFaces", dryRun)
82 useTopologicalSnapDetection_
84 dict.getOrDefault(
"useTopologicalSnapDetection",
true)
86 maxLoadUnbalance_(
dict.getOrDefault<scalar>(
"maxLoadUnbalance", 0)),
89 dict.getOrDefault<
Switch>(
"handleSnapProblems",
true)
93 dict.getOrDefault<
Switch>(
"interfaceRefine",
true)
95 nErodeCellZone_(
dict.getOrDefault<label>(
"nCellZoneErodeIter", 0)),
96 nFilterIter_(
dict.getOrDefault<label>(
"nFilterIter", 2)),
97 minCellFraction_(
dict.getOrDefault<scalar>(
"minCellFraction", 0)),
100 point locationInMesh;
102 if (
dict.readIfPresent(
"locationInMesh", locationInMesh))
104 locationsInMesh_.
append(locationInMesh);
105 zonesInMesh_.append(
"none");
107 if (
dict.found(
"locationsInMesh"))
110 <<
"Cannot both specify 'locationInMesh' and 'locationsInMesh'"
114 else if (
dict.readIfPresent(
"locationsInMesh", pointsToZone))
117 label
nZones = locationsInMesh_.size();
118 locationsInMesh_.setSize(
nZones+pointsToZone.size());
119 zonesInMesh_.setSize(locationsInMesh_.size());
123 locationsInMesh_[
nZones] = pointsToZone[i].first();
124 zonesInMesh_[
nZones] = pointsToZone[i].second();
125 if (zonesInMesh_[
nZones] == word::null)
127 zonesInMesh_[
nZones] =
"none";
135 <<
"No 'locationInMesh' or 'locationsInMesh' provided"
140 const scalar featAngle
142 meshRefinement::get<scalar>(
dict,
"resolveFeatureAngle", dryRun)
145 if (featAngle < 0 || featAngle > 180)
165 patchInfo.
add(
"type", wallPolyPatch::typeName);
166 faceType = surfaceZonesInfo::INTERNAL;
168 if (faceZoneControls_.found(fzName))
172 if (fzDict.
found(
"patchInfo"))
174 patchInfo = fzDict.
subDict(
"patchInfo");
180 faceType = surfaceZonesInfo::faceZoneTypeNames[faceTypeName];
195 if (zonesInMesh_[i] != word::null && zonesInMesh_[i] !=
"none")
197 zoneIDs[i] = surfaceZonesInfo::addCellZone
211 const bool checkInsideMesh,
217 (void)
mesh.tetBasePtIs();
227 const point& location = locations[i];
229 label localCellI =
mesh.findCell(location, polyMesh::FACE_DIAG_TRIS);
231 label globalCellI = -1;
233 if (localCellI != -1)
235 globalCellI = globalCells.toGlobal(localCellI);
240 if (checkInsideMesh && globalCellI == -1)
243 <<
"Point " << location
244 <<
" is not inside the mesh or on a face or edge." <<
nl
245 <<
"Bounding box of the mesh:" <<
mesh.bounds()
250 label procI = globalCells.whichProcID(globalCellI);
251 label procCellI = globalCells.toLocal(procI, globalCellI);
253 Info<<
"Found point " << location <<
" in cell " << procCellI
254 <<
" on processor " << procI <<
endl;
256 if (globalCells.isLocal(globalCellI))
258 cellLabels[i] = localCellI;
280 zonesInMesh[i] != word::null
281 && zonesInMesh[i] !=
"none"
302 zonesInMesh[i] == word::null
303 || zonesInMesh[i] ==
"none"
static labelList zonedLocations(const wordList &zonesInMesh)
Extract indices of named locations (so excludes 'keepPoints')
List< label > labelList
A List of labels.
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
faceZoneType
What to do with faceZone faces.
A class for handling words, derived from Foam::string.
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Search for an entry (const access) with the given keyword.
Unit conversion functions.
static labelList findCells(const bool checkInsideMesh, const polyMesh &, const pointField &locations)
Checks that cells are in mesh. Returns cells (or -1) they.
void append(const T &val)
Append an element at the end of the list.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const labelIOList & zoneIDs
Mesh consisting of general polyhedral cells.
#define forAll(list, i)
Loop across all elements in list.
messageStream Info
Information stream (stdout output on master, null elsewhere)
static labelList unzonedLocations(const wordList &zonesInMesh)
Extract indices of unnamed locations ('keepPoints')
DynamicList< T, SizeMin > & append(const T &val)
Append an element to the end of this list.
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
reduce(hasMovingMesh, orOp< bool >())
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
constexpr scalar degToRad(const scalar deg) noexcept
Conversion from degrees to radians.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dictionary getZoneInfo(const word &fzName, surfaceZonesInfo::faceZoneType &faceType) const
Get patchInfo and faceType for faceZone.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
labelList addCellZonesToMesh(polyMesh &) const
Add cellZones to mesh. Return indices of cellZones (or -1)
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
dimensionedScalar cos(const dimensionedScalar &ds)