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" 58 Foam::faceToCell::faceActionNames_
60 { faceAction::ANY,
"any" },
61 { faceAction::ALL,
"all" },
62 { faceAction::OWNER,
"owner" },
63 { faceAction::NEIGHBOUR,
"neighbour" },
69 void Foam::faceToCell::combine
77 faceSet loadedSet(
mesh_, setName);
82 for (
const label facei : faceLabels)
84 if ((option_ ==
OWNER) || (option_ ==
ANY))
107 Map<label> facesPerCell(loadedSet.size());
109 for (
const label facei : faceLabels)
125 const label celli = iter.key();
126 const label
count = iter.val();
141 const polyMesh&
mesh,
143 const faceAction option
147 names_(
one{}, setName),
154 const polyMesh&
mesh,
155 const dictionary&
dict 158 topoSetCellSource(
mesh),
160 option_(faceActionNames_.
get(
"option",
dict))
163 if (!
dict.readIfPresent(
"sets", names_))
173 const polyMesh&
mesh,
177 topoSetCellSource(
mesh),
178 names_(one{}, word(checkIs(is))),
179 option_(faceActionNames_.read(checkIs(is)))
195 Info<<
" Adding cells according to faceSet " 199 for (
const word& setName : names_)
208 Info<<
" Removing cells according to faceSet " 212 for (
const word& setName : names_)
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
void size(const label n)
Older name for setAddressableSize.
void resize(const label len)
Adjust allocated size of list.
virtual const labelList & faceNeighbour() const
Return face neighbour.
Create a new set and ADD elements to it.
Add elements to current set.
constexpr char nl
The newline '\n' character (0x0a)
T & first()
Access first element of the list, position [0].
const cellList & cells() const
The topoSetCellSource is a intermediate class for handling topoSet sources for selecting cells...
void addOrDelete(topoSet &set, const label id, const bool add) const
Add or delete id from set. Add when 'add' is true.
Macros for easy insertion into run-time selection tables.
bool isInternalFace(const label faceIndex) const noexcept
Return true if given face label is internal to the mesh.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
AccessType combine(const UList< T > &lists, AccessOp aop=accessOp< T >())
Combines sub-lists into a single list.
setAction
Enumeration defining various actions.
virtual const labelList & faceOwner() const
Return face owner.
const polyMesh & mesh_
Reference to the mesh.
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
defineTypeNameAndDebug(combustionModel, 0)
General set of labels of mesh quantity (points, cells, faces).
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
Subtract elements from current set.
faceToCell(const polyMesh &mesh, const word &setName, const faceAction option)
Construct from components.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Class with constructor to add usage string to table.
messageStream Info
Information stream (stdout output on master, null elsewhere)
faceAction
Enumeration defining the valid options.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
forAllConstIters(mixture.phases(), phase)
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.