Go to the documentation of this file.
61 for (
const entry& dEntry : residualDict)
63 const word& fName = dEntry.keyword();
68 fd.
name = fName.c_str();
72 fd.
absTol = residualDict.get<scalar>(fName);
76 else if (dEntry.isDict())
79 fd.
absTol = fieldDict.
get<scalar>(
"tolerance");
80 fd.
relTol = fieldDict.
get<scalar>(
"relTol");
86 <<
"Residual data for " << dEntry.keyword()
87 <<
" must be specified as a dictionary"
98 fd.
absTol = residualDict.get<scalar>(fName);
100 else if (dEntry.isDict())
103 fd.
absTol = fieldDict.
get<scalar>(
"tolerance");
104 fd.
relTol = fieldDict.
get<scalar>(
"relTol");
109 <<
"Residual data for " << dEntry.keyword()
110 <<
" must be specified as a dictionary"
123 Info<<
"residualControl[" << i <<
"]:" <<
nl
124 <<
" name : " << fd.
name <<
nl
143 const word& fieldName,
147 forAll(residualControl_, i)
149 if (residualControl_[i].
name.
match(fieldName, !useRegEx))
162 storePrevIter<scalar>();
163 storePrevIter<vector>();
164 storePrevIter<sphericalTensor>();
165 storePrevIter<symmTensor>();
166 storePrevIter<tensor>();
172 const entry& solverPerfDictEntry
175 return maxResidual(mesh_, solverPerfDictEntry);
186 <<
"solutionControl: force:" << force
187 <<
" check: " << check
188 <<
" corr: " << corr_
189 <<
" corrNonOrtho:" << corrNonOrtho_
192 if (force || (check && corr_ <= 1 && corrNonOrtho_ == 0))
194 DebugInfo<<
"solutionControl: set firstIteration flag" <<
endl;
195 mesh_.data::set(
"firstIteration",
true);
199 DebugInfo<<
"solutionControl: remove firstIteration flag" <<
endl;
200 mesh_.data::remove(
"firstIteration");
219 const entry& solverPerfDictEntry,
225 const word& fieldName = solverPerfDictEntry.
keyword();
231 residuals.first() =
cmptMax(sp.first().initialResidual());
232 residuals.last() =
cmptMax(sp.last().initialResidual());
244 const entry& solverPerfDictEntry
252 maxTypeResidual<scalar>(fvmesh, solverPerfDictEntry, residuals)
253 || maxTypeResidual<vector>(fvmesh, solverPerfDictEntry, residuals)
254 || maxTypeResidual<sphericalTensor>(fvmesh, solverPerfDictEntry, residuals)
255 || maxTypeResidual<symmTensor>(fvmesh, solverPerfDictEntry, residuals)
256 || maxTypeResidual<tensor>(fvmesh, solverPerfDictEntry, residuals)
261 Info<<
"no residual for " << solverPerfDictEntry.
keyword()
262 <<
" on mesh " << fvmesh.
name() <<
nl;
286 algorithmName_(algorithmName),
288 momentumPredictor_(true),
virtual const dictionary dict() const
Return the solution dictionary.
int debug
Static debugging option.
A keyword and a list of tokens is an 'entry'.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
A class for handling words, derived from Foam::string.
virtual bool writeData(Ostream &) const
Dummy write for regIOobject.
virtual ITstream & stream() const =0
Return token stream, if entry is a primitive entry.
const keyType & keyword() const
Return keyword.
fvSolution solutionDict(runTime)
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
static bool maxTypeResidual(const fvMesh &fvmesh, const entry &solverPerfDictEntry, Pair< scalar > &residuals)
bool read(const char *buf, int32_t &val)
Same as readInt32.
List< fieldData > residualControl_
List of residual data per field.
label nNonOrthCorr_
Maximum number of non-orthogonal correctors.
Ostream & endl(Ostream &os)
Add newline and flush stream.
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
T lookupOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
bool foundObject(const word &name, const bool recursive=false) const
Is the named Type found?
#define forAll(list, i)
Loop across all elements in list.
virtual void storePrevIterFields() const
Store previous iteration fields.
virtual void setFirstIterFlag(const bool check=true, const bool force=false)
Set the firstIteration flag on the mesh data dictionary.
virtual label applyToField(const word &fieldName, const bool useRegEx=true) const
Return index of field in residualControl_ if present.
void cmptMax(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
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 match(const std::string &text) const
Test for equality.
messageStream Info
Information stream (uses stdout - output is on the master only)
bool momentumPredictor_
Flag to indicate to solve for momentum.
word name(const complex &c)
Return string representation of complex.
static Pair< scalar > maxResidual(const fvMesh &fvmesh, const entry &dataDictEntry)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Mesh data needed to do the Finite Volume discretisation.
dictionary subOrEmptyDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX, const bool mandatory=false) const
virtual bool read()
Read controls from fvSolution dictionary.
errorManipArg< error, int > exit(error &err, const int errNo=1)
bool transonic_
Flag to indicate to solve using transonic algorithm.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define DebugInfo
Report an information message using Foam::Info.
An ordered pair of two objects of type <T> with first() and second() elements.
Simple convenient storage of field residuals.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
bool consistent_
Flag to indicate to relax pressure using the.
bool frozenFlow_
Flag to indicate that the flow system of equations should not.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
defineTypeNameAndDebug(combustionModel, 0)
Database for solution data, solver performance and other reduced data.
const word & name() const
Return reference to name.