Go to the documentation of this file.
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"
76 void Foam::regionToFace::markZone
86 List<patchEdgeFaceRegion> allEdgeInfo(
patch.nEdges());
87 List<patchEdgeFaceRegion> allFaceInfo(
patch.size());
89 DynamicList<label> changedEdges;
90 DynamicList<patchEdgeFaceRegion> changedInfo;
95 for (
const label edgei : fEdges)
97 changedEdges.append(edgei);
98 changedInfo.append(zoneI);
118 forAll(allFaceInfo, facei)
120 if (allFaceInfo[facei].region() == zoneI)
122 faceZone[facei] = zoneI;
128 void Foam::regionToFace::combine(topoSet& set,
const bool add)
const
132 Info<<
" Loading subset " << setName_
133 <<
" to delimit search region." <<
endl;
136 faceSet subSet(mesh_, setName_);
140 IndirectList<face>(mesh_.faces(), subSet.toc()),
147 Tuple2<scalar, label>
157 scalar d2 =
magSqr(fc-nearPoint_);
159 if (!ni.first().hit() || d2 < ni.second().first())
161 ni.second().first() = d2;
163 ni.first().setPoint(fc);
164 ni.first().setIndex(i);
173 Info<<
" Found nearest face at " << ni.first().rawPoint()
174 <<
" on processor " << ni.second().second()
175 <<
" face " << ni.first().index()
183 ni.second().second(),
191 if (faceRegion[facei] == 0)
193 addOrDelete(set,
patch.addressing()[facei],
add);
205 const point& nearPoint
210 nearPoint_(nearPoint)
233 setName_(checkIs(is)),
234 nearPoint_(checkIs(is))
250 Info<<
" Adding all faces of connected region of set "
251 << setName_ <<
" starting from point " << nearPoint_
261 Info<<
" Removing all cells of connected region of set "
262 << setName_ <<
" starting from point " << nearPoint_
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
List< label > labelList
A List of labels.
A class for handling words, derived from Foam::string.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
static constexpr const zero Zero
Global zero.
Class with constructor to add usage string to table.
void combineReduce(const List< UPstream::commsStruct > &comms, T &Value, const CombineOp &cop, const int tag, const label comm)
Ostream & endl(Ostream &os)
Add newline and flush stream.
setAction
Enumeration defining the valid actions.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &) const
Apply specified action to the topoSet.
Base class of a topoSet source for selecting faces.
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Create a new set and ADD elements to it.
Mesh consisting of general polyhedral cells.
#define forAll(list, i)
Loop across all elements in list.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
regionToFace(const polyMesh &mesh, const word &setName, const point &nearPoint)
Construct from components.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
messageStream Info
Information stream (uses stdout - output is on the master only)
AccessType combine(const UList< T > &lists, AccessOp aop=accessOp< T >())
Combines sub-lists into a single list.
Tuple2< pointIndexHit, Tuple2< scalar, label > > nearInfo
Helper class for finding nearest.
addNamedToRunTimeSelectionTable(topoSetCellSource, badQualityToCell, word, badQuality)
General set of labels of mesh quantity (points, cells, faces).
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
Macros for easy insertion into run-time selection tables.
Subtract elements from the set.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
PrimitivePatch< face, IndirectList, const pointField & > indirectPrimitivePatch
A PrimitivePatch using an IndirectList for the faces.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
PointIndexHit< point > pointIndexHit
const std::string patch
OpenFOAM patch number as a std::string.
dimensionedScalar sqrt(const dimensionedScalar &ds)
vector point
Point is a vector.
const polyMesh & mesh_
Reference to the mesh.
defineTypeNameAndDebug(combustionModel, 0)