From 6cb7ab41f31e40556f5b190d698aee42ffc1a4a7 Mon Sep 17 00:00:00 2001 From: Harry Moffat Date: Mon, 26 Jul 2004 15:58:21 +0000 Subject: [PATCH] Removed the at() function for vectors. gcc v2.95 does not support this function. --- Cantera/src/NasaThermo.h | 23 +++++++++++++++++++---- Cantera/src/ShomateThermo.h | 24 ++++++++++++++++++++---- 2 files changed, 39 insertions(+), 8 deletions(-) diff --git a/Cantera/src/NasaThermo.h b/Cantera/src/NasaThermo.h index d2b93f6a6..30494bbcd 100755 --- a/Cantera/src/NasaThermo.h +++ b/Cantera/src/NasaThermo.h @@ -120,13 +120,15 @@ namespace Cantera { int grp = m_group_map[k]; int pos = m_posInGroup_map[k]; - const NasaPoly1 *nlow = &(m_low[grp-1].at(pos)); + const vector &mlg = m_low[grp-1]; + const NasaPoly1 *nlow = &(mlg[pos]); doublereal tmid = nlow->maxTemp(); if (t < tmid) { nlow->updateProperties(m_t.begin(), cp_R, h_RT, s_R); } else { - const NasaPoly1 *nhigh = &(m_high[grp-1].at(pos)); + const vector &mhg = m_high[grp-1]; + const NasaPoly1 *nhigh = &(mhg[pos]); nhigh->updateProperties(m_t.begin(), cp_R, h_RT, s_R); } } @@ -204,8 +206,10 @@ namespace Cantera { if (type == NASA) { int grp = m_group_map[index]; int pos = m_posInGroup_map[index]; - const NasaPoly1 *lowPoly = &(m_low[grp-1].at(pos)); - const NasaPoly1 *highPoly = &(m_high[grp-1].at(pos)); + const vector &mlg = m_low[grp-1]; + const vector &mhg = m_high[grp-1]; + const NasaPoly1 *lowPoly = &(mlg[pos]); + const NasaPoly1 *highPoly = &(mhg[pos]); doublereal tmid = lowPoly->maxTemp(); c[0] = tmid; @@ -242,7 +246,18 @@ namespace Cantera { int m_ngroups; mutable vector_fp m_t; + /* + * This map takes as its index, the species index in the phase. + * It returns the group index, where the temperature polynomials + * for that species are storred. group indecises start at 1, + * so a decrement is always performed to access vectors. + */ mutable map m_group_map; + /* + * This map takes as its index, the species index in the phase. + * It returns the position index within the group, where the + * temperature polynomials for that species are storred. + */ mutable map m_posInGroup_map; private: diff --git a/Cantera/src/ShomateThermo.h b/Cantera/src/ShomateThermo.h index 194e987d7..17199e510 100755 --- a/Cantera/src/ShomateThermo.h +++ b/Cantera/src/ShomateThermo.h @@ -102,13 +102,15 @@ namespace Cantera { int grp = m_group_map[k]; int pos = m_posInGroup_map[k]; - const ShomatePoly *nlow = &(m_low[grp-1].at(pos)); + const vector &mlg = m_low[grp-1]; + const ShomatePoly *nlow = &(mlg[pos]); doublereal tmid = nlow->maxTemp(); if (t < tmid) { nlow->updateProperties(m_t.begin(), cp_R, h_RT, s_R); } else { - const ShomatePoly *nhigh = &(m_high[grp-1].at(pos)); + const vector &mhg = m_high[grp-1]; + const ShomatePoly *nhigh = &(mhg[pos]); nhigh->updateProperties(m_t.begin(), cp_R, h_RT, s_R); } } @@ -175,8 +177,10 @@ namespace Cantera { if (type == NASA) { int grp = m_group_map[index]; int pos = m_posInGroup_map[index]; - const ShomatePoly *lowPoly = &(m_low[grp-1].at(pos)); - const ShomatePoly *highPoly = &(m_high[grp-1].at(pos)); + const vector &mlg = m_low[grp-1]; + const vector &mhg = m_high[grp-1]; + const ShomatePoly *lowPoly = &(mlg[pos]); + const ShomatePoly *highPoly = &(mhg[pos]); doublereal tmid = lowPoly->maxTemp(); c[0] = tmid; int n; @@ -212,7 +216,19 @@ namespace Cantera { int m_ngroups; mutable vector_fp m_t; + /* + * This map takes as its index, the species index in the phase. + * It returns the group index, where the temperature polynomials + * for that species are storred. group indecises start at 1, + * so a decrement is always performed to access vectors. + */ mutable map m_group_map; + + /* + * This map takes as its index, the species index in the phase. + * It returns the position index within the group, where the + * temperature polynomials for that species are storred. + */ mutable map m_posInGroup_map; };