Function1: Rationalized construction to support the simpler sub-dictionary format

e.g.
    ramp
    {
        type     quadratic;
        start    200;
        duration 1.6;
    }

but the old format is supported for backward compatibility:

    ramp linear;
    rampCoeffs
    {
        start    200;
        duration 1.6;
    }
This commit is contained in:
Henry Weller
2017-03-16 20:53:08 +00:00
parent ae9224b5d7
commit 01c758b79a
16 changed files with 116 additions and 80 deletions

View File

@ -203,18 +203,16 @@ template<class Type>
Foam::Function1Types::CSV<Type>::CSV
(
const word& entryName,
const dictionary& dict,
const word& ext
const dictionary& dict
)
:
TableBase<Type>(entryName, dict.subDict(entryName + ext)),
coeffs_(dict.subDict(entryName + ext)),
nHeaderLine_(readLabel(coeffs_.lookup("nHeaderLine"))),
refColumn_(readLabel(coeffs_.lookup("refColumn"))),
componentColumns_(coeffs_.lookup("componentColumns")),
separator_(coeffs_.lookupOrDefault<string>("separator", string(","))[0]),
mergeSeparators_(readBool(coeffs_.lookup("mergeSeparators"))),
fName_(coeffs_.lookup("file"))
TableBase<Type>(entryName, dict),
nHeaderLine_(readLabel(dict.lookup("nHeaderLine"))),
refColumn_(readLabel(dict.lookup("refColumn"))),
componentColumns_(dict.lookup("componentColumns")),
separator_(dict.lookupOrDefault<string>("separator", string(","))[0]),
mergeSeparators_(readBool(dict.lookup("mergeSeparators"))),
fName_(dict.lookup("file"))
{
if (componentColumns_.size() != pTraits<Type>::nComponents)
{