43 searchableSurfaceToFaceZone,
51 void Foam::searchableSurfaceToFaceZone::combine
62 interiorFaceFaces[facei] = facei;
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];
95 nbrCc[interiorFacei] =
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;
142 forAll(interiorFaceFaces, interiorFacei)
144 const label facei = interiorFaceFaces[interiorFacei];
147 const label nbrSide =
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);
200 const polyMesh&
mesh,
201 const dictionary&
dict
207 searchableSurface::
New
218 searchableSurface::geometryDir(
mesh.
time()),
226 tol_(
dict.lookupOrDefault<scalar>(
"tol",
dimless, rootSmall))
244 if (!isA<faceZoneSet>(set))
247 <<
"Operation only allowed on a faceZoneSet." <<
endl;
251 faceZoneSet& fzSet = refCast<faceZoneSet>(set);
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.
Macros for easy insertion into run-time selection tables.
Motion of the mesh specified as a list of pointMeshMovers.
const polyBoundaryMesh & boundary() const
Return boundary mesh.
virtual const labelList & faceOwner() const
Return face owner.
virtual const labelList & faceNeighbour() const
Return face neighbour.
label nInternalFaces() const
const vectorField & cellCentres() const
bool isInternalFace(const label faceIndex) const
Return true if given face label is internal to the mesh.
searchableSurfaceToFaceZone(const polyMesh &mesh, const dictionary &dict)
Construct from dictionary.
virtual ~searchableSurfaceToFaceZone()
Destructor.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &) const
setAction
Enumeration defining the valid actions.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#define WarningInFunction
Report a warning using Foam::Warning.
const unitSet & lookup(const word &unitName)
Lookup and return the named unit from the table.
const dimensionSet & dimless
List< label > labelList
A List of labels.
dimensionedScalar sign(const dimensionedScalar &ds)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
addToRunTimeSelectionTable(polyPatch, mergedCyclicPolyPatch, word)
void add(GeometricField< typename typeOfSum< Type1, Type2 >::type, GeoMesh, PrimitiveField1 > &gf, const GeometricField< Type1, GeoMesh, PrimitiveField2 > &gf1, const GeometricField< Type2, GeoMesh, PrimitiveField3 > &gf2)
Ostream & endl(Ostream &os)
Add newline and flush stream.
vectorField pointField
pointField is a vectorField.
Vector< scalar > vector
A scalar version of the templated Vector.
Field< vector > vectorField
Specialisation of Field<T> for vector.
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
treeBoundBox combine(const treeBoundBox &a, const treeBoundBox &b)
defineTypeNameAndDebug(atmosphericBoundaryLayer, 0)
tmp< DimensionedField< TypeR, GeoMesh, Field > > New(const tmp< DimensionedField< TypeR, GeoMesh, Field >> &tdf1, const word &name, const dimensionSet &dimensions)