Fixed some problems with the tests caused by the int to size_t conversion
This commit is contained in:
parent
9470103bb2
commit
f2bf17e1b7
10 changed files with 15 additions and 15 deletions
|
|
@ -1038,7 +1038,7 @@ next:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (eqloc >= 0 && eqloc < int(s.size())) {
|
else if (eqloc != string::npos && eqloc < s.size()) {
|
||||||
if (nRxns > 0) {
|
if (nRxns > 0) {
|
||||||
rxn.number = nRxns;
|
rxn.number = nRxns;
|
||||||
reactions.push_back(rxn);
|
reactions.push_back(rxn);
|
||||||
|
|
@ -1062,17 +1062,17 @@ next:
|
||||||
// irreversible, and separate it into strings for
|
// irreversible, and separate it into strings for
|
||||||
// each side.
|
// each side.
|
||||||
|
|
||||||
if (eqloc = int(s.find("<=>")), eqloc >= 0) {
|
if (eqloc = s.find("<=>"), eqloc != string::npos) {
|
||||||
rxn.isReversible = true;
|
rxn.isReversible = true;
|
||||||
sleft = s.substr(0, eqloc);
|
sleft = s.substr(0, eqloc);
|
||||||
sright = s.substr(eqloc+3,1000);
|
sright = s.substr(eqloc+3,1000);
|
||||||
}
|
}
|
||||||
else if (eqloc = int(s.find("=>")), eqloc >= 0) {
|
else if (eqloc = s.find("=>"), eqloc != string::npos) {
|
||||||
rxn.isReversible = false;
|
rxn.isReversible = false;
|
||||||
sleft = s.substr(0, eqloc);
|
sleft = s.substr(0, eqloc);
|
||||||
sright = s.substr(eqloc+2,1000);
|
sright = s.substr(eqloc+2,1000);
|
||||||
}
|
}
|
||||||
else if (eqloc = int(s.find("=")), eqloc >= 0) {
|
else if (eqloc = s.find("="), eqloc != string::npos) {
|
||||||
rxn.isReversible = true;
|
rxn.isReversible = true;
|
||||||
sleft = s.substr(0, eqloc);
|
sleft = s.substr(0, eqloc);
|
||||||
sright = s.substr(eqloc+1,1000);
|
sright = s.substr(eqloc+1,1000);
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace VCSnonideal {
|
namespace VCSnonideal {
|
||||||
|
using std::size_t;
|
||||||
//! A class for 2D double arrays storred in column-major
|
//! A class for 2D double arrays storred in column-major
|
||||||
//! (Fortran-compatible) form.
|
//! (Fortran-compatible) form.
|
||||||
/*!
|
/*!
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace VCSnonideal {
|
namespace VCSnonideal {
|
||||||
|
using std::size_t;
|
||||||
//! A class for 2D int arrays storred in column-major
|
//! A class for 2D int arrays storred in column-major
|
||||||
//! (Fortran-compatible) form.
|
//! (Fortran-compatible) form.
|
||||||
/*!
|
/*!
|
||||||
|
|
|
||||||
|
|
@ -1336,7 +1336,7 @@ namespace VCSnonideal {
|
||||||
|
|
||||||
kT++;
|
kT++;
|
||||||
}
|
}
|
||||||
if (volPhase->phiVarIndex() >= 0) {
|
if (volPhase->phiVarIndex() != -1) {
|
||||||
size_t kphi = volPhase->phiVarIndex();
|
size_t kphi = volPhase->phiVarIndex();
|
||||||
size_t kglob = volPhase->spGlobalIndexVCS(kphi);
|
size_t kglob = volPhase->spGlobalIndexVCS(kphi);
|
||||||
vprob->w[kglob] = tPhase->electricPotential();
|
vprob->w[kglob] = tPhase->electricPotential();
|
||||||
|
|
|
||||||
|
|
@ -1569,7 +1569,7 @@ namespace VCSnonideal {
|
||||||
fm[e][k] = tPhase->nAtoms(k, eT);
|
fm[e][k] = tPhase->nAtoms(k, eT);
|
||||||
e++;
|
e++;
|
||||||
}
|
}
|
||||||
if (eFound >= 0) {
|
if (eFound != -2) {
|
||||||
fm[eFound][k] = - tPhase->charge(k);
|
fm[eFound][k] = - tPhase->charge(k);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3623,7 +3623,7 @@ namespace VCSnonideal {
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t iph = m_phaseID[kspec];
|
size_t iph = m_phaseID[kspec];
|
||||||
size_t irxn = kspec - m_numComponents;
|
int irxn = int(kspec) - int(m_numComponents);
|
||||||
vcs_VolPhase *VPhase = m_VolPhaseList[iph];
|
vcs_VolPhase *VPhase = m_VolPhaseList[iph];
|
||||||
int phaseExist = VPhase->exists();
|
int phaseExist = VPhase->exists();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -194,7 +194,7 @@ namespace Cantera {
|
||||||
* ThermoPhase object to find a match.
|
* ThermoPhase object to find a match.
|
||||||
*/
|
*/
|
||||||
k = thermo(n).speciesIndex(nm);
|
k = thermo(n).speciesIndex(nm);
|
||||||
if (k >= 0) return k + m_start[n];
|
if (k != -1) return k + m_start[n];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return -2;
|
return -2;
|
||||||
|
|
|
||||||
|
|
@ -1107,7 +1107,7 @@ namespace Cantera {
|
||||||
|
|
||||||
// if no phase with this id has been added to
|
// if no phase with this id has been added to
|
||||||
//the kinetics manager yet, then add this one
|
//the kinetics manager yet, then add this one
|
||||||
if (kin.phaseIndex(phase_id) < 0) {
|
if (kin.phaseIndex(phase_id) == -1) {
|
||||||
kin.addPhase(*th[m]);
|
kin.addPhase(*th[m]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ namespace Cantera {
|
||||||
* Resize the arrays if necessary, filling the empty
|
* Resize the arrays if necessary, filling the empty
|
||||||
* slots with the zero pointer.
|
* slots with the zero pointer.
|
||||||
*/
|
*/
|
||||||
if (index > m_kk - 1) {
|
if (index >= m_kk) {
|
||||||
m_sp.resize(index+1, 0);
|
m_sp.resize(index+1, 0);
|
||||||
m_kk = index+1;
|
m_kk = index+1;
|
||||||
}
|
}
|
||||||
|
|
@ -188,7 +188,7 @@ namespace Cantera {
|
||||||
"zero pointer");
|
"zero pointer");
|
||||||
}
|
}
|
||||||
size_t index = stit_ptr->speciesIndex();
|
size_t index = stit_ptr->speciesIndex();
|
||||||
if (index > m_kk - 1) {
|
if (index >= m_kk) {
|
||||||
m_sp.resize(index+1, 0);
|
m_sp.resize(index+1, 0);
|
||||||
m_kk = index+1;
|
m_kk = index+1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,8 @@ int main(int argc, char **argv) {
|
||||||
mphase.addPhase(&g, 10.0);
|
mphase.addPhase(&g, 10.0);
|
||||||
mphase.init();
|
mphase.init();
|
||||||
int usedZeroedSpecies = 0;
|
int usedZeroedSpecies = 0;
|
||||||
vector_int orderVectorSpecies;
|
std::vector<size_t> orderVectorSpecies;
|
||||||
vector_int orderVectorElements;
|
std::vector<size_t> orderVectorElements;
|
||||||
|
|
||||||
bool doFormMatrix = true;
|
bool doFormMatrix = true;
|
||||||
vector_fp formRxnMatrix;
|
vector_fp formRxnMatrix;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue