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"));
215 objectPath() +
".ddtSchemes",
221 ddtSchemes_.
name() +
".default",
228 objectPath() +
".d2dt2Schemes",
234 d2dt2Schemes_.
name() +
".default",
237 interpolationSchemes_
241 objectPath() +
".interpolationSchemes",
245 defaultInterpolationScheme_
247 interpolationSchemes_.
name() +
".default",
254 objectPath() +
".divSchemes",
260 divSchemes_.
name() +
".default",
267 objectPath() +
".gradSchemes",
273 gradSchemes_.
name() +
".default",
280 objectPath() +
".snGradSchemes",
286 snGradSchemes_.
name() +
".default",
293 objectPath() +
".laplacianSchemes",
297 defaultLaplacianScheme_
299 laplacianSchemes_.
name() +
".default",
306 objectPath() +
".fluxRequired",
310 defaultFluxRequired_(false),
354 Info<<
"Lookup ddtScheme for " << name <<
endl;
357 if (ddtSchemes_.
found(name) || defaultDdtScheme_.
empty())
359 return ddtSchemes_.
lookup(name);
363 const_cast<ITstream&
>(defaultDdtScheme_).rewind();
364 return const_cast<ITstream&
>(defaultDdtScheme_);
373 Info<<
"Lookup d2dt2Scheme for " << name <<
endl;
376 if (d2dt2Schemes_.
found(name) || defaultD2dt2Scheme_.
empty())
378 return d2dt2Schemes_.
lookup(name);
382 const_cast<ITstream&
>(defaultD2dt2Scheme_).rewind();
383 return const_cast<ITstream&
>(defaultD2dt2Scheme_);
392 Info<<
"Lookup interpolationScheme for " << name <<
endl;
397 interpolationSchemes_.
found(name)
398 || defaultInterpolationScheme_.
empty()
401 return interpolationSchemes_.
lookup(name);
405 const_cast<ITstream&
>(defaultInterpolationScheme_).rewind();
406 return const_cast<ITstream&
>(defaultInterpolationScheme_);
415 Info<<
"Lookup divScheme for " << name <<
endl;
418 if (divSchemes_.
found(name) || defaultDivScheme_.
empty())
420 return divSchemes_.
lookup(name);
424 const_cast<ITstream&
>(defaultDivScheme_).rewind();
425 return const_cast<ITstream&
>(defaultDivScheme_);
434 Info<<
"Lookup gradScheme for " << name <<
endl;
437 if (gradSchemes_.
found(name) || defaultGradScheme_.
empty())
439 return gradSchemes_.
lookup(name);
443 const_cast<ITstream&
>(defaultGradScheme_).rewind();
444 return const_cast<ITstream&
>(defaultGradScheme_);
453 Info<<
"Lookup snGradScheme for " << name <<
endl;
456 if (snGradSchemes_.
found(name) || defaultSnGradScheme_.
empty())
458 return snGradSchemes_.
lookup(name);
462 const_cast<ITstream&
>(defaultSnGradScheme_).rewind();
463 return const_cast<ITstream&
>(defaultSnGradScheme_);
472 Info<<
"Lookup laplacianScheme for " << name <<
endl;
475 if (laplacianSchemes_.
found(name) || defaultLaplacianScheme_.
empty())
477 return laplacianSchemes_.
lookup(name);
481 const_cast<ITstream&
>(defaultLaplacianScheme_).rewind();
482 return const_cast<ITstream&
>(defaultLaplacianScheme_);
491 Info<<
"Setting fluxRequired for " << name <<
endl;
494 fluxRequired_.
add(name,
true,
true);
502 Info<<
"Lookup fluxRequired for " << name <<
endl;
505 if (fluxRequired_.
found(name))
511 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)
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...
ITstream & div(const word &name) const
ITstream & interpolation(const word &name) const
bool read()
Read the fvSchemes.
Ostream & endl(Ostream &os)
Add newline and flush stream.
ITstream & laplacian(const word &name) const
void setFluxRequired(const word &name) const
const dictionary & dict() const
ITstream & d2dt2(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...
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
const fileName & name() const
Return the dictionary name.
A class for handling words, derived from string.
defineTypeNameAndDebug(combustionModel, 0)
ITstream & grad(const word &name) const
ITstream & snGrad(const word &name) const
word name(const complex &)
Return a string representation of a complex.
bool fluxRequired(const word &name) const
ITstream & ddt(const word &name) const
Registry of regIOobjects.
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.