diff --git a/include/cantera/equil/MultiPhase.h b/include/cantera/equil/MultiPhase.h index 0459e1906..ca992084d 100644 --- a/include/cantera/equil/MultiPhase.h +++ b/include/cantera/equil/MultiPhase.h @@ -750,7 +750,9 @@ size_t BasisOptimize(int* usedZeroedSpecies, bool doFormRxn, * @param[out] orderVectorElements Output vector containing the order of the * elements that is necessary for calculation of the formula matrix. * - * @ingroup equilfunctions + * @ingroup equilfunctions + * @deprecated - The return value for this function is deprecated. After + * Cantera 2.2, this function will return void. */ size_t ElemRearrange(size_t nComponents, const vector_fp& elementAbundances, MultiPhase* mphase, diff --git a/src/equil/BasisOptimize.cpp b/src/equil/BasisOptimize.cpp index 273f4c2a6..9fcffe26b 100644 --- a/src/equil/BasisOptimize.cpp +++ b/src/equil/BasisOptimize.cpp @@ -563,11 +563,10 @@ size_t Cantera::ElemRearrange(size_t nComponents, const vector_fp& elementAbunda if (k == nelements) { // When we are here, there is an error usually. // We haven't found the number of elements necessary. - // This is signalled by returning jr != nComponents. if (DEBUG_MODE_ENABLED && BasisOptimize_print_lvl > 0) { writelogf("Error exit: returning with nComponents = %d\n", jr); } - return jr; + throw CanteraError("ElemRearrange", "Required number of elements not found."); } /* diff --git a/src/equil/ChemEquil.cpp b/src/equil/ChemEquil.cpp index 81b368388..dd9dc66d8 100644 --- a/src/equil/ChemEquil.cpp +++ b/src/equil/ChemEquil.cpp @@ -273,12 +273,8 @@ int ChemEquil::estimateElementPotentials(thermo_t& s, vector_fp& lambda_RT, s.setMoleFractions(DATA_PTR(xMF_est)); s.getMoleFractions(DATA_PTR(xMF_est)); - size_t nct = Cantera::ElemRearrange(m_nComponents, elMolesGoal, &mp, - m_orderVectorSpecies, m_orderVectorElements); - if (nct != m_nComponents) { - throw CanteraError("ChemEquil::estimateElementPotentials", - "confused"); - } + ElemRearrange(m_nComponents, elMolesGoal, &mp, + m_orderVectorSpecies, m_orderVectorElements); s.getChemPotentials(DATA_PTR(mu_RT)); doublereal rrt = 1.0/(GasConstant* s.temperature());