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 "MultiPhase.h"
#include "stdio.h"
#include <cstdio>
int Cantera::ChemEquil_print_lvl = 0;
//static char sbuf[1024];
#ifndef MIN

View file

@ -193,8 +193,6 @@ namespace Cantera {
m_phase[n]->setTemperature(m_temp);
m_phase[n]->setMoleFractions_NoNorm(DATA_PTR(m_moleFractions) + m_spstart[n]);
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];
}
@ -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,
const doublereal *n) {
m_temp = T;

View file

@ -319,6 +319,14 @@ namespace Cantera {
*/
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
/*!
* @param T Temperature of the system (kelvin)

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -11,12 +11,13 @@
* U.S. Government retains certain rights in this software.
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "vcs_internal.h"
#include <cstdio>
#include <cstdlib>
#include <cmath>
namespace VCSnonideal {
#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.
*
* @verbatim
* #include "math.h"
* #include "stdlib.h"
* #include <cmath>
* #include <cstdlib>
*
* #include "Cantera.h"
* #include "kernel/vcs_internal.h"

View file

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

View file

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

View file

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

View file

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