ThermoPhase* ThermoFactory::newThermoPhase(const std::string& model) { int ieos=-1; for (int n = 0; n < ntypes; n++) { if (model == _types[n]) { ieos = _itypes[n]; break; } } switch (ieos) { case cIdealGas: return new IdealGasPhase; case cIncompressible: return new ConstDensityThermo; case cSurf: return new SurfPhase; case cEdge: return new EdgePhase; case cIdealSolidSolnPhase: return new IdealSolidSolnPhase(); case cMargulesVPSSTP: return new MargulesVPSSTP(); case cRedlichKisterVPSSTP: return new RedlichKisterVPSSTP(); case cMolarityIonicVPSSTP: return new MolarityIonicVPSSTP(); case cPhaseCombo_Interaction: return new PhaseCombo_Interaction(); case cIonsFromNeutral: return new IonsFromNeutralVPSSTP(); case cMetal: return new MetalPhase; case cStoichSubstance: #ifdef USE_SSTP return new StoichSubstanceSSTP; #else return new StoichSubstance; #endif case cFixedChemPot: return new FixedChemPotSSTP; case cMineralEQ3: return new MineralEQ3(); case cMetalSHEelectrons: return new MetalSHEelectrons(); case cLatticeSolid: return new LatticeSolidPhase; case cLattice: return new LatticePhase; case cPureFluid: return new PureFluidPhase; case cRedlichKwongMFTP: return new RedlichKwongMFTP; case cHMW: return new HMWSoln; case cDebyeHuckel: return new DebyeHuckel; case cIdealMolalSoln: return new IdealMolalSoln; case cVPSS_IdealGas: return new IdealSolnGasVPSS; case cIdealSolnGasVPSS_iscv: return new IdealSolnGasVPSS; case cMaskellSolidSolnPhase: return new MaskellSolidSolnPhase; default: throw UnknownThermoPhaseModel("ThermoFactory::newThermoPhase", model); } }
/* * This method returns a new instance of a subclass of ThermoPhase */ ThermoPhase* ThermoFactory::newThermoPhase(std::string model) { int ieos=-1; for (int n = 0; n < ntypes; n++) { if (model == _types[n]) ieos = _itypes[n]; } ThermoPhase* th=0; switch (ieos) { case cIdealGas: th = new IdealGasPhase; break; case cIncompressible: th = new ConstDensityThermo; break; case cSurf: th = new SurfPhase; break; case cEdge: th = new EdgePhase; break; #ifdef WITH_IDEAL_SOLUTIONS case cIdealSolidSolnPhase: th = new IdealSolidSolnPhase(); break; case cMargulesVPSSTP: th = new MargulesVPSSTP(); break; case cIonsFromNeutral: th = new IonsFromNeutralVPSSTP(); break; #endif #ifdef WITH_METAL case cMetal: th = new MetalPhase; break; #endif #ifdef WITH_STOICH_SUBSTANCE case cStoichSubstance: #ifdef USE_SSTP th = new StoichSubstanceSSTP; #else th = new StoichSubstance; #endif break; #endif #ifdef WITH_STOICH_SUBSTANCE case cMineralEQ3: th = new MineralEQ3(); break; #endif #ifdef WITH_STOICH_SUBSTANCE case cMetalSHEelectrons: th = new MetalSHEelectrons(); break; #endif #ifdef WITH_LATTICE_SOLID case cLatticeSolid: th = new LatticeSolidPhase; break; case cLattice: th = new LatticePhase; break; #endif #ifdef WITH_PURE_FLUIDS case cPureFluid: th = new PureFluidPhase; break; #endif #ifdef WITH_ELECTROLYTES case cHMW: th = new HMWSoln; break; case cDebyeHuckel: th = new DebyeHuckel; break; case cIdealMolalSoln: th = new IdealMolalSoln; break; #endif case cVPSS_IdealGas: th = new IdealSolnGasVPSS; break; default: throw UnknownThermoPhaseModel("ThermoFactory::newThermoPhase", model); } return th; }