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;
173 ni.first().hitPoint(fc);
174 ni.first().setIndex(i);
183 Info<<
" Found nearest face at " << ni.first().point()
184 <<
" on processor " << ni.second().second()
185 <<
" face " << ni.first().index()
193 ni.second().second(),
201 if (faceRegion[facei] == 0)
203 addOrDelete(
set,
patch.addressing()[facei],
add);
213 const polyMesh&
mesh,
215 const point& nearPoint
220 nearPoint_(nearPoint)
243 setName_(checkIs(is)),
244 nearPoint_(checkIs(is))
260 Info<<
" Adding all faces of connected region of set " 261 << setName_ <<
" starting from point " << nearPoint_
271 Info<<
" Removing all cells of connected region of set " 272 << setName_ <<
" starting from point " << nearPoint_
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
virtual void applyToSet(const topoSetSource::setAction action, topoSet &) const
Apply specified action to the topoSet.
Create a new set and ADD elements to it.
Add elements to current set.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
PointIndexHit< point > pointIndexHit
A PointIndexHit with a 3D point.
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Can be negative if the process i...
PrimitivePatch< IndirectList< face >, const pointField & > indirectPrimitivePatch
A PrimitivePatch with an IndirectList for the faces, const reference for the point field...
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
Macros for easy insertion into run-time selection tables.
addNamedToRunTimeSelectionTable(topoSetCellSource, badQualityToCell, word, badQuality)
#define forAll(list, i)
Loop across all elements in list.
AccessType combine(const UList< T > &lists, AccessOp aop=accessOp< T >())
Combines sub-lists into a single list.
A class for handling words, derived from Foam::string.
The topoSetFaceSource is a intermediate class for handling topoSet sources for selecting faces...
setAction
Enumeration defining various actions.
static void combineReduce(const List< commsStruct > &comms, T &value, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce) applying cop to inplace combine value from different processors...
const polyMesh & mesh_
Reference to the mesh.
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
defineTypeNameAndDebug(combustionModel, 0)
General set of labels of mesh quantity (points, cells, faces).
Subtract elements from current set.
regionToFace(const polyMesh &mesh, const word &setName, const point &nearPoint)
Construct from components.
Tuple2< pointIndexHit, Tuple2< scalar, label > > nearInfo
Helper class for finding nearest.
vector point
Point is a vector.
Class with constructor to add usage string to table.
const std::string patch
OpenFOAM patch number as a std::string.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Mesh consisting of general polyhedral cells.
List< label > labelList
A List of labels.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)
static constexpr const zero Zero
Global zero (0)