49 { selectionModeType::smAll,
"all" },
50 { selectionModeType::smFaceSet,
"faceSet" },
51 { selectionModeType::smFaceZone,
"faceZone" },
52 { selectionModeType::smPatch,
"patch" },
53 { selectionModeType::smFaceZone,
"volFaceZone" }
104 <<
"Unknown selectionMode " 106 <<
". Valid selectionMode types : " 119 for (
const label facei : faces_)
121 sumArea += regionMesh().S()[facei];
123 reduce(sumArea, sumOp<scalar>());
125 const scalar old(A_);
137 <<
" face(s) with area " << A_ <<
endl;
144 switch (selectionMode_)
149 faces_ =
identity(regionMesh().nFaces());
157 <<
"- selecting face subset using volume-mesh faceSet " 160 const faceSet
subset(mesh_, zoneName());
171 if (
subset.test(meshFacei))
173 faces_[nUsed] = facei;
177 faces_.resize(nUsed);
184 <<
"- selecting face subset using volume-mesh faceZones " 187 const auto& zones = mesh_.faceZones();
195 <<
"No matching faceZones: " 216 if (
subset.test(meshFacei))
218 faces_[nUsed] = facei;
222 faces_.resize(nUsed);
229 <<
"- selecting face subset using volume-mesh patches " 232 const polyBoundaryMesh&
pbm = mesh_.boundaryMesh();
240 <<
"No matching patches: " 242 <<
"Valid patches : " 249 const List<labelPair>& patchFaces = regionMesh().whichPatchFaces();
251 faces_.resize_nocopy(patchFaces.size());
256 const label patchi = patchFaces[facei].first();
260 faces_[nUsed] = facei;
264 faces_.resize(nUsed);
271 <<
"Unknown selectionMode " 272 << selectionModeTypeNames_[selectionMode_]
273 <<
". Valid selectionMode types are " 274 << selectionModeTypeNames_
282 <<
"No faces selected!" <<
endl;
292 const word& modelType,
300 selectionMode_(selectionModeTypeNames_.
get(
"selectionMode", coeffs_)),
323 if (mesh_.changing())
325 if (mesh_.topoChanging())
349 if (coeffs_.readIfPresent(
"timeStart", timeStart_))
351 coeffs_.readEntry(
"duration", duration_);
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
const labelList patchIDs(pbm.indices(polyPatchNames, true))
const polyBoundaryMesh & pbm
const labelIOList & zoneIDs
Ostream & indent(Ostream &os)
Indent stream.
errorManipArg< error, int > exit(error &err, const int errNo=1)
void resize(const label len)
Adjust allocated size of list.
void setFaceSelection()
Set face selection based on user input selection mode.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
constexpr char nl
The newline '\n' character (0x0a)
bool empty() const noexcept
True if List is empty (ie, size() is zero)
"patch" : subset with (volume) patches
T & first()
Access first element of the list, position [0].
Ostream & endl(Ostream &os)
Add newline and flush stream.
wordRes selectionNames_
Face selection names (for set, zone or patch selections)
virtual bool isActive()
Is the source active?
static unsigned int defaultPrecision() noexcept
Return the default precision.
const word & timeName() const noexcept
Return the current time name.
labelList faceLabels(nFaceLabels)
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
UList< label > labelUList
A UList of labels.
#define forAll(list, i)
Loop across all elements in list.
faceSetOption(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
bool returnReduceAnd(const bool value, const label comm=UPstream::worldComm)
Perform logical (and) MPI Allreduce on a copy. Uses UPstream::reduceAnd.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i), works like std::iota() but returning a...
void clear()
Clear the list, i.e. set size to zero.
A class for handling words, derived from Foam::string.
defineTypeNameAndDebug(limitHeight, 0)
"faceZone" : subset with (volume) zone faces
virtual bool read(const dictionary &dict)
Read source dictionary.
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
static const Enum< selectionModeType > selectionModeTypeNames_
List of selection mode type names.
List< T > subset(const BoolListType &select, const UList< T > &input, const bool invert=false)
Extract elements of the input list when select is true.
#define WarningInFunction
Report a warning using Foam::Warning.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
selectionModeType selectionMode_
Face selection mode.
void setSelection(const dictionary &dict)
Set face selection name from dictionary input.
Mesh data needed to do the Finite Volume discretisation.
virtual bool read(const dictionary &dict)
Read source dictionary.
messageStream Info
Information stream (stdout output on master, null elsewhere)
"faceSet" : subset with (volume) face set
virtual bool isActive()
Is the source active?
List< label > labelList
A List of labels.
selectionModeType
Enumeration for selection mode types.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
void setArea()
Recalculate the area.
void reduce(T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce) using linear/tree communication schedule.
dictionary coeffs_
Dictionary containing source coefficients.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.