diff --git a/src/OpenFOAM/primitives/functions/DataEntry/CSV/CSV.C b/src/OpenFOAM/primitives/functions/DataEntry/CSV/CSV.C index 15aebc08b84b69bb4ba1c4020ba31a9a64b8ee2f..28b0924db955bc0917ade8693cf758634a821985 100644 --- a/src/OpenFOAM/primitives/functions/DataEntry/CSV/CSV.C +++ b/src/OpenFOAM/primitives/functions/DataEntry/CSV/CSV.C @@ -203,7 +203,6 @@ Foam::CSV<Type>::CSV const word& ext ) : - DataEntry<Type>(entryName), TableBase<Type>(entryName, dict.subDict(entryName + ext)), coeffs_(dict.subDict(entryName + ext)), nHeaderLine_(readLabel(coeffs_.lookup("nHeaderLine"))), @@ -230,7 +229,6 @@ Foam::CSV<Type>::CSV template<class Type> Foam::CSV<Type>::CSV(const CSV<Type>& tbl) : - DataEntry<Type>(tbl), TableBase<Type>(tbl), nHeaderLine_(tbl.nHeaderLine_), refColumn_(tbl.refColumn_), diff --git a/src/OpenFOAM/primitives/functions/DataEntry/CSV/CSV.H b/src/OpenFOAM/primitives/functions/DataEntry/CSV/CSV.H index 78476adc80a6aad3923f403bf01d73c320b75a71..5969339d67ff5afd3480476a7ef10cce3f186311 100644 --- a/src/OpenFOAM/primitives/functions/DataEntry/CSV/CSV.H +++ b/src/OpenFOAM/primitives/functions/DataEntry/CSV/CSV.H @@ -79,7 +79,6 @@ Ostream& operator<< template<class Type> class CSV : - public DataEntry<Type>, public TableBase<Type> { // Private data @@ -150,52 +149,12 @@ public: // Member Functions - // Manipulation - - //- Convert time - virtual void convertTimeBase(const Time& t) - { - TableBase<Type>::convertTimeBase(t); - } - - // Access //- Return const access to the file name virtual const fileName& fName() const; - // Evaluation - - //- Return Table value - virtual Type value(const scalar x) const - { - return TableBase<Type>::value(x); - } - - //- Integrate between two (scalar) values - virtual Type integrate(const scalar x1, const scalar x2) const - { - return TableBase<Type>::integrate(x1, x2); - } - - //- Return dimensioned constant value - virtual dimensioned<Type> dimValue(const scalar x) const - { - return TableBase<Type>::dimValue(x); - } - - //- Integrate between two values and return dimensioned type - virtual dimensioned<Type> dimIntegrate - ( - const scalar x1, - const scalar x2 - ) const - { - return TableBase<Type>::dimIntegrate(x1, x2); - } - - // I/O //- Ostream Operator diff --git a/src/OpenFOAM/primitives/functions/DataEntry/Table/Table.C b/src/OpenFOAM/primitives/functions/DataEntry/Table/Table.C index eacfc0e1eb9bc1697143cba362666b766e77c256..1e1e0af54e40290f2b9ebd6adb7a09c3549cdacc 100644 --- a/src/OpenFOAM/primitives/functions/DataEntry/Table/Table.C +++ b/src/OpenFOAM/primitives/functions/DataEntry/Table/Table.C @@ -30,7 +30,6 @@ License template<class Type> Foam::Table<Type>::Table(const word& entryName, const dictionary& dict) : - DataEntry<Type>(entryName), TableBase<Type>(entryName, dict) { Istream& is(dict.lookup(entryName)); @@ -51,7 +50,6 @@ Foam::Table<Type>::Table(const word& entryName, const dictionary& dict) template<class Type> Foam::Table<Type>::Table(const Table<Type>& tbl) : - DataEntry<Type>(tbl), TableBase<Type>(tbl) {} @@ -63,9 +61,4 @@ Foam::Table<Type>::~Table() {} -// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * // - -#include "TableIO.C" - - // ************************************************************************* // diff --git a/src/OpenFOAM/primitives/functions/DataEntry/Table/Table.H b/src/OpenFOAM/primitives/functions/DataEntry/Table/Table.H index 950c3790a6238932ba93fab00d198e0cc2daf6ad..9f45b69d15a7120cc04ac1c623df0934dc144018 100644 --- a/src/OpenFOAM/primitives/functions/DataEntry/Table/Table.H +++ b/src/OpenFOAM/primitives/functions/DataEntry/Table/Table.H @@ -70,7 +70,6 @@ Ostream& operator<< template<class Type> class Table : - public DataEntry<Type>, public TableBase<Type> { // Private Member Functions @@ -102,42 +101,6 @@ public: //- Destructor virtual ~Table(); - - - // Member Functions - - // Manipulation - - //- Inherit convertTimeBase from TableBase - using TableBase<Type>::convertTimeBase; - - - // Evaluation - - //- Inherit value from TableBase - using TableBase<Type>::value; - - //- Inherit integrate from TableBase - using TableBase<Type>::integrate; - - //- Inherit dimValue from TableBase - using TableBase<Type>::dimValue; - - //- Inherit dimIntegrate from TableBase - using TableBase<Type>::dimIntegrate; - - - // I/O - - //- Ostream Operator - friend Ostream& operator<< <Type> - ( - Ostream& os, - const Table<Type>& tbl - ); - - //- Write in dictionary format - virtual void writeData(Ostream& os) const; }; diff --git a/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBase.C b/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBase.C index c2e768ccebc65daf8e4827a997afdad57ec823dd..2dedd9ffe357d5abd4695e690b2e5ab56e37f4f7 100644 --- a/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBase.C +++ b/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBase.C @@ -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 @@ -57,6 +57,7 @@ const Foam::interpolationWeights& Foam::TableBase<Type>::interpolator() const template<class Type> Foam::TableBase<Type>::TableBase(const word& name, const dictionary& dict) : + DataEntry<Type>(name), name_(name), boundsHandling_ ( @@ -77,6 +78,7 @@ Foam::TableBase<Type>::TableBase(const word& name, const dictionary& dict) template<class Type> Foam::TableBase<Type>::TableBase(const TableBase<Type>& tbl) : + DataEntry<Type>(tbl), name_(tbl.name_), boundsHandling_(tbl.boundsHandling_), interpolationScheme_(tbl.interpolationScheme_), diff --git a/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBase.H b/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBase.H index 793716803aeb6388f1029a85b19c13f125c88094..df7542e6fde0a5148b8a7bed0b470cdd90f84845 100644 --- a/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBase.H +++ b/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBase.H @@ -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 @@ -62,6 +62,8 @@ class interpolationWeights; template<class Type> class TableBase +: + public DataEntry<Type> { public: diff --git a/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBaseIO.C b/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBaseIO.C index 645934f5fef665d2fe630ddf6cf50e6a7efa3fdb..d4f608b8ab270ad6a89f08e623edbcf52d7376a0 100644 --- a/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBaseIO.C +++ b/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBaseIO.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -34,6 +34,8 @@ Foam::Ostream& Foam::operator<< const TableBase<Type>& tbl ) { + os << static_cast<const DataEntry<Type>&>(tbl); + if (os.format() == IOstream::ASCII) { os << token::SPACE << tbl.table_; @@ -60,6 +62,7 @@ Foam::Ostream& Foam::operator<< template<class Type> void Foam::TableBase<Type>::writeData(Ostream& os) const { + DataEntry<Type>::writeData(os); os << nl << indent << table_ << token::END_STATEMENT << nl; writeEntries(os); } diff --git a/src/OpenFOAM/primitives/functions/DataEntry/Table/TableIO.C b/src/OpenFOAM/primitives/functions/DataEntry/Table/TableIO.C deleted file mode 100644 index ec43d46dd9c37f91a96ca2015d5d4ba5ba6fcd6e..0000000000000000000000000000000000000000 --- a/src/OpenFOAM/primitives/functions/DataEntry/Table/TableIO.C +++ /dev/null @@ -1,58 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "DataEntry.H" - -// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // - -template<class Type> -Foam::Ostream& Foam::operator<< -( - Ostream& os, - const Table<Type>& tbl -) -{ - os << static_cast<const DataEntry<Type>&>(tbl) - << static_cast<const TableBase<Type>&>(tbl); - - // Check state of Ostream - os.check - ( - "Ostream& operator<<(Ostream&, const Table<Type>&)" - ); - - return os; -} - - -template<class Type> -void Foam::Table<Type>::writeData(Ostream& os) const -{ - DataEntry<Type>::writeData(os); - TableBase<Type>::writeData(os); -} - - -// ************************************************************************* // diff --git a/src/OpenFOAM/primitives/functions/DataEntry/TableFile/TableFile.C b/src/OpenFOAM/primitives/functions/DataEntry/TableFile/TableFile.C index 9119148a178cb09971d8ef9aa018ad4d46ab299c..20f8a4b1d07d21f44ab2c64559fcd64c3a9938b2 100644 --- a/src/OpenFOAM/primitives/functions/DataEntry/TableFile/TableFile.C +++ b/src/OpenFOAM/primitives/functions/DataEntry/TableFile/TableFile.C @@ -30,7 +30,6 @@ License template<class Type> Foam::TableFile<Type>::TableFile(const word& entryName, const dictionary& dict) : - DataEntry<Type>(entryName), TableBase<Type>(entryName, dict.subDict(entryName + "Coeffs")), fName_("none") { @@ -63,7 +62,6 @@ Foam::TableFile<Type>::TableFile(const word& entryName, const dictionary& dict) template<class Type> Foam::TableFile<Type>::TableFile(const TableFile<Type>& tbl) : - DataEntry<Type>(tbl), TableBase<Type>(tbl), fName_(tbl.fName_) {} diff --git a/src/OpenFOAM/primitives/functions/DataEntry/TableFile/TableFile.H b/src/OpenFOAM/primitives/functions/DataEntry/TableFile/TableFile.H index 537fa20a70f8e0f737d76c2dd2b87bccec41c288..dc34c00e795571170bb9a7d9f422210d881299a5 100644 --- a/src/OpenFOAM/primitives/functions/DataEntry/TableFile/TableFile.H +++ b/src/OpenFOAM/primitives/functions/DataEntry/TableFile/TableFile.H @@ -82,7 +82,6 @@ Ostream& operator<< template<class Type> class TableFile : - public DataEntry<Type>, public TableBase<Type> { // Private data @@ -122,38 +121,8 @@ public: virtual ~TableFile(); - // Member Functions - - // Manipulation - - //- Inherit convertTimeBase from TableBase - using TableBase<Type>::convertTimeBase; - - - // Evaluation - - //- Inherit value from TableBase - using TableBase<Type>::value; - - //- Inherit integrate from TableBase - using TableBase<Type>::integrate; - - //- Inherit dimValue from TableBase - using TableBase<Type>::dimValue; - - //- Inherit dimIntegrate from TableBase - using TableBase<Type>::dimIntegrate; - - // I/O - //- Ostream Operator - friend Ostream& operator<< <Type> - ( - Ostream& os, - const TableFile<Type>& tbl - ); - //- Write in dictionary format virtual void writeData(Ostream& os) const; }; diff --git a/src/OpenFOAM/primitives/functions/DataEntry/TableFile/TableFileIO.C b/src/OpenFOAM/primitives/functions/DataEntry/TableFile/TableFileIO.C index adaa63119f2965cdeadf8939d7abf734e4df6343..5b074027fcbd72a4fd1a1ad08828b71b64cee7a8 100644 --- a/src/OpenFOAM/primitives/functions/DataEntry/TableFile/TableFileIO.C +++ b/src/OpenFOAM/primitives/functions/DataEntry/TableFile/TableFileIO.C @@ -27,26 +27,6 @@ License // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // -template<class Type> -Foam::Ostream& Foam::operator<< -( - Ostream& os, - const TableFile<Type>& tbl -) -{ - os << static_cast<const DataEntry<Type>&>(tbl) - << static_cast<const TableBase<Type>&>(tbl); - - // Check state of Ostream - os.check - ( - "Ostream& operator<<(Ostream&, const TableFile<Type>&)" - ); - - return os; -} - - template<class Type> void Foam::TableFile<Type>::writeData(Ostream& os) const {