47 void Foam::regionToFace::markZone
49 const indirectPrimitivePatch& patch,
57 List<patchEdgeFaceRegion> allEdgeInfo(patch.nEdges());
58 List<patchEdgeFaceRegion> allFaceInfo(patch.size());
60 DynamicList<label> changedEdges;
61 DynamicList<patchEdgeFaceRegion> changedInfo;
65 const labelList& fEdges = patch.faceEdges()[facei];
68 changedEdges.append(fEdges[i]);
69 changedInfo.append(zoneI);
91 if (allFaceInfo[facei].region() == zoneI)
93 faceZone[facei] = zoneI;
99 void Foam::regionToFace::combine(topoSet&
set,
const bool add)
const 101 Info<<
" Loading subset " << setName_ <<
" to delimit search region." 103 faceSet subSet(mesh_, setName_);
105 indirectPrimitivePatch patch
107 IndirectList<face>(mesh_.faces(), subSet.toc()),
114 Tuple2<scalar, label>
123 const point& fc = patch.faceCentres()[i];
124 scalar d2 =
magSqr(fc-nearPoint_);
126 if (!ni.first().hit() || d2 < ni.second().first())
128 ni.second().first() = d2;
130 ni.first().setPoint(fc);
131 ni.first().setIndex(i);
138 Info<<
" Found nearest face at " << ni.first().rawPoint()
139 <<
" on processor " << ni.second().second()
140 <<
" face " << ni.first().index()
141 <<
" distance " <<
Foam::sqrt(ni.second().first()) << endl;
147 ni.second().second(),
155 if (faceRegion[facei] == 0)
157 addOrDelete(
set, patch.addressing()[facei],
add);
169 const point& nearPoint
174 nearPoint_(nearPoint)
185 setName_(dict.
lookup(
"set")),
186 nearPoint_(dict.
lookup(
"nearPoint"))
206 Info<<
" Adding all faces of connected region of set " 208 <<
" starting from point " 209 << nearPoint_ <<
" ..." <<
endl;
215 Info<<
" Removing all cells of connected region of set " 217 <<
" starting from point " 218 << 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)
FvWallInfoData< WallInfo, label > 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)
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.
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.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
Mesh consisting of general polyhedral cells.
treeBoundBox combine(const treeBoundBox &a, const treeBoundBox &b)
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.