37 const bool forceReference
42 word refCellName = field.
name() +
"RefCell";
43 word refPointName = field.
name() +
"RefPoint";
45 word refValueName = field.
name() +
"RefValue";
47 if (dict.
found(refCellName))
49 if (Pstream::master())
53 if (refCelli < 0 || refCelli >= field.
mesh().nCells())
58 ) <<
"Illegal master cellID " << refCelli
59 <<
". Should be 0.." << field.
mesh().nCells()
68 else if (dict.
found(refPointName))
73 refCelli = field.
mesh().findCell(refPointi, polyMesh::FACE_PLANES);
75 label hasRef = (refCelli >= 0 ? 1 : 0);
82 refCelli = field.
mesh().findCell(refPointi);
84 hasRef = (refCelli >= 0 ? 1 : 0);
93 ) <<
"Unable to set reference cell for field " << field.
name()
94 <<
nl <<
" Reference point " << refPointName
96 <<
" found on " << sumHasRef <<
" domains (should be one)" 105 ) <<
"Unable to set reference cell for field " << field.
name()
107 <<
" Please supply either " << refCellName
111 refValue = dict.
lookup<scalar>(refValueName);
128 const bool forceReference
131 return setRefCell(field, field, dict, refCelli, refValue, forceReference);
141 scalar refCellValue = (refCelli >= 0 ? field[refCelli] : 0.0);
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
const word & name() const
Return name.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by any number of values (e...
scalar getRefCellValue(const volScalarField &field, const label refCelli)
Return the current value of field in the reference cell.
Find the reference cell nearest (in index) to the given cell but which is not on a cyclic...
bool needReference() const
Does the field need a reference level for solution.
A class for handling words, derived from string.
const Mesh & mesh() const
Return mesh.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
bool setRefCell(const volScalarField &field, const volScalarField &fieldRef, const dictionary &dict, label &refCelli, scalar &refValue, const bool forceReference=false)
If the field fieldRef needs referencing find the reference cell nearest.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.