Go to the documentation of this file.
47 solutionDict.
getOrDefault<label>(
"nNonOrthogonalCorrectors", 0);
62 for (
const entry& dEntry : residualDict)
64 const word& fName = dEntry.keyword();
69 fd.
name = fName.c_str();
73 fd.
absTol = residualDict.get<scalar>(fName);
77 else if (dEntry.isDict())
80 fd.
absTol = fieldDict.
get<scalar>(
"tolerance");
81 fd.
relTol = fieldDict.
get<scalar>(
"relTol");
87 <<
"Residual data for " << dEntry.keyword()
88 <<
" must be specified as a dictionary"
99 fd.
absTol = residualDict.get<scalar>(fName);
101 else if (dEntry.isDict())
104 fd.
absTol = fieldDict.
get<scalar>(
"tolerance");
105 fd.
relTol = fieldDict.
get<scalar>(
"relTol");
110 <<
"Residual data for " << dEntry.keyword()
111 <<
" must be specified as a dictionary"
124 Info<<
"residualControl[" << i <<
"]:" <<
nl
125 <<
" name : " << fd.
name <<
nl
144 const word& fieldName,
148 forAll(residualControl_, i)
150 if (residualControl_[i].
name.
match(fieldName, !useRegEx))
163 storePrevIter<scalar>();
164 storePrevIter<vector>();
165 storePrevIter<sphericalTensor>();
166 storePrevIter<symmTensor>();
167 storePrevIter<tensor>();
173 const entry& solverPerfDictEntry
176 return maxResidual(mesh_, solverPerfDictEntry);
187 <<
"solutionControl: force:" << force
188 <<
" check: " << check
189 <<
" corr: " << corr_
190 <<
" corrNonOrtho:" << corrNonOrtho_
193 if (force || (check && corr_ <= 1 && corrNonOrtho_ == 0))
195 DebugInfo<<
"solutionControl: set firstIteration flag" <<
endl;
196 mesh_.data::set(
"firstIteration",
true);
200 DebugInfo<<
"solutionControl: remove firstIteration flag" <<
endl;
201 mesh_.data::remove(
"firstIteration");
220 const entry& solverPerfDictEntry,
226 const word& fieldName = solverPerfDictEntry.
keyword();
232 residuals.first() =
cmptMax(sp.first().initialResidual());
233 residuals.last() =
cmptMax(sp.last().initialResidual());
245 const entry& solverPerfDictEntry
253 maxTypeResidual<scalar>(fvmesh, solverPerfDictEntry, residuals)
254 || maxTypeResidual<vector>(fvmesh, solverPerfDictEntry, residuals)
255 || maxTypeResidual<sphericalTensor>(fvmesh, solverPerfDictEntry, residuals)
256 || maxTypeResidual<symmTensor>(fvmesh, solverPerfDictEntry, residuals)
257 || maxTypeResidual<tensor>(fvmesh, solverPerfDictEntry, residuals)
262 Info<<
"no residual for " << solverPerfDictEntry.
keyword()
263 <<
" on mesh " << fvmesh.
name() <<
nl;
287 algorithmName_(algorithmName),
289 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
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.
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,...
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
defineTypeNameAndDebug(combustionModel, 0)
Database for solution data, solver performance and other reduced data.
const word & name() const
Return reference to name.