46 void Foam::fieldToCell::applyToSet
48 const topoSetSource::setAction action,
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
132 mesh().time().
name(),
142 <<
"Cannot read field " << fieldName_
143 <<
" from time " << mesh().time().name() <<
endl;
159 fieldDict, mesh().nCells()
162 applyToSet(action, internalVals, set);
169 mesh().time().
name(),
190 fieldDict, mesh().nCells()
193 applyToSet(action,
mag(internalVals), set);
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
static const char *const typeName
fileName filePath(const word &typeName, const bool global) const
Return complete path + object name if the file exists.
const word & headerClassName() const
Return name of the class name read from header.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Read field as dictionary (without mesh).
A topoSetSource to select cells based on field values.
fieldToCell(const polyMesh &mesh, const word &fieldName, const scalar min, const scalar max)
Construct from components.
virtual ~fieldToCell()
Destructor.
Mesh consisting of general polyhedral cells.
Base class of a source for a topoSet.
setAction
Enumeration defining the valid actions.
General set of labels of mesh quantity (points, cells, faces).
Templated form of IOobject providing type information for file reading and header type checking.
A class for handling words, derived from string.
IOobject fieldObject(fieldNames[var2field[nVar]], runTime.name(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE)
volScalarField scalarField(fieldObject, mesh)
#define WarningInFunction
Report a warning using Foam::Warning.
addToRunTimeSelectionTable(polyPatch, mergedCyclicPolyPatch, word)
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
dimensioned< scalar > mag(const dimensioned< Type > &)
defineTypeNameAndDebug(combustionModel, 0)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)