diff --git a/src/OpenFOAM/interpolations/interpolationWeights/interpolationWeights/interpolationWeights.C b/src/OpenFOAM/interpolations/interpolationWeights/interpolationWeights/interpolationWeights.C index 30fc2fc0f6..779f134de3 100644 --- a/src/OpenFOAM/interpolations/interpolationWeights/interpolationWeights/interpolationWeights.C +++ b/src/OpenFOAM/interpolations/interpolationWeights/interpolationWeights/interpolationWeights.C @@ -57,8 +57,12 @@ autoPtr interpolationWeights::New const scalarField& samples ) { - Info<< nl << "Selecting interpolationWeights " - << type << endl; + if (debug) + { + InfoIn("interpolationWeights::New") + << "Selecting interpolationWeights " + << type << endl; + } wordConstructorTable::iterator cstrIter = wordConstructorTablePtr_->find(type); @@ -87,33 +91,6 @@ interpolationWeights::~interpolationWeights() {} -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -//objectRegistry& interpolationWeights::registry -//( -// const objectRegistry& obr, -// const word& name -//) -//{ -// if (!obr.foundObject(name)) -// { -// objectRegistry* fieldsCachePtr = new objectRegistry -// ( -// IOobject -// ( -// name, -// obr.time().constant(), -// obr, -// IOobject::NO_READ, -// IOobject::NO_WRITE -// ) -// ); -// fieldsCachePtr->store(); -// } -// return const_cast(obr.subRegistry(name)); -//} - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBase.C b/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBase.C index e59c5ec898..4b52d26699 100644 --- a/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBase.C +++ b/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBase.C @@ -45,6 +45,7 @@ const Foam::interpolationWeights& Foam::TableBase::interpolator() const tableSamples_ ); } + return interpolatorPtr_(); } @@ -172,6 +173,7 @@ Foam::TableBase::outOfBounds { boundsHandling prev = boundsHandling_; boundsHandling_ = bound; + return prev; } @@ -366,22 +368,8 @@ Type Foam::TableBase::value(const scalar x) const { t += currentWeights_[i]*table_[currentIndices_[i]].second(); } - return t; - //// Find i such that x(i) < xDash < x(i+1) - //label i = 0; - //while ((table_[i+1].first() < xDash) && (i+1 < table_.size())) - //{ - // i++; - //} - // - //// Linear interpolation to find value - //return Type - //( - // (xDash - table_[i].first())/(table_[i+1].first() - table_[i].first()) - // * (table_[i+1].second() - table_[i].second()) - // + table_[i].second() - //); + return t; } @@ -396,66 +384,8 @@ Type Foam::TableBase::integrate(const scalar x1, const scalar x2) const { sum += currentWeights_[i]*table_[currentIndices_[i]].second(); } + return sum; - - - //// Initialise return value - //Type sum = pTraits::zero; - // - //// Return zero if out of bounds - //if ((x1 > table_.last().first()) || (x2 < table_[0].first())) - //{ - // return sum; - //} - // - //// Find next index greater than x1 - //label id1 = 0; - //while ((table_[id1].first() < x1) && (id1 < table_.size())) - //{ - // id1++; - //} - // - //// Find next index less than x2 - //label id2 = table_.size() - 1; - //while ((table_[id2].first() > x2) && (id2 >= 1)) - //{ - // id2--; - //} - // - //if ((id1 - id2) == 1) - //{ - // // x1 and x2 lie within 1 interval - // sum = 0.5*(value(x1) + value(x2))*(x2 - x1); - //} - //else - //{ - // // x1 and x2 cross multiple intervals - // - // // Integrate table body - // for (label i=id1; i 0) - // { - // sum += 0.5 - // * (value(x1) + table_[id1].second()) - // * (table_[id1].first() - x1); - // } - // if (id2 < table_.size() - 1) - // { - // sum += 0.5 - // * (table_[id2].second() + value(x2)) - // * (x2 - table_[id2].first()); - // } - //} - // - //return sum; } @@ -481,9 +411,9 @@ Foam::dimensioned Foam::TableBase::dimIntegrate ); } + // * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * // #include "TableBaseIO.C" - // ************************************************************************* //