DataEntry: Base the name of the coefficients sub-dicts on the entry name rather than the type name

This allows for more than one of these data types to be specified in a dictionary
Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1652

e.g.
        <entryName> csvFile;
        <entryName>Coeffs
        {
            nHeaderLine         4;
            refColumn           0;          // reference column index
            componentColumns    (1 2 3);    // component column indices
            separator           ",";        // optional (defaults to ",")
            mergeSeparators     no;         // merge multiple separators
            fileName            "fileXYZ";  // name of csv data file
            outOfBounds         clamp;      // optional out-of-bounds handling
            interpolationScheme linear;     // optional interpolation scheme
        }
This commit is contained in:
Henry 2015-04-08 21:22:23 +01:00
parent ff2f3205af
commit d79abdaa17
7 changed files with 14 additions and 15 deletions

View File

@ -204,8 +204,8 @@ Foam::CSV<Type>::CSV
)
:
DataEntry<Type>(entryName),
TableBase<Type>(entryName, dict.subDict(type() + ext)),
coeffs_(dict.subDict(type() + ext)),
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")),

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -29,8 +29,8 @@ Description
e.g. time
\verbatim
<entryName> csvFile;
csvFileCoeffs
<entryName> csvFile;
<entryName>Coeffs
{
nHeaderLine 4;
refColumn 0; // reference column index

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -61,7 +61,7 @@ void Foam::CSV<Type>::writeData(Ostream& os) const
{
DataEntry<Type>::writeData(os);
os << token::END_STATEMENT << nl;
os << indent << word(type() + "Coeffs") << nl;
os << indent << word(this->name() + "Coeffs") << nl;
os << indent << token::BEGIN_BLOCK << incrIndent << nl;
// Note: for TableBase write the dictionary entries it needs but not

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -215,5 +215,4 @@ Foam::DataEntry<Type>::dimIntegrate
#include "DataEntryIO.C"
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -31,10 +31,10 @@ template<class Type>
Foam::TableFile<Type>::TableFile(const word& entryName, const dictionary& dict)
:
DataEntry<Type>(entryName),
TableBase<Type>(entryName, dict.subDict(type() + "Coeffs")),
TableBase<Type>(entryName, dict.subDict(entryName + "Coeffs")),
fName_("none")
{
const dictionary coeffs(dict.subDict(type() + "Coeffs"));
const dictionary coeffs(dict.subDict(entryName + "Coeffs"));
coeffs.lookup("fileName") >> fName_;
if (coeffs.found("dimensions"))

View File

@ -28,8 +28,8 @@ Description
Templated table container data entry where data is read from file.
\verbatim
<entryName> tableFile;
tableFileCoeffs
<entryName> tableFile;
<entryName>Coeffs
{
dimensions [0 0 1 0 0]; // optional dimensions
fileName dataFile; // name of data file

View File

@ -53,7 +53,7 @@ void Foam::TableFile<Type>::writeData(Ostream& os) const
DataEntry<Type>::writeData(os);
os << token::END_STATEMENT << nl
<< indent << word(type() + "Coeffs") << nl
<< indent << word(this->name() + "Coeffs") << nl
<< indent << token::BEGIN_BLOCK << nl << incrIndent;
// Note: for TableBase write the dictionary entries it needs but not