40 void Foam::schemesLookup::clear()
43 d2dt2Schemes_.clear();
44 interpSchemes_.clear();
47 lnGradSchemes_.clear();
48 snGradSchemes_.clear();
49 laplacianSchemes_.clear();
55 void Foam::schemesLookup::checkSteady()
57 ITstream& is = ddtSchemes_.fallback();
60 if (is.peek().isWord())
68 schemeName ==
"steady" 69 || schemeName ==
"steadyState" 76 ddtSchemes_.populate(
dict,
"none");
77 d2dt2Schemes_.populate(
dict,
"none");
78 interpSchemes_.populate(
dict,
"linear");
79 divSchemes_.populate(
dict,
"",
true);
80 gradSchemes_.populate(
dict,
"",
true);
81 lnGradSchemes_.populate(
dict,
"corrected");
82 snGradSchemes_.populate(
dict,
"corrected");
83 laplacianSchemes_.populate(
dict,
"",
true);
88 fluxRequired_.
merge(*fluxDictPtr);
90 if (fluxRequired_.found(
"default"))
92 Switch sw(fluxRequired_.lookup(
"default").peek());
96 fluxRequiredDefault_ = bool(sw);
120 Foam::schemesLookup::schemesLookup
143 ddtSchemes_(
"ddtSchemes", objectPath()),
144 d2dt2Schemes_(
"d2dt2Schemes", objectPath()),
145 interpSchemes_(
"interpolationSchemes", objectPath()),
146 divSchemes_(
"divSchemes", objectPath()),
147 gradSchemes_(
"gradSchemes", objectPath()),
148 lnGradSchemes_(
"lnGradSchemes", objectPath()),
149 snGradSchemes_(
"snGradSchemes", objectPath()),
150 laplacianSchemes_(
"laplacianSchemes", objectPath()),
152 fluxRequired_(objectPath() /
"fluxRequired"),
153 fluxRequiredDefault_(false),
171 || !dictionary::empty()
174 read(selectedDict());
179 Foam::schemesLookup::schemesLookup
181 const objectRegistry& obr,
183 const dictionary* fallback
198 read(selectedDict());
210 return ddtSchemes_.lookup(
name);
217 return d2dt2Schemes_.lookup(
name);
224 return interpSchemes_.lookup(
name);
231 return divSchemes_.lookup(
name);
238 return gradSchemes_.lookup(
name);
245 return lnGradSchemes_.lookup(
name);
252 return snGradSchemes_.lookup(
name);
259 return laplacianSchemes_.lookup(
name);
266 fluxRequired_.add(
name,
true,
true);
273 return (fluxRequired_.found(
name) || fluxRequiredDefault_);
279 return selectedDict();
285 ddtSchemes_.writeEntryOptional(
os);
286 d2dt2Schemes_.writeEntryOptional(
os);
287 interpSchemes_.writeEntryOptional(
os);
288 divSchemes_.writeEntry(
os);
289 gradSchemes_.writeEntry(
os);
290 lnGradSchemes_.writeEntryOptional(
os);
291 snGradSchemes_.writeEntryOptional(
os);
292 laplacianSchemes_.writeEntry(
os);
294 if (!fluxRequired_.empty())
296 fluxRequired_.writeEntry(
os);
ITstream & ddtScheme(const word &name) const
Get ddt scheme for given name, or default.
readOption readOpt() const noexcept
Get the read option.
virtual bool read()
Read object.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
List< bool > select(const label n, const labelUList &locations)
Construct a selection list of bools (all false) with the given pre-size, subsequently add specified l...
int debugSwitch(const char *name, const int deflt=0)
Lookup debug switch or add default value.
const word dictName("faMeshDefinition")
void writeDicts(Ostream &os) const
Write dictionary (possibly modified) settings.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool headerOk()
Read and check header info. Does not check the headerClassName.
ITstream & d2dt2Scheme(const word &name) const
Get d2dt2 scheme for given name, or default.
const dictionary & fluxRequired() const noexcept
Access flux-required dictionary.
bool isReadOptional() const noexcept
True if (LAZY_READ) bits are set [same as READ_IF_PRESENT].
void setFluxRequired(const word &name) const
Set flux-required for given name (mutable)
ITstream & interpolationScheme(const word &name) const
Get interpolation scheme for given name, or default.
bool read(const char *buf, int32_t &val)
Same as readInt32.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
bool merge(const dictionary &dict)
Merge entries from the given dictionary.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
A class for handling words, derived from Foam::string.
ITstream & gradScheme(const word &name) const
Get grad scheme for given name, or default.
const dictionary & schemesDict() const
The entire dictionary or the optional "select" sub-dictionary.
#define DebugInfo
Report an information message using Foam::Info.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Selector class for finite area/finite volume differencing schemes.
OBJstream os(runTime.globalPath()/outputName)
virtual void addWatch()
Add file watch on object (if registered and READ_IF_MODIFIED)
ITstream & lnGradScheme(const word &name) const
Get (finiteArea) lnGrad scheme for given name, or default.
ITstream & laplacianScheme(const word &name) const
Get laplacian scheme for given name, or default.
ITstream & snGradScheme(const word &name) const
Get (finiteVolume) snGrad scheme for given name, or default.
ITstream & divScheme(const word &name) const
Get div scheme for given name, or default.
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
meshDefDict readIfPresent("polyMeshPatches", polyPatchNames)
int system(const std::string &command, const bool bg=false)
Execute the specified command via the shell.
Registry of regIOobjects.
Defines the attributes of an object for which implicit objectRegistry management is supported...
static int debug
Debug switch.
An input stream of tokens.
bool read()
Read schemes from IOdictionary, respects the "select" keyword.
const dictionary * findDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary pointer if present (and it is a dictionary) otherwise return nullptr...
readOption
Enumeration defining read preferences.