From 13ad54a518b4e9eeb1c42ae350eadc2c69c20191 Mon Sep 17 00:00:00 2001 From: andy <a.heather@opencfd.co.uk> Date: Thu, 9 Jul 2009 17:27:03 +0100 Subject: [PATCH] removing name - was big penalty in poly thermo --- .../functions/Polynomial/Polynomial.C | 19 +++++-------------- .../functions/Polynomial/Polynomial.H | 10 ++-------- .../functions/Polynomial/PolynomialIO.C | 3 +-- .../thermo/hPolynomial/hPolynomialThermo.C | 4 ++-- 4 files changed, 10 insertions(+), 26 deletions(-) diff --git a/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.C b/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.C index 8f3381ea45a..e2d1463f7d6 100644 --- a/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.C +++ b/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.C @@ -32,7 +32,6 @@ template<int PolySize> Foam::Polynomial<PolySize>::Polynomial() : VectorSpace<Polynomial<PolySize>, scalar, PolySize>(), - name_("unknownPolynomialName"), logActive_(false), logCoeff_(0.0) {} @@ -42,16 +41,17 @@ template<int PolySize> Foam::Polynomial<PolySize>::Polynomial(const word& name, Istream& is) : VectorSpace<Polynomial<PolySize>, scalar, PolySize>(), - name_(is), logActive_(false), logCoeff_(0.0) { - if (name_ != name) + word isName(is); + + if (isName != name) { FatalErrorIn ( "Polynomial<PolySize>::Polynomial(const word&, Istream&)" - ) << "Expected polynomial name " << name << " but read " << name_ + ) << "Expected polynomial name " << name << " but read " << isName << nl << exit(FatalError); } @@ -63,7 +63,7 @@ Foam::Polynomial<PolySize>::Polynomial(const word& name, Istream& is) FatalErrorIn ( "Polynomial<PolySize>::Polynomial(const word&, Istream&)" - ) << "Polynomial coefficients for entry " << name_ + ) << "Polynomial coefficients for entry " << isName << " are invalid (empty)" << nl << exit(FatalError); } } @@ -72,12 +72,10 @@ Foam::Polynomial<PolySize>::Polynomial(const word& name, Istream& is) template<int PolySize> Foam::Polynomial<PolySize>::Polynomial ( - const word& name, const Polynomial<PolySize>& poly ) : VectorSpace<Polynomial<PolySize>, scalar, PolySize>(poly), - name_(name), logActive_(poly.logActive_), logCoeff_(poly.logCoeff_) {} @@ -85,13 +83,6 @@ Foam::Polynomial<PolySize>::Polynomial // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template<int PolySize> -const Foam::word& Foam::Polynomial<PolySize>::name() const -{ - return name_; -} - - template<int PolySize> bool& Foam::Polynomial<PolySize>::logActive() { diff --git a/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.H b/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.H index c1e2b580090..9d787f6c1ba 100644 --- a/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.H +++ b/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.H @@ -82,9 +82,6 @@ class Polynomial { // Private data - //- Polynomial name - word name_; - //- Include the log term? - only activated using integrateMinus1() bool logActive_; @@ -107,17 +104,14 @@ public: //- Construct from name and Istream Polynomial(const word& name, Istream& is); - //- Copy constructor with name - Polynomial(const word& name, const Polynomial& poly); + //- Copy constructor + Polynomial(const Polynomial& poly); // Member Functions // Access - //- Return const access to the polynomial name - const word& name() const; - //- Return access to the log term active flag bool& logActive(); diff --git a/src/OpenFOAM/primitives/functions/Polynomial/PolynomialIO.C b/src/OpenFOAM/primitives/functions/Polynomial/PolynomialIO.C index 2a0d2187aa7..5da0a67d64e 100644 --- a/src/OpenFOAM/primitives/functions/Polynomial/PolynomialIO.C +++ b/src/OpenFOAM/primitives/functions/Polynomial/PolynomialIO.C @@ -35,8 +35,7 @@ Foam::Ostream& Foam::operator<< const Polynomial<PolySize>& poly ) { - os << poly.name_ << token::SPACE - << static_cast + os << static_cast <VectorSpace<Polynomial<PolySize>, scalar, PolySize> >(poly); // Check state of Ostream diff --git a/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermo.C b/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermo.C index 294a96005a3..284b9b7049e 100644 --- a/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermo.C +++ b/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermo.C @@ -36,8 +36,8 @@ Foam::hPolynomialThermo<EquationOfState, PolySize>::hPolynomialThermo(Istream& i Hf_(readScalar(is)), Sf_(readScalar(is)), cpPolynomial_("cpPolynomial", is), - dhPolynomial_("dhPolynomial", cpPolynomial_.integrate()), - sPolynomial_("sPolynomial", cpPolynomial_.integrateMinus1()) + dhPolynomial_(cpPolynomial_.integrate()), + sPolynomial_(cpPolynomial_.integrateMinus1()) {} -- GitLab