58 "\n Usage: faceToCell <faceSet> neighbour|owner|any|all\n\n" 59 " Select cells that are the owner|neighbour|any" 60 " of the faces in the faceSet or where all faces are in the faceSet\n\n" 64 Foam::faceToCell::faceActionNames_;
69 void Foam::faceToCell::combine(
topoSet&
set,
const bool add)
const 72 faceSet loadedSet(mesh_, setName_);
78 const label faceI = iter.key();
80 if ((option_ == OWNER) || (option_ == ANY))
82 const label cellI = mesh_.faceOwner()[faceI];
84 addOrDelete(
set, cellI, add);
87 if (mesh_.isInternalFace(faceI))
89 if ((option_ == NEIGHBOUR) || (option_ == ANY))
91 const label cellI = mesh_.faceNeighbour()[faceI];
93 addOrDelete(
set, cellI, add);
107 const label faceI = iter.key();
108 const label own = mesh_.faceOwner()[faceI];
112 if (fndOwn == facesPerCell.
end())
114 facesPerCell.insert(own, 1);
121 if (mesh_.isInternalFace(faceI))
123 label nei = mesh_.faceNeighbour()[faceI];
127 if (fndNei == facesPerCell.
end())
129 facesPerCell.insert(nei, 1);
142 const label cellI = iter.key();
144 if (iter() == mesh_.cells()[cellI].size())
146 addOrDelete(
set, cellI, add);
177 setName_(dict.
lookup(
"set")),
178 option_(faceActionNames_.read(dict.
lookup(
"option")))
190 setName_(checkIs(is)),
191 option_(faceActionNames_.read(checkIs(is)))
211 Info<<
" Adding cells according to faceSet " << setName_
218 Info<<
" Removing cells according to faceSet " << setName_
virtual void applyToSet(const topoSetSource::setAction action, topoSet &) const
General set of labels of mesh quantity (points, cells, faces).
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
A class for handling words, derived from string.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A list of keyword definitions, which are a keyword followed by any number of values (e...
AccessType combine(const List< T > &, AccessOp aop=accessOp< T >())
Combines sublists into one big list.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
faceAction
Enumeration defining the valid options.
Ostream & endl(Ostream &os)
Add newline and flush stream.
setAction
Enumeration defining the valid actions.
Macros for easy insertion into run-time selection tables.
label size() const
Return number of elements in table.
Initialise the NamedEnum HashTable from the static list of names.
Mesh consisting of general polyhedral cells.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
virtual ~faceToCell()
Destructor.
static iteratorEnd end()
iteratorEnd set to beyond the end of any HashTable
Base class of a source for a topoSet.
iterator find(const Key &)
Find and return an iterator set at the hashedEntry.
Class with constructor to add usage string to table.
faceToCell(const polyMesh &mesh, const word &setName, const faceAction option)
Construct from components.
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)