43 searchableSurfaceToFaceZone,
51 void Foam::searchableSurfaceToFaceZone::combine
58 labelList interiorFaceFaces(mesh_.nFaces());
60 forAll(mesh_.faceNeighbour(), facei)
62 interiorFaceFaces[facei] = facei;
64 label nInteriorFaces = mesh_.nInternalFaces();
67 const polyPatch& patch = mesh_.boundaryMesh()[
patchi];
72 const label facei = patch.start() + patchFacei;
73 interiorFaceFaces[nInteriorFaces] = facei;
78 interiorFaceFaces.resize(nInteriorFaces);
90 forAll(ownCc, interiorFacei)
92 const label facei = interiorFaceFaces[interiorFacei];
94 ownCc[interiorFacei] = cc[mesh_.faceOwner()[facei]];
95 nbrCc[interiorFacei] =
96 mesh_.isInternalFace(facei)
97 ? cc[mesh_.faceNeighbour()[facei]]
98 : boundaryNbrCc[facei - mesh_.nInternalFaces()];
104 List<pointIndexHit> hits;
106 surfacePtr_().findLine
108 ownCc + tol_*(ownCc - nbrCc),
109 nbrCc - tol_*(ownCc - nbrCc),
112 surfacePtr_().getNormal(hits, normals);
118 forAll(hits, interiorFacei)
120 if (hits[interiorFacei].hit())
122 const label facei = interiorFaceFaces[interiorFacei];
124 const vector d = nbrCc[interiorFacei] - ownCc[interiorFacei];
125 const bool sign = (normals[interiorFacei] & d) < 0;
127 side[mesh_.faceOwner()[facei]] = sign ? -1 : +1;
129 if (mesh_.isInternalFace(facei))
131 side[mesh_.faceNeighbour()[facei]] = sign ? +1 : -1;
142 forAll(interiorFaceFaces, interiorFacei)
144 const label facei = interiorFaceFaces[interiorFacei];
146 const label ownSide = side[mesh_.faceOwner()[facei]];
147 const label nbrSide =
148 mesh_.isInternalFace(facei)
149 ? side[mesh_.faceNeighbour()[facei]]
150 : boundaryNbrSide[facei - mesh_.nInternalFaces()];
152 direction[facei] = ownSide*nbrSide < 0 ? ownSide - nbrSide : 0;
156 DynamicList<label> newAddressing;
157 DynamicList<bool> newFlipMap;
161 newAddressing = DynamicList<label>(fzSet.addressing());
162 newFlipMap = DynamicList<bool>(fzSet.flipMap());
167 if (
direction[facei] != 0 && !fzSet.found(facei))
169 newAddressing.append(facei);
177 newAddressing = DynamicList<label>(fzSet.addressing().size());
178 newFlipMap = DynamicList<bool>(fzSet.flipMap().size());
181 forAll(fzSet.addressing(), i)
183 if (
direction[fzSet.addressing()[i]] == 0)
185 newAddressing.append(fzSet.addressing()[i]);
186 newFlipMap.append(fzSet.flipMap()[i]);
190 fzSet.addressing().transfer(newAddressing);
191 fzSet.flipMap().transfer(newFlipMap);
215 mesh.objectRegistry::db().
name()
219 mesh.objectRegistry::db(),
244 if (!isA<faceZoneSet>(
set))
247 <<
"Operation only allowed on a faceZoneSet." <<
endl;
255 Info<<
" Adding all faces from surface " 256 << surfacePtr_().name() <<
" ..." <<
endl;
262 Info<<
" Removing all faces from surface " 263 << surfacePtr_().name() <<
" ..." <<
endl;
#define forAll(list, i)
Loop across all elements in list.
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const word & name() const
Return name.
searchableSurfaceToFaceZone(const polyMesh &mesh, const dictionary &dict)
Construct from dictionary.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Ostream & endl(Ostream &os)
Add newline and flush stream.
Vector< scalar > vector
A scalar version of the templated Vector.
Macros for easy insertion into run-time selection tables.
Base class of a source for a topoSet.
vectorField pointField
pointField is a vectorField.
static const word & geometryDir()
Return the geometry directory name.
A class for handling words, derived from string.
const word & constant() const
Return constant name.
setAction
Enumeration defining the valid actions.
List< label > labelList
A List of labels.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
virtual ~searchableSurfaceToFaceZone()
Destructor.
const Time & time() const
Return time.
defineTypeNameAndDebug(combustionModel, 0)
Like faceSet but -reads data from faceZone -updates faceZone when writing.
General set of labels of mesh quantity (points, cells, faces).
virtual void applyToSet(const topoSetSource::setAction action, topoSet &) const
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
#define WarningInFunction
Report a warning using Foam::Warning.
static autoPtr< searchableSurface > New(const word &surfaceType, const IOobject &io, const dictionary &dict)
Return a reference to the selected searchableSurface.
Field< vector > vectorField
Specialisation of Field<T> for vector.
Mesh consisting of general polyhedral cells.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
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.