Fixed problems that generated warnings with the Intel compiler

This commit is contained in:
Ray Speth 2012-03-07 00:51:13 +00:00
parent afe97da43f
commit 3bff32dd55
75 changed files with 195 additions and 195 deletions

View file

@ -199,7 +199,7 @@ typedef doublereal* workPtr;
typedef const doublereal* const_workPtr;
//! index returned by functions to indicate "no position"
const size_t npos = -1;
const size_t npos = static_cast<size_t>(-1);
} // namespace

View file

@ -46,7 +46,7 @@ public:
if (m < m_nel) {
return m_order[m];
} else {
return -1;
return npos;
}
}

View file

@ -243,7 +243,7 @@ public:
*/
size_t phaseIndex(std::string ph) {
if (m_phaseindex.find(ph) == m_phaseindex.end()) {
return -1;
return npos;
} else {
return m_phaseindex[ph] - 1;
}

View file

@ -58,7 +58,7 @@ public:
return m_rates.size() - 1;
}
}
return -1;
return npos;
}
/**

View file

@ -35,7 +35,7 @@ public:
typedef std::vector<Path*> path_list;
/// Default constructor
SpeciesNode() : number(-1), name(""), value(0.0),
SpeciesNode() : number(npos), name(""), value(0.0),
visible(false), m_in(0.0), m_out(0.0) {}
/// Destructor
@ -218,7 +218,7 @@ public:
void addNode(size_t k, std::string nm, doublereal x = 0.0);
void displayOnly(size_t k=-1) {
void displayOnly(size_t k=npos) {
m_local = k;
}

View file

@ -50,7 +50,7 @@ public:
m_rdt(0.0),
m_time(time),
m_container(0),
m_index(-1),
m_index(npos),
m_type(0),
m_iloc(0),
m_jstart(0),
@ -67,14 +67,14 @@ public:
}
/// Domain type flag.
const int domainType() {
int domainType() {
return m_type;
}
/**
* The left-to-right location of this domain.
*/
const size_t domainIndex() {
size_t domainIndex() {
return m_index;
}
@ -137,7 +137,7 @@ public:
virtual void init() { }
virtual void setInitialState(doublereal* xlocal = 0) {}
virtual void setState(int point, const doublereal* state, doublereal* x) {}
virtual void setState(size_t point, const doublereal* state, doublereal* x) {}
/**
* Resize the domain to have nv components and np grid points.
@ -308,10 +308,10 @@ public:
* transient mode. Used only to print diagnostic output.
*/
void evalss(doublereal* x, doublereal* r, integer* mask) {
eval(-1,x,r,mask,0.0);
eval(npos,x,r,mask,0.0);
}
//! Evaluate the residual function at point j. If j < 0,
//! Evaluate the residual function at point j. If j == npos,
//! evaluate the residual function at all points.
/*!
* @param j Grid point j

View file

@ -88,7 +88,7 @@ public:
writelog("Bdry1D::_getInitialSoln called!\n");
}
virtual void setupGrid(int n, const doublereal* z) {}
virtual void setupGrid(size_t n, const doublereal* z) {}
protected:

View file

@ -88,7 +88,7 @@ public:
void solve(int loglevel = 0, bool refine_grid = true);
void eval(doublereal rdt=-1.0, int count = 1) {
OneDim::eval(-1, DATA_PTR(m_x), DATA_PTR(m_xnew), rdt, count);
OneDim::eval(npos, DATA_PTR(m_x), DATA_PTR(m_xnew), rdt, count);
}
/// Refine the grid in all domains.

View file

@ -207,8 +207,8 @@ public:
return "<none>";
}
void solveEnergyEqn(int j=-1) {
if (j < 0)
void solveEnergyEqn(size_t j=npos) {
if (j == npos)
for (size_t i = 0; i < m_points; i++) {
m_do_energy[i] = true;
}

View file

@ -328,13 +328,13 @@ public:
* @return
* Returns The standard Concentration as 1.0
*/
virtual doublereal standardConcentration(int k=0) const;
virtual doublereal standardConcentration(size_t k=0) const;
//! Natural logarithm of the standard concentration of the kth species.
/*!
* @param k index of the species (defaults to zero)
*/
virtual doublereal logStandardConc(int k=0) const;
virtual doublereal logStandardConc(size_t k=0) const;
//! Get the array of chemical potentials at unit activity for the species
//! at their standard states at the current <I>T</I> and <I>P</I> of the solution.

View file

@ -151,7 +151,7 @@ public:
*
* @param k Species index
*/
virtual doublereal minTemp(size_t k=-1) const;
virtual doublereal minTemp(size_t k=npos) const;
//! Maximum temperature.
/*!
@ -163,7 +163,7 @@ public:
*
* @param k Species Index
*/
virtual doublereal maxTemp(size_t k=-1) const;
virtual doublereal maxTemp(size_t k=npos) const;
//! The reference-state pressure for species k.
/*!
@ -178,7 +178,7 @@ public:
*
* @param k Species Index
*/
virtual doublereal refPressure(size_t k = -1) const;
virtual doublereal refPressure(size_t k=npos) const;
//! This utility function reports the type of parameterization
//! used for the species with index number index.

View file

@ -264,7 +264,7 @@ public:
* Returns the standard concentration. The units are by definition
* dependent on the ThermoPhase and kinetics manager representation.
*/
virtual doublereal standardConcentration(int k=0) const;
virtual doublereal standardConcentration(size_t k=0) const;
//! Get the array of non-dimensional activities at
//! the current solution temperature, pressure, and solution concentration.

View file

@ -300,7 +300,7 @@ public:
*
* @param k Species index
*/
virtual doublereal minTemp(size_t k=-1) const =0;
virtual doublereal minTemp(size_t k=npos) const =0;
//! Maximum temperature.
/*!
@ -312,7 +312,7 @@ public:
*
* @param k Species Index
*/
virtual doublereal maxTemp(size_t k=-1) const =0;
virtual doublereal maxTemp(size_t k=npos) const =0;
//! The reference-state pressure for species k.
/*!
@ -327,7 +327,7 @@ public:
*
* @param k Species Index
*/
virtual doublereal refPressure(size_t k=-1) const =0;
virtual doublereal refPressure(size_t k=npos) const =0;
//! This utility function reports the type of parameterization
//! used for the species with index number index.
@ -335,7 +335,7 @@ public:
*
* @param index Species index
*/
virtual int reportType(size_t index = -1) const = 0;
virtual int reportType(size_t index=npos) const = 0;
//! This utility function reports back the type of

View file

@ -255,7 +255,7 @@ public:
*
* @param k Species index
*/
virtual doublereal minTemp(size_t k = -1) const;
virtual doublereal minTemp(size_t k = npos) const;
//! Maximum temperature.
/*!
@ -267,7 +267,7 @@ public:
*
* @param k index for parameterization k
*/
virtual doublereal maxTemp(size_t k = -1) const;
virtual doublereal maxTemp(size_t k = npos) const;
/**
* The reference-state pressure for species k.
@ -282,7 +282,7 @@ public:
*
* @param k index for parameterization k
*/
virtual doublereal refPressure(size_t k = -1) const;
virtual doublereal refPressure(size_t k = npos) const;
//! This utility function reports the type of parameterization
//! used for the species with index number index.
@ -434,19 +434,19 @@ public:
/*!
* @param k species index. Defaults to -1.
*/
virtual doublereal minTemp(size_t k = -1) const;
virtual doublereal minTemp(size_t k = npos) const;
//! Returns the maximum temperature
/*!
* @param k species index. Defaults to -1.
*/
virtual doublereal maxTemp(size_t k = -1) const;
virtual doublereal maxTemp(size_t k = npos) const;
//! returns the reference pressure
/*!
* @param k species index. Defaults to -1.
*/
virtual doublereal refPressure(size_t k = -1) const;
virtual doublereal refPressure(size_t k = npos) const;
//! This utility function reports the type of parameterization
//! used for the species with index number index.

View file

@ -659,7 +659,7 @@ public:
*
* @param k Species index
*/
virtual doublereal minTemp(size_t k=-1) const ;
virtual doublereal minTemp(size_t k=npos) const ;
//! Maximum temperature.
/*!
@ -671,7 +671,7 @@ public:
*
* @param k Species Index
*/
virtual doublereal maxTemp(size_t k=-1) const;
virtual doublereal maxTemp(size_t k=npos) const;
//! The reference-state pressure for the standard state
/*!
@ -687,7 +687,7 @@ public:
* @param k Species index. Default is -1, which returns
* the generic answer.
*/
virtual doublereal refPressure(size_t k = -1) const ;
virtual doublereal refPressure(size_t k=npos) const ;
//@}

View file

@ -639,7 +639,7 @@ public:
* Flat vector with the m_nsp in the inner loop.
* length = ldx * ndim
*/
virtual void getSpeciesFluxesES(int ndim,
virtual void getSpeciesFluxesES(size_t ndim,
const doublereal* grad_T,
int ldx,
const doublereal* grad_X,

View file

@ -432,7 +432,7 @@ public:
* Flat vector with the m_nsp in the inner loop.
* length = ldx * ndim
*/
virtual void getSpeciesVdiff(int ndim,
virtual void getSpeciesVdiff(size_t ndim,
const doublereal* grad_T,
int ldx,
const doublereal* grad_X,
@ -465,7 +465,7 @@ public:
* Flat vector with the m_nsp in the inner loop.
* length = ldx * ndim
*/
virtual void getSpeciesVdiffES(int ndim, const doublereal* grad_T,
virtual void getSpeciesVdiffES(size_t ndim, const doublereal* grad_T,
int ldx, const doublereal* grad_X,
int ldf, const doublereal* grad_Phi,
doublereal* Vdiff);

View file

@ -581,7 +581,7 @@ public:
* length = ldx * ndim
* units are m / s.
*/
virtual void getSpeciesVdiff(int ndim,
virtual void getSpeciesVdiff(size_t ndim,
const doublereal* grad_T,
int ldx,
const doublereal* grad_X,
@ -613,7 +613,7 @@ public:
* length = ldx * ndim
* units are m / s.
*/
virtual void getSpeciesVdiffES(int ndim,
virtual void getSpeciesVdiffES(size_t ndim,
const doublereal* grad_T,
int ldx,
const doublereal* grad_X,

View file

@ -1539,8 +1539,8 @@ void getMatrixValues(const Cantera::XML_Node& node,
key2 = rmm.substr(0,icolon);
val = rmm.substr(icolon+1, rmm.size());
size_t icol = -1;
size_t irow = -1;
size_t icol = npos;
size_t irow = npos;
for (size_t j = 0; j < szKey1; j++) {
if (key1 == keyStringRow[j]) {
irow = j;

View file

@ -105,7 +105,7 @@ std::string lowercase(const std::string& s)
int n = static_cast<int>(s.size());
std::string lc(s);
for (int i = 0; i < n; i++) {
lc[i] = tolower(s[i]);
lc[i] = (char) tolower(s[i]);
}
return lc;
}

View file

@ -443,9 +443,9 @@ extern "C" {
{
try {
if (flag > 0) {
_stflow(i)->solveSpecies(-1);
_stflow(i)->solveSpecies(npos);
} else {
_stflow(i)->fixSpecies(-1);
_stflow(i)->fixSpecies(npos);
}
return 0;
} catch (...) {
@ -458,9 +458,9 @@ extern "C" {
{
try {
if (flag > 0) {
_stflow(i)->solveEnergyEqn(-1);
_stflow(i)->solveEnergyEqn(npos);
} else {
_stflow(i)->fixTemperature(-1);
_stflow(i)->fixTemperature(npos);
}
return 0;
} catch (...) {

View file

@ -278,9 +278,9 @@ static void addSpecies(FILE* f, string idtag, const ckr::Species& sp)
* second letter, if needed.
*/
nm = sp.elements[m].name;
nm[0] = toupper(nm[0]);
nm[0] = (char) toupper(nm[0]);
if (nm.size() == 2) {
nm[1] = tolower(nm[1]);
nm[1] = (char) tolower(nm[1]);
}
/*
* Obtain the current number of atoms in the species.
@ -480,9 +480,9 @@ void ck2ct(FILE* f, string idtag, ckr::CKReader& r, bool hastransport)
string elnm;
for (i = 0; i < nel; i++) {
elnm = r.elements[i].name;
elnm[0] = toupper(elnm[0]);
elnm[0] = (char) toupper(elnm[0]);
if (elnm.size() == 2) {
elnm[1] = tolower(elnm[1]);
elnm[1] = (char) tolower(elnm[1]);
}
emap[r.elements[i].name] = elnm;
enames += " "+elnm+" ";

View file

@ -155,9 +155,9 @@ string capitalize(const std::string& word)
string cap = word;
int n = static_cast<int>(word.size());
if (n > 0) {
cap[0] = toupper(word[0]);
cap[0] = (char) toupper(word[0]);
for (int m = 1; m < n; m++) {
cap[m] = tolower(word[m]);
cap[m] = (char) tolower(word[m]);
}
}
return cap;

View file

@ -237,7 +237,7 @@ size_t Cantera::BasisOptimize(int* usedZeroedSpecies, bool doFormRxn,
#endif
size_t jr = -1;
size_t jr = npos;
/*
* Top of a loop of some sort based on the index JR. JR is the
* current number of component species found.
@ -752,7 +752,7 @@ size_t Cantera::ElemRearrange(size_t nComponents, const vector_fp& elementAbunda
* Top of a loop of some sort based on the index JR. JR is the
* current number independent elements found.
*/
jr = -1;
jr = npos;
do {
++jr;
/*

View file

@ -64,8 +64,8 @@ int _equilflag(const char* xy)
/// Default Constructor.
ChemEquil::ChemEquil() : m_skip(-1), m_p1(0), m_p2(0), m_elementTotalSum(1.0),
m_p0(OneAtm), m_eloc(-1),
ChemEquil::ChemEquil() : m_skip(npos), m_p1(0), m_p2(0), m_elementTotalSum(1.0),
m_p0(OneAtm), m_eloc(npos),
m_elemFracCutoff(1.0E-100),
m_doResPerturb(false)
{}
@ -77,9 +77,9 @@ ChemEquil::ChemEquil() : m_skip(-1), m_p1(0), m_p2(0), m_elementTotalSum(1.0),
* @param s ThermoPhase object that will be used in the equilibrium calls.
*/
ChemEquil::ChemEquil(thermo_t& s) :
m_skip(-1), m_p1(0), m_p2(0),
m_skip(npos), m_p1(0), m_p2(0),
m_elementTotalSum(1.0),
m_p0(OneAtm), m_eloc(-1),
m_p0(OneAtm), m_eloc(npos),
m_elemFracCutoff(1.0E-100),
m_doResPerturb(false)
{
@ -128,7 +128,7 @@ void ChemEquil::initialize(thermo_t& s)
m_grt.resize(m_kk);
m_mu_RT.resize(m_kk);
m_muSS_RT.resize(m_kk);
m_component.resize(m_mm,-2);
m_component.resize(m_mm,npos);
m_orderVectorElements.resize(m_mm);
for (size_t m = 0; m < m_mm; m++) {
@ -140,7 +140,7 @@ void ChemEquil::initialize(thermo_t& s)
}
// set up elemental composition matrix
size_t mneg = -1;
size_t mneg = npos;
doublereal na, ewt;
for (size_t m = 0; m < m_mm; m++) {
for (size_t k = 0; k < m_kk; k++) {
@ -1530,7 +1530,7 @@ int ChemEquil::estimateEP_Brinkley(thermo_t& s, vector_fp& x,
/*
* Decide if we are to do a normal step or a modified step
*/
size_t iM = -1;
size_t iM = npos;
for (m = 0; m < m_mm; m++) {
if (elMoles[m] > 0.001 * elMolesTotal) {
if (eMolesCalc[m] > 1000. * elMoles[m]) {
@ -1615,8 +1615,8 @@ int ChemEquil::estimateEP_Brinkley(thermo_t& s, vector_fp& x,
}
#endif
for (m = 0; m < m_mm; m++) {
size_t kMSp = -1;
size_t kMSp2 = -1;
size_t kMSp = npos;
size_t kMSp2 = npos;
int nSpeciesWithElem = 0;
for (k = 0; k < m_kk; k++) {
if (n_i_calc[k] > nCutoff) {

View file

@ -25,7 +25,7 @@ MultiPhase::MultiPhase() :
m_nel(0),
m_nsp(0),
m_init(false),
m_eloc(-1),
m_eloc(npos),
m_Tmin(1.0),
m_Tmax(100000.0)
{
@ -42,7 +42,7 @@ MultiPhase::MultiPhase(const MultiPhase& right) :
m_nel(0),
m_nsp(0),
m_init(false),
m_eloc(-1),
m_eloc(npos),
m_Tmin(1.0),
m_Tmax(100000.0)
{
@ -1022,7 +1022,7 @@ size_t MultiPhase::elementIndex(std::string name) const
return e;
}
}
return -1;
return npos;
}
//====================================================================================================================
// Name of species with global index \a k.

View file

@ -119,24 +119,24 @@ void DoubleStarStar::resize(size_t m, size_t n, double v)
}
}
double* const DoubleStarStar::operator[](size_t jcol)
double* DoubleStarStar::operator[](size_t jcol)
{
return m_colAddr[jcol];
}
const double* const DoubleStarStar::operator[](size_t jcol) const
const double* DoubleStarStar::operator[](size_t jcol) const
{
return (const double * const) m_colAddr[jcol];
return (const double*) m_colAddr[jcol];
}
double* const* const DoubleStarStar::baseDataAddr()
double* const* DoubleStarStar::baseDataAddr()
{
return (double * const * const) &(m_colAddr[0]);
return (double* const*) &(m_colAddr[0]);
}
double const* const* const DoubleStarStar::constBaseDataAddr() const
double const* const* DoubleStarStar::constBaseDataAddr() const
{
return (double const * const * const) &(m_colAddr[0]);
return (double const* const*) &(m_colAddr[0]);
}
// Number of rows

View file

@ -71,7 +71,7 @@ public:
*
* @return returns the pointer to the top of the jth column
*/
double* const operator[](size_t jcol);
double* operator[](size_t jcol);
//! Returns a const Pointer to the top of the jth column
/*!
@ -79,7 +79,7 @@ public:
*
* @return returns the pointer to the top of the jth column
*/
const double* const operator[](size_t jcol) const;
const double* operator[](size_t jcol) const;
//! Returns a double ** pointer to the base address
/*!
@ -87,7 +87,7 @@ public:
* This returns a double ** which can later be used in
* Dmatrix[icol][irow] notation to get to the data
*/
double* const* const baseDataAddr();
double* const* baseDataAddr();
//! Returns a const double ** pointer to the base address
/*!
@ -95,7 +95,7 @@ public:
* This returns a double ** which can later be used in
* Dmatrix[icol][irow] notation to get to the data
*/
double const* const* const constBaseDataAddr() const;
double const* const* constBaseDataAddr() const;
//! Number of rows
size_t nRows() const;

View file

@ -119,19 +119,19 @@ void IntStarStar::resize(size_t m, size_t n, int v)
}
}
int* const IntStarStar::operator[](size_t jcol)
int* IntStarStar::operator[](size_t jcol)
{
return m_colAddr[jcol];
}
const int* const IntStarStar::operator[](size_t jcol) const
const int* IntStarStar::operator[](size_t jcol) const
{
return (const int * const) m_colAddr[jcol];
return (const int*) m_colAddr[jcol];
}
int* const* const IntStarStar::baseDataAddr()
int* const* IntStarStar::baseDataAddr()
{
return (int * const * const) &(m_colAddr[0]);
return (int* const*) &(m_colAddr[0]);
}
/// Number of rows

View file

@ -59,13 +59,13 @@ public:
/*!
* @param jcol Pointer to the top of the jth column
*/
int* const operator[](size_t jcol);
int* operator[](size_t jcol);
//! Pointer to the top of the column
/*!
* @param j Pointer to the top of the jth column
*/
const int* const operator[](size_t jcol) const;
const int* operator[](size_t jcol) const;
//! Returns a int ** pointer to the base address
/*!
@ -73,7 +73,7 @@ public:
* This returns a int ** which can later be used in
* Imatrix[icol][irow] notation to get to the data
*/
int* const* const baseDataAddr();
int* const* baseDataAddr();
//! Number of rows
size_t nRows() const;

View file

@ -1488,7 +1488,7 @@ void vcs_MultiPhaseEquil::getStoichVector(index_t rxn, Cantera::vector_fp& nu)
size_t vcs_MultiPhaseEquil::numComponents() const
{
size_t nc = -1;
size_t nc = npos;
if (m_vsolvePtr) {
nc = m_vsolvePtr->m_numComponents;
}
@ -1497,7 +1497,7 @@ size_t vcs_MultiPhaseEquil::numComponents() const
size_t vcs_MultiPhaseEquil::numElemConstraints() const
{
size_t nec = -1;
size_t nec = npos;
if (m_vsolvePtr) {
nec = m_vsolvePtr->m_numElemConstraints;
}
@ -1511,7 +1511,7 @@ size_t vcs_MultiPhaseEquil::component(size_t m) const
if (m < nc) {
return m_vsolvePtr->m_speciesMapIndex[m];
} else {
return -1;
return npos;
}
}

View file

@ -31,12 +31,12 @@ namespace VCSnonideal
*/
vcs_VolPhase::vcs_VolPhase(VCS_SOLVE* owningSolverObject) :
m_owningSolverObject(0),
VP_ID_(-1),
VP_ID_(npos),
Domain_ID(-1),
m_singleSpecies(true),
m_gasPhase(false),
m_eqnState(VCS_EOS_CONSTANT),
ChargeNeutralityElement(-1),
ChargeNeutralityElement(npos),
p_VCS_UnitsFormat(VCS_UNITS_MKS),
p_activityConvention(0),
m_numElemConstraints(0),
@ -52,7 +52,7 @@ vcs_VolPhase::vcs_VolPhase(VCS_SOLVE* owningSolverObject) :
v_totalMoles(0.0),
creationMoleNumbers_(0),
creationGlobalRxnNumbers_(0),
m_phiVarIndex(-1),
m_phiVarIndex(npos),
m_totalVol(0.0),
m_vcsStateStatus(VCS_STATECALC_OLD),
m_phi(0.0),
@ -114,7 +114,7 @@ vcs_VolPhase::vcs_VolPhase(const vcs_VolPhase& b) :
v_totalMoles(b.v_totalMoles),
creationMoleNumbers_(0),
creationGlobalRxnNumbers_(0),
m_phiVarIndex(-1),
m_phiVarIndex(npos),
m_totalVol(b.m_totalVol),
m_vcsStateStatus(VCS_STATECALC_OLD),
m_phi(b.m_phi),
@ -251,7 +251,7 @@ void vcs_VolPhase::resize(const size_t phaseNum, const size_t nspecies,
#endif
setTotalMolesInert(molesInert);
m_phi = 0.0;
m_phiVarIndex = -1;
m_phiVarIndex = npos;
if (phaseNum == VP_ID_) {
if (strcmp(PhaseName.c_str(), phaseName)) {
@ -285,7 +285,7 @@ void vcs_VolPhase::resize(const size_t phaseNum, const size_t nspecies,
}
IndSpecies.resize(nspecies, -1);
IndSpecies.resize(nspecies, npos);
if (ListSpeciesPtr.size() >= m_numSpecies) {
for (size_t i = 0; i < m_numSpecies; i++) {
@ -302,7 +302,7 @@ void vcs_VolPhase::resize(const size_t phaseNum, const size_t nspecies,
Xmol_.resize(nspecies, 0.0);
creationMoleNumbers_.resize(nspecies, 0.0);
creationGlobalRxnNumbers_.resize(nspecies, -1);
creationGlobalRxnNumbers_.resize(nspecies, npos);
for (size_t i = 0; i < nspecies; i++) {
Xmol_[i] = 1.0/nspecies;
creationMoleNumbers_[i] = 1.0/nspecies;
@ -342,7 +342,7 @@ void vcs_VolPhase::elemResize(const size_t numElemConstraints)
m_formulaMatrix.resize(numElemConstraints, m_numSpecies, 0.0);
m_elementNames.resize(numElemConstraints, "");
m_elemGlobalIndex.resize(numElemConstraints, -1);
m_elemGlobalIndex.resize(numElemConstraints, npos);
m_numElemConstraints = numElemConstraints;
}
@ -1700,9 +1700,9 @@ void vcs_VolPhase::setElementType(const size_t e, const int eType)
}
/***************************************************************************/
double const* const* const vcs_VolPhase::getFormulaMatrix() const
double const* const* vcs_VolPhase::getFormulaMatrix() const
{
double const* const* const fm = m_formulaMatrix.constBaseDataAddr();
double const* const* fm = m_formulaMatrix.constBaseDataAddr();
return fm;
}
/***************************************************************************/

View file

@ -567,7 +567,7 @@ public:
*
* fm[e][f] is the formula matrix entry for element e for species k
*/
double const* const* const getFormulaMatrix() const;
double const* const* getFormulaMatrix() const;
//! Returns the type of the species unknown
/*!

View file

@ -263,7 +263,7 @@ int VCS_SOLVE::vcs_elcorr(double aa[], double x[])
}
} else {
int numCompNonZero = 0;
size_t compID = -1;
size_t compID = npos;
for (size_t kspec = 0; kspec < m_numComponents; kspec++) {
if (m_speciesUnknownType[kspec] != VCS_SPECIES_TYPE_INTERFACIALVOLTAGE) {
double eval = m_formulaMatrix[i][kspec];

View file

@ -98,7 +98,7 @@ int VCS_SOLVE::vcs_elem_rearrange(double* const aw, double* const sa,
* Top of a loop of some sort based on the index JR. JR is the
* current number independent elements found.
*/
jr = -1;
jr = npos;
do {
++jr;
/*

View file

@ -80,7 +80,7 @@ VCS_PROB::VCS_PROB(size_t nsp, size_t nel, size_t nph) :
FormulaMatrix.resize(ne, nspecies, 0.0);
SpeciesUnknownType.resize(nspecies, VCS_SPECIES_TYPE_MOLNUM);
VolPM.resize(nspecies, 0.0);
PhaseID.resize(nspecies, -1);
PhaseID.resize(nspecies, npos);
SpName.resize(nspecies, "");
ElName.resize(ne, "");
m_elType.resize(ne, VCS_ELEM_TYPE_ABSPOS);
@ -387,7 +387,7 @@ void VCS_PROB::prob_report(int print_lvl)
void VCS_PROB::addPhaseElements(vcs_VolPhase* volPhase)
{
size_t e, eVP;
size_t foundPos = -1;
size_t foundPos = npos;
size_t neVP = volPhase->nElemConstraints();
std::string en;
std::string enVP;
@ -395,7 +395,7 @@ void VCS_PROB::addPhaseElements(vcs_VolPhase* volPhase)
* Loop through the elements in the vol phase object
*/
for (eVP = 0; eVP < neVP; eVP++) {
foundPos = -1;
foundPos = npos;
enVP = volPhase->elementName(eVP);
/*
* Search for matches with the existing elements.

View file

@ -436,13 +436,13 @@ L_MAINLOOP_ALL_SPECIES:
/*
* Don't do this step if there is a phase pop
*/
iphaseDelete = -1;
iphaseDelete = npos;
if (iphasePop == npos) {
/*
* Figure out the new reaction step sizes
* for the major species (do minor species in the future too)
*/
kspec = -1;
kspec = npos;
iphaseDelete = vcs_RxnStepSizes(forceComponentCalc, kspec);
}
#ifdef DEBUG_MODE
@ -3207,8 +3207,8 @@ int VCS_SOLVE::vcs_basopt(const bool doJustComponents, double aw[], double sa[],
size_t j, k, l, i, jl, ml, jr, irxn, kspec;
bool lindep;
size_t ncTrial;
size_t juse = -1;
size_t jlose = -1;
size_t juse = npos;
size_t jlose = npos;
double* dptr, *scrxn_ptr;
Cantera::clockWC tickTock;
#ifdef DEBUG_MODE
@ -3274,7 +3274,7 @@ int VCS_SOLVE::vcs_basopt(const bool doJustComponents, double aw[], double sa[],
}
}
jr = -1;
jr = npos;
/*
* Top of a loop of some sort based on the index JR. JR is the
* current number of component species found.
@ -3336,7 +3336,7 @@ int VCS_SOLVE::vcs_basopt(const bool doJustComponents, double aw[], double sa[],
double maxConcPossKspec = 0.0;
double maxConcPoss = 0.0;
size_t kfound = -1;
size_t kfound = npos;
int minNonZeroes = 100000;
int nonZeroesKspec = 0;
for (kspec = ncTrial; kspec < m_numSpeciesTot; kspec++) {
@ -3569,8 +3569,8 @@ L_END_LOOP:
* was just wrong -> hopefully it didn't blow up. Redo the problem.
* Search for inactive E
*/
juse = -1;
jlose = -1;
juse = npos;
jlose = npos;
for (j = 0; j < m_numElemConstraints; j++) {
if (!(m_elementActive[j])) {
if (!strcmp((m_elementName[j]).c_str(), "E")) {

View file

@ -642,7 +642,7 @@ int vcsUtil_gaussj(double* c, size_t idem, size_t n, double* b, size_t m)
}
}
if (needInverse) {
for (l = n-1; l >= 0; l--) {
for (l = n-1; l != npos; l--) {
if (indxr[l] != indxc[l]) {
for (k = 0; k < n; k++) {
std::swap(c[k + idem * indxr[l]], c[k + idem * indxr[l]]);

View file

@ -60,11 +60,11 @@ ImplicitSurfChem::ImplicitSurfChem(vector<InterfaceKinetics*> k) :
size_t nPhases = kinPtr->nPhases();
vector_int pLocTmp(nPhases);
size_t imatch = -1;
size_t imatch = npos;
for (size_t ip = 0; ip < nPhases; ip++) {
if (ip != ns) {
ThermoPhase* thPtr = & kinPtr->thermo(ip);
if ((imatch = checkMatch(m_bulkPhases, thPtr)) == -1) {
if ((imatch = checkMatch(m_bulkPhases, thPtr)) == npos) {
m_bulkPhases.push_back(thPtr);
m_numBulkPhases++;
nsp = thPtr->nSpecies();

View file

@ -32,8 +32,8 @@ Kinetics::Kinetics() :
m_thermo(0),
m_start(0),
m_phaseindex(),
m_surfphase(-1),
m_rxnphase(-1),
m_surfphase(npos),
m_rxnphase(npos),
m_mindim(4),
m_dummygroups(0)
{
@ -56,8 +56,8 @@ Kinetics::Kinetics(const Kinetics& right) :
m_thermo(0),
m_start(0),
m_phaseindex(),
m_surfphase(-1),
m_rxnphase(-1),
m_surfphase(npos),
m_rxnphase(npos),
m_mindim(4),
m_dummygroups(0)
{
@ -297,7 +297,7 @@ size_t Kinetics::speciesPhaseIndex(size_t k)
}
}
throw CanteraError("speciesPhaseIndex", "illegal species index: "+int2str(k));
return -1;
return npos;
}
/*

View file

@ -117,7 +117,7 @@ ReactionPathDiagram::ReactionPathDiagram()
show_details = false;
arrow_hue = 0.6666;
title = "";
m_local = -1;
m_local = npos;
}

View file

@ -456,7 +456,7 @@ public:
C_AnyN() :
m_n(0),
m_rxn(-1) {
m_rxn(npos) {
}
C_AnyN(size_t rxn, const std::vector<size_t>& ic, const vector_fp& order, const vector_fp& stoich) :

View file

@ -125,13 +125,13 @@ BEulerInt::~BEulerInt()
SAFE_DELETE(tdjac_ptr);
}
//================================================================================================
void BEulerInt::setTolerances(double reltol, int n, double* abstol)
void BEulerInt::setTolerances(double reltol, size_t n, double* abstol)
{
m_itol = 1;
if (!m_abstol) {
m_abstol = mdp_alloc_dbl_1(m_neq, MDP_DBL_NOINIT);
}
if (n != m_neq) {
if (static_cast<int>(n) != m_neq) {
printf("ERROR n is wrong\n");
exit(-1);
}

View file

@ -71,7 +71,7 @@ public:
BEulerInt();
//! Destructor
virtual ~BEulerInt();
virtual void setTolerances(double reltol, int n, double* abstol);
virtual void setTolerances(double reltol, size_t n, double* abstol);
virtual void setTolerances(double reltol, double abstol);
virtual void setProblemType(int probtype);
virtual void initializeRJE(double t0, ResidJacEval& func);
@ -79,7 +79,7 @@ public:
virtual double integrateRJE(double tout, double tinit = 0.0);
virtual doublereal step(double tout);
virtual void setSolnWeights();
virtual double& solution(int k) {
virtual double& solution(size_t k) {
return m_y_n[k];
}
double* solution() {

View file

@ -441,7 +441,7 @@ size_t BandMatrix::checkRows(doublereal& valueSmall) const
for (size_t i = 0; i < m_n; i++) {
double valueS = 0.0;
for (size_t j = i - m_kl; j <= i + m_ku; j++) {
if (j >= 0 && (j < m_n)) {
if (j < m_n) {
vv = fabs(value(i,j));
if (vv > valueS) {
valueS = vv;
@ -467,7 +467,7 @@ size_t BandMatrix::checkColumns(doublereal& valueSmall) const
for (size_t j = 0; j < m_n; j++) {
double valueS = 0.0;
for (size_t i = j - m_ku; i <= j + m_kl; i++) {
if (i >= 0 && (i < m_n)) {
if (i < m_n) {
vv = fabs(value(i,j));
if (vv > valueS) {
valueS = vv;

View file

@ -160,7 +160,7 @@ CVodesIntegrator::~CVodesIntegrator()
//delete[] m_iopt;
}
double& CVodesIntegrator::solution(int k)
double& CVodesIntegrator::solution(size_t k)
{
return NV_Ith_S(nv(m_y),k);
}

View file

@ -56,7 +56,7 @@ public:
virtual void reinitialize(double t0, FuncEval& func);
virtual void integrate(double tout);
virtual doublereal step(double tout);
virtual double& solution(int k);
virtual double& solution(size_t k);
virtual double* solution();
virtual int nEquations() const {
return m_neq;

View file

@ -788,7 +788,7 @@ void NonlinearSolver::scaleMatrix(GeneralMatrix& jac, doublereal* const y_comm,
for (jcol = 0; jcol < neq_; jcol++) {
colP_j = (doublereal*) jac.ptrColumn(jcol);
for (irow = jcol - ku; irow <= jcol + kl; irow++) {
if (irow >= 0 && irow < neq_) {
if (irow < neq_) {
colP_j[kl + ku + irow - jcol] *= m_colScales[jcol];
}
}
@ -833,7 +833,7 @@ void NonlinearSolver::scaleMatrix(GeneralMatrix& jac, doublereal* const y_comm,
for (jcol = 0; jcol < neq_; jcol++) {
colP_j = (doublereal*) jac.ptrColumn(jcol);
for (irow = jcol - ku; irow <= jcol + kl; irow++) {
if (irow >= 0 && irow < neq_) {
if (irow < neq_) {
double vv = fabs(colP_j[kl + ku + irow - jcol]);
if (m_rowScaling) {
m_rowScales[irow] += vv;
@ -876,7 +876,7 @@ void NonlinearSolver::scaleMatrix(GeneralMatrix& jac, doublereal* const y_comm,
for (jcol = 0; jcol < neq_; jcol++) {
colP_j = (doublereal*) jac.ptrColumn(jcol);
for (irow = jcol - ku; irow <= jcol + kl; irow++) {
if (irow >= 0 && irow < neq_) {
if (irow < neq_) {
colP_j[kl + ku + irow - jcol] *= m_rowScales[irow];
}
}
@ -3879,7 +3879,7 @@ int NonlinearSolver::beuler_jac(GeneralMatrix& J, doublereal* const f,
for (size_t i = j - ku; i <= j + kl; i++) {
if (i >= 0 && i < neq_) {
if (i < neq_) {
diff = subtractRD(m_wksp[i], f[i]);
col_j[kl + ku + i - j] = diff / dy;
}

View file

@ -554,7 +554,7 @@ doublereal solveProb::calc_damping(doublereal x[], doublereal dxneg[], size_t di
*/
if (damp > damp_old*3) {
damp = damp_old*3;
*label = -1;
*label = npos;
}
/*
@ -840,7 +840,7 @@ void solveProb::printIteration(int ioflag, doublereal damp, size_t label_d,
printf(" ");
}
}
if (label_d >= 0) {
if (label_d != npos) {
k = label_d;
printf(" %s", int2str(k).c_str());
}
@ -930,7 +930,7 @@ void solveProb::printFinal(int ioflag, doublereal damp, size_t label_d, size_t l
printf(" ");
}
}
if (label_d >= 0) {
if (label_d != npos) {
k = label_d;
printf(" %s", int2str(k).c_str());

View file

@ -109,7 +109,7 @@ void MultiNewton::step(doublereal* x, doublereal* step,
{
size_t iok;
size_t sz = r.size();
r.eval(-1, x, step);
r.eval(npos, x, step);
#undef DEBUG_STEP
#ifdef DEBUG_STEP
vector_fp ssave(sz, 0.0);
@ -324,7 +324,7 @@ int MultiNewton::solve(doublereal* x0, doublereal* x1,
}
if (forceNewJac) {
r.eval(-1, x, stp, 0.0, 0);
r.eval(npos, x, stp, 0.0, 0);
jac.eval(x, stp, 0.0);
jac.updateTransient(rdt, DATA_PTR(r.transientMask()));
forceNewJac = false;

View file

@ -232,7 +232,7 @@ void OneDim::resize()
int OneDim::solve(doublereal* x, doublereal* xnew, int loglevel)
{
if (!m_jac_ok) {
eval(-1, x, xnew, 0.0, 0);
eval(npos, x, xnew, 0.0, 0);
m_jac->eval(x, xnew, 0.0);
m_jac->updateTransient(m_rdt, DATA_PTR(m_mask));
m_jac_ok = true;
@ -246,7 +246,7 @@ void OneDim::evalSSJacobian(doublereal* x, doublereal* xnew)
doublereal rdt_save = m_rdt;
m_jac_ok = false;
setSteadyMode();
eval(-1, x, xnew, 0.0, 0);
eval(npos, x, xnew, 0.0, 0);
m_jac->eval(x, xnew, 0.0);
m_rdt = rdt_save;
}
@ -313,7 +313,7 @@ void OneDim::eval(size_t j, double* x, double* r, doublereal rdt, int count)
*/
doublereal OneDim::ssnorm(doublereal* x, doublereal* r)
{
eval(-1, x, r, 0.0, 0);
eval(npos, x, r, 0.0, 0);
doublereal ss = 0.0;
for (size_t i = 0; i < m_size; i++) {
ss = std::max(fabs(r[i]),ss);

View file

@ -1026,7 +1026,7 @@ size_t StFlow::componentIndex(string name) const
}
}
return -1;
return npos;
}

View file

@ -422,7 +422,7 @@ size_t Constituents::speciesIndex(std::string name) const
}
++it;
}
return -1;
return npos;
}
/*

View file

@ -1517,7 +1517,7 @@ initThermoXML(XML_Node& phaseNode, std::string id)
std::string kname, jname;
size_t jj = xspecies.size();
for (size_t k = 0; k < m_kk; k++) {
size_t jmap = -1;
size_t jmap = npos;
kname = speciesName(k);
for (size_t j = 0; j < jj; j++) {
const XML_Node& sp = *xspecies[j];

View file

@ -311,7 +311,7 @@ size_t Elements::elementIndex(std::string name) const
return i;
}
}
return -1;
return npos;
}
#endif

View file

@ -294,7 +294,7 @@ getActivityConcentrations(doublereal* c) const
* by which the generalized concentration is normalized to produce
* the activity.
*/
doublereal FixedChemPotSSTP::standardConcentration(int k) const
doublereal FixedChemPotSSTP::standardConcentration(size_t k) const
{
return 1.0;
}
@ -303,7 +303,7 @@ doublereal FixedChemPotSSTP::standardConcentration(int k) const
* Returns the natural logarithm of the standard
* concentration of the kth species
*/
doublereal FixedChemPotSSTP::logStandardConc(int k) const
doublereal FixedChemPotSSTP::logStandardConc(size_t k) const
{
return 0.0;
}

View file

@ -1499,7 +1499,7 @@ initThermoXML(XML_Node& phaseNode, std::string id)
string kname, jname;
size_t jj = xspecies.size();
for (size_t k = 0; k < m_kk; k++) {
size_t jmap = -1;
size_t jmap = npos;
kname = speciesName(k);
for (size_t j = 0; j < jj; j++) {
const XML_Node& sp = *xspecies[j];

View file

@ -40,8 +40,8 @@ IonsFromNeutralVPSSTP::IonsFromNeutralVPSSTP() :
GibbsExcessVPSSTP(),
ionSolnType_(cIonSolnType_SINGLEANION),
numNeutralMoleculeSpecies_(0),
indexSpecialSpecies_(-1),
indexSecondSpecialSpecies_(-1),
indexSpecialSpecies_(npos),
indexSecondSpecialSpecies_(npos),
numCationSpecies_(0),
numAnionSpecies_(0),
numPassThroughSpecies_(0),
@ -84,8 +84,8 @@ IonsFromNeutralVPSSTP::IonsFromNeutralVPSSTP(std::string inputFile, std::string
GibbsExcessVPSSTP(),
ionSolnType_(cIonSolnType_SINGLEANION),
numNeutralMoleculeSpecies_(0),
indexSpecialSpecies_(-1),
indexSecondSpecialSpecies_(-1),
indexSpecialSpecies_(npos),
indexSecondSpecialSpecies_(npos),
numCationSpecies_(0),
numAnionSpecies_(0),
numPassThroughSpecies_(0),
@ -106,8 +106,8 @@ IonsFromNeutralVPSSTP::IonsFromNeutralVPSSTP(XML_Node& phaseRoot, std::string id
GibbsExcessVPSSTP(),
ionSolnType_(cIonSolnType_SINGLEANION),
numNeutralMoleculeSpecies_(0),
indexSpecialSpecies_(-1),
indexSecondSpecialSpecies_(-1),
indexSpecialSpecies_(npos),
indexSecondSpecialSpecies_(npos),
numCationSpecies_(0),
numAnionSpecies_(0),
numPassThroughSpecies_(0),
@ -136,8 +136,8 @@ IonsFromNeutralVPSSTP::IonsFromNeutralVPSSTP(const IonsFromNeutralVPSSTP& b) :
GibbsExcessVPSSTP(),
ionSolnType_(cIonSolnType_SINGLEANION),
numNeutralMoleculeSpecies_(0),
indexSpecialSpecies_(-1),
indexSecondSpecialSpecies_(-1),
indexSpecialSpecies_(npos),
indexSecondSpecialSpecies_(npos),
numCationSpecies_(0),
numAnionSpecies_(0),
numPassThroughSpecies_(0),
@ -1233,7 +1233,7 @@ void IonsFromNeutralVPSSTP::initThermoXML(XML_Node& phaseNode, std::string id)
}
PDSS_IonsFromNeutral* speciesSS = 0;
indexSpecialSpecies_ = -1;
indexSpecialSpecies_ = npos;
for (k = 0; k < m_kk; k++) {
speciesSS = dynamic_cast<PDSS_IonsFromNeutral*>(providePDSS(k));
if (!speciesSS) {
@ -1259,7 +1259,7 @@ void IonsFromNeutralVPSSTP::initThermoXML(XML_Node& phaseNode, std::string id)
vector<doublereal> fm_tmp(m_kk);
for (size_t k = 0; k < m_kk; k++) {
fm_invert_ionForNeutral[k] = -1;
fm_invert_ionForNeutral[k] = npos;
}
/* for (int jNeut = 0; jNeut < numNeutralMoleculeSpecies_; jNeut++) {
fm_invert_ionForNeutral[jNeut] = -1;

View file

@ -128,7 +128,7 @@ doublereal LatticeSolidPhase::minTemp(size_t k) const
}
doublereal mm = 1.0E300;
for (size_t n = 0; n < m_nlattice; n++) {
double ml = (m_lattice[n])->minTemp(-1);
double ml = (m_lattice[n])->minTemp();
mm = std::min(mm, ml);
}
return mm;
@ -158,7 +158,7 @@ doublereal LatticeSolidPhase::maxTemp(size_t k) const
}
doublereal mm = -1.0E300;
for (size_t n = 0; n < m_nlattice; n++) {
double ml = (m_lattice[n])->maxTemp(-1);
double ml = (m_lattice[n])->maxTemp();
mm = std::max(mm, ml);
}
return mm;

View file

@ -1077,8 +1077,8 @@ void MargulesVPSSTP::resizeNumInteractions(const size_t num)
m_VSE_c_ij.resize(num, 0.0);
m_VSE_d_ij.resize(num, 0.0);
m_pSpecies_A_ij.resize(num, -1);
m_pSpecies_B_ij.resize(num, -1);
m_pSpecies_A_ij.resize(num, npos);
m_pSpecies_B_ij.resize(num, npos);
}
//====================================================================================================================

View file

@ -1079,8 +1079,8 @@ void MixedSolventElectrolyte::resizeNumInteractions(const size_t num)
m_VSE_c_ij.resize(num, 0.0);
m_VSE_d_ij.resize(num, 0.0);
m_pSpecies_A_ij.resize(num, -1);
m_pSpecies_B_ij.resize(num, -1);
m_pSpecies_A_ij.resize(num, npos);
m_pSpecies_B_ij.resize(num, npos);
}
//====================================================================================================================

View file

@ -37,7 +37,7 @@ MolalityVPSSTP::MolalityVPSSTP() :
VPStandardStateTP(),
m_indexSolvent(0),
m_pHScalingType(PHSCALE_PITZER),
m_indexCLM(-1),
m_indexCLM(npos),
m_weightSolvent(18.01528),
m_xmolSolventMIN(0.01),
m_Mnaught(18.01528E-3)
@ -334,9 +334,9 @@ void MolalityVPSSTP::setMolalitiesByName(compositionMap& mMap)
/*
* check charge neutrality
*/
size_t largePos = -1;
size_t largePos = npos;
double cPos = 0.0;
size_t largeNeg = -1;
size_t largeNeg = npos;
double cNeg = 0.0;
double sum = 0.0;
for (size_t k = 0; k < kk; k++) {
@ -735,9 +735,9 @@ void MolalityVPSSTP::applyphScale(doublereal* acMolality) const
*/
size_t MolalityVPSSTP::findCLMIndex() const
{
size_t indexCLM = -1;
size_t eCl = -1;
size_t eE = -1;
size_t indexCLM = npos;
size_t eCl = npos;
size_t eE = npos;
size_t ne = nElements();
string sn;
for (size_t e = 0; e < ne; e++) {
@ -749,7 +749,7 @@ size_t MolalityVPSSTP::findCLMIndex() const
}
// We have failed if we can't find the Cl element index
if (eCl == npos) {
return -1;
return npos;
}
for (size_t e = 0; e < ne; e++) {
sn = elementName(e);

View file

@ -40,7 +40,7 @@ MolarityIonicVPSSTP::MolarityIonicVPSSTP() :
GibbsExcessVPSSTP(),
PBType_(PBTYPE_PASSTHROUGH),
numPBSpecies_(m_kk),
indexSpecialSpecies_(-1),
indexSpecialSpecies_(npos),
numCationSpecies_(0),
numAnionSpecies_(0),
numPassThroughSpecies_(0),
@ -60,7 +60,7 @@ MolarityIonicVPSSTP::MolarityIonicVPSSTP(std::string inputFile, std::string id)
GibbsExcessVPSSTP(),
PBType_(PBTYPE_PASSTHROUGH),
numPBSpecies_(m_kk),
indexSpecialSpecies_(-1),
indexSpecialSpecies_(npos),
numCationSpecies_(0),
numAnionSpecies_(0),
numPassThroughSpecies_(0),
@ -73,7 +73,7 @@ MolarityIonicVPSSTP::MolarityIonicVPSSTP(XML_Node& phaseRoot, std::string id) :
GibbsExcessVPSSTP(),
PBType_(PBTYPE_PASSTHROUGH),
numPBSpecies_(m_kk),
indexSpecialSpecies_(-1),
indexSpecialSpecies_(npos),
numCationSpecies_(0),
numAnionSpecies_(0),
numPassThroughSpecies_(0),
@ -92,7 +92,7 @@ MolarityIonicVPSSTP::MolarityIonicVPSSTP(const MolarityIonicVPSSTP& b) :
GibbsExcessVPSSTP(),
PBType_(PBTYPE_PASSTHROUGH),
numPBSpecies_(m_kk),
indexSpecialSpecies_(-1),
indexSpecialSpecies_(npos),
numCationSpecies_(0),
numAnionSpecies_(0),
numPassThroughSpecies_(0),
@ -510,7 +510,7 @@ void MolarityIonicVPSSTP::calcPseudoBinaryMoleFractions() const
for (k = 0; k < m_kk; k++) {
moleFractionsTmp_[k] = moleFractions_[k];
}
kMax = -1;
kMax = npos;
sumMax = 0.0;
for (k = 0; k < cationList_.size(); k++) {
kCat = cationList_[k];

View file

@ -34,7 +34,7 @@ PDSS::PDSS() :
m_tp(0),
m_vpssmgr_ptr(0),
m_mw(0.0),
m_spindex(-1),
m_spindex(npos),
m_spthermo(0),
m_h0_RT_ptr(0),
m_cp0_R_ptr(0),

View file

@ -1143,8 +1143,8 @@ void PhaseCombo_Interaction::resizeNumInteractions(const size_t num)
m_VSE_c_ij.resize(num, 0.0);
m_VSE_d_ij.resize(num, 0.0);
m_pSpecies_A_ij.resize(num, -1);
m_pSpecies_B_ij.resize(num, -1);
m_pSpecies_A_ij.resize(num, npos);
m_pSpecies_B_ij.resize(num, npos);
}
//====================================================================================================================

View file

@ -33,7 +33,7 @@ PseudoBinaryVPSSTP::PseudoBinaryVPSSTP() :
GibbsExcessVPSSTP(),
PBType_(PBTYPE_PASSTHROUGH),
numPBSpecies_(m_kk),
indexSpecialSpecies_(-1),
indexSpecialSpecies_(npos),
numCationSpecies_(0),
numAnionSpecies_(0),
numPassThroughSpecies_(0),
@ -53,7 +53,7 @@ PseudoBinaryVPSSTP::PseudoBinaryVPSSTP(const PseudoBinaryVPSSTP& b) :
GibbsExcessVPSSTP(),
PBType_(PBTYPE_PASSTHROUGH),
numPBSpecies_(m_kk),
indexSpecialSpecies_(-1),
indexSpecialSpecies_(npos),
numCationSpecies_(0),
numAnionSpecies_(0),
numPassThroughSpecies_(0),

View file

@ -314,7 +314,7 @@ void PureFluidPhase::getActivityConcentrations(doublereal* c) const
c[0] = 1.0;
}
//====================================================================================================================
doublereal PureFluidPhase::standardConcentration(int k) const
doublereal PureFluidPhase::standardConcentration(size_t k) const
{
return 1.0;
}

View file

@ -48,7 +48,7 @@ void SpeciesThermoInterpType::modifyOneHf298(const int k, const doublereal Hf298
//! Constructor
STITbyPDSS::STITbyPDSS() :
m_speciesIndex(-1)
m_speciesIndex(npos)
{
}

View file

@ -11,7 +11,7 @@ static string lowercase(string s)
size_t i, n = s.size();
string lc(s);
for (i = 0; i < n; i++) {
lc[i] = tolower(s[i]);
lc[i] = (char) tolower(s[i]);
}
return lc;
}

View file

@ -123,12 +123,12 @@ void LiquidTranInteraction::init(const XML_Node& compModelNode,
speciesA = xmlChild.attrib("speciesA");
speciesB = xmlChild.attrib("speciesB");
size_t iSpecies = m_thermo->speciesIndex(speciesA);
if (iSpecies < 0) {
if (iSpecies == npos) {
throw CanteraError("TransportFactory::getLiquidInteractionsTransportData",
"Unknown species " + speciesA);
}
size_t jSpecies = m_thermo->speciesIndex(speciesB);
if (jSpecies < 0) {
if (jSpecies == npos) {
throw CanteraError("TransportFactory::getLiquidInteractionsTransportData",
"Unknown species " + speciesB);
}

View file

@ -1151,7 +1151,7 @@ void LiquidTransport::getSpeciesFluxes(size_t ndim,
* Flat vector with the m_nsp in the inner loop.
* length = ldx * ndim
*/
void LiquidTransport::getSpeciesFluxesES(int ndim,
void LiquidTransport::getSpeciesFluxesES(size_t ndim,
const doublereal* grad_T,
int ldx,
const doublereal* grad_X,

View file

@ -636,7 +636,7 @@ void SimpleTransport::getThermalDiffCoeffs(doublereal* const dt)
* Flat vector with the m_nsp in the inner loop.
* length = ldx * ndim
*/
void SimpleTransport::getSpeciesVdiff(int ndim,
void SimpleTransport::getSpeciesVdiff(size_t ndim,
const doublereal* grad_T,
int ldx,
const doublereal* grad_X,
@ -687,7 +687,7 @@ void SimpleTransport::getSpeciesVdiff(int ndim,
* Flat vector with the m_nsp in the inner loop.
* length = ldx * ndim
*/
void SimpleTransport::getSpeciesVdiffES(int ndim, const doublereal* grad_T,
void SimpleTransport::getSpeciesVdiffES(size_t ndim, const doublereal* grad_T,
int ldx, const doublereal* grad_X,
int ldf, const doublereal* grad_Phi,
doublereal* Vdiff)

View file

@ -307,7 +307,7 @@ size_t ConstPressureReactor::componentIndex(string nm) const
}
}
}
return -1;
return npos;
}
}

View file

@ -140,7 +140,7 @@ size_t FlowReactor::componentIndex(string nm) const
if (k != npos) {
return k + 2;
} else {
return -1;
return npos;
}
}

View file

@ -28,7 +28,7 @@ Reactor::Reactor() : ReactorBase(),
m_Q(0.0),
m_rtol(1.e-9),
m_chem(true),
m_energy(true), m_nsens(-1)
m_energy(true), m_nsens(npos)
{}
// overloaded method of FuncEval. Called by the integrator to
@ -376,7 +376,7 @@ size_t Reactor::componentIndex(string nm) const
}
}
}
return -1;
return npos;
}
}