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),
169 read(selectedDict());
174 Foam::schemesLookup::schemesLookup
176 const objectRegistry& obr,
178 const dictionary* fallback
193 read(selectedDict());
205 return ddtSchemes_.lookup(
name);
212 return d2dt2Schemes_.lookup(
name);
219 return interpSchemes_.lookup(
name);
226 return divSchemes_.lookup(
name);
233 return gradSchemes_.lookup(
name);
240 return lnGradSchemes_.lookup(
name);
247 return snGradSchemes_.lookup(
name);
254 return laplacianSchemes_.lookup(
name);
261 fluxRequired_.add(
name,
true,
true);
268 return (fluxRequired_.found(
name) || fluxRequiredDefault_);
274 return selectedDict();
280 ddtSchemes_.writeEntryOptional(
os);
281 d2dt2Schemes_.writeEntryOptional(
os);
282 interpSchemes_.writeEntryOptional(
os);
283 divSchemes_.writeEntry(
os);
284 gradSchemes_.writeEntry(
os);
285 lnGradSchemes_.writeEntryOptional(
os);
286 snGradSchemes_.writeEntryOptional(
os);
287 laplacianSchemes_.writeEntry(
os);
289 if (!fluxRequired_.empty())
291 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.
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 a sub-dictionary) otherwise return nullptr...
readOption
Enumeration defining read preferences.