Make use of make_unique

Also use make_shared more consistently
This commit is contained in:
Ray Speth
2023-03-09 11:01:23 -06:00
committed by Ingmar Schoegl
parent da264799cb
commit 7a69a67f2c
37 changed files with 111 additions and 115 deletions
@@ -17,8 +17,8 @@ void testProblem(int printLvl)
auto LiSi_solid = newThermo("Li7Si3_latsol.yaml", "Li7Si3_and_Interstitials(S)");
auto Li_liq = newThermo("Li7Si3_latsol.yaml", "Li(L)");
auto LiFixed = newThermo("Li7Si3_latsol.yaml", "LiFixed");
shared_ptr<ThermoPhase> salt(new MargulesVPSSTP(
"Li7Si3_latsol.yaml", "MoltenSalt_electrolyte"));
auto salt = make_unique<MargulesVPSSTP>(
"Li7Si3_latsol.yaml", "MoltenSalt_electrolyte");
// set states
vector_fp x(salt->nSpecies(), 0);
@@ -85,8 +85,7 @@ int main(int argc, char** argv)
// Initialize the individual phases
shared_ptr<ThermoPhase> hmw(new HMWSoln(
inputFile, "NaCl_electrolyte_complex_shomate"));
auto hmw = make_shared<HMWSoln>(inputFile, "NaCl_electrolyte_complex_shomate");
hmw->setName("NaCl_electrolyte");
size_t kk = hmw->nSpecies();
vector_fp Xmol(kk, 0.0);
@@ -106,7 +105,7 @@ int main(int argc, char** argv)
gas->setState_TPX(T, pres, Xmol.data());
shared_ptr<ThermoPhase> ss(new StoichSubstance("NaCl_Solid.yaml"));
auto ss = make_unique<StoichSubstance>("NaCl_Solid.yaml");
ss->setState_TP(T, pres);