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 void Foam::cellToFace::combine
85 cellSet loadedSet(
mesh_, setName);
91 for (
const label celli : cellLabels)
98 else if (option_ ==
BOTH)
109 for (label facei = 0; facei < nInt; ++facei)
111 if (cellLabels.found(own[facei]) && cellLabels.found(nei[facei]))
125 label facei =
pp.start();
128 neiInSet[facei-nInt] = cellLabels.found(own[facei]);
141 label facei =
pp.start();
144 if (cellLabels.found(own[facei]) && neiInSet[facei-nInt])
164 for (label facei = 0; facei < nInt; ++facei)
166 if (cellLabels.found(own[facei]) != cellLabels.found(nei[facei]))
180 label facei =
pp.start();
183 neiInSet[facei-nInt] = cellLabels.found(own[facei]);
194 label facei =
pp.start();
197 if (cellLabels.found(own[facei]) != neiInSet[facei-nInt])
208 <<
"Selected option is not available" 209 <<
", option: " << cellActionNames_[option_]
219 const polyMesh&
mesh,
221 const cellAction option
225 names_(
one{}, setName),
232 const polyMesh&
mesh,
233 const dictionary&
dict 236 topoSetFaceSource(
mesh),
238 option_(cellActionNames_.
get(
"option",
dict))
241 if (!
dict.readIfPresent(
"sets", names_))
251 const polyMesh&
mesh,
255 topoSetFaceSource(
mesh),
256 names_(one{}, word(checkIs(is))),
257 option_(cellActionNames_.read(checkIs(is)))
273 Info<<
" Adding faces according to cell sets: " 277 for (
const word& setName : names_)
286 Info<<
" Removing faces according to cell sets: " 290 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.
fileName path() const
Return path.
errorManipArg< error, int > exit(error &err, const int errNo=1)
void resize(const label len)
Adjust allocated size of list.
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.
constexpr char nl
The newline '\n' character (0x0a)
T & front()
Access first element of the list, position [0].
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.
#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.
const Time & time() const noexcept
Return time registry.
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).
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
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)
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.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
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.