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<edgeTopoDistanceData<label>> allEdgeInfo(
patch.nEdges());
87 List<edgeTopoDistanceData<label>> allFaceInfo(
patch.size());
89 DynamicList<label> changedEdges;
90 DynamicList<edgeTopoDistanceData<label>> changedInfo;
95 for (
const label edgei : fEdges)
97 changedEdges.append(edgei);
100 edgeTopoDistanceData<label>
113 edgeTopoDistanceData<label>
125 forAll(allFaceInfo, facei)
129 allFaceInfo[facei].valid(calc.data())
130 && allFaceInfo[facei].data() == zonei
133 faceZone[facei] = zonei;
139 void Foam::regionToFace::combine(topoSet&
set,
const bool add)
const
143 Info<<
" Loading subset " << setName_
144 <<
" to delimit search region." <<
endl;
147 faceSet subSet(mesh_, setName_);
151 IndirectList<face>(mesh_.faces(), subSet.toc()),
158 Tuple2<scalar, label>
168 scalar d2 =
magSqr(fc-nearPoint_);
170 if (!ni.first().hit() || d2 < ni.second().first())
172 ni.second().first() = d2;
174 ni.first().setPoint(fc);
175 ni.first().setIndex(i);
184 Info<<
" Found nearest face at " << ni.first().rawPoint()
185 <<
" on processor " << ni.second().second()
186 <<
" face " << ni.first().index()
194 ni.second().second(),
202 if (faceRegion[facei] == 0)
214 const polyMesh&
mesh,
216 const point& nearPoint
221 nearPoint_(nearPoint)
244 setName_(checkIs(is)),
245 nearPoint_(checkIs(is))
261 Info<<
" Adding all faces of connected region of set "
262 << setName_ <<
" starting from point " << nearPoint_
272 Info<<
" Removing all cells of connected region of set "
273 << setName_ <<
" starting from point " << nearPoint_
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
List< label > labelList
A List of labels.
@ ADD
Add elements to current set.
void set(List< bool > &bools, const labelRange &range)
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
void combineReduce(const List< UPstream::commsStruct > &comms, T &Value, const CombineOp &cop, const int tag, const label comm)
Ostream & endl(Ostream &os)
virtual void applyToSet(const topoSetSource::setAction action, topoSet &) const
The topoSetFaceSource is a intermediate class for handling topoSet sources for selecting faces.
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
@ NEW
Create a new set and ADD elements to it.
Mesh consisting of general polyhedral cells.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
regionToFace(const polyMesh &mesh, const word &setName, const point &nearPoint)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
AccessType combine(const UList< T > &lists, AccessOp aop=accessOp< T >())
Tuple2< pointIndexHit, Tuple2< scalar, label > > nearInfo
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
Subtract elements from current set.
PrimitivePatch< IndirectList< face >, const pointField & > indirectPrimitivePatch
A PrimitivePatch with an IndirectList for the faces, const reference for the point field.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
PointIndexHit< point > pointIndexHit
A PointIndexHit for 3D points.
static int myProcNo(const label communicator=worldComm)
dimensionedScalar sqrt(const dimensionedScalar &ds)
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
vector point
Point is a vector.
defineTypeNameAndDebug(combustionModel, 0)