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_)
124 const polyMesh&
mesh,
125 const word& fieldName,
130 topoSetCellSource(
mesh),
131 fieldName_(fieldName),
138 <<
"Input min value = " << min_ <<
" is larger than " 139 <<
"input max value = " << max_ <<
" for field = " << fieldName_
147 const polyMesh&
mesh,
148 const dictionary&
dict 165 fieldName_(checkIs(is)),
166 min_(readScalar(checkIs(is))),
167 max_(readScalar(checkIs(is)))
173 void Foam::fieldToCell::applyToSet
195 <<
"Cannot read field " << fieldName_
198 else if (
"volScalarField" == fieldObject.headerClassName())
203 IFstream str(fieldObject.typeFilePath<
labelIOList>());
206 fieldDictionary fieldDict(fieldObject, fieldObject.headerClassName());
210 applyToSet(action, internalVals,
set);
212 else if (
"volVectorField" == fieldObject.headerClassName())
217 IFstream str(fieldObject.typeFilePath<
labelIOList>());
220 fieldDictionary fieldDict(fieldObject, fieldObject.headerClassName());
224 applyToSet(action,
mag(internalVals),
set);
229 <<
"Cannot handle fields of type " << fieldObject.headerClassName()
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
bool verbose_
Output verbosity (default: true)
Create a new set and ADD elements to it.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
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.
Ignore writing from objectRegistry::writeObject()
const Time & time() const
Return the top-level database.
The topoSetCellSource is a intermediate class for handling topoSet sources for selecting cells...
Macros for easy insertion into run-time selection tables.
addNamedToRunTimeSelectionTable(topoSetCellSource, badQualityToCell, word, badQuality)
#define forAll(list, i)
Loop across all elements in list.
IOList< label > labelIOList
IO for a List of label.
A class for handling words, derived from Foam::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
setAction
Enumeration defining various actions.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
static word timeName(const scalar t, const int precision=precision_)
Return a time name for the given scalar time value formatted with the given precision.
defineTypeNameAndDebug(combustionModel, 0)
General set of labels of mesh quantity (points, cells, faces).
Subtract elements from current set.
#define WarningInFunction
Report a warning using Foam::Warning.
Class with constructor to add usage string to table.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Field< vector > vectorField
Specialisation of Field<T> for vector.
Mesh consisting of general polyhedral cells.
fieldToCell(const polyMesh &mesh, const word &fieldName, const scalar min, const scalar max)
Construct from components.
Defines the attributes of an object for which implicit objectRegistry management is supported...
Do not request registration (bool: false)
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)