65 fieldToCell::typeName,
66 "\n Usage: fieldToCell field min max\n\n"
67 " Select all cells with field value >= min and <= max\n\n"
73void Foam::fieldToCell::applyToSet
75 const topoSetSource::setAction action,
76 const scalarField&
field,
89 Info<<
" Adding all cells with value of field " << fieldName_
90 <<
" within range " << min_ <<
".." << max_ <<
endl;
95 if (
field[celli] >= min_ &&
field[celli] <= max_)
105 Info<<
" Removing all cells with value of field " << fieldName_
106 <<
" within range " << min_ <<
".." << max_ <<
endl;
111 if (
field[celli] >= min_ &&
field[celli] <= max_)
125 const word& fieldName,
131 fieldName_(fieldName),
138 <<
"Input min value = " << min_ <<
" is larger than "
139 <<
"input max value = " << max_ <<
" for field = " << fieldName_
155 dict.get<scalar>(
"min"),
156 dict.get<scalar>(
"max")
168 fieldName_(checkIs(is)),
169 min_(readScalar(checkIs(is))),
170 max_(readScalar(checkIs(is)))
176void Foam::fieldToCell::applyToSet
198 <<
"Cannot read field " << fieldName_
206 IFstream str(typeFilePath<labelIOList>(fieldObject));
213 applyToSet(action, internalVals, set);
220 IFstream str(typeFilePath<labelIOList>(fieldObject));
227 applyToSet(action,
mag(internalVals), set);
Macros for easy insertion into run-time selection tables.
#define addNamedToRunTimeSelectionTable(baseType, thisType, argNames, lookupName)
Add to construction table with 'lookupName' as the key.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Input from file stream, using an ISstream.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const word & headerClassName() const noexcept
Return name of the class name read from header.
bool typeHeaderOk(const bool checkType=true, const bool search=true, const bool verbose=true)
Read header (uses typeFilePath to find file) and check its info.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
static word timeName(const scalar t, const int precision=precision_)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Read field as dictionary (without mesh).
A topoSetCellSource to select cells based on volScalarField values, i.e. select cells with given fiel...
const Time & time() const
Return the top-level database.
Mesh consisting of general polyhedral cells.
The topoSetCellSource is a intermediate class for handling topoSet sources for selecting cells.
Class with constructor to add usage string to table.
Base class of a source for a topoSet.
setAction
Enumeration defining various actions.
@ SUBTRACT
Subtract elements from current set.
@ ADD
Add elements to current set.
@ NEW
Create a new set and ADD elements to it.
bool verbose_
Output verbosity (default: true)
General set of labels of mesh quantity (points, cells, faces).
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define WarningInFunction
Report a warning using Foam::Warning.
void set(List< bool > &bools, const labelUList &locations)
Set the listed locations (assign 'true').
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.