62 dict.get<scalar>(
"resolveFeatureAngle")
73 "locationsOutsideMesh",
77 useLeakClosure_(
dict.getOrDefault<
bool>(
"useLeakClosure", false)),
78 faceZoneControls_(
dict.subOrEmptyDict(
"faceZoneControls")),
79 allowFreeStandingZoneFaces_
83 useTopologicalSnapDetection_
85 dict.getOrDefault(
"useTopologicalSnapDetection", true)
87 maxLoadUnbalance_(
dict.getOrDefault<scalar>(
"maxLoadUnbalance", 0)),
90 dict.getOrDefault<
Switch>(
"handleSnapProblems", true)
94 dict.getOrDefault<
Switch>(
"interfaceRefine", true)
96 nErodeCellZone_(
dict.getOrDefault<label>(
"nCellZoneErodeIter", 0)),
97 nFilterIter_(
dict.getOrDefault<label>(
"nFilterIter", 2)),
98 minCellFraction_(
dict.getOrDefault<scalar>(
"minCellFraction", 0)),
99 nMinCells_(
dict.getOrDefault<label>(
"nMinCells", 0)),
102 point locationInMesh;
106 locationsInMesh_.
append(locationInMesh);
107 zonesInMesh_.
append(
"none");
112 <<
"Cannot both specify 'locationInMesh' and 'locationsInMesh'"
125 locationsInMesh_[
nZones] = pointsToZone[i].
first();
126 zonesInMesh_[
nZones] = pointsToZone[i].second();
129 zonesInMesh_[
nZones] =
"none";
137 <<
"No 'locationInMesh' or 'locationsInMesh' provided"
142 const scalar featAngle
144 meshRefinement::get<scalar>(
dict,
"resolveFeatureAngle", dryRun)
147 if (featAngle < 0 || featAngle > 180)
170 if (faceZoneControls_.found(fzName))
174 if (fzDict.
found(
"patchInfo"))
176 patchInfo = fzDict.
subDict(
"patchInfo");
197 if (zonesInMesh_[i] !=
word::null && zonesInMesh_[i] !=
"none")
213 const bool checkInsideMesh,
229 const point& location = locations[i];
233 label globalCellI = -1;
235 if (localCellI != -1)
237 globalCellI = globalCells.
toGlobal(localCellI);
242 if (checkInsideMesh && globalCellI == -1)
245 <<
"Point " << location
246 <<
" is not inside the mesh or on a face or edge." <<
nl
247 <<
"Bounding box of the mesh:" <<
mesh.
bounds()
252 label procI = globalCells.whichProcID(globalCellI);
253 label procCellI = globalCells.
toLocal(procI, globalCellI);
255 Info<<
"Found point " << location <<
" in cell " << procCellI
256 <<
" on processor " << procI <<
endl;
258 if (globalCells.
isLocal(globalCellI))
260 cellLabels[i] = localCellI;
283 && zonesInMesh[i] !=
"none"
305 || zonesInMesh[i] ==
"none"
334 const point& pt = locationsInMesh[i];
336 const label index = allZoneNames.
find(
name);
344 allLocations[index].
append(pt);
348 allZoneNames.
append(
"outside");
349 allLocations.
append(locationsOutsideMesh);
353 return std::move(allLocations);
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
DynamicList< T, SizeMin > & shrink()
Shrink the allocated space to the number of elements used.
void append(const T &val)
Copy append an element to the end of this list.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void setSize(const label n)
Alias for resize()
void append(const T &val)
Append an element at the end of the list.
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
T & first()
Return the first element of the list.
label find(const T &val, label pos=0) const
Find index of the first occurrence of the value.
void size(const label n)
Older name for setAddressableSize.
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.
ITstream & lookup(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Search for an entry (const access) with the given keyword.
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
label toGlobal(const label i) const
From local to global index.
label toLocal(const label i) const
From global to local on current processor.
bool isLocal(const label i) const
Is on local processor.
Helper class which maintains intersections of (changing) mesh with (static) surfaces.
Mesh consisting of general polyhedral cells.
label findCell(const point &p, const cellDecomposition=CELL_TETS) const
Find cell enclosing this location and return index.
const boundBox & bounds() const
Return mesh bounding box.
const labelIOList & tetBasePtIs() const
Return the tetBasePtIs.
label nCells() const noexcept
Number of mesh cells.
Simple container to keep together refinement specific information.
static labelList unzonedLocations(const wordList &zonesInMesh)
Extract indices of unnamed locations ('keepPoints')
labelList addCellZonesToMesh(polyMesh &) const
Add cellZones to mesh. Return indices of cellZones (or -1)
static labelList zonedLocations(const wordList &zonesInMesh)
Extract indices of named locations (so excludes 'keepPoints')
static labelList findCells(const bool checkInsideMesh, const polyMesh &, const pointField &locations)
Checks that cells are in mesh. Returns cells (or -1) they.
static List< pointField > zonePoints(const pointField &locationsInMesh, const wordList &zonesInMesh, const pointField &locationsOutsideMesh)
Helper: per zone (entry in zonesInMesh) the locations with.
dictionary getZoneInfo(const word &fzName, surfaceZonesInfo::faceZoneType &faceType) const
Get patchInfo and faceType for faceZone.
faceZoneType
What to do with faceZone faces.
static const Enum< faceZoneType > faceZoneTypeNames
static label addCellZone(const word &name, const labelList &addressing, polyMesh &mesh)
A class for handling words, derived from Foam::string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const labelIOList & zoneIDs
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
List< label > labelList
A List of labels.
messageStream Info
Information stream (stdout output on master, null elsewhere)
vectorField pointField
pointField is a vectorField.
Ostream & endl(Ostream &os)
Add newline and flush stream.
constexpr scalar degToRad() noexcept
Multiplication factor for degrees to radians conversion.
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensionedScalar cos(const dimensionedScalar &ds)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.
static const char *const typeName
The type name used in ensight case files.
Unit conversion functions.