67 regionToFace::typeName,
68 "\n Usage: regionToFace <faceSet> (x y z)\n\n"
69 " Select all faces in the connected region of the faceSet"
70 " starting from the point.\n"
76void Foam::regionToFace::markZone
78 const indirectPrimitivePatch& patch,
86 List<edgeTopoDistanceData<label>> allEdgeInfo(patch.nEdges());
87 List<edgeTopoDistanceData<label>>
allFaceInfo(patch.size());
89 DynamicList<label> changedEdges;
90 DynamicList<edgeTopoDistanceData<label>> changedInfo;
94 const labelList& fEdges = patch.faceEdges()[facei];
95 for (
const label edgei : fEdges)
97 changedEdges.append(edgei);
100 edgeTopoDistanceData<label>
113 edgeTopoDistanceData<label>
133 faceZone[facei] = zonei;
139void Foam::regionToFace::combine
148 Info<<
" Loading subset " << setName_
149 <<
" to delimit search region." <<
nl;
171 scalar d2 =
magSqr(fc-nearPoint_);
173 if (!ni.first().hit() || d2 < ni.second().first())
175 ni.second().first() = d2;
176 ni.first().hitPoint(fc);
177 ni.first().setIndex(i);
186 Info<<
" Found nearest face at " << ni.first().point()
187 <<
" on processor " << ni.second().second()
188 <<
" face " << ni.first().index()
196 ni.second().second(),
204 if (faceRegion[facei] == 0)
206 addOrDelete(set,
patch.addressing()[facei],
add);
218 const point& nearPoint
224 nearPoint_(nearPoint)
240 if (!
dict.readIfPresent(
"set", setName_))
243 dict.readEntry(
"zone", setName_);
256 setName_(checkIs(is)),
274 Info<<
" Adding all faces of connected region of "
275 << (isZone_ ?
"zone " :
"set ")
276 << setName_ <<
" starting from point " << nearPoint_
282 combine(set,
true, mesh_.faceZones()[setName_].addressing());
287 combine(set,
true, subSet.sortedToc());
294 Info<<
" Removing all cells of connected region of "
295 << (isZone_ ?
"zone " :
"set ")
296 << setName_ <<
" starting from point " << nearPoint_
302 combine(set,
false, mesh_.faceZones()[setName_].addressing());
307 combine(set,
false, subSet.sortedToc());
Macros for easy insertion into run-time selection tables.
#define addNamedToRunTimeSelectionTable(baseType, thisType, argNames, lookupName)
Add to construction table with 'lookupName' as the key.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
List< Key > sortedToc() const
The table of contents (the keys) in sorted order.
@ NO_REGISTER
Do not request registration (bool: false).
A List with indirect addressing.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
static void combineReduce(T &value, CombineOp cop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce) applying cop to inplace combine value from different processors.
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Negative if the process is not a...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Tuple2< pointIndexHit, Tuple2< scalar, label > > nearInfo
Helper class for finding nearest.
Mesh consisting of general polyhedral cells.
A topoSetFaceSource to select cells belonging to a topologically connected region (that contains give...
virtual void applyToSet(const topoSetSource::setAction action, topoSet &) const
Apply specified action to the topoSet.
regionToFace(const polyMesh &mesh, const word &setName, const point &nearPoint)
Construct from components.
The topoSetFaceSource is a intermediate class for handling topoSet sources for selecting faces.
topoSetFaceSource(const polyMesh &mesh)
Construct from mesh.
Class with constructor to add usage string to table.
Base class of a source for a topoSet.
setAction
Enumeration defining various actions.
@ SUBTRACT
Subtract elements from current set.
@ ADD
Add elements to current set.
@ NEW
Create a new set and ADD elements to it.
bool verbose_
Output verbosity (default: true).
const polyMesh & mesh() const noexcept
Reference to the mesh.
const polyMesh & mesh_
Reference to the mesh.
static Istream & checkIs(Istream &is)
Check state of stream.
General set of labels of mesh quantity (points, cells, faces).
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
List< wallPoints > allFaceInfo(mesh_.nFaces())
const std::string patch
OpenFOAM patch number as a std::string.
List< label > labelList
A List of labels.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
messageStream Info
Information stream (stdout output on master, null elsewhere).
T returnReduce(const T &value, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void add(DimensionedField< scalar, GeoMesh > &result, const dimensioned< scalar > &dt1, const DimensionedField< scalar, GeoMesh > &f2)
dimensionedScalar sqrt(const dimensionedScalar &ds)
PrimitivePatch< IndirectList< face >, const pointField & > indirectPrimitivePatch
A PrimitivePatch with an IndirectList for the faces, const reference for the point field.
vector point
Point is a vector.
static constexpr const zero Zero
Global zero (0).
PointIndexHit< point > pointIndexHit
A PointIndexHit with a 3D point.
UList< label > labelUList
A UList of labels.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
constexpr char nl
The newline '\n' character (0x0a).
#define forAll(list, i)
Loop across all elements in list.