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" 61 Foam::cellToFace::cellActionNames_
63 { cellAction::ALL,
"all" },
64 { cellAction::BOTH,
"both" },
65 { cellAction::OUTSIDE,
"outside" }
71 template<
class Selector>
72 void Foam::cellToFace::combineImpl
76 const Selector& cellLabels
82 for (
const label celli : cellLabels)
89 else if (option_ ==
BOTH)
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])
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_]
206 void 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
245 topoSetFaceSource(
mesh),
254 const polyMesh&
mesh,
255 const dictionary&
dict 261 option_(cellActionNames_.
get(
"option",
dict))
272 names_(
Foam::
one{}, word(checkIs(is))),
274 option_(cellActionNames_.read(checkIs(is)))
290 Info<<
" Adding faces according to cell " 291 << (isZone_ ?
"zones: " :
"sets: ")
295 for (
const word& setName : names_)
304 Info<<
" Removing faces according to cell " 305 << (isZone_ ?
"zones: " :
"sets: ")
309 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.
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual const labelList & faceNeighbour() const
Return face neighbour.
cellAction
Enumeration defining the valid options.
Create a new set and ADD elements to it.
Add elements to current set.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
const cellList & cells() const
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.
Base class of a source for a topoSet.
#define forAll(list, i)
Loop across all elements in list.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
AccessType combine(const UList< T > &lists, AccessOp aop=accessOp< T >())
Combines sub-lists into a single list.
messageStream SeriousError
Error stream (stdout output on all processes), with additional 'FOAM Serious Error' header text...
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
The topoSetFaceSource is a intermediate class for handling topoSet sources for selecting faces...
setAction
Enumeration defining various actions.
virtual const labelList & faceOwner() const
Return face owner.
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?
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
label nInternalFaces() const noexcept
Number of internal faces.
const polyMesh & mesh_
Reference to the mesh.
cellToFace(const polyMesh &mesh, const word &setName, const cellAction option)
Construct from components.
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).
Subtract elements from current set.
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.
const polyBoundaryMesh & patches
messageStream Info
Information stream (stdout output on master, null elsewhere)
Mesh consisting of general polyhedral cells.
List< label > labelList
A List of labels.
label nBoundaryFaces() const noexcept
Number of boundary faces (== nFaces - nInternalFaces)
List< bool > boolList
A List of bools.
static fileName localPath(const polyMesh &mesh, const word &name)
Name of file set will use.
Do not request registration (bool: false)
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)
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.