solaris port;
std:: additions
This commit is contained in:
parent
3899dfcdf6
commit
438c1476e6
3 changed files with 49 additions and 52 deletions
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* @file BandMatrix.h
|
||||
* @file BandMatrix.h
|
||||
*
|
||||
* Banded matrices.
|
||||
*/
|
||||
|
|
@ -21,10 +21,10 @@
|
|||
#include "utilities.h"
|
||||
#include "ctexceptions.h"
|
||||
|
||||
namespace Cantera {
|
||||
namespace Cantera {
|
||||
|
||||
/**
|
||||
* A class for banded matrices.
|
||||
* A class for banded matrices.
|
||||
*/
|
||||
class BandMatrix {
|
||||
|
||||
|
|
@ -35,7 +35,7 @@ namespace Cantera {
|
|||
|
||||
/// copy constructor
|
||||
BandMatrix(const BandMatrix& y);
|
||||
|
||||
|
||||
/// Destructor. Does nothing.
|
||||
virtual ~BandMatrix(){}
|
||||
|
||||
|
|
@ -45,7 +45,7 @@ namespace Cantera {
|
|||
void resize(int n, int kl, int ku, doublereal v = 0.0);
|
||||
|
||||
void bfill(doublereal v) {
|
||||
fill(data.begin(), data.end(), v);
|
||||
std::fill(data.begin(), data.end(), v);
|
||||
m_factored = false;
|
||||
}
|
||||
|
||||
|
|
@ -57,8 +57,8 @@ namespace Cantera {
|
|||
return value(i,j);
|
||||
}
|
||||
|
||||
/// Return a reference to element (i,j). Since this method may
|
||||
/// alter the element value, it may need to be refactored, so
|
||||
/// Return a reference to element (i,j). Since this method may
|
||||
/// alter the element value, it may need to be refactored, so
|
||||
/// the flag m_factored is set to false.
|
||||
doublereal& value( int i, int j) {
|
||||
m_factored = false;
|
||||
|
|
@ -76,17 +76,17 @@ namespace Cantera {
|
|||
return data[index(i,j)];
|
||||
}
|
||||
|
||||
/// Return the location in the internal 1D array corresponding to
|
||||
/// Return the location in the internal 1D array corresponding to
|
||||
/// the (i,j) element in the banded array.
|
||||
int index(int i, int j) const {
|
||||
int rw = m_kl + m_ku + i - j;
|
||||
return (2*m_kl + m_ku + 1)*j + rw;
|
||||
}
|
||||
|
||||
/// Return the value of the (i,j) element for (i,j) within the
|
||||
|
||||
/// Return the value of the (i,j) element for (i,j) within the
|
||||
/// bandwidth. For efficiency, this method does not check that
|
||||
/// (i,j) are within the bandwidth; it is up to the calling
|
||||
/// program to insure that this is true.
|
||||
/// program to insure that this is true.
|
||||
doublereal _value(int i, int j) const {
|
||||
return data[index(i,j)];
|
||||
}
|
||||
|
|
@ -109,7 +109,7 @@ namespace Cantera {
|
|||
|
||||
int ldim() const { return 2*m_kl + m_ku + 1; }
|
||||
vector_int& ipiv() { return m_ipiv; }
|
||||
|
||||
|
||||
/// Multiply A*b and write result to prod.
|
||||
void mult(const double* b, double* prod) const;
|
||||
|
||||
|
|
@ -122,14 +122,14 @@ namespace Cantera {
|
|||
|
||||
int solve(int n, const doublereal* b, doublereal* x);
|
||||
int solve(int n, doublereal* b);
|
||||
|
||||
vector_fp::iterator begin() {
|
||||
|
||||
vector_fp::iterator begin() {
|
||||
m_factored = false;
|
||||
return data.begin();
|
||||
return data.begin();
|
||||
}
|
||||
vector_fp::iterator end() {
|
||||
vector_fp::iterator end() {
|
||||
m_factored = false;
|
||||
return data.end();
|
||||
return data.end();
|
||||
}
|
||||
vector_fp::const_iterator begin() const { return data.begin(); }
|
||||
vector_fp::const_iterator end() const { return data.end(); }
|
||||
|
|
@ -151,6 +151,3 @@ namespace Cantera {
|
|||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -61,22 +61,22 @@ namespace Cantera {
|
|||
|
||||
void getEnthalpy_RT(doublereal* hrt) const {
|
||||
const array_fp& _h = enthalpy_RT();
|
||||
copy(_h.begin(), _h.end(), hrt);
|
||||
std::copy(_h.begin(), _h.end(), hrt);
|
||||
}
|
||||
|
||||
void getEntropy_R(doublereal* sr) const {
|
||||
const array_fp& _s = entropy_R();
|
||||
copy(_s.begin(), _s.end(), sr);
|
||||
std::copy(_s.begin(), _s.end(), sr);
|
||||
}
|
||||
|
||||
virtual void getGibbs_RT(doublereal* grt) const {
|
||||
const array_fp& gibbsrt = gibbs_RT();
|
||||
copy(gibbsrt.begin(), gibbsrt.end(), grt);
|
||||
std::copy(gibbsrt.begin(), gibbsrt.end(), grt);
|
||||
}
|
||||
|
||||
void getCp_R(doublereal* cpr) const {
|
||||
const array_fp& _cpr = cp_R();
|
||||
copy(_cpr.begin(), _cpr.end(), cpr);
|
||||
std::copy(_cpr.begin(), _cpr.end(), cpr);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -95,7 +95,7 @@ namespace Cantera {
|
|||
const array_fp& expGibbs_RT() const {
|
||||
_updateThermo();
|
||||
int k;
|
||||
for (k = 0; k != m_kk; k++) m_expg0_RT[k] = exp(m_g0_RT[k]);
|
||||
for (k = 0; k != m_kk; k++) m_expg0_RT[k] = std::exp(m_g0_RT[k]);
|
||||
return m_expg0_RT;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ namespace Cantera {
|
|||
class EdgeKineticsData {
|
||||
public:
|
||||
EdgeKineticsData() :
|
||||
m_ROP_ok(false),
|
||||
m_ROP_ok(false),
|
||||
m_temp(0.0), m_logtemp(0.0)
|
||||
{}
|
||||
virtual ~EdgeKineticsData(){}
|
||||
|
|
@ -61,7 +61,7 @@ namespace Cantera {
|
|||
public:
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* Constructor
|
||||
*
|
||||
*/
|
||||
EdgeKinetics();
|
||||
|
|
@ -84,7 +84,7 @@ namespace Cantera {
|
|||
/**
|
||||
* Set the electric potential in the nth phase
|
||||
*
|
||||
* @param n phase Index in this kinetics object.
|
||||
* @param n phase Index in this kinetics object.
|
||||
* @param V Electric potential (volts)
|
||||
*/
|
||||
void setElectricPotential(int n, doublereal V) {
|
||||
|
|
@ -95,7 +95,7 @@ namespace Cantera {
|
|||
/**
|
||||
* @name Reaction Rates Of Progress
|
||||
*/
|
||||
//@{
|
||||
//@{
|
||||
|
||||
/**
|
||||
* Forward rates of progress.
|
||||
|
|
@ -104,9 +104,9 @@ namespace Cantera {
|
|||
* of reactions.
|
||||
* Units are kmol/m2/s
|
||||
*/
|
||||
virtual void getFwdRatesOfProgress(doublereal* fwdROP) {
|
||||
updateROP();
|
||||
copy(m_kdata->m_ropf.begin(), m_kdata->m_ropf.end(), fwdROP);
|
||||
virtual void getFwdRatesOfProgress(doublereal* fwdROP) {
|
||||
updateROP();
|
||||
std::copy(m_kdata->m_ropf.begin(), m_kdata->m_ropf.end(), fwdROP);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -116,9 +116,9 @@ namespace Cantera {
|
|||
* of reactions.
|
||||
* Units are kmol/m2/s
|
||||
*/
|
||||
virtual void getRevRatesOfProgress(doublereal* revROP) {
|
||||
updateROP();
|
||||
copy(m_kdata->m_ropr.begin(), m_kdata->m_ropr.end(), revROP);
|
||||
virtual void getRevRatesOfProgress(doublereal* revROP) {
|
||||
updateROP();
|
||||
std::copy(m_kdata->m_ropr.begin(), m_kdata->m_ropr.end(), revROP);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -128,9 +128,9 @@ namespace Cantera {
|
|||
* reactions.
|
||||
* Units are kmol/m2/s
|
||||
*/
|
||||
virtual void getNetRatesOfProgress(doublereal* netROP) {
|
||||
updateROP();
|
||||
copy(m_kdata->m_ropnet.begin(), m_kdata->m_ropnet.end(), netROP);
|
||||
virtual void getNetRatesOfProgress(doublereal* netROP) {
|
||||
updateROP();
|
||||
std::copy(m_kdata->m_ropnet.begin(), m_kdata->m_ropnet.end(), netROP);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -149,13 +149,13 @@ namespace Cantera {
|
|||
//@{
|
||||
|
||||
/**
|
||||
* Species creation rates [kmol/m^2/s]. Return the species
|
||||
* Species creation rates [kmol/m^2/s]. Return the species
|
||||
* creation rates in array cdot, which must be
|
||||
* dimensioned at least as large as the total number of
|
||||
* species in all phases of the kinetics
|
||||
* model
|
||||
*
|
||||
*/
|
||||
*
|
||||
*/
|
||||
virtual void getCreationRates(doublereal* cdot) {
|
||||
updateROP();
|
||||
std::fill(cdot, cdot + m_kk, 0.0);
|
||||
|
|
@ -168,13 +168,13 @@ namespace Cantera {
|
|||
}
|
||||
|
||||
/**
|
||||
* Species destruction rates [kmol/m^2/s]. Return the species
|
||||
* Species destruction rates [kmol/m^2/s]. Return the species
|
||||
* destruction rates in array ddot, which must be
|
||||
* dimensioned at least as large as the total number of
|
||||
* species in all phases of the kinetics
|
||||
* model
|
||||
*
|
||||
*/
|
||||
*
|
||||
*/
|
||||
virtual void getDestructionRates(doublereal* ddot) {
|
||||
updateROP();
|
||||
std::fill(ddot, ddot + m_kk, 0.0);
|
||||
|
|
@ -190,7 +190,7 @@ namespace Cantera {
|
|||
* wdot, which must be dimensioned at least as large as the
|
||||
* total number of species in all phases of the kinetics
|
||||
* model
|
||||
*/
|
||||
*/
|
||||
virtual void getNetProductionRates(doublereal* net) {
|
||||
updateROP();
|
||||
std::fill(net, net + m_kk, 0.0);
|
||||
|
|
@ -210,7 +210,7 @@ namespace Cantera {
|
|||
|
||||
/**
|
||||
* Stoichiometric coefficient of species k as a reactant in
|
||||
* reaction i.
|
||||
* reaction i.
|
||||
*/
|
||||
virtual doublereal reactantStoichCoeff(int k, int i) const {
|
||||
return m_rrxn[k][i];
|
||||
|
|
@ -218,7 +218,7 @@ namespace Cantera {
|
|||
|
||||
/**
|
||||
* Stoichiometric coefficient of species k as a product in
|
||||
* reaction i.
|
||||
* reaction i.
|
||||
*/
|
||||
virtual doublereal productStoichCoeff(int k, int i) const {
|
||||
return m_prxn[k][i];
|
||||
|
|
@ -239,7 +239,7 @@ namespace Cantera {
|
|||
* for reaction i is always zero.
|
||||
*/
|
||||
virtual bool isReversible(int i) {
|
||||
if (find(m_revindex.begin(), m_revindex.end(), i)
|
||||
if (std::find(m_revindex.begin(), m_revindex.end(), i)
|
||||
< m_revindex.end()) return true;
|
||||
else return false;
|
||||
}
|
||||
|
|
@ -263,7 +263,7 @@ namespace Cantera {
|
|||
* any reactions are actually added to the mechanism.
|
||||
* This function calculates m_kk the number of species in all
|
||||
* phases participating in the reaction mechanism. We don't know
|
||||
* m_kk previously, before all phases have been added.
|
||||
* m_kk previously, before all phases have been added.
|
||||
*/
|
||||
virtual void init();
|
||||
|
||||
|
|
@ -275,7 +275,7 @@ namespace Cantera {
|
|||
/**
|
||||
* Finish adding reactions and prepare for use. This function
|
||||
* must be called after all reactions are entered into the mechanism
|
||||
* and before the mechanism is used to calculate reaction rates.
|
||||
* and before the mechanism is used to calculate reaction rates.
|
||||
*/
|
||||
virtual void finalize();
|
||||
virtual bool ready() const;
|
||||
|
|
@ -301,8 +301,8 @@ namespace Cantera {
|
|||
*/
|
||||
int m_kk;
|
||||
|
||||
Rate1<SurfaceArrhenius> m_rates;
|
||||
//Rate1<Arrhenius> m_rates;
|
||||
Rate1<SurfaceArrhenius> m_rates;
|
||||
//Rate1<Arrhenius> m_rates;
|
||||
bool m_redo_rates;
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue