diff --git a/src/Thermochimica-cxx.C b/src/Thermochimica-cxx.C index 8ee37cec..83d8b790 100644 --- a/src/Thermochimica-cxx.C +++ b/src/Thermochimica-cxx.C @@ -14,7 +14,15 @@ namespace Thermochimica TCAPI_thermochimica(); } - void setThermoFilename(const std::string &filename) + void thermochimicaSolver() + { + TCAPI_thermochimicaSolver(); + } + + void + + void + setThermoFilename(const std::string &filename) { TCAPI_setThermoFilename(filename.c_str(), filename.length()); } @@ -75,7 +83,7 @@ namespace Thermochimica void parseThermoFile() { - TCAPI_sSParseCSDataFile(); + TCAPI_parseCSDataFile(); } void setPrintResultsMode(int mode) @@ -225,6 +233,14 @@ namespace Thermochimica return potential; } + // std::pair getElementPotential(const int elementID) + // { + // double potential; + // int info; + // TCAPI_getElementPotential(&elementID, &potential, &info); + // return {potential, info}; + // } + double getElementFraction(int atomicNumber) { double fraction; diff --git a/src/Thermochimica-cxx.h b/src/Thermochimica-cxx.h index c418e6a0..7d78af6b 100644 --- a/src/Thermochimica-cxx.h +++ b/src/Thermochimica-cxx.h @@ -9,6 +9,7 @@ namespace Thermochimica { void thermochimica(); + void thermochimicaSolver(); void setThermoFilename(const std::string &filename); void setUnitTemperature(const std::string &tunit); void setUnitPressure(const std::string &punit); diff --git a/src/Thermochimica.f90 b/src/Thermochimica.f90 index cbf6fce5..4057805a 100755 --- a/src/Thermochimica.f90 +++ b/src/Thermochimica.f90 @@ -416,31 +416,12 @@ ! !------------------------------------------------------------------------------- - -subroutine Thermochimica - +subroutine ThermochimicaSolver USE ModuleThermoIO USE ModuleThermo implicit none - ! Check the input variables: - if (INFOThermo == 0) call CheckThermoInput - - ! Initialize Thermochimica: - if (INFOThermo == 0) call InitThermo - - ! Check that the system in the data-file is consistent with the input data - ! variables: - if (INFOThermo == 0) call CheckSystem - - ! Compute thermodynamic data using the parameters from the specified - ! ChemSage data-file: - if (INFOThermo == 0) call CompThermoData - - ! Check the thermodynamic database to ensure that it is appropriate: - if (INFOThermo == 0) call CheckThermoData - ! Check is load is requested and data available: lReinitLoaded = .FALSE. if ((INFOThermo == 0) .AND. lReinitRequested .AND. lReinitAvailable) call LoadReinitData @@ -474,4 +455,34 @@ subroutine Thermochimica return +end subroutine ThermochimicaSolver + +subroutine Thermochimica + + USE ModuleThermoIO + USE ModuleThermo + + implicit none + + ! Check the input variables: + if (INFOThermo == 0) call CheckThermoInput + + ! Initialize Thermochimica: + if (INFOThermo == 0) call InitThermo + + ! Check that the system in the data-file is consistent with the input data + ! variables: + if (INFOThermo == 0) call CheckSystem + + ! Compute thermodynamic data using the parameters from the specified + ! ChemSage data-file: + if (INFOThermo == 0) call CompThermoData + + ! Check the thermodynamic database to ensure that it is appropriate: + if (INFOThermo == 0) call CheckThermoData + + call ThermochimicaSolver + + return + end subroutine Thermochimica diff --git a/src/Thermochimica.h b/src/Thermochimica.h index 8baec355..9d8e921a 100644 --- a/src/Thermochimica.h +++ b/src/Thermochimica.h @@ -36,8 +36,9 @@ extern "C" void TCAPI_setTemperaturePressure(double *, double *); void TCAPI_checkInfoThermo(int *); - void TCAPI_sSParseCSDataFile(); + void TCAPI_parseCSDataFile(); void TCAPI_thermochimica(); + void TCAPI_thermochimicaSolver(); void TCAPI_solPhaseParse(int *, double *); diff --git a/src/api/CouplingUtilitiesISO_C.f90 b/src/api/CouplingUtilitiesISO_C.f90 index b87da56a..bcb2c110 100644 --- a/src/api/CouplingUtilitiesISO_C.f90 +++ b/src/api/CouplingUtilitiesISO_C.f90 @@ -411,7 +411,7 @@ subroutine SolPhaseParseISO(iElem, dMolSum) & end subroutine SolPhaseParseISO subroutine SSParseCSDataFileISO() & - bind(C, name="TCAPI_sSParseCSDataFile") + bind(C, name="TCAPI_parseCSDataFile") USE,INTRINSIC :: ISO_C_BINDING @@ -436,6 +436,19 @@ subroutine ThermochimicaISO() & end subroutine ThermochimicaISO +subroutine ThermochimicaSolver() & + bind(C, name="TCAPI_thermochimicaSolver") + + USE,INTRINSIC :: ISO_C_BINDING + + implicit none + + call ThermochimicaSolver() + + return + +end subroutine ThermochimicaSolver + subroutine getMolFractionISO(i, value, ierr) & bind(C, name="TCAPI_getMolFraction")