52 regionToFace::typeName,
53 "\n Usage: regionToFace <faceSet> (x y z)\n\n" 54 " Select all faces in the connected region of the faceSet" 55 " starting from the point.\n" 61 void Foam::regionToFace::markZone
63 const indirectPrimitivePatch& patch,
71 List<patchEdgeFaceRegion> allEdgeInfo(patch.nEdges());
72 List<patchEdgeFaceRegion> allFaceInfo(patch.size());
74 DynamicList<label> changedEdges;
75 DynamicList<patchEdgeFaceRegion> changedInfo;
79 const labelList& fEdges = patch.faceEdges()[facei];
82 changedEdges.append(fEdges[i]);
83 changedInfo.append(zoneI);
103 forAll(allFaceInfo, facei)
105 if (allFaceInfo[facei].region() == zoneI)
107 faceZone[facei] = zoneI;
113 void Foam::regionToFace::combine(topoSet&
set,
const bool add)
const 115 Info<<
" Loading subset " << setName_ <<
" to delimit search region." 117 faceSet subSet(mesh_, setName_);
119 indirectPrimitivePatch patch
121 IndirectList<face>(mesh_.faces(), subSet.toc()),
128 Tuple2<scalar, label>
137 const point& fc = patch.faceCentres()[i];
138 scalar d2 =
magSqr(fc-nearPoint_);
140 if (!ni.first().hit() || d2 < ni.second().first())
142 ni.second().first() = d2;
144 ni.first().setPoint(fc);
145 ni.first().setIndex(i);
152 Info<<
" Found nearest face at " << ni.first().rawPoint()
153 <<
" on processor " << ni.second().second()
154 <<
" face " << ni.first().index()
155 <<
" distance " <<
Foam::sqrt(ni.second().first()) << endl;
161 ni.second().second(),
169 if (faceRegion[facei] == 0)
171 addOrDelete(
set, patch.addressing()[facei],
add);
184 const point& nearPoint
189 nearPoint_(nearPoint)
201 setName_(dict.
lookup(
"set")),
202 nearPoint_(dict.
lookup(
"nearPoint"))
214 setName_(checkIs(is)),
215 nearPoint_(checkIs(is))
235 Info<<
" Adding all faces of connected region of set " 237 <<
" starting from point " 238 << nearPoint_ <<
" ..." <<
endl;
244 Info<<
" Removing all cells of connected region of set " 246 <<
" starting from point " 247 << nearPoint_ <<
" ..." <<
endl;
#define forAll(list, i)
Loop across all elements in list.
void combineReduce(const List< UPstream::commsStruct > &comms, T &Value, const CombineOp &cop, const int tag, const label comm)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A list of keyword definitions, which are a keyword followed by any number of values (e...
virtual void applyToSet(const topoSetSource::setAction action, topoSet &) const
dimensionedSymmTensor sqr(const dimensionedVector &dv)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
PointIndexHit< point > pointIndexHit
PrimitivePatch< face, IndirectList, const pointField & > indirectPrimitivePatch
Foam::indirectPrimitivePatch.
AccessType combine(const List< T > &, AccessOp aop=accessOp< T >())
Combines sublists into one big list.
Macros for easy insertion into run-time selection tables.
Base class of a source for a topoSet.
A class for handling words, derived from string.
setAction
Enumeration defining the valid actions.
List< label > labelList
A List of labels.
virtual ~regionToFace()
Destructor.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
General set of labels of mesh quantity (points, cells, faces).
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.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
Mesh consisting of general polyhedral cells.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.