40 void Foam::fvSchemes::clear()
43 defaultDdtScheme_.clear();
44 d2dt2Schemes_.clear();
45 defaultD2dt2Scheme_.clear();
46 interpolationSchemes_.clear();
47 defaultInterpolationScheme_.clear();
49 defaultDivScheme_.clear();
51 defaultGradScheme_.clear();
52 snGradSchemes_.clear();
53 defaultSnGradScheme_.clear();
54 laplacianSchemes_.clear();
55 defaultLaplacianScheme_.clear();
62 if (dict.found(
"ddtSchemes"))
64 ddtSchemes_ = dict.subDict(
"ddtSchemes");
68 ddtSchemes_.set(
"default",
"none");
73 ddtSchemes_.found(
"default")
74 && word(ddtSchemes_.lookup(
"default")) !=
"none" 77 defaultDdtScheme_ = ddtSchemes_.lookup(
"default");
80 word(defaultDdtScheme_)
81 == fv::steadyStateDdtScheme<scalar>::typeName
86 if (dict.found(
"d2dt2Schemes"))
88 d2dt2Schemes_ = dict.subDict(
"d2dt2Schemes");
92 d2dt2Schemes_.set(
"default",
"none");
97 d2dt2Schemes_.found(
"default")
98 && word(d2dt2Schemes_.lookup(
"default")) !=
"none" 101 defaultD2dt2Scheme_ = d2dt2Schemes_.lookup(
"default");
105 if (dict.found(
"interpolationSchemes"))
107 interpolationSchemes_ = dict.subDict(
"interpolationSchemes");
109 else if (!interpolationSchemes_.found(
"default"))
111 interpolationSchemes_.add(
"default",
"linear");
116 interpolationSchemes_.found(
"default")
117 && word(interpolationSchemes_.lookup(
"default")) !=
"none" 120 defaultInterpolationScheme_ =
121 interpolationSchemes_.lookup(
"default");
125 divSchemes_ = dict.subDict(
"divSchemes");
129 divSchemes_.found(
"default")
130 && word(divSchemes_.lookup(
"default")) !=
"none" 133 defaultDivScheme_ = divSchemes_.lookup(
"default");
137 gradSchemes_ = dict.subDict(
"gradSchemes");
141 gradSchemes_.found(
"default")
142 && word(gradSchemes_.lookup(
"default")) !=
"none" 145 defaultGradScheme_ = gradSchemes_.lookup(
"default");
149 if (dict.found(
"snGradSchemes"))
151 snGradSchemes_ = dict.subDict(
"snGradSchemes");
153 else if (!snGradSchemes_.found(
"default"))
155 snGradSchemes_.add(
"default",
"corrected");
160 snGradSchemes_.found(
"default")
161 && word(snGradSchemes_.lookup(
"default")) !=
"none" 164 defaultSnGradScheme_ = snGradSchemes_.lookup(
"default");
168 laplacianSchemes_ = dict.subDict(
"laplacianSchemes");
172 laplacianSchemes_.found(
"default")
173 && word(laplacianSchemes_.lookup(
"default")) !=
"none" 176 defaultLaplacianScheme_ = laplacianSchemes_.lookup(
"default");
180 if (dict.found(
"fluxRequired"))
182 fluxRequired_.merge(dict.subDict(
"fluxRequired"));
186 fluxRequired_.found(
"default")
187 && word(fluxRequired_.lookup(
"default")) !=
"none" 190 defaultFluxRequired_ = Switch(fluxRequired_.lookup(
"default"));
208 obr.readOpt() ==
IOobject::MUST_READ
209 || obr.readOpt() ==
IOobject::READ_IF_PRESENT
220 objectPath() +
".ddtSchemes",
226 ddtSchemes_.
name() +
".default",
233 objectPath() +
".d2dt2Schemes",
239 d2dt2Schemes_.
name() +
".default",
242 interpolationSchemes_
246 objectPath() +
".interpolationSchemes",
250 defaultInterpolationScheme_
252 interpolationSchemes_.
name() +
".default",
259 objectPath() +
".divSchemes",
265 divSchemes_.
name() +
".default",
272 objectPath() +
".gradSchemes",
278 gradSchemes_.
name() +
".default",
285 objectPath() +
".snGradSchemes",
291 snGradSchemes_.
name() +
".default",
298 objectPath() +
".laplacianSchemes",
302 defaultLaplacianScheme_
304 laplacianSchemes_.
name() +
".default",
311 objectPath() +
".fluxRequired",
315 defaultFluxRequired_(false),
367 Info<<
"Lookup ddtScheme for " << name <<
endl;
370 if (ddtSchemes_.
found(name) || defaultDdtScheme_.
empty())
372 return ddtSchemes_.
lookup(name);
376 const_cast<ITstream&
>(defaultDdtScheme_).rewind();
377 return const_cast<ITstream&
>(defaultDdtScheme_);
386 Info<<
"Lookup d2dt2Scheme for " << name <<
endl;
389 if (d2dt2Schemes_.
found(name) || defaultD2dt2Scheme_.
empty())
391 return d2dt2Schemes_.
lookup(name);
395 const_cast<ITstream&
>(defaultD2dt2Scheme_).rewind();
396 return const_cast<ITstream&
>(defaultD2dt2Scheme_);
405 Info<<
"Lookup interpolationScheme for " << name <<
endl;
410 interpolationSchemes_.
found(name)
411 || defaultInterpolationScheme_.
empty()
414 return interpolationSchemes_.
lookup(name);
418 const_cast<ITstream&
>(defaultInterpolationScheme_).rewind();
419 return const_cast<ITstream&
>(defaultInterpolationScheme_);
428 Info<<
"Lookup divScheme for " << name <<
endl;
431 if (divSchemes_.
found(name) || defaultDivScheme_.
empty())
433 return divSchemes_.
lookup(name);
437 const_cast<ITstream&
>(defaultDivScheme_).rewind();
438 return const_cast<ITstream&
>(defaultDivScheme_);
447 Info<<
"Lookup gradScheme for " << name <<
endl;
450 if (gradSchemes_.
found(name) || defaultGradScheme_.
empty())
452 return gradSchemes_.
lookup(name);
456 const_cast<ITstream&
>(defaultGradScheme_).rewind();
457 return const_cast<ITstream&
>(defaultGradScheme_);
466 Info<<
"Lookup snGradScheme for " << name <<
endl;
469 if (snGradSchemes_.
found(name) || defaultSnGradScheme_.
empty())
471 return snGradSchemes_.
lookup(name);
475 const_cast<ITstream&
>(defaultSnGradScheme_).rewind();
476 return const_cast<ITstream&
>(defaultSnGradScheme_);
485 Info<<
"Lookup laplacianScheme for " << name <<
endl;
488 if (laplacianSchemes_.
found(name) || defaultLaplacianScheme_.
empty())
490 return laplacianSchemes_.
lookup(name);
494 const_cast<ITstream&
>(defaultLaplacianScheme_).rewind();
495 return const_cast<ITstream&
>(defaultLaplacianScheme_);
504 Info<<
"Setting fluxRequired for " << name <<
endl;
507 fluxRequired_.
add(name,
true,
true);
515 Info<<
"Lookup fluxRequired for " << name <<
endl;
518 if (fluxRequired_.
found(name))
524 return defaultFluxRequired_;
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
bool empty() const
Return true if the UList is empty (ie, size() is zero)
ITstream & laplacianScheme(const word &name) const
virtual bool read()
Read object.
A list of keyword definitions, which are a keyword followed by any number of values (e...
fvSchemes(const objectRegistry &obr)
Construct for objectRegistry.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
bool read()
Read the fvSchemes.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool headerOk()
Read and check header info.
void setFluxRequired(const word &name) const
ITstream & ddtScheme(const word &name) const
bool add(entry *, bool mergeEntry=false)
Add a new entry.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
ITstream & snGradScheme(const word &name) const
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
const dictionary & schemesDict() const
ITstream & divScheme(const word &name) const
const fileName & name() const
Return the dictionary name.
A class for handling words, derived from string.
ITstream & interpolationScheme(const word &name) const
defineTypeNameAndDebug(combustionModel, 0)
ITstream & d2dt2Scheme(const word &name) const
ITstream & gradScheme(const word &name) const
word name(const complex &)
Return a string representation of a complex.
bool fluxRequired(const word &name) const
Registry of regIOobjects.
readOption readOpt() const
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
int system(const std::string &command)
Execute the specified command.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.