43 d2dt2Schemes_.clear();
44 interpSchemes_.clear();
47 lnGradSchemes_.clear();
48 snGradSchemes_.clear();
49 laplacianSchemes_.clear();
55void 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());
94 if (sw.good() && !sw.is_none())
96 fluxRequiredDefault_ = bool(sw);
105const Foam::dictionary& Foam::schemesLookup::selectedDict()
const
111 return subDict(select);
120Foam::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),
174 read(selectedDict());
179Foam::schemesLookup::schemesLookup
181 const objectRegistry& obr,
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);
propsDict readIfPresent("fields", acceptFields)
bool empty() const noexcept
True if the list is empty.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
IOdictionary(const IOobject &io, const dictionary *fallback=nullptr)
Construct given an IOobject and optional fallback dictionary content.
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
bool isReadOptional() const noexcept
True if (LAZY_READ) bits are set [same as READ_IF_PRESENT].
readOption readOpt() const noexcept
Get the read option.
readOption
Enumeration defining read preferences.
@ MUST_READ
Reading required.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const Time & time() const noexcept
Return Time associated with the objectRegistry.
fileName objectPath() const
The complete path + object name.
An input stream of tokens.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
const word & name() const
Name function is needed to disambiguate those inherited from regIOobject and dictionary.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
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...
word dictName() const
The local dictionary name (final part of scoped name).
Registry of regIOobjects.
bool headerOk()
Read and check header info. Does not check the headerClassName.
virtual void addWatch()
Add file watch on object (if registered and READ_IF_MODIFIED).
virtual bool read()
Read object.
ITstream & ddtScheme(const word &name) const
Get ddt scheme for given name, or default.
ITstream & d2dt2Scheme(const word &name) const
Get d2dt2 scheme for given name, or default.
void setFluxRequired(const word &name) const
Set flux-required for given name (mutable).
ITstream & lnGradScheme(const word &name) const
Get (finiteArea) lnGrad scheme for given name, or default.
ITstream & divScheme(const word &name) const
Get div scheme for given name, or default.
ITstream & snGradScheme(const word &name) const
Get (finiteVolume) snGrad scheme for given name, or default.
const dictionary & schemesDict() const
The entire dictionary or the optional "select" sub-dictionary.
void writeDicts(Ostream &os) const
Write dictionary (possibly modified) settings.
static int debug
Debug switch.
ITstream & laplacianScheme(const word &name) const
Get laplacian scheme for given name, or default.
const dictionary & fluxRequired() const noexcept
Access flux-required dictionary.
ITstream & interpolationScheme(const word &name) const
Get interpolation scheme for given name, or default.
ITstream & gradScheme(const word &name) const
Get grad scheme for given name, or default.
bool read()
Read schemes from IOdictionary, respects the "select" keyword.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
const word dictName("faMeshDefinition")
#define DebugInfo
Report an information message using Foam::Info.
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.
bool read(const char *buf, int32_t &val)
Same as readInt32.
int system(const std::string &command, const bool bg=false)
Execute the specified command via the shell.
Ostream & endl(Ostream &os)
Add newline and flush stream.