48 regionToFace::typeName,
49 "\n Usage: regionToFace <faceSet> (x y z)\n\n" 50 " Select all faces in the connected region of the faceSet" 51 " starting from the point.\n" 57 void Foam::regionToFace::markZone
59 const indirectPrimitivePatch& patch,
67 List<patchEdgeFaceRegion> allEdgeInfo(patch.nEdges());
68 List<patchEdgeFaceRegion> allFaceInfo(patch.size());
70 DynamicList<label> changedEdges;
71 DynamicList<patchEdgeFaceRegion> changedInfo;
75 const labelList& fEdges = patch.faceEdges()[facei];
78 changedEdges.append(fEdges[i]);
79 changedInfo.append(zoneI);
101 if (allFaceInfo[facei].region() == zoneI)
103 faceZone[facei] = zoneI;
109 void Foam::regionToFace::combine(topoSet&
set,
const bool add)
const 111 Info<<
" Loading subset " << setName_ <<
" to delimit search region." 113 faceSet subSet(mesh_, setName_);
115 indirectPrimitivePatch patch
117 IndirectList<face>(mesh_.faces(), subSet.toc()),
124 Tuple2<scalar, label>
133 const point& fc = patch.faceCentres()[i];
134 scalar d2 =
magSqr(fc-nearPoint_);
136 if (!ni.first().hit() || d2 < ni.second().first())
138 ni.second().first() = d2;
140 ni.first().setPoint(fc);
141 ni.first().setIndex(i);
148 Info<<
" Found nearest face at " << ni.first().rawPoint()
149 <<
" on processor " << ni.second().second()
150 <<
" face " << ni.first().index()
151 <<
" distance " <<
Foam::sqrt(ni.second().first()) << endl;
157 ni.second().second(),
165 if (faceRegion[facei] == 0)
167 addOrDelete(
set, patch.addressing()[facei],
add);
179 const point& nearPoint
184 nearPoint_(nearPoint)
195 setName_(dict.
lookup(
"set")),
196 nearPoint_(dict.
lookup(
"nearPoint"))
207 setName_(checkIs(is)),
208 nearPoint_(checkIs(is))
228 Info<<
" Adding all faces of connected region of set " 230 <<
" starting from point " 231 << nearPoint_ <<
" ..." <<
endl;
237 Info<<
" Removing all cells of connected region of set " 239 <<
" starting from point " 240 << 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< IndirectList< face >, 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.