36 maxGlobalCells_(
dict.lookup<
label>(
"maxGlobalCells")),
37 maxLocalCells_(
dict.lookup<
label>(
"maxLocalCells")),
38 minRefineCells_(
dict.lookup<
label>(
"minRefinementCells")),
48 nBufferLayers_(
dict.lookup<
label>(
"nCellsBetweenLevels")),
49 selectionPoints_(
dict),
50 allowFreeStandingZoneFaces_(
dict.lookup(
"allowFreeStandingZoneFaces")),
51 useTopologicalSnapDetection_
53 dict.lookupOrDefault<bool>(
"useTopologicalSnapDetection", true)
55 maxLoadUnbalance_(
dict.lookupOrDefault<scalar>(
"maxLoadUnbalance", 0)),
58 dict.lookupOrDefault<
Switch>(
"handleSnapProblems", true)
61 scalar featAngle(
dict.lookup<scalar>(
"resolveFeatureAngle",
unitDegrees));
63 if (featAngle < 0 || featAngle >
degToRad(180))
100 Info <<
"Cell selection insidePoints: " << inside_ <<
endl;
105 Info <<
"Cell selection outsidePoints: " << outside_ <<
endl;
108 if (!inside_.size() && !outside_.size())
111 <<
"Neither insidePoint/insidePoints nor "
112 "outsidePoint/outsidePoints specified: "
113 <<
"cannot select any cells."
136 const point& insidePoint = selectionPoints_.
inside()[i];
140 label globalCelli = -1;
142 if (localCelli != -1)
144 globalCelli = globalCells.
toGlobal(localCelli);
149 if (globalCelli == -1)
152 <<
"Point " << insidePoint
153 <<
" is not inside the mesh or on a face or edge." <<
nl
154 <<
"Bounding box of the mesh:" <<
mesh.
bounds()
160 label procCelli = globalCells.
toLocal(proci, globalCelli);
162 Info<<
"Found point " << insidePoint <<
" in cell " << procCelli
163 <<
" on processor " << proci <<
endl;
166 if (globalCells.
isLocal(globalCelli))
168 cellLabels[i] = localCelli;
#define forAll(list, i)
Loop across all elements in list.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
label whichProcID(const label i) const
Which processor does global come from? Binary search.
label toGlobal(const label i) const
From local to global.
label toLocal(const label i) const
From global to local on current processor.
bool isLocal(const label i) const
Is on local processor.
Mesh object that implements searches within the local cells and faces.
label findCell(const point &p, const pointInCellShapes=pointInCellShapes::tets) const
Find the cell containing the given point.
static const meshSearch & New(const polyMesh &mesh, const pointInCellShapes=pointInCellShapes::tets)
Lookup or construct from mesh and cell decomposition option.
Mesh consisting of general polyhedral cells.
const boundBox & bounds() const
Return mesh bounding box.
cellSelectionPoints(const dictionary &dict)
Constructor.
const List< point > & inside() const
Return the points inside the surface regions to selected cells.
refinementParameters(const dictionary &dict)
Construct from dictionary - new syntax.
labelList findCells(const polyMesh &) const
Checks that cells are in mesh. Returns cells they are in.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
errorManipArg< error, int > exit(error &err, const int errNo=1)
scalar degToRad(const scalar deg)
Convert degrees to radians.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet dimLength
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
dimensionedScalar cos(const dimensionedScalar &ds)
const unitConversion unitDegrees