46 void Foam::fieldToCell::applyToSet
53 Info<<
" Field min:" <<
min(field)
54 <<
" max:" <<
max(field) <<
endl;
58 Info<<
" Adding all cells with value of field " << fieldName_
59 <<
" within range " << min_ <<
".." << max_ <<
endl;
63 if (field[celli] >= min_ && field[celli] <= max_)
71 Info<<
" Removing all cells with value of field " << fieldName_
72 <<
" within range " << min_ <<
".." << max_ <<
endl;
76 if (field[celli] >= min_ && field[celli] <= max_)
90 const word& fieldName,
96 fieldName_(fieldName),
109 fieldName_(dict.
lookup(
"field")),
110 min_(dict.
lookup<scalar>(
"min")),
111 max_(dict.
lookup<scalar>(
"max"))
123 void Foam::fieldToCell::applyToSet
139 if (!fieldObject.IOobject::headerOk())
142 <<
"Cannot read field " << fieldName_
145 else if (fieldObject.IOobject::headerOk())
159 fieldDict,
mesh().nCells()
162 applyToSet(action, internalVals,
set);
176 if (fieldObject.IOobject::headerOk())
190 fieldDict,
mesh().nCells()
193 applyToSet(action,
mag(internalVals),
set);
#define forAll(list, i)
Loop across all elements in list.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
virtual ~fieldToCell()
Destructor.
A list of keyword definitions, which are a keyword followed by any number of values (e...
static const char *const typeName
Templated form of IOobject providing type information for file reading and header type checking...
Ostream & endl(Ostream &os)
Add newline and flush stream.
const Time & time() const
Return the top-level database.
IOobject fieldObject(fieldNames[var2field[nVar]], runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE)
fileName filePath() const
Return the path for the file for this Type.
Macros for easy insertion into run-time selection tables.
Base class of a source for a topoSet.
static word timeName(const scalar, const int precision=curPrecision_)
Return time name of given scalar time.
A class for handling words, derived from string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
setAction
Enumeration defining the valid actions.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
Read field as dictionary (without mesh).
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
General set of labels of mesh quantity (points, cells, faces).
#define WarningInFunction
Report a warning using Foam::Warning.
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.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.