51 "\n Usage: cellToFace <cellSet> all|both|outside\n\n"
52 " Select -all : all faces of cells in the cellSet\n"
53 " -both: faces where both neighbours are in the cellSet\n\n"
61Foam::cellToFace::cellActionNames_
63 { cellAction::ALL,
"all" },
64 { cellAction::BOTH,
"both" },
65 { cellAction::OUTSIDE,
"outside" }
71template<
class Selector>
72void Foam::cellToFace::combineImpl
76 const Selector& cellLabels
82 for (
const label celli : cellLabels)
89 else if (option_ ==
BOTH)
93 const label nInt =
mesh_.nInternalFaces();
100 for (label facei = 0; facei < nInt; ++facei)
102 if (cellLabels.found(own[facei]) && cellLabels.found(nei[facei]))
116 label facei =
pp.start();
119 neiInSet[facei-nInt] = cellLabels.found(own[facei]);
132 label facei =
pp.start();
135 if (cellLabels.found(own[facei]) && neiInSet[facei-nInt])
148 const label nInt =
mesh_.nInternalFaces();
155 for (label facei = 0; facei < nInt; ++facei)
157 if (cellLabels.found(own[facei]) != cellLabels.found(nei[facei]))
171 label facei =
pp.start();
174 neiInSet[facei-nInt] = cellLabels.found(own[facei]);
185 label facei =
pp.start();
188 if (cellLabels.found(own[facei]) != neiInSet[facei-nInt])
199 <<
"Selected option is not available"
200 <<
", option: " << cellActionNames_[option_]
206void Foam::cellToFace::combine
215 const labelList& cellLabels = mesh_.cellZones()[setName];
217 combineImpl(set,
add, cellLabels);
225 <<
"Cannot load set " << setName <<
endl;
231 combineImpl(set,
add, cellLabels);
240 const polyMesh&
mesh,
242 const cellAction option
261 option_(cellActionNames_.get(
"option",
dict))
290 Info<<
" Adding faces according to cell "
291 << (isZone_ ?
"zones: " :
"sets: ")
295 for (
const word& setName : names_)
297 combine(set,
true, setName);
304 Info<<
" Removing faces according to cell "
305 << (isZone_ ?
"zones: " :
"sets: ")
309 for (
const word& setName : names_)
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
@ NO_REGISTER
Do not request registration (bool: false).
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A collection of cell labels.
A topoSetFaceSource to select all the faces from given cellSet(s).
cellToFace(const polyMesh &mesh, const word &setName, const cellAction option)
Construct from components.
cellAction
Enumeration defining the valid options.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
Mesh consisting of general polyhedral cells.
The topoSetFaceSource is a intermediate class for handling topoSet sources for selecting faces.
topoSetFaceSource(const polyMesh &mesh)
Construct from mesh.
Class with constructor to add usage string to table.
Base class of a source for a topoSet.
static bool readNames(const dictionary &dict, wordList &names)
Helper: extract wordList of patches/zones from dictionary. Returns.
void addOrDelete(topoSet &set, const label id, const bool add) const
Add or delete id from set. Add when 'add' is true.
setAction
Enumeration defining various actions.
@ SUBTRACT
Subtract elements from current set.
@ ADD
Add elements to current set.
@ NEW
Create a new set and ADD elements to it.
bool verbose_
Output verbosity (default: true).
const polyMesh & mesh() const noexcept
Reference to the mesh.
const polyMesh & mesh_
Reference to the mesh.
static Istream & checkIs(Istream &is)
Check state of stream.
General set of labels of mesh quantity (points, cells, faces).
static fileName localPath(const polyMesh &mesh, const word &name)
Name of file set will use.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
const polyBoundaryMesh & patches
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
bool read(const char *buf, int32_t &val)
Same as readInt32.
bool exists(const fileName &name, const bool checkGzip=true, const bool followLink=true)
Does the name exist (as DIRECTORY or FILE) in the file system?
List< label > labelList
A List of labels.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
messageStream Info
Information stream (stdout output on master, null elsewhere).
Ostream & endl(Ostream &os)
Add newline and flush stream.
void add(DimensionedField< scalar, GeoMesh > &result, const dimensioned< scalar > &dt1, const DimensionedField< scalar, GeoMesh > &f2)
messageStream SeriousError
Error stream (stdout output on all processes), with additional 'FOAM Serious Error' header text.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
List< bool > boolList
A List of bools.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a).
dict add("bounds", meshBb)
#define forAll(list, i)
Loop across all elements in list.