37 void Foam::fvSchemes::clear()
40 defaultDdtScheme_.
clear();
41 d2dt2Schemes_.
clear();
42 defaultD2dt2Scheme_.
clear();
43 interpolationSchemes_.
clear();
44 defaultInterpolationScheme_.
clear();
46 defaultDivScheme_.
clear();
48 defaultGradScheme_.
clear();
49 snGradSchemes_.
clear();
50 defaultSnGradScheme_.
clear();
51 laplacianSchemes_.
clear();
52 defaultLaplacianScheme_.
clear();
59 if (dict.found(
"ddtSchemes"))
61 ddtSchemes_ = dict.
subDict(
"ddtSchemes");
65 ddtSchemes_.
set(
"default",
"none");
70 ddtSchemes_.
found(
"default")
71 && word(ddtSchemes_.
lookup(
"default")) !=
"none" 74 defaultDdtScheme_ = ddtSchemes_.
lookup(
"default");
77 word(defaultDdtScheme_)
78 == fv::steadyStateDdtScheme<scalar>::typeName
83 if (dict.found(
"d2dt2Schemes"))
85 d2dt2Schemes_ = dict.
subDict(
"d2dt2Schemes");
89 d2dt2Schemes_.
set(
"default",
"none");
94 d2dt2Schemes_.
found(
"default")
95 && word(d2dt2Schemes_.
lookup(
"default")) !=
"none" 98 defaultD2dt2Scheme_ = d2dt2Schemes_.
lookup(
"default");
102 if (dict.found(
"interpolationSchemes"))
104 interpolationSchemes_ = dict.
subDict(
"interpolationSchemes");
106 else if (!interpolationSchemes_.
found(
"default"))
108 interpolationSchemes_.
add(
"default",
"linear");
113 interpolationSchemes_.
found(
"default")
114 && word(interpolationSchemes_.
lookup(
"default")) !=
"none" 117 defaultInterpolationScheme_ =
118 interpolationSchemes_.
lookup(
"default");
122 divSchemes_ = dict.
subDict(
"divSchemes");
126 divSchemes_.
found(
"default")
127 && word(divSchemes_.
lookup(
"default")) !=
"none" 130 defaultDivScheme_ = divSchemes_.
lookup(
"default");
134 gradSchemes_ = dict.
subDict(
"gradSchemes");
138 gradSchemes_.
found(
"default")
139 && word(gradSchemes_.
lookup(
"default")) !=
"none" 142 defaultGradScheme_ = gradSchemes_.
lookup(
"default");
146 if (dict.found(
"snGradSchemes"))
148 snGradSchemes_ = dict.
subDict(
"snGradSchemes");
150 else if (!snGradSchemes_.
found(
"default"))
152 snGradSchemes_.
add(
"default",
"corrected");
157 snGradSchemes_.
found(
"default")
158 && word(snGradSchemes_.
lookup(
"default")) !=
"none" 161 defaultSnGradScheme_ = snGradSchemes_.
lookup(
"default");
165 laplacianSchemes_ = dict.
subDict(
"laplacianSchemes");
169 laplacianSchemes_.
found(
"default")
170 && word(laplacianSchemes_.
lookup(
"default")) !=
"none" 173 defaultLaplacianScheme_ = laplacianSchemes_.
lookup(
"default");
177 if (dict.found(
"fluxRequired"))
179 fluxRequired_.
merge(dict.subDict(
"fluxRequired"));
183 fluxRequired_.
found(
"default")
184 && word(fluxRequired_.
lookup(
"default")) !=
"none" 187 defaultFluxRequired_ = Switch(fluxRequired_.
lookup(
"default"));
223 ddtSchemes_.
name() +
".default",
236 d2dt2Schemes_.
name() +
".default",
239 interpolationSchemes_
247 defaultInterpolationScheme_
249 interpolationSchemes_.
name() +
".default",
262 divSchemes_.
name() +
".default",
275 gradSchemes_.
name() +
".default",
288 snGradSchemes_.
name() +
".default",
299 defaultLaplacianScheme_
301 laplacianSchemes_.
name() +
".default",
312 defaultFluxRequired_(false),
364 Info<<
"Lookup ddtScheme for " << name <<
endl;
367 if (ddtSchemes_.
found(name) || defaultDdtScheme_.
empty())
369 return ddtSchemes_.
lookup(name);
373 const_cast<ITstream&
>(defaultDdtScheme_).rewind();
374 return const_cast<ITstream&
>(defaultDdtScheme_);
383 Info<<
"Lookup d2dt2Scheme for " << name <<
endl;
386 if (d2dt2Schemes_.
found(name) || defaultD2dt2Scheme_.
empty())
388 return d2dt2Schemes_.
lookup(name);
392 const_cast<ITstream&
>(defaultD2dt2Scheme_).rewind();
393 return const_cast<ITstream&
>(defaultD2dt2Scheme_);
402 Info<<
"Lookup interpolationScheme for " << name <<
endl;
407 interpolationSchemes_.
found(name)
408 || defaultInterpolationScheme_.
empty()
411 return interpolationSchemes_.
lookup(name);
415 const_cast<ITstream&
>(defaultInterpolationScheme_).rewind();
416 return const_cast<ITstream&
>(defaultInterpolationScheme_);
425 Info<<
"Lookup divScheme for " << name <<
endl;
428 if (divSchemes_.
found(name) || defaultDivScheme_.
empty())
430 return divSchemes_.
lookup(name);
434 const_cast<ITstream&
>(defaultDivScheme_).rewind();
435 return const_cast<ITstream&
>(defaultDivScheme_);
444 Info<<
"Lookup gradScheme for " << name <<
endl;
447 if (gradSchemes_.
found(name) || defaultGradScheme_.
empty())
449 return gradSchemes_.
lookup(name);
453 const_cast<ITstream&
>(defaultGradScheme_).rewind();
454 return const_cast<ITstream&
>(defaultGradScheme_);
463 Info<<
"Lookup snGradScheme for " << name <<
endl;
466 if (snGradSchemes_.
found(name) || defaultSnGradScheme_.
empty())
468 return snGradSchemes_.
lookup(name);
472 const_cast<ITstream&
>(defaultSnGradScheme_).rewind();
473 return const_cast<ITstream&
>(defaultSnGradScheme_);
482 Info<<
"Lookup laplacianScheme for " << name <<
endl;
485 if (laplacianSchemes_.
found(name) || defaultLaplacianScheme_.
empty())
487 return laplacianSchemes_.
lookup(name);
491 const_cast<ITstream&
>(defaultLaplacianScheme_).rewind();
492 return const_cast<ITstream&
>(defaultLaplacianScheme_);
501 Info<<
"Setting fluxRequired for " << name <<
endl;
504 fluxRequired_.
add(name,
true,
true);
512 Info<<
"Lookup fluxRequired for " << name <<
endl;
515 if (fluxRequired_.
found(name))
521 return defaultFluxRequired_;
ITstream & laplacianScheme(const word &name) const
fileName objectPath() const
Return complete path + object name.
virtual bool read()
Read object.
A list of keyword definitions, which are a keyword followed by any number of values (e...
bool empty() const
Return true if the UList is empty (ie, size() is zero)
static int debug
Debug switch.
void setFluxRequired(const word &name) const
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
bool read()
Read the fvSchemes.
Ostream & endl(Ostream &os)
Add newline and flush stream.
ITstream & snGradScheme(const word &name) const
ITstream & d2dt2Scheme(const word &name) const
bool fluxRequired(const word &name) const
bool add(entry *, bool mergeEntry=false)
Add a new entry.
const dictionary & schemesDict() const
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
dictionary()
Construct top-level dictionary null.
void clear()
Clear the list, i.e. set size to zero.
A class for handling words, derived from string.
const Time & time() const
Return time.
int debugSwitch(const char *name, const int defaultValue=0)
Lookup debug switch or add default value.
ITstream & divScheme(const word &name) const
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
const word & name() const
Name function is needed to disambiguate those inherited.
ITstream & interpolationScheme(const word &name) const
readOption readOpt() const
void set(entry *)
Assign a new entry, overwrite any existing entry.
bool merge(const dictionary &)
Merge entries from the given dictionary.
bool headerOk()
Read and check header info.
ITstream & gradScheme(const word &name) const
Registry of regIOobjects.
void clear()
Clear the dictionary.
ITstream & ddtScheme(const word &name) 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.