Go to the documentation of this file.
42 "preconditioner",
"smoother"
50 if (
dict.found(
"cache"))
52 cache_ =
dict.subDict(
"cache");
56 if (
dict.found(
"relaxationFactors"))
59 if (relaxDict.found(
"fields") || relaxDict.found(
"equations"))
61 if (relaxDict.found(
"fields"))
63 fieldRelaxDict_ = relaxDict.
subDict(
"fields");
66 if (relaxDict.found(
"equations"))
68 eqnRelaxDict_ = relaxDict.
subDict(
"equations");
74 fieldRelaxDict_.
clear();
76 for (
const word&
e : relaxDict.toc())
78 scalar value = relaxDict.get<scalar>(
e);
80 if (
e.starts_with(
'p'))
82 fieldRelaxDict_.
add(
e, value);
84 else if (
e.starts_with(
"rho"))
86 fieldRelaxDict_.
add(
e, value);
91 eqnRelaxDict_ = relaxDict;
101 <<
"Relaxation factors:" <<
nl
102 <<
"fields: " << fieldRelaxDict_ <<
nl
103 <<
"equations: " << eqnRelaxDict_ <<
endl;
106 if (
dict.found(
"solvers"))
108 solvers_ =
dict.subDict(
"solvers");
116 Foam::solution::solution
142 fieldRelaxDefault_(0),
172 if (!dEntry.isDict())
189 if (eptr && !eptr->
isDict())
208 Info<<
"// using new solver syntax:\n"
209 << dEntry.keyword() << subdict <<
endl;
213 dict.
set(dEntry.keyword(), subdict);
228 <<
"Cache: find entry for " <<
name <<
endl;
230 return cache_.found(
name);
240 <<
"Field relaxation factor for " <<
name
241 <<
" is " << (fieldRelaxDict_.found(
name) ?
"set" :
"unset") <<
endl;
243 return fieldRelaxDict_.found(
name) || fieldRelaxDict_.found(
"default");
250 <<
"Find equation relaxation factor for " <<
name <<
endl;
252 return eqnRelaxDict_.found(
name) || eqnRelaxDict_.found(
"default");
259 <<
"Lookup variable relaxation factor for " <<
name <<
endl;
261 if (fieldRelaxDict_.found(
name))
263 return fieldRelaxDict_.get<scalar>(
name);
265 else if (fieldRelaxDefault_ > SMALL)
267 return fieldRelaxDefault_;
271 <<
"Cannot find variable relaxation factor for '" <<
name
272 <<
"' or a suitable default value." <<
nl
282 <<
"Lookup equation relaxation factor for " <<
name <<
endl;
284 if (eqnRelaxDict_.found(
name))
286 return eqnRelaxDict_.get<scalar>(
name);
288 else if (eqnRelaxDefault_ > SMALL)
290 return eqnRelaxDefault_;
294 <<
"Cannot find equation relaxation factor for '" <<
name
295 <<
"' or a suitable default value."
306 return subDict(get<word>(
"select"));
316 <<
"Lookup solver for " <<
name <<
endl;
318 return solvers_.subDict(
name);
325 <<
"Lookup solver for " <<
name <<
endl;
327 return solvers_.subDict(
name);
A keyword and a list of tokens is an 'entry'.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const dictionary & solverDict(const word &name) const
Return the solver controls dictionary for the given field.
A class for handling words, derived from Foam::string.
A class for handling file names.
virtual ITstream & stream() const =0
Return token stream, if entry is a primitive entry.
defineDebugSwitchWithName(pointMVCWeight, "pointMVCWeight", 0)
bool cache(const word &name) const
Return true if the given field should be cached.
fvSolution solutionDict(runTime)
bool eof() const
Return true if end of input seen.
dictionary()
Construct top-level dictionary null.
bool read(const char *buf, int32_t &val)
Same as readInt32.
const Time & time() const
Return time.
virtual bool read()
Read object.
const word dictName("blockMeshDict")
static label upgradeSolverDict(dictionary &dict, const bool verbose=true)
Update from older solver controls syntax.
Ostream & endl(Ostream &os)
Add newline and flush stream.
entry * set(entry *entryPtr)
Assign a new entry, overwriting any existing entry.
static const Foam::List< Foam::word > subDictNames({ "preconditioner", "smoother" })
static const dictionary null
An empty dictionary, which is also the parent for all dictionaries.
Registry of regIOobjects.
scalar fieldRelaxationFactor(const word &name) const
Return the relaxation factor for the given field.
virtual bool isDict() const
Return true if this entry is a dictionary.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
messageStream Info
Information stream (uses stdout - output is on the master only)
word name(const complex &c)
Return string representation of complex.
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
bool read()
Read the solution dictionary.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
bool relaxEquation(const word &name) const
Return true if the relaxation factor is given for the equation.
errorManipArg< error, int > exit(error &err, const int errNo=1)
scalar equationRelaxationFactor(const word &name) const
Return the relaxation factor for the given equation.
static bool master(const label communicator=0)
Am I the master process.
const word & system() const
Return system name.
const dictionary & solutionDict() const
Return the selected sub-dictionary of solvers if the "select".
#define DebugInfo
Report an information message using Foam::Info.
readOption readOpt() const
The read option.
entry * findEntry(const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
Find for an entry (non-const access) with the given keyword.
const dimensionedScalar e
Elementary charge.
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
const dictionary & solver(const word &name) const
Return the solver controls dictionary for the given field.
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
void clear()
Clear the dictionary.
bool relaxField(const word &name) const
Return true if the relaxation factor is given for the field.