diff --git a/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBase.C b/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBase.C index 08dde8e758..054d87575e 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-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -414,6 +414,36 @@ Foam::dimensioned Foam::TableBase::dimIntegrate } +template +Foam::tmp Foam::TableBase::x() const +{ + tmp tfld(new scalarField(table_.size(), 0.0)); + scalarField& fld = tfld(); + + forAll(table_, i) + { + fld[i] = table_[i].first(); + } + + return tfld; +} + + +template +Foam::tmp > Foam::TableBase::y() const +{ + tmp > tfld(new Field(table_.size(), pTraits::zero)); + Field& fld = tfld(); + + forAll(table_, i) + { + fld[i] = table_[i].second(); + } + + return tfld; +} + + // * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * // #include "TableBaseIO.C" diff --git a/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBase.H b/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBase.H index da670e2db5..793716803a 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-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -172,6 +172,12 @@ public: const scalar x2 ) const; + //- Return the reference values + virtual tmp x() const; + + //- Return the dependent values + virtual tmp > y() const; + // I/O