Changed old to new style headers.

This commit is contained in:
Harry Moffat 2008-12-17 16:34:17 +00:00
parent 72b38cd0e6
commit ff6aff01aa
21 changed files with 120 additions and 103 deletions

View file

@ -32,7 +32,8 @@ using namespace std;
#include "stringUtils.h" #include "stringUtils.h"
#include "MultiPhase.h" #include "MultiPhase.h"
#include "stdio.h" #include <cstdio>
int Cantera::ChemEquil_print_lvl = 0; int Cantera::ChemEquil_print_lvl = 0;
//static char sbuf[1024]; //static char sbuf[1024];
#ifndef MIN #ifndef MIN

View file

@ -193,8 +193,6 @@ namespace Cantera {
m_phase[n]->setTemperature(m_temp); m_phase[n]->setTemperature(m_temp);
m_phase[n]->setMoleFractions_NoNorm(DATA_PTR(m_moleFractions) + m_spstart[n]); m_phase[n]->setMoleFractions_NoNorm(DATA_PTR(m_moleFractions) + m_spstart[n]);
m_phase[n]->setPressure(m_press); m_phase[n]->setPressure(m_press);
//m_phase[n]->setState_TPX(m_temp, m_press,
// DATA_PTR(m_moleFractions) + m_spstart[n]);
return *m_phase[n]; return *m_phase[n];
} }
@ -455,6 +453,13 @@ namespace Cantera {
} }
} }
void MultiPhase::setState_TP(const doublereal T, const doublereal Pres) {
if (!m_init) init();
m_temp = T;
m_press = Pres;
updatePhases();
}
void MultiPhase::setState_TPMoles(const doublereal T, const doublereal Pres, void MultiPhase::setState_TPMoles(const doublereal T, const doublereal Pres,
const doublereal *n) { const doublereal *n) {
m_temp = T; m_temp = T;

View file

@ -319,6 +319,14 @@ namespace Cantera {
*/ */
void setTemperature(const doublereal T); void setTemperature(const doublereal T);
//! Set the state of the underlying ThermoPhase objects in one call
/*!
* @param T Temperature of the system (kelvin)
* @param Pres pressure of the system (pascal)
* (kmol)
*/
void setState_TP(const doublereal T, const doublereal Pres);
//! Set the state of the underlying ThermoPhase objects in one call //! Set the state of the underlying ThermoPhase objects in one call
/*! /*!
* @param T Temperature of the system (kelvin) * @param T Temperature of the system (kelvin)

View file

@ -866,7 +866,7 @@ namespace Cantera {
return m_mix->phaseMoles(iph); return m_mix->phaseMoles(iph);
} }
#include <stdio.h> #include <cstdio>
/* /*
* *
*/ */

View file

@ -4,9 +4,6 @@
/* /*
* $Id $ * $Id $
*/ */
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "vcs_defs.h" #include "vcs_defs.h"
#include "vcs_SpeciesProperties.h" #include "vcs_SpeciesProperties.h"
@ -14,6 +11,10 @@
#include "vcs_species_thermo.h" #include "vcs_species_thermo.h"
#include "vcs_internal.h" #include "vcs_internal.h"
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std; using namespace std;
namespace VCSnonideal { namespace VCSnonideal {

View file

@ -7,15 +7,16 @@
/* $Date$ */ /* $Date$ */
/* $Revision$ */ /* $Revision$ */
/* ======================================================================= */ /* ======================================================================= */
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "vcs_solve.h" #include "vcs_solve.h"
#include "vcs_internal.h" #include "vcs_internal.h"
#include "vcs_species_thermo.h" #include "vcs_species_thermo.h"
#include "vcs_VolPhase.h" #include "vcs_VolPhase.h"
#include <cstdio>
#include <cstdlib>
#include <cmath>
namespace VCSnonideal { namespace VCSnonideal {
/*****************************************************************************/ /*****************************************************************************/

View file

@ -249,11 +249,11 @@ namespace VCSnonideal {
#ifdef DEBUG_MODE #ifdef DEBUG_MODE
if (nspecies <= 0) { if (nspecies <= 0) {
plogf("nspecies Error\n"); plogf("nspecies Error\n");
std::exit(-1); exit(EXIT_FAILURE);
} }
if (phaseNum < 0) { if (phaseNum < 0) {
plogf("phaseNum should be greater than 0\n"); plogf("phaseNum should be greater than 0\n");
std::exit(-1); exit(EXIT_FAILURE);
} }
#endif #endif
setTotalMolesInert(molesInert); setTotalMolesInert(molesInert);
@ -264,7 +264,7 @@ namespace VCSnonideal {
if (strcmp(PhaseName.c_str(), phaseName)) { if (strcmp(PhaseName.c_str(), phaseName)) {
plogf("Strings are different: %s %s :unknown situation\n", plogf("Strings are different: %s %s :unknown situation\n",
PhaseName.c_str(), phaseName); PhaseName.c_str(), phaseName);
std::exit(-1); exit(EXIT_FAILURE);
} }
} else { } else {
VP_ID = phaseNum; VP_ID = phaseNum;
@ -529,13 +529,13 @@ namespace VCSnonideal {
// is set to a normal settting. // is set to a normal settting.
if (vcsStateStatus != VCS_STATECALC_TMP) { if (vcsStateStatus != VCS_STATECALC_TMP) {
printf("vcs_VolPhase::setMolesFractionsState: inappropriate usage\n"); printf("vcs_VolPhase::setMolesFractionsState: inappropriate usage\n");
std::exit(-1); exit(EXIT_FAILURE);
} }
m_UpToDate = false; m_UpToDate = false;
m_vcsStateStatus = VCS_STATECALC_TMP; m_vcsStateStatus = VCS_STATECALC_TMP;
if (m_existence == VCS_PHASE_EXIST_ZEROEDPHASE ) { if (m_existence == VCS_PHASE_EXIST_ZEROEDPHASE ) {
printf("vcs_VolPhase::setMolesFractionsState: inappropriate usage\n"); printf("vcs_VolPhase::setMolesFractionsState: inappropriate usage\n");
std::exit(-1); exit(EXIT_FAILURE);
} }
m_existence = VCS_PHASE_EXIST_YES; m_existence = VCS_PHASE_EXIST_YES;
} else { } else {
@ -553,7 +553,7 @@ namespace VCSnonideal {
} }
if (sum == 0.0) { if (sum == 0.0) {
printf("vcs_VolPhase::setMolesFractionsState: inappropriate usage\n"); printf("vcs_VolPhase::setMolesFractionsState: inappropriate usage\n");
std::exit(-1); exit(EXIT_FAILURE);
} }
if (sum != 1.0) { if (sum != 1.0) {
for (int k = 0; k < m_numSpecies; k++) { for (int k = 0; k < m_numSpecies; k++) {
@ -588,7 +588,7 @@ namespace VCSnonideal {
#ifdef DEBUG_MODE #ifdef DEBUG_MODE
if (m_owningSolverObject == 0) { if (m_owningSolverObject == 0) {
printf("vcs_VolPhase::setMolesFromVCS shouldn't be here\n"); printf("vcs_VolPhase::setMolesFromVCS shouldn't be here\n");
std::exit(-1); exit(EXIT_FAILURE);
} }
#endif #endif
if (stateCalc == VCS_STATECALC_OLD) { if (stateCalc == VCS_STATECALC_OLD) {
@ -599,7 +599,7 @@ namespace VCSnonideal {
#ifdef DEBUG_MODE #ifdef DEBUG_MODE
else { else {
printf("vcs_VolPhase::setMolesFromVCS shouldn't be here\n"); printf("vcs_VolPhase::setMolesFromVCS shouldn't be here\n");
std::exit(-1); exit(EXIT_FAILURE);
} }
#endif #endif
} }
@ -609,12 +609,12 @@ namespace VCSnonideal {
if (stateCalc == VCS_STATECALC_OLD) { if (stateCalc == VCS_STATECALC_OLD) {
if (molesSpeciesVCS != VCS_DATA_PTR(m_owningSolverObject->m_molNumSpecies_old)) { if (molesSpeciesVCS != VCS_DATA_PTR(m_owningSolverObject->m_molNumSpecies_old)) {
printf("vcs_VolPhase::setMolesFromVCS shouldn't be here\n"); printf("vcs_VolPhase::setMolesFromVCS shouldn't be here\n");
std::exit(-1); exit(EXIT_FAILURE);
} }
} else if (stateCalc == VCS_STATECALC_NEW) { } else if (stateCalc == VCS_STATECALC_NEW) {
if (molesSpeciesVCS != VCS_DATA_PTR(m_owningSolverObject->m_molNumSpecies_new)) { if (molesSpeciesVCS != VCS_DATA_PTR(m_owningSolverObject->m_molNumSpecies_new)) {
printf("vcs_VolPhase::setMolesFromVCS shouldn't be here\n"); printf("vcs_VolPhase::setMolesFromVCS shouldn't be here\n");
std::exit(-1); exit(EXIT_FAILURE);
} }
} }
} }
@ -718,7 +718,7 @@ namespace VCSnonideal {
plogf("vcs_VolPhase::setMolesFromVCSCheck: " plogf("vcs_VolPhase::setMolesFromVCSCheck: "
"We have a consistency problem: %21.16g %21.16g\n", "We have a consistency problem: %21.16g %21.16g\n",
Tcheck, v_totalMoles); Tcheck, v_totalMoles);
std::exit(-1); exit(EXIT_FAILURE);
} }
} }
} }
@ -962,7 +962,7 @@ namespace VCSnonideal {
m_totalVol += volI; m_totalVol += volI;
} else { } else {
printf("unknown situation\n"); printf("unknown situation\n");
std::exit(-1); exit(EXIT_FAILURE);
} }
} }
m_UpToDate_VolPM = true; m_UpToDate_VolPM = true;
@ -1185,7 +1185,7 @@ namespace VCSnonideal {
printf(" vcs_VolPhase::setTotalMoles:: ERROR totalMoles " printf(" vcs_VolPhase::setTotalMoles:: ERROR totalMoles "
"less than inert moles: %g %g\n", "less than inert moles: %g %g\n",
totalMols, m_totalMolesInert); totalMols, m_totalMolesInert);
std::exit(-1); exit(EXIT_FAILURE);
} }
#endif #endif
} else { } else {
@ -1311,7 +1311,7 @@ namespace VCSnonideal {
#ifdef DEBUG_MODE #ifdef DEBUG_MODE
plogf("vcs_VolPhase::setExistence setting false existence for phase with moles"); plogf("vcs_VolPhase::setExistence setting false existence for phase with moles");
plogendl(); plogendl();
exit(-1); exit(EXIT_FAILURE);
#endif #endif
v_totalMoles = 0.0; v_totalMoles = 0.0;
} }
@ -1322,7 +1322,7 @@ namespace VCSnonideal {
if (v_totalMoles == 0.0) { if (v_totalMoles == 0.0) {
plogf("vcs_VolPhase::setExistence setting true existence for phase with no moles"); plogf("vcs_VolPhase::setExistence setting true existence for phase with no moles");
plogendl(); plogendl();
exit(-1); exit(EXIT_FAILURE);
} }
} }
} }

View file

@ -17,9 +17,9 @@
#include "vcs_internal.h" #include "vcs_internal.h"
#include "vcs_VolPhase.h" #include "vcs_VolPhase.h"
#include <stdio.h> #include <cstdio>
#include <stdlib.h> #include <cstdlib>
#include <math.h> #include <cmath>
namespace VCSnonideal { namespace VCSnonideal {

View file

@ -19,9 +19,9 @@
#include "clockWC.h" #include "clockWC.h"
#include <stdio.h> #include <cstdio>
#include <stdlib.h> #include <cstdlib>
#include <math.h> #include <cmath>
namespace VCSnonideal { namespace VCSnonideal {

View file

@ -242,8 +242,8 @@ namespace VCSnonideal {
* cylinder floating on the water is calculated. * cylinder floating on the water is calculated.
* *
* @verbatim * @verbatim
#include "math.h" #include <cmath>
#include "stdlib.h" #include <cstdlib>
#include "Cantera.h" #include "Cantera.h"
#include "kernel/vcs_internal.h" #include "kernel/vcs_internal.h"
@ -324,7 +324,7 @@ namespace VCSnonideal {
//! available if this ever fails. //! available if this ever fails.
#define USE_MEMSET #define USE_MEMSET
#ifdef USE_MEMSET #ifdef USE_MEMSET
#include <string.h> #include <cstring>
//! Zero a double vector //! Zero a double vector
/*! /*!

View file

@ -9,9 +9,6 @@
* U.S. Government retains certain rights in this software. * U.S. Government retains certain rights in this software.
*/ */
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#ifdef hpux #ifdef hpux
#define dbocls_ dbocls #define dbocls_ dbocls
@ -23,6 +20,10 @@
#include "vcs_internal.h" #include "vcs_internal.h"
#include "vcs_solve.h" #include "vcs_solve.h"
#include <cstdio>
#include <cstdlib>
#include <cmath>
extern "C" void dbocls_(double *W, int *MDW, int *MCON, int *MROWS, extern "C" void dbocls_(double *W, int *MDW, int *MCON, int *MROWS,
int *NCOLS, int *NCOLS,
double *BL, double *BU, int *IND, int *IOPT, double *BL, double *BU, int *IND, int *IOPT,

View file

@ -10,15 +10,16 @@
* Contract DE-AC04-94AL85000 with Sandia Corporation, the * Contract DE-AC04-94AL85000 with Sandia Corporation, the
* U.S. Government retains certain rights in this software. * U.S. Government retains certain rights in this software.
*/ */
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "vcs_solve.h" #include "vcs_solve.h"
#include "vcs_internal.h" #include "vcs_internal.h"
#include "vcs_VolPhase.h" #include "vcs_VolPhase.h"
#include "stringUtils.h" #include "stringUtils.h"
#include <cstdio>
#include <cstdlib>
#include <cmath>
namespace VCSnonideal { namespace VCSnonideal {
// Returns the multiplier for electric charge terms // Returns the multiplier for electric charge terms

View file

@ -14,18 +14,14 @@
#include "vcs_species_thermo.h" #include "vcs_species_thermo.h"
#include "vcs_VolPhase.h" #include "vcs_VolPhase.h"
#include <stdio.h> #include <cstdio>
#include <stdlib.h> #include <cstdlib>
#include <math.h> #include <cmath>
#include <vector> #include <vector>
using namespace std; using namespace std;
namespace VCSnonideal { namespace VCSnonideal {
int VCS_SOLVE::vcs_phaseStabilityTest(const int iph) { int VCS_SOLVE::vcs_phaseStabilityTest(const int iph) {

View file

@ -12,9 +12,6 @@
* Contract DE-AC04-94AL85000 with Sandia Corporation, the * Contract DE-AC04-94AL85000 with Sandia Corporation, the
* U.S. Government retains certain rights in this software. * U.S. Government retains certain rights in this software.
*/ */
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "vcs_solve.h" #include "vcs_solve.h"
#include "vcs_internal.h" #include "vcs_internal.h"
@ -22,6 +19,10 @@
#include "vcs_VolPhase.h" #include "vcs_VolPhase.h"
#include "vcs_SpeciesProperties.h" #include "vcs_SpeciesProperties.h"
#include <cstdio>
#include <cstdlib>
#include <cmath>
namespace VCSnonideal { namespace VCSnonideal {

View file

@ -11,13 +11,14 @@
* U.S. Government retains certain rights in this software. * U.S. Government retains certain rights in this software.
*/ */
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "vcs_solve.h" #include "vcs_solve.h"
#include "vcs_internal.h" #include "vcs_internal.h"
#include <cstdio>
#include <cstdlib>
#include <cmath>
namespace VCSnonideal { namespace VCSnonideal {

View file

@ -8,14 +8,15 @@
* U.S. Government retains certain rights in this software. * U.S. Government retains certain rights in this software.
*/ */
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "vcs_solve.h" #include "vcs_solve.h"
#include "vcs_internal.h" #include "vcs_internal.h"
#include "vcs_VolPhase.h" #include "vcs_VolPhase.h"
#include <cstdio>
#include <cstdlib>
#include <cmath>
namespace VCSnonideal { namespace VCSnonideal {
/*****************************************************************************/ /*****************************************************************************/

View file

@ -11,12 +11,13 @@
* U.S. Government retains certain rights in this software. * U.S. Government retains certain rights in this software.
*/ */
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "vcs_internal.h" #include "vcs_internal.h"
#include <cstdio>
#include <cstdlib>
#include <cmath>
namespace VCSnonideal { namespace VCSnonideal {
#define TOL_CONV 1.0E-5 #define TOL_CONV 1.0E-5
@ -51,8 +52,8 @@ static void print_funcEval(FILE *fp, double xval, double fval, int its)
* cylinder floating on water is calculated. * cylinder floating on water is calculated.
* *
* @verbatim * @verbatim
* #include "math.h" * #include <cmath>
* #include "stdlib.h" * #include <cstdlib>
* *
* #include "Cantera.h" * #include "Cantera.h"
* #include "kernel/vcs_internal.h" * #include "kernel/vcs_internal.h"

View file

@ -15,9 +15,9 @@
#include "vcs_internal.h" #include "vcs_internal.h"
#include "vcs_VolPhase.h" #include "vcs_VolPhase.h"
#include <stdio.h> #include <cstdio>
#include <stdlib.h> #include <cstdlib>
#include <math.h> #include <cmath>
namespace VCSnonideal { namespace VCSnonideal {

View file

@ -11,16 +11,16 @@
* U.S. Government retains certain rights in this software. * U.S. Government retains certain rights in this software.
*/ */
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "vcs_internal.h" #include "vcs_internal.h"
#include "vcs_VolPhase.h" #include "vcs_VolPhase.h"
#include "vcs_species_thermo.h" #include "vcs_species_thermo.h"
#include "vcs_solve.h" #include "vcs_solve.h"
#include <math.h> #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iostream> #include <iostream>
using namespace std; using namespace std;

View file

@ -63,7 +63,7 @@ namespace VCSnonideal {
double denom = MAX(m_totalMolNum, 1.0E-4); double denom = MAX(m_totalMolNum, 1.0E-4);
if (!vcs_doubleEqual(dchange[iphase]/denom, delTPhMoles[iphase]/denom)) { if (!vcs_doubleEqual(dchange[iphase]/denom, delTPhMoles[iphase]/denom)) {
plogf("checkDelta1: we have found a problem\n"); plogf("checkDelta1: we have found a problem\n");
exit(-1); exit(EXIT_FAILURE);
} }
} }
} }
@ -333,7 +333,7 @@ namespace VCSnonideal {
default: default:
plogf(" --- Unknown type - ERROR %d\n", m_speciesStatus[kspec]); plogf(" --- Unknown type - ERROR %d\n", m_speciesStatus[kspec]);
plogendl(); plogendl();
std::exit(-1); exit(EXIT_FAILURE);
} }
} }
} }
@ -944,7 +944,7 @@ namespace VCSnonideal {
m_deltaMolNumSpecies[kspec], dx, kspec); m_deltaMolNumSpecies[kspec], dx, kspec);
plogf("we have a problem!"); plogf("we have a problem!");
plogendl(); plogendl();
exit(-1); exit(EXIT_FAILURE);
} }
#endif #endif
for (k = 0; k < m_numComponents; ++k) { for (k = 0; k < m_numComponents; ++k) {
@ -1079,7 +1079,7 @@ namespace VCSnonideal {
plogf("vcs_solve_TP: ERROR on step change wt[%d:%s]: %g < 0.0", plogf("vcs_solve_TP: ERROR on step change wt[%d:%s]: %g < 0.0",
kspec, m_speciesName[kspec].c_str(), m_molNumSpecies_new[kspec]); kspec, m_speciesName[kspec].c_str(), m_molNumSpecies_new[kspec]);
plogendl(); plogendl();
exit(-1); exit(EXIT_FAILURE);
} }
} }
@ -1340,7 +1340,7 @@ namespace VCSnonideal {
#ifdef DEBUG_MODE #ifdef DEBUG_MODE
plogf(" --- BASOPT returned with an error condition\n"); plogf(" --- BASOPT returned with an error condition\n");
#endif #endif
std::exit(-1); exit(EXIT_FAILURE);
} }
vcs_setFlagsVolPhases(false, VCS_STATECALC_OLD); vcs_setFlagsVolPhases(false, VCS_STATECALC_OLD);
vcs_dfe(VCS_STATECALC_OLD, 0, 0, m_numSpeciesRdc); vcs_dfe(VCS_STATECALC_OLD, 0, 0, m_numSpeciesRdc);
@ -2157,7 +2157,7 @@ namespace VCSnonideal {
if (irxn < 0) { if (irxn < 0) {
plogf(" --- delete_species() ERROR: called for a component %d", kspec); plogf(" --- delete_species() ERROR: called for a component %d", kspec);
plogendl(); plogendl();
std::exit(-1); exit(EXIT_FAILURE);
} }
#endif #endif
if (m_speciesUnknownType[kspec] != VCS_SPECIES_TYPE_INTERFACIALVOLTAGE) { if (m_speciesUnknownType[kspec] != VCS_SPECIES_TYPE_INTERFACIALVOLTAGE) {
@ -2278,7 +2278,7 @@ namespace VCSnonideal {
if (! retn) { if (! retn) {
plogf("Failed to delete a species!"); plogf("Failed to delete a species!");
plogendl(); plogendl();
exit(-1); exit(EXIT_FAILURE);
} }
#endif #endif
/* /*
@ -3311,7 +3311,7 @@ namespace VCSnonideal {
int numPreDeleted = m_numRxnTot - m_numRxnRdc; int numPreDeleted = m_numRxnTot - m_numRxnRdc;
if (numPreDeleted != (m_numSpeciesTot - m_numSpeciesRdc)) { if (numPreDeleted != (m_numSpeciesTot - m_numSpeciesRdc)) {
plogf("vcs_basopt:: we shouldn't be here\n"); plogf("vcs_basopt:: we shouldn't be here\n");
std::exit(-1); exit(EXIT_FAILURE);
} }
m_numRxnTot = m_numSpeciesTot - ncTrial; m_numRxnTot = m_numSpeciesTot - ncTrial;
m_numRxnRdc = m_numRxnTot - numPreDeleted; m_numRxnRdc = m_numRxnTot - numPreDeleted;
@ -3967,11 +3967,11 @@ namespace VCSnonideal {
#ifdef DEBUG_MODE #ifdef DEBUG_MODE
if (molNum[kspec] != phi) { if (molNum[kspec] != phi) {
plogf("We have an inconsistency!\n"); plogf("We have an inconsistency!\n");
exit(-1); exit(EXIT_FAILURE);
} }
if (m_chargeSpecies[kspec] != -1.0) { if (m_chargeSpecies[kspec] != -1.0) {
plogf("We have an unexpected situation!\n"); plogf("We have an unexpected situation!\n");
exit(-1); exit(EXIT_FAILURE);
} }
#endif #endif
mu_i[kspec] = m_SSfeSpecies[kspec] + m_chargeSpecies[kspec] * Faraday_phi; mu_i[kspec] = m_SSfeSpecies[kspec] + m_chargeSpecies[kspec] * Faraday_phi;
@ -4145,14 +4145,14 @@ namespace VCSnonideal {
plogf("vcs_dfe: wrong stateCalc value"); plogf("vcs_dfe: wrong stateCalc value");
plogf(" --- Subroutine vcs_dfe called with bad stateCalc value: %d", stateCalc); plogf(" --- Subroutine vcs_dfe called with bad stateCalc value: %d", stateCalc);
plogendl(); plogendl();
std::exit(-1); exit(EXIT_FAILURE);
} }
#endif #endif
#ifdef DEBUG_MODE #ifdef DEBUG_MODE
if (m_unitsState == VCS_DIMENSIONAL_G) { if (m_unitsState == VCS_DIMENSIONAL_G) {
printf("vcs_dfe: called with wrong units state\n"); printf("vcs_dfe: called with wrong units state\n");
std::exit(-1); exit(EXIT_FAILURE);
} }
#endif #endif
@ -4196,7 +4196,7 @@ namespace VCSnonideal {
if (! vcs_doubleEqual(tlogMoles[iph], tPhMoles_ptr[iph])) { if (! vcs_doubleEqual(tlogMoles[iph], tPhMoles_ptr[iph])) {
plogf("phase Moles may be off, iph = %d, %20.14g %20.14g \n", plogf("phase Moles may be off, iph = %d, %20.14g %20.14g \n",
iph, tlogMoles[iph], tPhMoles_ptr[iph]); iph, tlogMoles[iph], tPhMoles_ptr[iph]);
std::exit(0); exit(EXIT_FAILURE);
} }
} }
#endif #endif
@ -4244,11 +4244,11 @@ namespace VCSnonideal {
#ifdef DEBUG_MODE #ifdef DEBUG_MODE
if (molNum[kspec] != m_phasePhi[iphase]) { if (molNum[kspec] != m_phasePhi[iphase]) {
plogf("We have an inconsistency!\n"); plogf("We have an inconsistency!\n");
std::exit(-1); exit(EXIT_FAILURE);
} }
if (m_chargeSpecies[kspec] != -1.0) { if (m_chargeSpecies[kspec] != -1.0) {
plogf("We have an unexpected situation!\n"); plogf("We have an unexpected situation!\n");
std::exit(-1); exit(EXIT_FAILURE);
} }
#endif #endif
feSpecies[kspec] = m_SSfeSpecies[kspec] feSpecies[kspec] = m_SSfeSpecies[kspec]
@ -4294,11 +4294,11 @@ namespace VCSnonideal {
#ifdef DEBUG_MODE #ifdef DEBUG_MODE
if (molNum[kspec] != m_phasePhi[iphase]) { if (molNum[kspec] != m_phasePhi[iphase]) {
plogf("We have an inconsistency!\n"); plogf("We have an inconsistency!\n");
std::exit(-1); exit(EXIT_FAILURE);
} }
if (m_chargeSpecies[kspec] != -1.0) { if (m_chargeSpecies[kspec] != -1.0) {
plogf("We have an unexpected situation!\n"); plogf("We have an unexpected situation!\n");
std::exit(-1); exit(EXIT_FAILURE);
} }
#endif #endif
feSpecies[kspec] = m_SSfeSpecies[kspec] feSpecies[kspec] = m_SSfeSpecies[kspec]
@ -4345,11 +4345,11 @@ namespace VCSnonideal {
#ifdef DEBUG_MODE #ifdef DEBUG_MODE
if (molNum[kspec] != m_phasePhi[iphase]) { if (molNum[kspec] != m_phasePhi[iphase]) {
plogf("We have an inconsistency!\n"); plogf("We have an inconsistency!\n");
std::exit(-1); exit(EXIT_FAILURE);
} }
if (m_chargeSpecies[kspec] != -1.0) { if (m_chargeSpecies[kspec] != -1.0) {
plogf("We have an unexpected situation!\n"); plogf("We have an unexpected situation!\n");
std::exit(-1); exit(EXIT_FAILURE);
} }
#endif #endif
feSpecies[kspec] = m_SSfeSpecies[kspec] feSpecies[kspec] = m_SSfeSpecies[kspec]
@ -4501,7 +4501,6 @@ namespace VCSnonideal {
if (!vcs_doubleEqual(m_tPhaseMoles_old[i]/denom, m_tPhaseMoles_old_a/denom)) { if (!vcs_doubleEqual(m_tPhaseMoles_old[i]/denom, m_tPhaseMoles_old_a/denom)) {
plogf("check_tmoles: we have found a problem with phase %d: %20.15g, %20.15g\n", plogf("check_tmoles: we have found a problem with phase %d: %20.15g, %20.15g\n",
i, m_tPhaseMoles_old[i], m_tPhaseMoles_old_a); i, m_tPhaseMoles_old[i], m_tPhaseMoles_old_a);
//std::exit(-1);
} }
} }
} }
@ -4532,7 +4531,7 @@ namespace VCSnonideal {
else { else {
plogf("vcs_updateVP ERROR: wrong stateCalc value: %d", vcsState); plogf("vcs_updateVP ERROR: wrong stateCalc value: %d", vcsState);
plogendl(); plogendl();
std::exit(-1); exit(EXIT_FAILURE);
} }
#endif #endif
} }
@ -4628,7 +4627,7 @@ namespace VCSnonideal {
actCoeffSpecies = VCS_DATA_PTR(m_actCoeffSpecies_old); actCoeffSpecies = VCS_DATA_PTR(m_actCoeffSpecies_old);
} else { } else {
printf("Error\n"); printf("Error\n");
exit(-1); exit(EXIT_FAILURE);
} }
#ifdef DEBUG_MODE #ifdef DEBUG_MODE
@ -4843,7 +4842,7 @@ namespace VCSnonideal {
else { else {
plogf("vcs_deltag_Phase: we shouldn't be here\n"); plogf("vcs_deltag_Phase: we shouldn't be here\n");
plogendl(); plogendl();
exit(-1); exit(EXIT_FAILURE);
} }
#endif #endif
@ -4866,7 +4865,7 @@ namespace VCSnonideal {
#ifdef DEBUG_MODE #ifdef DEBUG_MODE
if (iphase != m_phaseID[kspec]) { if (iphase != m_phaseID[kspec]) {
plogf("vcs_deltag_Phase index error\n"); plogf("vcs_deltag_Phase index error\n");
exit(-1); exit(EXIT_FAILURE);
} }
#endif #endif
if (kspec >= m_numComponents) { if (kspec >= m_numComponents) {
@ -5006,11 +5005,11 @@ namespace VCSnonideal {
#ifdef DEBUG_MODE #ifdef DEBUG_MODE
if (pv1->spGlobalIndexVCS(kp1) != k1) { if (pv1->spGlobalIndexVCS(kp1) != k1) {
plogf("Indexing error in program\n"); plogf("Indexing error in program\n");
exit(-1); exit(EXIT_FAILURE);
} }
if (pv2->spGlobalIndexVCS(kp2) != k2) { if (pv2->spGlobalIndexVCS(kp2) != k2) {
plogf("Indexing error in program\n"); plogf("Indexing error in program\n");
exit(-1); exit(EXIT_FAILURE);
} }
#endif #endif
pv1->setSpGlobalIndexVCS(kp1, k2); pv1->setSpGlobalIndexVCS(kp1, k2);
@ -5126,7 +5125,7 @@ namespace VCSnonideal {
if (m_molNumSpecies_old[kspec] != 0.0) { if (m_molNumSpecies_old[kspec] != 0.0) {
w_kspec = 0.0; w_kspec = 0.0;
plogf("vcs_birthGuess:: we shouldn't be here\n"); plogf("vcs_birthGuess:: we shouldn't be here\n");
std::exit(-1); exit(EXIT_FAILURE);
} }
#endif #endif
int ss = m_SSPhase[kspec]; int ss = m_SSPhase[kspec];

View file

@ -21,9 +21,9 @@
#include "vcs_Exception.h" #include "vcs_Exception.h"
#include "vcs_internal.h" #include "vcs_internal.h"
#include <stdio.h> #include <cstdio>
#include <stdlib.h> #include <cstdlib>
#include <math.h> #include <cmath>
using namespace std; using namespace std;
@ -201,7 +201,7 @@ double VCS_SPECIES_THERMO::GStar_R_calc(int kglob, double TKelvin,
break; break;
default: default:
plogf("%sERROR: unknown SSStar model\n", yo); plogf("%sERROR: unknown SSStar model\n", yo);
exit(-1); exit(EXIT_FAILURE);
} }
} }
return fe; return fe;
@ -243,7 +243,7 @@ VolStar_calc(int kglob, double TKelvin, double presPA)
break; break;
default: default:
plogf("%sERROR: unknown SSVol model\n", yo); plogf("%sERROR: unknown SSVol model\n", yo);
exit(-1); exit(EXIT_FAILURE);
} }
} }
return vol; return vol;
@ -298,7 +298,7 @@ double VCS_SPECIES_THERMO::G0_R_calc(int kglob, double TKelvin)
#ifdef DEBUG_MODE #ifdef DEBUG_MODE
plogf("%sERROR: unknown model\n", yo); plogf("%sERROR: unknown model\n", yo);
#endif #endif
exit(-1); exit(EXIT_FAILURE);
} }
} }
SS0_feSave = fe; SS0_feSave = fe;
@ -349,7 +349,7 @@ double VCS_SPECIES_THERMO::eval_ac(int kglob)
#ifdef DEBUG_MODE #ifdef DEBUG_MODE
plogf("%sERROR: unknown model\n", yo); plogf("%sERROR: unknown model\n", yo);
#endif #endif
exit(-1); exit(EXIT_FAILURE);
} }
} }
return ac; return ac;