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.lookupOrDefault(
"useTopologicalSnapDetection",
true)
86 maxLoadUnbalance_(
dict.lookupOrDefault<scalar>(
"maxLoadUnbalance", 0)),
89 dict.lookupOrDefault<
Switch>(
"handleSnapProblems",
true)
93 dict.lookupOrDefault<
Switch>(
"interfaceRefine",
true)
95 nErodeCellZone_(
dict.lookupOrDefault<
label>(
"nCellZoneErodeIter", 0)),
96 nFilterIter_(
dict.lookupOrDefault<
label>(
"nFilterIter", 2)),
101 if (
dict.readIfPresent(
"locationInMesh", locationInMesh))
103 locationsInMesh_.
append(locationInMesh);
104 zonesInMesh_.append(
"none");
106 if (
dict.found(
"locationsInMesh"))
109 <<
"Cannot both specify 'locationInMesh' and 'locationsInMesh'"
113 else if (
dict.readIfPresent(
"locationsInMesh", pointsToZone))
117 locationsInMesh_.setSize(
nZones+pointsToZone.size());
118 zonesInMesh_.setSize(locationsInMesh_.size());
122 locationsInMesh_[
nZones] = pointsToZone[i].first();
123 zonesInMesh_[
nZones] = pointsToZone[i].second();
124 if (zonesInMesh_[
nZones] == word::null)
126 zonesInMesh_[
nZones] =
"none";
134 <<
"No 'locationInMesh' or 'locationsInMesh' provided"
139 const scalar featAngle
141 meshRefinement::get<scalar>(
dict,
"resolveFeatureAngle", dryRun)
144 if (featAngle < 0 || featAngle > 180)
164 patchInfo.
add(
"type", wallPolyPatch::typeName);
165 faceType = surfaceZonesInfo::INTERNAL;
167 if (faceZoneControls_.found(fzName))
171 if (fzDict.
found(
"patchInfo"))
173 patchInfo = fzDict.
subDict(
"patchInfo");
179 faceType = surfaceZonesInfo::faceZoneTypeNames[faceTypeName];
194 if (zonesInMesh_[i] != word::null && zonesInMesh_[i] !=
"none")
196 zoneIDs[i] = surfaceZonesInfo::addCellZone
210 const bool checkInsideMesh,
216 (void)
mesh.tetBasePtIs();
226 const point& location = locations[i];
228 label localCellI =
mesh.findCell(location, polyMesh::FACE_DIAG_TRIS);
230 label globalCellI = -1;
232 if (localCellI != -1)
234 globalCellI = globalCells.toGlobal(localCellI);
239 if (checkInsideMesh && globalCellI == -1)
242 <<
"Point " << location
243 <<
" is not inside the mesh or on a face or edge." <<
nl
244 <<
"Bounding box of the mesh:" <<
mesh.bounds()
249 label procI = globalCells.whichProcID(globalCellI);
250 label procCellI = globalCells.toLocal(procI, globalCellI);
252 Info<<
"Found point " << location <<
" in cell " << procCellI
253 <<
" on processor " << procI <<
endl;
255 if (globalCells.isLocal(globalCellI))
257 cellLabels[i] = localCellI;
279 zonesInMesh[i] != word::null
280 && zonesInMesh[i] !=
"none"
301 zonesInMesh[i] == word::null
302 || 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.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
messageStream Info
Information stream (uses stdout - output is on the master only)
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,...
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)