41 void Foam::fvSchemes::clear()
44 defaultDdtScheme_.
clear();
45 d2dt2Schemes_.
clear();
46 defaultD2dt2Scheme_.
clear();
47 interpolationSchemes_.
clear();
48 defaultInterpolationScheme_.
clear();
50 defaultDivScheme_.
clear();
52 defaultGradScheme_.
clear();
53 snGradSchemes_.
clear();
54 defaultSnGradScheme_.
clear();
55 laplacianSchemes_.
clear();
56 defaultLaplacianScheme_.
clear();
69 ddtSchemes_.
set(
"default",
"none");
74 ddtSchemes_.found(
"default")
75 && word(ddtSchemes_.lookup(
"default")) !=
"none"
78 defaultDdtScheme_ = ddtSchemes_.lookup(
"default");
81 word(defaultDdtScheme_)
82 == fv::steadyStateDdtScheme<scalar>::typeName
93 d2dt2Schemes_.
set(
"default",
"none");
98 d2dt2Schemes_.found(
"default")
99 && word(d2dt2Schemes_.lookup(
"default")) !=
"none"
102 defaultD2dt2Scheme_ = d2dt2Schemes_.lookup(
"default");
105 word(defaultD2dt2Scheme_)
106 == fv::steadyStateD2dt2Scheme<scalar>::typeName
113 interpolationSchemes_ =
dict.
subDict(
"interpolationSchemes");
115 else if (!interpolationSchemes_.found(
"default"))
117 interpolationSchemes_.
add(
"default",
"linear");
122 interpolationSchemes_.found(
"default")
123 && word(interpolationSchemes_.lookup(
"default")) !=
"none"
126 defaultInterpolationScheme_ =
127 interpolationSchemes_.lookup(
"default");
135 divSchemes_.found(
"default")
136 && word(divSchemes_.lookup(
"default")) !=
"none"
139 defaultDivScheme_ = divSchemes_.
lookup(
"default");
147 gradSchemes_.found(
"default")
148 && word(gradSchemes_.lookup(
"default")) !=
"none"
151 defaultGradScheme_ = gradSchemes_.
lookup(
"default");
159 else if (!snGradSchemes_.found(
"default"))
161 snGradSchemes_.
add(
"default",
"corrected");
166 snGradSchemes_.found(
"default")
167 && word(snGradSchemes_.lookup(
"default")) !=
"none"
170 defaultSnGradScheme_ = snGradSchemes_.lookup(
"default");
174 laplacianSchemes_ =
dict.
subDict(
"laplacianSchemes");
178 laplacianSchemes_.found(
"default")
179 && word(laplacianSchemes_.lookup(
"default")) !=
"none"
182 defaultLaplacianScheme_ = laplacianSchemes_.
lookup(
"default");
192 fluxRequired_.found(
"default")
193 && word(fluxRequired_.lookup(
"default")) !=
"none"
196 defaultFluxRequired_ = Switch(fluxRequired_.lookup(
"default"));
204 word filteredName(
name);
207 word::iterator iter2 = filteredName.begin();
213 word::const_iterator iter1 = filteredName.begin();
214 iter1 != filteredName.end();
218 const char c = *iter1;
224 else if (!
found || !isalnum(
c))
232 filteredName.resize(
n);
241 const dictionary& schemes,
242 const ITstream& defaultScheme
248 <<
" in dictionary " << schemes.name().caseName() <<
endl;
252 const entry* schemePtr = schemes.lookupEntryPtr(
name,
false,
true);
256 return schemePtr->stream();
261 bool filtered = (
name.find(
'.') != word::npos);
266 const entry* schemePtr =
267 schemes.lookupEntryPtr(filterGroup(
name),
false,
true);
271 return schemePtr->stream();
276 if (!defaultScheme.empty())
278 const_cast<ITstream&
>(defaultScheme).rewind();
279 return const_cast<ITstream&
>(defaultScheme);
286 <<
"Cannot find scheme for " <<
name;
294 <<
" in dictionary " << schemes.name().caseName()
296 return const_cast<ITstream&
>(defaultScheme);
321 objectPath() +
".ddtSchemes",
327 ddtSchemes_.
name() +
".default",
334 objectPath() +
".d2dt2Schemes",
340 d2dt2Schemes_.
name() +
".default",
343 interpolationSchemes_
347 objectPath() +
".interpolationSchemes",
351 defaultInterpolationScheme_
353 interpolationSchemes_.
name() +
".default",
360 objectPath() +
".divSchemes",
366 divSchemes_.
name() +
".default",
373 objectPath() +
".gradSchemes",
379 gradSchemes_.
name() +
".default",
386 objectPath() +
".snGradSchemes",
392 snGradSchemes_.
name() +
".default",
399 objectPath() +
".laplacianSchemes",
403 defaultLaplacianScheme_
405 laplacianSchemes_.
name() +
".default",
412 objectPath() +
".fluxRequired",
416 defaultFluxRequired_(false),
447 return subDict(
word(lookup(
"select")));
458 return lookupScheme(
name, ddtSchemes_, defaultDdtScheme_);
464 return lookupScheme(
name, d2dt2Schemes_, defaultD2dt2Scheme_);
473 interpolationSchemes_,
474 defaultInterpolationScheme_
481 return lookupScheme(
name, divSchemes_, defaultDivScheme_);
487 return lookupScheme(
name, gradSchemes_, defaultGradScheme_);
493 return lookupScheme(
name, snGradSchemes_, defaultSnGradScheme_);
499 return lookupScheme(
name, laplacianSchemes_, defaultLaplacianScheme_);
510 fluxRequired_.add(
name,
true,
true);
521 if (fluxRequired_.found(
name))
527 return defaultFluxRequired_;
graph_traits< Graph >::vertices_size_type size_type
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void clear()
Clear the list, i.e. set size to zero.
A list of keyword definitions, which are a keyword followed by any number of values (e....
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
void set(entry *)
Assign a new entry, overwrite any existing entry.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
bool add(entry *, bool mergeEntry=false)
Add a new entry.
void clear()
Clear the dictionary.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
Selector class for finite volume differencing schemes. fvMesh is derived from fvSchemes so that all f...
void setFluxRequired(const word &name) const
ITstream & interpolation(const word &name) const
ITstream & snGrad(const word &name) const
ITstream & grad(const word &name) const
const dictionary & dict() const
ITstream & ddt(const word &name) const
fvSchemes(const objectRegistry &obr)
Construct for objectRegistry.
ITstream & laplacian(const word &name) const
ITstream & div(const word &name) const
ITstream & d2dt2(const word &name) const
bool read()
Read the fvSchemes.
bool fluxRequired(const word &name) const
Registry of regIOobjects.
virtual bool read()
Read object.
A class for handling words, derived from string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
const dimensionedScalar c
Speed of light in a vacuum.
errorManipArg< error, int > exit(error &err, const int errNo=1)
int system(const std::string &command)
Execute the specified command.
bool read(const char *, int32_t &)
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
defineTypeNameAndDebug(combustionModel, 0)