Go to the documentation of this file.
65 fieldToCell::typeName,
66 "\n Usage: fieldToCell field min max\n\n"
67 " Select all cells with field value >= min and <= max\n\n"
73 void Foam::fieldToCell::applyToSet
75 const topoSetSource::setAction action,
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_
168 fieldName_(checkIs(is)),
169 min_(readScalar(checkIs(is))),
170 max_(readScalar(checkIs(is)))
176 void Foam::fieldToCell::applyToSet
198 <<
"Cannot read field " << fieldName_
206 IFstream str(typeFilePath<labelIOList>(fieldObject));
213 applyToSet(action, internalVals, set);
217 IFstream str(typeFilePath<labelIOList>(fieldObject));
224 applyToSet(action,
mag(internalVals), set);
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
A class for handling words, derived from Foam::string.
Read field as dictionary (without mesh).
Input from file stream, using an ISstream.
fieldToCell(const polyMesh &mesh, const word &fieldName, const scalar min, const scalar max)
Construct from components.
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.
Class with constructor to add usage string to table.
static word timeName(const scalar t, const int precision=precision_)
Ostream & endl(Ostream &os)
Add newline and flush stream.
setAction
Enumeration defining the valid actions.
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Create a new set and ADD elements to it.
A topoSetCellSource to select cells based on volScalarField values, i.e. select cells with given fiel...
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Mesh consisting of general polyhedral cells.
#define forAll(list, i)
Loop across all elements in list.
bool verbose_
Verbosity (default: true)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
messageStream Info
Information stream (uses stdout - output is on the master only)
addNamedToRunTimeSelectionTable(topoSetCellSource, badQualityToCell, word, badQuality)
General set of labels of mesh quantity (points, cells, faces).
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Macros for easy insertion into run-time selection tables.
Subtract elements from the set.
const word & headerClassName() const
Return name of the class name read from header.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
The topoSetCellSource is a intermediate class for handling topoSet sources for selecting cells.
const Time & time() const
Return the top-level database.
defineTypeNameAndDebug(combustionModel, 0)
#define WarningInFunction
Report a warning using Foam::Warning.