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
142 <<
"Cannot read field " << fieldName_
153 volScalarField::typeName
159 fieldDict,
mesh().nCells()
162 applyToSet(action, internalVals, set);
184 volVectorField::typeName
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.
fileName filePath(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 keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
const word & name() const
Return const reference to name.
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.
const Time & time() const
Return the top-level database.
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.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
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.
void mag(LagrangianPatchField< scalar > &f, const LagrangianPatchField< Type > &f1)
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
defineTypeNameAndDebug(combustionModel, 0)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.