49 "\n Usage: faceToCell <faceSet> neighbour|owner|any|all\n\n"
50 " Select cells that are the owner|neighbour|any"
51 " of the faces in the faceSet or where all faces are in the faceSet\n\n"
58Foam::faceToCell::faceActionNames_
60 { faceAction::ANY,
"any" },
61 { faceAction::ALL,
"all" },
62 { faceAction::OWNER,
"owner" },
63 { faceAction::NEIGHBOUR,
"neighbour" },
69template<
class Selector>
70void Foam::faceToCell::combineImpl
80 if ((option_ ==
OWNER) || (option_ ==
ANY))
82 const label celli =
mesh_.faceOwner()[facei];
87 if (
mesh_.isInternalFace(facei))
91 const label celli =
mesh_.faceNeighbour()[facei];
108 ++(facesPerCell(
mesh_.faceOwner()[facei], 0));
110 if (
mesh_.isInternalFace(facei))
113 ++(facesPerCell(
mesh_.faceNeighbour()[facei], 0));
121 const label celli = iter.key();
122 const label
count = iter.val();
124 if (count ==
mesh_.cells()[celli].size())
133void Foam::faceToCell::combine
161 const polyMesh&
mesh,
163 const faceAction option
182 option_(faceActionNames_.get(
"option",
dict))
211 Info<<
" Adding cells according to face "
212 << (isZone_ ?
"zones: " :
"sets: ")
216 for (
const word& setName : names_)
218 combine(set,
true, setName);
225 Info<<
" Removing cells according to face "
226 << (isZone_ ?
"zones: " :
"sets: ")
230 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.
labelList faceLabels(nFaceLabels)
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 list of keyword definitions, which are a keyword followed by a number of values (eg,...
A topoSetCellSource to select all cells based on usage in given faceSet(s), e.g. select cells that ar...
faceToCell(const polyMesh &mesh, const word &setName, const faceAction option)
Construct from components.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
faceAction
Enumeration defining the valid options.
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 topoSetCellSource is a intermediate class for handling topoSet sources for selecting cells.
topoSetCellSource(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).
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
bool read(const char *buf, int32_t &val)
Same as readInt32.
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).
void add(DimensionedField< scalar, GeoMesh > &result, const dimensioned< scalar > &dt1, const DimensionedField< scalar, GeoMesh > &f2)
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
constexpr char nl
The newline '\n' character (0x0a).
dict add("bounds", meshBb)
#define forAllConstIters(container, iter)
Iterate across all elements of the container object with const access.