mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: update {fa,fv}Schemes for more recent dictionary/ITstream definitions
- can construct named empty dictionary directly. - removed some duplicate code
This commit is contained in:
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -42,12 +43,11 @@ Foam::tolerances::tolerances(const Time& t, const fileName& dictName)
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
),
|
||||
relaxationFactors_(ITstream("relaxationFactors", tokenList())()),
|
||||
solverTolerances_(ITstream("solverTolerances", tokenList())()),
|
||||
solverRelativeTolerances_
|
||||
(
|
||||
ITstream("solverRelativeTolerances", tokenList())()
|
||||
)
|
||||
|
||||
// Named, but empty dictionaries
|
||||
relaxationFactors_("relaxationFactors"),
|
||||
solverTolerances_("solverTolerances"),
|
||||
solverRelativeTolerances_("solverRelativeTolerances")
|
||||
{
|
||||
read();
|
||||
}
|
||||
@ -60,7 +60,7 @@ bool Foam::tolerances::read()
|
||||
if (regIOobject::read())
|
||||
{
|
||||
const word toleranceSetName(get<word>("toleranceSet"));
|
||||
const dictionary& toleranceSet(subDict(toleranceSetName));
|
||||
const dictionary& toleranceSet = subDict(toleranceSetName);
|
||||
|
||||
if (toleranceSet.found("relaxationFactors"))
|
||||
{
|
||||
|
||||
@ -39,21 +39,28 @@ int Foam::faSchemes::debug(Foam::debug::debugSwitch("faSchemes", 0));
|
||||
void Foam::faSchemes::clear()
|
||||
{
|
||||
ddtSchemes_.clear();
|
||||
defaultDdtScheme_.clear();
|
||||
ddtSchemeDefault_.clear();
|
||||
|
||||
d2dt2Schemes_.clear();
|
||||
defaultD2dt2Scheme_.clear();
|
||||
d2dt2SchemeDefault_.clear();
|
||||
|
||||
interpolationSchemes_.clear();
|
||||
defaultInterpolationScheme_.clear();
|
||||
interpolationSchemeDefault_.clear();
|
||||
|
||||
divSchemes_.clear(); // optional
|
||||
defaultDivScheme_.clear();
|
||||
divSchemeDefault_.clear();
|
||||
|
||||
gradSchemes_.clear(); // optional
|
||||
defaultGradScheme_.clear();
|
||||
gradSchemeDefault_.clear();
|
||||
|
||||
lnGradSchemes_.clear();
|
||||
defaultLnGradScheme_.clear();
|
||||
lnGradSchemeDefault_.clear();
|
||||
|
||||
laplacianSchemes_.clear(); // optional
|
||||
defaultLaplacianScheme_.clear();
|
||||
laplacianSchemeDefault_.clear();
|
||||
|
||||
fluxRequired_.clear();
|
||||
defaultFluxRequired_ = false;
|
||||
fluxRequiredDefault_ = false;
|
||||
}
|
||||
|
||||
|
||||
@ -74,8 +81,7 @@ void Foam::faSchemes::read(const dictionary& dict)
|
||||
&& word(ddtSchemes_.lookup("default")) != "none"
|
||||
)
|
||||
{
|
||||
defaultDdtScheme_ = ddtSchemes_.lookup("default");
|
||||
|
||||
ddtSchemeDefault_ = ddtSchemes_.lookup("default");
|
||||
}
|
||||
|
||||
|
||||
@ -94,7 +100,7 @@ void Foam::faSchemes::read(const dictionary& dict)
|
||||
&& word(d2dt2Schemes_.lookup("default")) != "none"
|
||||
)
|
||||
{
|
||||
defaultD2dt2Scheme_ = d2dt2Schemes_.lookup("default");
|
||||
d2dt2SchemeDefault_ = d2dt2Schemes_.lookup("default");
|
||||
}
|
||||
|
||||
|
||||
@ -113,7 +119,7 @@ void Foam::faSchemes::read(const dictionary& dict)
|
||||
&& word(interpolationSchemes_.lookup("default")) != "none"
|
||||
)
|
||||
{
|
||||
defaultInterpolationScheme_ =
|
||||
interpolationSchemeDefault_ =
|
||||
interpolationSchemes_.lookup("default");
|
||||
}
|
||||
|
||||
@ -126,7 +132,7 @@ void Foam::faSchemes::read(const dictionary& dict)
|
||||
&& word(divSchemes_.lookup("default")) != "none"
|
||||
)
|
||||
{
|
||||
defaultDivScheme_ = divSchemes_.lookup("default");
|
||||
divSchemeDefault_ = divSchemes_.lookup("default");
|
||||
}
|
||||
|
||||
|
||||
@ -138,7 +144,7 @@ void Foam::faSchemes::read(const dictionary& dict)
|
||||
&& word(gradSchemes_.lookup("default")) != "none"
|
||||
)
|
||||
{
|
||||
defaultGradScheme_ = gradSchemes_.lookup("default");
|
||||
gradSchemeDefault_ = gradSchemes_.lookup("default");
|
||||
}
|
||||
|
||||
|
||||
@ -157,7 +163,7 @@ void Foam::faSchemes::read(const dictionary& dict)
|
||||
&& word(lnGradSchemes_.lookup("default")) != "none"
|
||||
)
|
||||
{
|
||||
defaultLnGradScheme_ = lnGradSchemes_.lookup("default");
|
||||
lnGradSchemeDefault_ = lnGradSchemes_.lookup("default");
|
||||
}
|
||||
|
||||
|
||||
@ -169,7 +175,7 @@ void Foam::faSchemes::read(const dictionary& dict)
|
||||
&& word(laplacianSchemes_.lookup("default")) != "none"
|
||||
)
|
||||
{
|
||||
defaultLaplacianScheme_ = laplacianSchemes_.lookup("default");
|
||||
laplacianSchemeDefault_ = laplacianSchemes_.lookup("default");
|
||||
}
|
||||
|
||||
|
||||
@ -183,17 +189,32 @@ void Foam::faSchemes::read(const dictionary& dict)
|
||||
&& fluxRequired_.get<word>("default") != "none"
|
||||
)
|
||||
{
|
||||
defaultFluxRequired_ = fluxRequired_.get<bool>("default");
|
||||
fluxRequiredDefault_ = fluxRequired_.get<bool>("default");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::faSchemes::writeDicts(Ostream& os) const
|
||||
{
|
||||
// Write dictionaries
|
||||
ddtSchemes_.writeEntry(os);
|
||||
d2dt2Schemes_.writeEntry(os);
|
||||
interpolationSchemes_.writeEntry(os);
|
||||
divSchemes_.writeEntry(os);
|
||||
gradSchemes_.writeEntry(os);
|
||||
lnGradSchemes_.writeEntry(os);
|
||||
laplacianSchemes_.writeEntry(os);
|
||||
fluxRequired_.writeEntry(os);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::faSchemes::faSchemes
|
||||
(
|
||||
const objectRegistry& obr,
|
||||
const word& dictName,
|
||||
const dictionary* fallback
|
||||
)
|
||||
:
|
||||
@ -201,7 +222,7 @@ Foam::faSchemes::faSchemes
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"faSchemes",
|
||||
dictName,
|
||||
obr.time().system(),
|
||||
obr,
|
||||
(
|
||||
@ -214,106 +235,76 @@ Foam::faSchemes::faSchemes
|
||||
),
|
||||
fallback
|
||||
),
|
||||
|
||||
// Named, but empty dictionaries and default schemes
|
||||
ddtSchemes_
|
||||
(
|
||||
ITstream
|
||||
(
|
||||
objectPath() + ".ddtSchemes",
|
||||
tokenList()
|
||||
)()
|
||||
objectPath() + ".ddtSchemes"
|
||||
),
|
||||
defaultDdtScheme_
|
||||
ddtSchemeDefault_
|
||||
(
|
||||
ddtSchemes_.name() + ".default",
|
||||
tokenList()
|
||||
zero{},
|
||||
ddtSchemes_.name() + ".default"
|
||||
),
|
||||
d2dt2Schemes_
|
||||
(
|
||||
ITstream
|
||||
(
|
||||
objectPath() + ".d2dt2Schemes",
|
||||
tokenList()
|
||||
)()
|
||||
objectPath() + ".d2dt2Schemes"
|
||||
),
|
||||
defaultD2dt2Scheme_
|
||||
d2dt2SchemeDefault_
|
||||
(
|
||||
d2dt2Schemes_.name() + ".default",
|
||||
tokenList()
|
||||
zero{},
|
||||
d2dt2Schemes_.name() + ".default"
|
||||
),
|
||||
interpolationSchemes_
|
||||
(
|
||||
ITstream
|
||||
(
|
||||
objectPath() + ".interpolationSchemes",
|
||||
tokenList()
|
||||
)()
|
||||
objectPath() + ".interpolationSchemes"
|
||||
),
|
||||
defaultInterpolationScheme_
|
||||
interpolationSchemeDefault_
|
||||
(
|
||||
interpolationSchemes_.name() + ".default",
|
||||
tokenList()
|
||||
zero{},
|
||||
interpolationSchemes_.name() + ".default"
|
||||
),
|
||||
divSchemes_
|
||||
(
|
||||
ITstream
|
||||
(
|
||||
objectPath() + ".divSchemes",
|
||||
tokenList()
|
||||
)()
|
||||
objectPath() + ".divSchemes"
|
||||
),
|
||||
defaultDivScheme_
|
||||
divSchemeDefault_
|
||||
(
|
||||
divSchemes_.name() + ".default",
|
||||
tokenList()
|
||||
zero{},
|
||||
divSchemes_.name() + ".default"
|
||||
),
|
||||
gradSchemes_
|
||||
(
|
||||
ITstream
|
||||
(
|
||||
objectPath() + ".gradSchemes",
|
||||
tokenList()
|
||||
)()
|
||||
objectPath() + ".gradSchemes"
|
||||
),
|
||||
defaultGradScheme_
|
||||
gradSchemeDefault_
|
||||
(
|
||||
gradSchemes_.name() + ".default",
|
||||
tokenList()
|
||||
zero{},
|
||||
gradSchemes_.name() + ".default"
|
||||
),
|
||||
lnGradSchemes_
|
||||
(
|
||||
ITstream
|
||||
(
|
||||
objectPath() + ".snGradSchemes",
|
||||
tokenList()
|
||||
)()
|
||||
objectPath() + ".lnGradSchemes"
|
||||
),
|
||||
defaultLnGradScheme_
|
||||
lnGradSchemeDefault_
|
||||
(
|
||||
lnGradSchemes_.name() + ".default",
|
||||
tokenList()
|
||||
zero{},
|
||||
lnGradSchemes_.name() + ".default"
|
||||
),
|
||||
laplacianSchemes_
|
||||
(
|
||||
ITstream
|
||||
(
|
||||
objectPath() + ".laplacianSchemes",
|
||||
tokenList()
|
||||
)()
|
||||
objectPath() + ".laplacianSchemes"
|
||||
),
|
||||
defaultLaplacianScheme_
|
||||
laplacianSchemeDefault_
|
||||
(
|
||||
laplacianSchemes_.name() + ".default",
|
||||
tokenList()
|
||||
zero{},
|
||||
laplacianSchemes_.name() + ".default"
|
||||
),
|
||||
fluxRequired_
|
||||
(
|
||||
ITstream
|
||||
(
|
||||
objectPath() + ".fluxRequired",
|
||||
tokenList()
|
||||
)()
|
||||
objectPath() + ".fluxRequired"
|
||||
),
|
||||
defaultFluxRequired_(false)
|
||||
fluxRequiredDefault_(false)
|
||||
{
|
||||
if
|
||||
(
|
||||
@ -327,12 +318,6 @@ Foam::faSchemes::faSchemes
|
||||
}
|
||||
|
||||
|
||||
Foam::faSchemes::faSchemes(const objectRegistry& obr, const dictionary& dict)
|
||||
:
|
||||
faSchemes(obr, &dict)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::faSchemes::read()
|
||||
@ -364,147 +349,137 @@ const Foam::dictionary& Foam::faSchemes::schemesDict() const
|
||||
|
||||
Foam::ITstream& Foam::faSchemes::ddtScheme(const word& name) const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Lookup ddtScheme for " << name << endl;
|
||||
}
|
||||
DebugInfo<< "Lookup ddtScheme for " << name << endl;
|
||||
|
||||
if (ddtSchemes_.found(name) || defaultDdtScheme_.empty())
|
||||
if (ddtSchemes_.found(name) || ddtSchemeDefault_.empty())
|
||||
{
|
||||
return ddtSchemes_.lookup(name);
|
||||
}
|
||||
else
|
||||
{
|
||||
const_cast<ITstream&>(defaultDdtScheme_).rewind();
|
||||
return const_cast<ITstream&>(defaultDdtScheme_);
|
||||
// Default scheme
|
||||
ITstream& is = const_cast<ITstream&>(ddtSchemeDefault_);
|
||||
is.rewind();
|
||||
return is;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::ITstream& Foam::faSchemes::d2dt2Scheme(const word& name) const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Lookup d2dt2Scheme for " << name << endl;
|
||||
}
|
||||
DebugInfo<< "Lookup d2dt2Scheme for " << name << endl;
|
||||
|
||||
if (d2dt2Schemes_.found(name) || defaultD2dt2Scheme_.empty())
|
||||
if (d2dt2Schemes_.found(name) || d2dt2SchemeDefault_.empty())
|
||||
{
|
||||
return d2dt2Schemes_.lookup(name);
|
||||
}
|
||||
else
|
||||
{
|
||||
const_cast<ITstream&>(defaultD2dt2Scheme_).rewind();
|
||||
return const_cast<ITstream&>(defaultD2dt2Scheme_);
|
||||
// Default scheme
|
||||
ITstream& is = const_cast<ITstream&>(d2dt2SchemeDefault_);
|
||||
is.rewind();
|
||||
return is;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::ITstream& Foam::faSchemes::interpolationScheme(const word& name) const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Lookup interpolationScheme for " << name << endl;
|
||||
}
|
||||
DebugInfo<< "Lookup interpolationScheme for " << name << endl;
|
||||
|
||||
if
|
||||
(
|
||||
interpolationSchemes_.found(name)
|
||||
|| defaultInterpolationScheme_.empty()
|
||||
|| interpolationSchemeDefault_.empty()
|
||||
)
|
||||
{
|
||||
return interpolationSchemes_.lookup(name);
|
||||
}
|
||||
else
|
||||
{
|
||||
const_cast<ITstream&>(defaultInterpolationScheme_).rewind();
|
||||
return const_cast<ITstream&>(defaultInterpolationScheme_);
|
||||
// Default scheme
|
||||
ITstream& is = const_cast<ITstream&>(interpolationSchemeDefault_);
|
||||
is.rewind();
|
||||
return is;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::ITstream& Foam::faSchemes::divScheme(const word& name) const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Lookup divScheme for " << name << endl;
|
||||
}
|
||||
DebugInfo<< "Lookup divScheme for " << name << endl;
|
||||
|
||||
if (divSchemes_.found(name) || defaultDivScheme_.empty())
|
||||
if (divSchemes_.found(name) || divSchemeDefault_.empty())
|
||||
{
|
||||
return divSchemes_.lookup(name);
|
||||
}
|
||||
else
|
||||
{
|
||||
const_cast<ITstream&>(defaultDivScheme_).rewind();
|
||||
return const_cast<ITstream&>(defaultDivScheme_);
|
||||
// Default scheme
|
||||
ITstream& is = const_cast<ITstream&>(divSchemeDefault_);
|
||||
is.rewind();
|
||||
return is;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::ITstream& Foam::faSchemes::gradScheme(const word& name) const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Lookup gradScheme for " << name << endl;
|
||||
}
|
||||
DebugInfo<< "Lookup gradScheme for " << name << endl;
|
||||
|
||||
if (gradSchemes_.found(name) || defaultGradScheme_.empty())
|
||||
if (gradSchemes_.found(name) || gradSchemeDefault_.empty())
|
||||
{
|
||||
return gradSchemes_.lookup(name);
|
||||
}
|
||||
else
|
||||
{
|
||||
const_cast<ITstream&>(defaultGradScheme_).rewind();
|
||||
return const_cast<ITstream&>(defaultGradScheme_);
|
||||
// Default scheme
|
||||
ITstream& is = const_cast<ITstream&>(gradSchemeDefault_);
|
||||
is.rewind();
|
||||
return is;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::ITstream& Foam::faSchemes::lnGradScheme(const word& name) const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Lookup snGradScheme for " << name << endl;
|
||||
}
|
||||
DebugInfo<< "Lookup lnGradScheme for " << name << endl;
|
||||
|
||||
if (lnGradSchemes_.found(name) || defaultLnGradScheme_.empty())
|
||||
if (lnGradSchemes_.found(name) || lnGradSchemeDefault_.empty())
|
||||
{
|
||||
return lnGradSchemes_.lookup(name);
|
||||
}
|
||||
else
|
||||
{
|
||||
const_cast<ITstream&>(defaultLnGradScheme_).rewind();
|
||||
return const_cast<ITstream&>(defaultLnGradScheme_);
|
||||
// Default scheme
|
||||
ITstream& is = const_cast<ITstream&>(lnGradSchemeDefault_);
|
||||
is.rewind();
|
||||
return is;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::ITstream& Foam::faSchemes::laplacianScheme(const word& name) const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Lookup laplacianScheme for " << name << endl;
|
||||
}
|
||||
DebugInfo<< "Lookup laplacianScheme for " << name << endl;
|
||||
|
||||
if (laplacianSchemes_.found(name) || defaultLaplacianScheme_.empty())
|
||||
if (laplacianSchemes_.found(name) || laplacianSchemeDefault_.empty())
|
||||
{
|
||||
return laplacianSchemes_.lookup(name);
|
||||
}
|
||||
else
|
||||
{
|
||||
const_cast<ITstream&>(defaultLaplacianScheme_).rewind();
|
||||
return const_cast<ITstream&>(defaultLaplacianScheme_);
|
||||
// Default scheme
|
||||
ITstream& is = const_cast<ITstream&>(laplacianSchemeDefault_);
|
||||
is.rewind();
|
||||
return is;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::faSchemes::setFluxRequired(const word& name) const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Setting fluxRequired for " << name << endl;
|
||||
}
|
||||
DebugInfo<< "Setting fluxRequired for " << name << endl;
|
||||
|
||||
fluxRequired_.add(name, true, true);
|
||||
}
|
||||
@ -512,49 +487,20 @@ void Foam::faSchemes::setFluxRequired(const word& name) const
|
||||
|
||||
bool Foam::faSchemes::fluxRequired(const word& name) const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Lookup fluxRequired for " << name << endl;
|
||||
}
|
||||
DebugInfo<< "Lookup fluxRequired for " << name << endl;
|
||||
|
||||
if (fluxRequired_.found(name))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return defaultFluxRequired_;
|
||||
}
|
||||
|
||||
return fluxRequiredDefault_;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::faSchemes::writeData(Ostream& os) const
|
||||
{
|
||||
// Write dictionaries
|
||||
os << nl << "ddtSchemes";
|
||||
ddtSchemes_.write(os, true);
|
||||
|
||||
os << nl << "d2dt2Schemes";
|
||||
d2dt2Schemes_.write(os, true);
|
||||
|
||||
os << nl << "interpolationSchemes";
|
||||
interpolationSchemes_.write(os, true);
|
||||
|
||||
os << nl << "divSchemes";
|
||||
divSchemes_.write(os, true);
|
||||
|
||||
os << nl << "gradSchemes";
|
||||
gradSchemes_.write(os, true);
|
||||
|
||||
os << nl << "lnGradSchemes";
|
||||
lnGradSchemes_.write(os, true);
|
||||
|
||||
os << nl << "laplacianSchemes";
|
||||
laplacianSchemes_.write(os, true);
|
||||
|
||||
os << nl << "fluxRequired";
|
||||
fluxRequired_.write(os, true);
|
||||
|
||||
this->writeDicts(os);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -58,28 +58,28 @@ class faSchemes
|
||||
// Private Data
|
||||
|
||||
dictionary ddtSchemes_;
|
||||
ITstream defaultDdtScheme_;
|
||||
ITstream ddtSchemeDefault_;
|
||||
|
||||
dictionary d2dt2Schemes_;
|
||||
ITstream defaultD2dt2Scheme_;
|
||||
ITstream d2dt2SchemeDefault_;
|
||||
|
||||
dictionary interpolationSchemes_;
|
||||
ITstream defaultInterpolationScheme_;
|
||||
ITstream interpolationSchemeDefault_;
|
||||
|
||||
dictionary divSchemes_;
|
||||
ITstream defaultDivScheme_;
|
||||
ITstream divSchemeDefault_;
|
||||
|
||||
dictionary gradSchemes_;
|
||||
ITstream defaultGradScheme_;
|
||||
ITstream gradSchemeDefault_;
|
||||
|
||||
dictionary lnGradSchemes_;
|
||||
ITstream defaultLnGradScheme_;
|
||||
ITstream lnGradSchemeDefault_;
|
||||
|
||||
dictionary laplacianSchemes_;
|
||||
ITstream defaultLaplacianScheme_;
|
||||
ITstream laplacianSchemeDefault_;
|
||||
|
||||
mutable dictionary fluxRequired_;
|
||||
bool defaultFluxRequired_;
|
||||
bool fluxRequiredDefault_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
@ -90,6 +90,9 @@ class faSchemes
|
||||
//- Read settings from the dictionary
|
||||
void read(const dictionary&);
|
||||
|
||||
//- Write dictionary (possibly modified) settings
|
||||
void writeDicts(Ostream& os) const;
|
||||
|
||||
//- No copy construct
|
||||
faSchemes(const faSchemes&) = delete;
|
||||
|
||||
@ -97,6 +100,19 @@ class faSchemes
|
||||
void operator=(const faSchemes&) = delete;
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct for objectRegistry, system dictName, and optional
|
||||
//- fallback dictionary content (for a NO_READ or missing file)
|
||||
// A null dictionary pointer is treated like an empty dictionary.
|
||||
faSchemes
|
||||
(
|
||||
const objectRegistry& obr,
|
||||
const word& dictName,
|
||||
const dictionary* fallback
|
||||
);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Debug switch
|
||||
@ -112,11 +128,17 @@ public:
|
||||
(
|
||||
const objectRegistry& obr,
|
||||
const dictionary* fallback = nullptr
|
||||
);
|
||||
)
|
||||
:
|
||||
faSchemes(obr, "faSchemes", fallback)
|
||||
{}
|
||||
|
||||
//- Construct for objectRegistry, and
|
||||
//- fallback dictionary content (for a NO_READ or missing file)
|
||||
faSchemes(const objectRegistry& obr, const dictionary& dict);
|
||||
faSchemes(const objectRegistry& obr, const dictionary& dict)
|
||||
:
|
||||
faSchemes(obr, "faSchemes", &dict)
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
@ -147,49 +169,49 @@ public:
|
||||
// Edit
|
||||
|
||||
//- Return access to ddt schemes
|
||||
dictionary& ddtSchemes()
|
||||
dictionary& ddtSchemes() noexcept
|
||||
{
|
||||
return ddtSchemes_;
|
||||
}
|
||||
|
||||
//- Return access to d2dt2 schemes
|
||||
dictionary& d2dt2Schemes()
|
||||
dictionary& d2dt2Schemes() noexcept
|
||||
{
|
||||
return d2dt2Schemes_;
|
||||
}
|
||||
|
||||
//- Return access to interpolation schemes
|
||||
dictionary& interpolationSchemes()
|
||||
dictionary& interpolationSchemes() noexcept
|
||||
{
|
||||
return interpolationSchemes_;
|
||||
}
|
||||
|
||||
//- Return access to div schemes
|
||||
dictionary& divSchemes()
|
||||
dictionary& divSchemes() noexcept
|
||||
{
|
||||
return divSchemes_;
|
||||
}
|
||||
|
||||
//- Return access to grad schemes
|
||||
dictionary& gradSchemes()
|
||||
dictionary& gradSchemes() noexcept
|
||||
{
|
||||
return gradSchemes_;
|
||||
}
|
||||
|
||||
//- Return access to lnGrad schemes
|
||||
dictionary& lnGradSchemes()
|
||||
dictionary& lnGradSchemes() noexcept
|
||||
{
|
||||
return lnGradSchemes_;
|
||||
}
|
||||
|
||||
//- Return access to laplacian schemes
|
||||
dictionary& laplacianSchemes()
|
||||
dictionary& laplacianSchemes() noexcept
|
||||
{
|
||||
return laplacianSchemes_;
|
||||
}
|
||||
|
||||
//- Return access to flux required
|
||||
dictionary& fluxRequired()
|
||||
dictionary& fluxRequired() noexcept
|
||||
{
|
||||
return fluxRequired_;
|
||||
}
|
||||
|
||||
@ -40,19 +40,26 @@ int Foam::fvSchemes::debug(Foam::debug::debugSwitch("fvSchemes", 0));
|
||||
void Foam::fvSchemes::clear()
|
||||
{
|
||||
ddtSchemes_.clear();
|
||||
defaultDdtScheme_.clear();
|
||||
ddtSchemeDefault_.clear();
|
||||
|
||||
d2dt2Schemes_.clear();
|
||||
defaultD2dt2Scheme_.clear();
|
||||
d2dt2SchemeDefault_.clear();
|
||||
|
||||
interpolationSchemes_.clear();
|
||||
defaultInterpolationScheme_.clear();
|
||||
interpolationSchemeDefault_.clear();
|
||||
|
||||
divSchemes_.clear();
|
||||
defaultDivScheme_.clear();
|
||||
divSchemeDefault_.clear();
|
||||
|
||||
gradSchemes_.clear();
|
||||
defaultGradScheme_.clear();
|
||||
gradSchemeDefault_.clear();
|
||||
|
||||
snGradSchemes_.clear();
|
||||
defaultSnGradScheme_.clear();
|
||||
snGradSchemeDefault_.clear();
|
||||
|
||||
laplacianSchemes_.clear();
|
||||
defaultLaplacianScheme_.clear();
|
||||
laplacianSchemeDefault_.clear();
|
||||
|
||||
// Do not clear fluxRequired settings
|
||||
}
|
||||
|
||||
@ -74,10 +81,10 @@ void Foam::fvSchemes::read(const dictionary& dict)
|
||||
&& word(ddtSchemes_.lookup("default")) != "none"
|
||||
)
|
||||
{
|
||||
defaultDdtScheme_ = ddtSchemes_.lookup("default");
|
||||
ddtSchemeDefault_ = ddtSchemes_.lookup("default");
|
||||
steady_ =
|
||||
(
|
||||
word(defaultDdtScheme_)
|
||||
word(ddtSchemeDefault_)
|
||||
== fv::steadyStateDdtScheme<scalar>::typeName
|
||||
);
|
||||
}
|
||||
@ -98,7 +105,7 @@ void Foam::fvSchemes::read(const dictionary& dict)
|
||||
&& word(d2dt2Schemes_.lookup("default")) != "none"
|
||||
)
|
||||
{
|
||||
defaultD2dt2Scheme_ = d2dt2Schemes_.lookup("default");
|
||||
d2dt2SchemeDefault_ = d2dt2Schemes_.lookup("default");
|
||||
}
|
||||
|
||||
|
||||
@ -117,7 +124,7 @@ void Foam::fvSchemes::read(const dictionary& dict)
|
||||
&& word(interpolationSchemes_.lookup("default")) != "none"
|
||||
)
|
||||
{
|
||||
defaultInterpolationScheme_ =
|
||||
interpolationSchemeDefault_ =
|
||||
interpolationSchemes_.lookup("default");
|
||||
}
|
||||
|
||||
@ -130,7 +137,7 @@ void Foam::fvSchemes::read(const dictionary& dict)
|
||||
&& word(divSchemes_.lookup("default")) != "none"
|
||||
)
|
||||
{
|
||||
defaultDivScheme_ = divSchemes_.lookup("default");
|
||||
divSchemeDefault_ = divSchemes_.lookup("default");
|
||||
}
|
||||
|
||||
|
||||
@ -142,7 +149,7 @@ void Foam::fvSchemes::read(const dictionary& dict)
|
||||
&& word(gradSchemes_.lookup("default")) != "none"
|
||||
)
|
||||
{
|
||||
defaultGradScheme_ = gradSchemes_.lookup("default");
|
||||
gradSchemeDefault_ = gradSchemes_.lookup("default");
|
||||
}
|
||||
|
||||
|
||||
@ -161,7 +168,7 @@ void Foam::fvSchemes::read(const dictionary& dict)
|
||||
&& word(snGradSchemes_.lookup("default")) != "none"
|
||||
)
|
||||
{
|
||||
defaultSnGradScheme_ = snGradSchemes_.lookup("default");
|
||||
snGradSchemeDefault_ = snGradSchemes_.lookup("default");
|
||||
}
|
||||
|
||||
|
||||
@ -173,7 +180,7 @@ void Foam::fvSchemes::read(const dictionary& dict)
|
||||
&& word(laplacianSchemes_.lookup("default")) != "none"
|
||||
)
|
||||
{
|
||||
defaultLaplacianScheme_ = laplacianSchemes_.lookup("default");
|
||||
laplacianSchemeDefault_ = laplacianSchemes_.lookup("default");
|
||||
}
|
||||
|
||||
|
||||
@ -187,17 +194,32 @@ void Foam::fvSchemes::read(const dictionary& dict)
|
||||
&& fluxRequired_.get<word>("default") != "none"
|
||||
)
|
||||
{
|
||||
defaultFluxRequired_ = fluxRequired_.get<bool>("default");
|
||||
fluxRequiredDefault_ = fluxRequired_.get<bool>("default");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::fvSchemes::writeDicts(Ostream& os) const
|
||||
{
|
||||
// Write dictionaries
|
||||
ddtSchemes_.writeEntry(os);
|
||||
d2dt2Schemes_.writeEntry(os);
|
||||
interpolationSchemes_.writeEntry(os);
|
||||
divSchemes_.writeEntry(os);
|
||||
gradSchemes_.writeEntry(os);
|
||||
snGradSchemes_.writeEntry(os);
|
||||
laplacianSchemes_.writeEntry(os);
|
||||
fluxRequired_.writeEntry(os);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::fvSchemes::fvSchemes
|
||||
(
|
||||
const objectRegistry& obr,
|
||||
const word& dictName,
|
||||
const dictionary* fallback
|
||||
)
|
||||
:
|
||||
@ -205,7 +227,7 @@ Foam::fvSchemes::fvSchemes
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"fvSchemes",
|
||||
dictName,
|
||||
obr.time().system(),
|
||||
obr,
|
||||
(
|
||||
@ -218,106 +240,76 @@ Foam::fvSchemes::fvSchemes
|
||||
),
|
||||
fallback
|
||||
),
|
||||
|
||||
// Named, but empty dictionaries and default schemes
|
||||
ddtSchemes_
|
||||
(
|
||||
ITstream
|
||||
(
|
||||
objectPath() + ".ddtSchemes",
|
||||
tokenList()
|
||||
)()
|
||||
objectPath() + ".ddtSchemes"
|
||||
),
|
||||
defaultDdtScheme_
|
||||
ddtSchemeDefault_
|
||||
(
|
||||
ddtSchemes_.name() + ".default",
|
||||
tokenList()
|
||||
zero{},
|
||||
ddtSchemes_.name() + ".default"
|
||||
),
|
||||
d2dt2Schemes_
|
||||
(
|
||||
ITstream
|
||||
(
|
||||
objectPath() + ".d2dt2Schemes",
|
||||
tokenList()
|
||||
)()
|
||||
objectPath() + ".d2dt2Schemes"
|
||||
),
|
||||
defaultD2dt2Scheme_
|
||||
d2dt2SchemeDefault_
|
||||
(
|
||||
d2dt2Schemes_.name() + ".default",
|
||||
tokenList()
|
||||
zero{},
|
||||
d2dt2Schemes_.name() + ".default"
|
||||
),
|
||||
interpolationSchemes_
|
||||
(
|
||||
ITstream
|
||||
(
|
||||
objectPath() + ".interpolationSchemes",
|
||||
tokenList()
|
||||
)()
|
||||
objectPath() + ".interpolationSchemes"
|
||||
),
|
||||
defaultInterpolationScheme_
|
||||
interpolationSchemeDefault_
|
||||
(
|
||||
interpolationSchemes_.name() + ".default",
|
||||
tokenList()
|
||||
zero{},
|
||||
interpolationSchemes_.name() + ".default"
|
||||
),
|
||||
divSchemes_
|
||||
(
|
||||
ITstream
|
||||
(
|
||||
objectPath() + ".divSchemes",
|
||||
tokenList()
|
||||
)()
|
||||
objectPath() + ".divSchemes"
|
||||
),
|
||||
defaultDivScheme_
|
||||
divSchemeDefault_
|
||||
(
|
||||
divSchemes_.name() + ".default",
|
||||
tokenList()
|
||||
zero{},
|
||||
divSchemes_.name() + ".default"
|
||||
),
|
||||
gradSchemes_
|
||||
(
|
||||
ITstream
|
||||
(
|
||||
objectPath() + ".gradSchemes",
|
||||
tokenList()
|
||||
)()
|
||||
objectPath() + ".gradSchemes"
|
||||
),
|
||||
defaultGradScheme_
|
||||
gradSchemeDefault_
|
||||
(
|
||||
gradSchemes_.name() + ".default",
|
||||
tokenList()
|
||||
zero{},
|
||||
gradSchemes_.name() + ".default"
|
||||
),
|
||||
snGradSchemes_
|
||||
(
|
||||
ITstream
|
||||
(
|
||||
objectPath() + ".snGradSchemes",
|
||||
tokenList()
|
||||
)()
|
||||
objectPath() + ".snGradSchemes"
|
||||
),
|
||||
defaultSnGradScheme_
|
||||
snGradSchemeDefault_
|
||||
(
|
||||
snGradSchemes_.name() + ".default",
|
||||
tokenList()
|
||||
zero{},
|
||||
snGradSchemes_.name() + ".default"
|
||||
),
|
||||
laplacianSchemes_
|
||||
(
|
||||
ITstream
|
||||
(
|
||||
objectPath() + ".laplacianSchemes",
|
||||
tokenList()
|
||||
)()
|
||||
objectPath() + ".laplacianSchemes"
|
||||
),
|
||||
defaultLaplacianScheme_
|
||||
laplacianSchemeDefault_
|
||||
(
|
||||
laplacianSchemes_.name() + ".default",
|
||||
tokenList()
|
||||
zero{},
|
||||
laplacianSchemes_.name() + ".default"
|
||||
),
|
||||
fluxRequired_
|
||||
(
|
||||
ITstream
|
||||
(
|
||||
objectPath() + ".fluxRequired",
|
||||
tokenList()
|
||||
)()
|
||||
objectPath() + ".fluxRequired"
|
||||
),
|
||||
defaultFluxRequired_(false),
|
||||
fluxRequiredDefault_(false),
|
||||
steady_(false)
|
||||
{
|
||||
if
|
||||
@ -332,12 +324,6 @@ Foam::fvSchemes::fvSchemes
|
||||
}
|
||||
|
||||
|
||||
Foam::fvSchemes::fvSchemes(const objectRegistry& obr, const dictionary& dict)
|
||||
:
|
||||
fvSchemes(obr, &dict)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::fvSchemes::read()
|
||||
@ -369,147 +355,137 @@ const Foam::dictionary& Foam::fvSchemes::schemesDict() const
|
||||
|
||||
Foam::ITstream& Foam::fvSchemes::ddtScheme(const word& name) const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Lookup ddtScheme for " << name << endl;
|
||||
}
|
||||
DebugInfo<< "Lookup ddtScheme for " << name << endl;
|
||||
|
||||
if (ddtSchemes_.found(name) || defaultDdtScheme_.empty())
|
||||
if (ddtSchemes_.found(name) || ddtSchemeDefault_.empty())
|
||||
{
|
||||
return ddtSchemes_.lookup(name);
|
||||
}
|
||||
else
|
||||
{
|
||||
const_cast<ITstream&>(defaultDdtScheme_).rewind();
|
||||
return const_cast<ITstream&>(defaultDdtScheme_);
|
||||
// Default scheme
|
||||
ITstream& is = const_cast<ITstream&>(ddtSchemeDefault_);
|
||||
is.rewind();
|
||||
return is;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::ITstream& Foam::fvSchemes::d2dt2Scheme(const word& name) const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Lookup d2dt2Scheme for " << name << endl;
|
||||
}
|
||||
DebugInfo<< "Lookup d2dt2Scheme for " << name << endl;
|
||||
|
||||
if (d2dt2Schemes_.found(name) || defaultD2dt2Scheme_.empty())
|
||||
if (d2dt2Schemes_.found(name) || d2dt2SchemeDefault_.empty())
|
||||
{
|
||||
return d2dt2Schemes_.lookup(name);
|
||||
}
|
||||
else
|
||||
{
|
||||
const_cast<ITstream&>(defaultD2dt2Scheme_).rewind();
|
||||
return const_cast<ITstream&>(defaultD2dt2Scheme_);
|
||||
// Default scheme
|
||||
ITstream& is = const_cast<ITstream&>(d2dt2SchemeDefault_);
|
||||
is.rewind();
|
||||
return is;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::ITstream& Foam::fvSchemes::interpolationScheme(const word& name) const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Lookup interpolationScheme for " << name << endl;
|
||||
}
|
||||
DebugInfo<< "Lookup interpolationScheme for " << name << endl;
|
||||
|
||||
if
|
||||
(
|
||||
interpolationSchemes_.found(name)
|
||||
|| defaultInterpolationScheme_.empty()
|
||||
|| interpolationSchemeDefault_.empty()
|
||||
)
|
||||
{
|
||||
return interpolationSchemes_.lookup(name);
|
||||
}
|
||||
else
|
||||
{
|
||||
const_cast<ITstream&>(defaultInterpolationScheme_).rewind();
|
||||
return const_cast<ITstream&>(defaultInterpolationScheme_);
|
||||
// Default scheme
|
||||
ITstream& is = const_cast<ITstream&>(interpolationSchemeDefault_);
|
||||
is.rewind();
|
||||
return is;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::ITstream& Foam::fvSchemes::divScheme(const word& name) const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Lookup divScheme for " << name << endl;
|
||||
}
|
||||
DebugInfo<< "Lookup divScheme for " << name << endl;
|
||||
|
||||
if (divSchemes_.found(name) || defaultDivScheme_.empty())
|
||||
if (divSchemes_.found(name) || divSchemeDefault_.empty())
|
||||
{
|
||||
return divSchemes_.lookup(name);
|
||||
}
|
||||
else
|
||||
{
|
||||
const_cast<ITstream&>(defaultDivScheme_).rewind();
|
||||
return const_cast<ITstream&>(defaultDivScheme_);
|
||||
// Default scheme
|
||||
ITstream& is = const_cast<ITstream&>(divSchemeDefault_);
|
||||
is.rewind();
|
||||
return is;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::ITstream& Foam::fvSchemes::gradScheme(const word& name) const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Lookup gradScheme for " << name << endl;
|
||||
}
|
||||
DebugInfo<< "Lookup gradScheme for " << name << endl;
|
||||
|
||||
if (gradSchemes_.found(name) || defaultGradScheme_.empty())
|
||||
if (gradSchemes_.found(name) || gradSchemeDefault_.empty())
|
||||
{
|
||||
return gradSchemes_.lookup(name);
|
||||
}
|
||||
else
|
||||
{
|
||||
const_cast<ITstream&>(defaultGradScheme_).rewind();
|
||||
return const_cast<ITstream&>(defaultGradScheme_);
|
||||
// Default scheme
|
||||
ITstream& is = const_cast<ITstream&>(gradSchemeDefault_);
|
||||
is.rewind();
|
||||
return is;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::ITstream& Foam::fvSchemes::snGradScheme(const word& name) const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Lookup snGradScheme for " << name << endl;
|
||||
}
|
||||
DebugInfo<< "Lookup snGradScheme for " << name << endl;
|
||||
|
||||
if (snGradSchemes_.found(name) || defaultSnGradScheme_.empty())
|
||||
if (snGradSchemes_.found(name) || snGradSchemeDefault_.empty())
|
||||
{
|
||||
return snGradSchemes_.lookup(name);
|
||||
}
|
||||
else
|
||||
{
|
||||
const_cast<ITstream&>(defaultSnGradScheme_).rewind();
|
||||
return const_cast<ITstream&>(defaultSnGradScheme_);
|
||||
// Default scheme
|
||||
ITstream& is = const_cast<ITstream&>(snGradSchemeDefault_);
|
||||
is.rewind();
|
||||
return is;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::ITstream& Foam::fvSchemes::laplacianScheme(const word& name) const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Lookup laplacianScheme for " << name << endl;
|
||||
}
|
||||
DebugInfo<< "Lookup laplacianScheme for " << name << endl;
|
||||
|
||||
if (laplacianSchemes_.found(name) || defaultLaplacianScheme_.empty())
|
||||
if (laplacianSchemes_.found(name) || laplacianSchemeDefault_.empty())
|
||||
{
|
||||
return laplacianSchemes_.lookup(name);
|
||||
}
|
||||
else
|
||||
{
|
||||
const_cast<ITstream&>(defaultLaplacianScheme_).rewind();
|
||||
return const_cast<ITstream&>(defaultLaplacianScheme_);
|
||||
// Default scheme
|
||||
ITstream& is = const_cast<ITstream&>(laplacianSchemeDefault_);
|
||||
is.rewind();
|
||||
return is;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::fvSchemes::setFluxRequired(const word& name) const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Setting fluxRequired for " << name << endl;
|
||||
}
|
||||
DebugInfo<< "Setting fluxRequired for " << name << endl;
|
||||
|
||||
fluxRequired_.add(name, true, true);
|
||||
}
|
||||
@ -517,17 +493,14 @@ void Foam::fvSchemes::setFluxRequired(const word& name) const
|
||||
|
||||
bool Foam::fvSchemes::fluxRequired(const word& name) const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Lookup fluxRequired for " << name << endl;
|
||||
}
|
||||
DebugInfo<< "Lookup fluxRequired for " << name << endl;
|
||||
|
||||
if (fluxRequired_.found(name))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return defaultFluxRequired_;
|
||||
return fluxRequiredDefault_;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -58,28 +58,28 @@ class fvSchemes
|
||||
// Private Data
|
||||
|
||||
dictionary ddtSchemes_;
|
||||
ITstream defaultDdtScheme_;
|
||||
ITstream ddtSchemeDefault_;
|
||||
|
||||
dictionary d2dt2Schemes_;
|
||||
ITstream defaultD2dt2Scheme_;
|
||||
ITstream d2dt2SchemeDefault_;
|
||||
|
||||
dictionary interpolationSchemes_;
|
||||
ITstream defaultInterpolationScheme_;
|
||||
ITstream interpolationSchemeDefault_;
|
||||
|
||||
dictionary divSchemes_;
|
||||
ITstream defaultDivScheme_;
|
||||
ITstream divSchemeDefault_;
|
||||
|
||||
dictionary gradSchemes_;
|
||||
ITstream defaultGradScheme_;
|
||||
ITstream gradSchemeDefault_;
|
||||
|
||||
dictionary snGradSchemes_;
|
||||
ITstream defaultSnGradScheme_;
|
||||
ITstream snGradSchemeDefault_;
|
||||
|
||||
dictionary laplacianSchemes_;
|
||||
ITstream defaultLaplacianScheme_;
|
||||
ITstream laplacianSchemeDefault_;
|
||||
|
||||
mutable dictionary fluxRequired_;
|
||||
bool defaultFluxRequired_;
|
||||
bool fluxRequiredDefault_;
|
||||
|
||||
//- Steady-state run indicator
|
||||
// Set true if the default ddtScheme is steadyState
|
||||
@ -94,6 +94,9 @@ class fvSchemes
|
||||
//- Read settings from the dictionary
|
||||
void read(const dictionary&);
|
||||
|
||||
//- Write dictionary (possibly modified) settings
|
||||
void writeDicts(Ostream& os) const;
|
||||
|
||||
//- No copy construct
|
||||
fvSchemes(const fvSchemes&) = delete;
|
||||
|
||||
@ -101,6 +104,19 @@ class fvSchemes
|
||||
void operator=(const fvSchemes&) = delete;
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct for objectRegistry, system dictName, and optional
|
||||
//- fallback dictionary content (for a NO_READ or missing file)
|
||||
// A null dictionary pointer is treated like an empty dictionary.
|
||||
fvSchemes
|
||||
(
|
||||
const objectRegistry& obr,
|
||||
const word& dictName,
|
||||
const dictionary* fallback
|
||||
);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Debug switch
|
||||
@ -116,11 +132,17 @@ public:
|
||||
(
|
||||
const objectRegistry& obr,
|
||||
const dictionary* fallback = nullptr
|
||||
);
|
||||
)
|
||||
:
|
||||
fvSchemes(obr, "fvSchemes", fallback)
|
||||
{}
|
||||
|
||||
//- Construct for objectRegistry, and
|
||||
//- fallback dictionary content (for a NO_READ or missing file)
|
||||
fvSchemes(const objectRegistry& obr, const dictionary& dict);
|
||||
fvSchemes(const objectRegistry& obr, const dictionary& dict)
|
||||
:
|
||||
fvSchemes(obr, "fvSchemes", &dict)
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
@ -147,14 +169,14 @@ public:
|
||||
|
||||
bool fluxRequired(const word& name) const;
|
||||
|
||||
//- Return true if the default ddtScheme is steadyState
|
||||
bool steady() const
|
||||
//- True if the default ddtScheme is steadyState
|
||||
bool steady() const noexcept
|
||||
{
|
||||
return steady_;
|
||||
}
|
||||
|
||||
//- Return true if the default ddtScheme is not steadyState
|
||||
bool transient() const
|
||||
//- True if the default ddtScheme is not steadyState
|
||||
bool transient() const noexcept
|
||||
{
|
||||
return !steady_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user