45 mesh_(control.
mesh()),
62 control_.dict().subOrEmptyDict(
"residualControl")
69 const word& fName = iter().keyword();
74 <<
"Solution convergence criteria specified in " 75 << control_.algorithmName() <<
'.' << residualDict.dictName()
76 <<
" must be given as single values. Corrector loop " 77 <<
"convergence criteria, if appropriate, are specified as " 78 <<
"dictionaries in " << control_.algorithmName()
83 residualControlIndex(fName, residualControl_,
false);
87 rd.
name = fName.c_str();
88 rd.
absTol = residualDict.lookup<scalar>(fName);
94 rd.
absTol = residualDict.lookup<scalar>(fName);
98 residualControl_.transfer(data);
100 if (control_.debug > 1)
102 forAll(residualControl_, i)
105 Info<< residualDict.dictName() <<
'[' << i <<
"]:" <<
nl 106 <<
" name : " << rd.
name <<
nl 119 Info<< control_.algorithmName() <<
": " 120 << (residualControl_.empty() ?
"No c" :
"C")
121 <<
"onvergence criteria found" << nl;
123 forAll(residualControl_, i)
125 Info<< control_.algorithmSpace() <<
" " << residualControl_[i].name
126 <<
": tolerance " << residualControl_[i].absTol <<
nl;
135 return !residualControl_.empty();
141 if (!hasResidualControls())
146 bool achieved =
true;
147 bool checked =
false;
151 Info<< control_.algorithmName() <<
": Residuals" <<
endl;
158 const word& fieldName = fieldNames[i];
160 residualControlIndex(fieldName, residualControl_);
175 bool absCheck = residual < residualControl_[fieldi].absTol;
177 achieved = achieved && absCheck;
181 Info<< control_.algorithmSpace() <<
" " << fieldName
182 <<
": tolerance " << residual <<
" (" 183 << residualControl_[fieldi].absTol <<
")" 184 << (absCheck ?
" CONVERGED" :
"") <<
endl;
189 return checked && achieved;
Single-region-specific derivation of the solution control class.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
bool readResidualControls()
Read residual controls.
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...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static List< word > fieldNames
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
A class for handling words, derived from string.
Convergence control class. Provides methods to check the convergence of the time loop against an abso...
const fvMesh & mesh() const
Return the mesh.
virtual bool hasResidualControls() const
Return true if residual controls are present.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
singleRegionConvergenceControl(const singleRegionSolutionControl &control)
Construct from a solution control.
defineTypeNameAndDebug(combustionModel, 0)
Database for solution and other reduced data.
virtual bool criteriaSatisfied() const
Return true if all convergence checks are satisfied.
void printResidualControls() const
Print the residual controls.
virtual ~singleRegionConvergenceControl()
Destructor.