47 fieldToCell::typeName,
48 "\n Usage: fieldToCell field min max\n\n" 49 " Select all cells with field value >= min and <= max\n\n" 55 void Foam::fieldToCell::applyToSet
62 Info<<
" Field min:" <<
min(field)
63 <<
" max:" <<
max(field) <<
endl;
67 Info<<
" Adding all cells with value of field " << fieldName_
68 <<
" within range " << min_ <<
".." << max_ <<
endl;
72 if (field[celli] >= min_ && field[celli] <= max_)
80 Info<<
" Removing all cells with value of field " << fieldName_
81 <<
" within range " << min_ <<
".." << max_ <<
endl;
85 if (field[celli] >= min_ && field[celli] <= max_)
99 const word& fieldName,
105 fieldName_(fieldName),
118 fieldName_(dict.
lookup(
"field")),
119 min_(dict.
lookup<scalar>(
"min")),
120 max_(dict.
lookup<scalar>(
"max"))
131 fieldName_(checkIs(is)),
145 void Foam::fieldToCell::applyToSet
167 <<
"Cannot read field " << fieldName_
172 IFstream str(typeFilePath<labelIOList>(fieldObject));
179 applyToSet(action, internalVals,
set);
183 IFstream str(typeFilePath<labelIOList>(fieldObject));
190 applyToSet(action,
mag(internalVals),
set);
#define forAll(list, i)
Loop across all elements in list.
virtual ~fieldToCell()
Destructor.
bool typeHeaderOk(const bool checkType=true)
Read header (uses typeFilePath to find file) and check header.
A list of keyword definitions, which are a keyword followed by any number of values (e...
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Ostream & endl(Ostream &os)
Add newline and flush stream.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
const Time & time() const
Return the top-level database.
IOobject fieldObject(fieldNames[var2field[nVar]], runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE)
Macros for easy insertion into run-time selection tables.
Base class of a source for a topoSet.
A class for handling words, derived from string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
setAction
Enumeration defining the valid actions.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if successful.
Read field as dictionary (without mesh).
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
General set of labels of mesh quantity (points, cells, faces).
#define WarningInFunction
Report a warning using Foam::Warning.
Class with constructor to add usage string to table.
dimensioned< scalar > mag(const dimensioned< Type > &)
Mesh consisting of general polyhedral cells.
fieldToCell(const polyMesh &mesh, const word &fieldName, const scalar min, const scalar max)
Construct from components.
const word & headerClassName() const
Return name of the class name read from header.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.