45 searchableSurfaceToFaceZone,
50 topoSetFaceZoneSource,
51 searchableSurfaceToFaceZone,
56 topoSetFaceZoneSource,
57 searchableSurfaceToFaceZone,
66 searchableSurfaceToFaceZone::typeName,
67 "\n Usage: searchableSurfaceToFaceZone surface\n\n" 68 " Select all faces whose cell-cell centre vector intersects the surface " 88 const word& defaultName
107 const word& surfaceType,
121 mesh.time().constant(),
141 dict.getCompat<
word>(
"surfaceType", {{
"surface", 0}}),
156 if (!isA<faceZoneSet>(
set))
159 <<
"Operation only allowed on a faceZoneSet." <<
endl;
164 faceZoneSet& fzSet = refCast<faceZoneSet>(
set);
175 for (label facei = 0; facei < mesh_.nInternalFaces(); facei++)
177 start[facei] = cc[mesh_.faceOwner()[facei]];
178 end[facei] = cc[mesh_.faceNeighbour()[facei]];
185 const polyBoundaryMesh&
pbm = mesh_.boundaryMesh();
187 for (
const polyPatch&
pp :
pbm)
193 label facei =
pp.start()+i;
194 start[facei] = cc[mesh_.faceOwner()[facei]];
195 end[facei] = nbrCellCentres[facei-mesh_.nInternalFaces()];
202 label facei =
pp.start()+i;
203 start[facei] = cc[mesh_.faceOwner()[facei]];
204 end[facei] = mesh_.faceCentres()[facei];
213 List<pointIndexHit> hits;
214 surfacePtr_().findLine(start,
end, hits);
216 surfacePtr_().getNormal(hits, normals);
226 Info<<
" Adding all faces from surface " 227 << surfacePtr_().name() <<
" ..." <<
endl;
230 DynamicList<label> newAddressing(fzSet.addressing());
231 DynamicList<bool> newFlipMap(fzSet.flipMap());
235 if (hits[facei].hit() && !fzSet.found(facei))
237 newAddressing.append(facei);
239 newFlipMap.append((normals[facei] & d) < 0);
243 fzSet.addressing().transfer(newAddressing);
244 fzSet.flipMap().transfer(newFlipMap);
251 Info<<
" Removing all faces from surface " 252 << surfacePtr_().name() <<
" ..." <<
endl;
256 DynamicList<label> newAddressing(fzSet.addressing().size());
257 DynamicList<bool> newFlipMap(fzSet.flipMap().size());
259 forAll(fzSet.addressing(), i)
261 if (!hits[fzSet.addressing()[i]].hit())
263 newAddressing.append(fzSet.addressing()[i]);
264 newFlipMap.append(fzSet.flipMap()[i]);
267 fzSet.addressing().transfer(newAddressing);
268 fzSet.flipMap().transfer(newFlipMap);
const polyBoundaryMesh & pbm
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Create a new set and ADD elements to it.
Add elements to current set.
Ostream & endl(Ostream &os)
Add newline and flush stream.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
Base class of (analytical or triangulated) surface. Encapsulates all the search routines. WIP.
static word getSurfaceName(const dictionary &dict, const word &defaultName)
searchableSurfaceToFaceZone(const word &surfaceType, const polyMesh &mesh, const dictionary &dict)
Construct surface-type from dictionary.
Macros for easy insertion into run-time selection tables.
addNamedToRunTimeSelectionTable(topoSetCellSource, badQualityToCell, word, badQuality)
#define forAll(list, i)
Loop across all elements in list.
vectorField pointField
pointField is a vectorField.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
A topoSetSource to select all faces whose cell-cell centre vector intersects with a given searchableS...
A class for handling words, derived from Foam::string.
setAction
Enumeration defining various actions.
static word getSurfaceName(const dictionary &dict, word surfaceName)
const wordList surface
Standard surface field types (scalar, vector, tensor, etc)
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
defineTypeNameAndDebug(combustionModel, 0)
General set of labels of mesh quantity (points, cells, faces).
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
Subtract elements from current set.
#define WarningInFunction
Report a warning using Foam::Warning.
Class with constructor to add usage string to table.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Field< vector > vectorField
Specialisation of Field<T> for vector.
The topoSetFaceZoneSource is a intermediate class for handling topoSet sources for selecting face zon...
Mesh consisting of general polyhedral cells.
Registry of regIOobjects.
Defines the attributes of an object for which implicit objectRegistry management is supported...
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
T getOrDefaultCompat(const word &keyword, std::initializer_list< std::pair< const char *, int >> compat, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T, or return the given default value using any compatibility names if needed...