[Cython] Fixed choosing equilibrium solver by name

This commit is contained in:
Ray Speth 2012-10-24 15:42:13 +00:00
parent 8bcda61e4c
commit 771192fa9a
2 changed files with 7 additions and 5 deletions

View file

@ -201,7 +201,7 @@ cdef extern from "cantera/equil/equil.h" namespace "Cantera":
int equilibrate(CxxThermoPhase&, char*, int, double, int, int, int) except +
cdef extern from "cantera/equil/vcs_MultiPhaseEquil.h" namespace "Cantera":
int vcs_equilibrate(CxxMultiPhase&, char*, int, int, int, double, int, int, int)
int vcs_equilibrate(CxxMultiPhase&, char*, int, int, int, double, int, int, int) except +
cdef extern from "cantera/zeroD/ReactorBase.h" namespace "Cantera":

View file

@ -94,9 +94,9 @@ cdef class ThermoPhase(_SolutionBase):
Specifies the equilibrium solver to use. May be one of the following:
* ''element_potential'' - a fast solver using the element potential
method will be used.
* 'gibbs' - a slower but more robust Gibbs minimization solver will
be used.
method
* 'gibbs' - a slower but more robust Gibbs minimization solver
* 'vcs' - the VCS non-ideal equilibrium solver
* "auto" - The element potential solver will be tried first, then
if it fails the gibbs solver will be tried.
:param rtol:
@ -121,8 +121,10 @@ cdef class ThermoPhase(_SolutionBase):
elif solver == 'auto':
iSolver = -1
elif solver == 'element_potential':
iSolver = 1
iSolver = 0
elif solver == 'gibbs':
iSolver = 1
elif solver == 'vcs':
iSolver = 2
else:
raise ValueError('Invalid equilibrium solver specified')