Skip to content

Commit

Permalink
Using std::shared_ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
ischoegl authored and speth committed Aug 5, 2023
1 parent 1b81689 commit e482e13
Show file tree
Hide file tree
Showing 15 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion include/cantera/base/AnyMap.h
Expand Up @@ -700,7 +700,7 @@ class AnyMap : public AnyBase
std::unordered_map<std::string, AnyValue> m_data;

//! The default units that are used to convert stored values
std::shared_ptr<UnitSystem> m_units;
shared_ptr<UnitSystem> m_units;

//! Cache for previously-parsed input (YAML) files. The key is the full path
//! to the file, and the second element of the value is the last-modified
Expand Down
2 changes: 1 addition & 1 deletion include/cantera/kinetics/Kinetics.h
Expand Up @@ -1476,7 +1476,7 @@ class Kinetics
double* phase_data);

//! Set root Solution holding all phase information
virtual void setRoot(std::shared_ptr<Solution> root) {
virtual void setRoot(shared_ptr<Solution> root) {
m_root = root;
}

Expand Down
2 changes: 1 addition & 1 deletion include/cantera/transport/Transport.h
Expand Up @@ -797,7 +797,7 @@ class Transport

//! Set root Solution holding all phase information
//! @deprecated Unused. To be removed after %Cantera 3.0.
virtual void setRoot(std::shared_ptr<Solution> root);
virtual void setRoot(shared_ptr<Solution> root);

//! Boolean indicating the form of the transport properties polynomial fits.
//! Returns true if the Chemkin form is used.
Expand Down
2 changes: 1 addition & 1 deletion samples/cxx/openmp_ignition/openmp_ignition.cpp
Expand Up @@ -28,7 +28,7 @@ void run()
// Containers for Cantera objects to be used in different. Each thread needs
// to have its own set of linked Cantera objects. Multiple threads accessing
// the same objects at the same time will cause errors.
vector<std::shared_ptr<Solution>> sols;
vector<shared_ptr<Solution>> sols;
vector<std::unique_ptr<IdealGasConstPressureReactor>> reactors;
vector<std::unique_ptr<ReactorNet>> nets;

Expand Down
2 changes: 1 addition & 1 deletion src/transport/Transport.cpp
Expand Up @@ -92,7 +92,7 @@ void Transport::setThermo(ThermoPhase& thermo)
}
}

void Transport::setRoot(std::shared_ptr<Solution> root)
void Transport::setRoot(shared_ptr<Solution> root)
{
warn_deprecated("Transport::setRoot", "To be removed after Cantera 3.0");
m_root = root;
Expand Down
2 changes: 1 addition & 1 deletion test/thermo/BinarySolutionTabulatedThermo_Test.cpp
Expand Up @@ -19,7 +19,7 @@ class BinarySolutionTabulatedThermo_Test : public testing::Test
test_phase->setMoleFractions(&moleFracs[0]);
}

std::shared_ptr<ThermoPhase> test_phase;
shared_ptr<ThermoPhase> test_phase;
};

TEST_F(BinarySolutionTabulatedThermo_Test,interp_h)
Expand Down
4 changes: 2 additions & 2 deletions test/thermo/CoverageDependentSurfPhase_Test.cpp
Expand Up @@ -32,8 +32,8 @@ class CoverageDependentSurfPhase_Test: public testing::Test
covdepsurf_phase = newInterface("copt_covdepsurf_example.yaml", "covdep")->thermo();
idealsurf_phase = newInterface("copt_covdepsurf_example.yaml", "ideal")->thermo();
}
std::shared_ptr<SurfPhase> covdepsurf_phase;
std::shared_ptr<SurfPhase> idealsurf_phase;
shared_ptr<SurfPhase> covdepsurf_phase;
shared_ptr<SurfPhase> idealsurf_phase;
// To call unit convert methods
UnitSystem us;

Expand Down
2 changes: 1 addition & 1 deletion test/thermo/MaskellSolidSolnPhase_Test.cpp
Expand Up @@ -50,7 +50,7 @@ class MaskellSolidSolnPhase_Test : public testing::Test
}
}

std::shared_ptr<ThermoPhase> test_phase;
shared_ptr<ThermoPhase> test_phase;
};

TEST_F(MaskellSolidSolnPhase_Test, construct_from_file)
Expand Down
2 changes: 1 addition & 1 deletion test/thermo/PengRobinson_Test.cpp
Expand Up @@ -21,7 +21,7 @@ class PengRobinson_Test : public testing::Test
test_phase->setMoleFractions(&moleFracs[0]);
}

std::shared_ptr<ThermoPhase> test_phase;
shared_ptr<ThermoPhase> test_phase;
};

TEST_F(PengRobinson_Test, chem_potentials)
Expand Down
2 changes: 1 addition & 1 deletion test/thermo/RedlichKisterTest.cpp
Expand Up @@ -37,7 +37,7 @@ class RedlichKister_Test : public testing::Test
test_phase->setMoleFractions(&moleFracs[0]);
}

std::shared_ptr<ThermoPhase> test_phase;
shared_ptr<ThermoPhase> test_phase;
};

TEST_F(RedlichKister_Test, chem_potentials)
Expand Down
2 changes: 1 addition & 1 deletion test/thermo/RedlichKwongMFTP_Test.cpp
Expand Up @@ -22,7 +22,7 @@ class RedlichKwongMFTP_Test : public testing::Test
test_phase->setMoleFractions(&moleFracs[0]);
}

std::shared_ptr<ThermoPhase> test_phase;
shared_ptr<ThermoPhase> test_phase;
};

TEST_F(RedlichKwongMFTP_Test, chem_potentials)
Expand Down
2 changes: 1 addition & 1 deletion test/thermo/ThermoPhase_Test.cpp
Expand Up @@ -9,7 +9,7 @@ namespace Cantera
class TestThermoMethods : public testing::Test
{
public:
std::shared_ptr<ThermoPhase> thermo;
shared_ptr<ThermoPhase> thermo;
TestThermoMethods() {
thermo = newThermo("h2o2.yaml", "");
}
Expand Down
2 changes: 1 addition & 1 deletion test/thermo/cubicSolver_Test.cpp
Expand Up @@ -20,7 +20,7 @@ class cubicSolver_Test : public testing::Test
test_phase->setMoleFractions(&moleFracs[0]);
}

std::shared_ptr<ThermoPhase> test_phase;
shared_ptr<ThermoPhase> test_phase;
};

#ifdef __MINGW32__
Expand Down
2 changes: 1 addition & 1 deletion test/transport/transportPolynomials.cpp
Expand Up @@ -57,7 +57,7 @@ class TransportPolynomialsTest : public testing::Test
}
}

std::shared_ptr<ThermoPhase> phase;
shared_ptr<ThermoPhase> phase;
MixTransport tran;
MixTransport ck_tran;
};
Expand Down
6 changes: 3 additions & 3 deletions test/zeroD/test_zeroD.cpp
Expand Up @@ -47,7 +47,7 @@ TEST(zerodim, test_individual_reactor_initialization)
double tol = 1e-7;
std::string X0 = "H2:1.0, O2:0.5, AR:8.0";
// reactor solution, phase, and kinetics objects
std::shared_ptr<Solution> sol1 = newSolution("h2o2.yaml");
shared_ptr<Solution> sol1 = newSolution("h2o2.yaml");
sol1->thermo()->setState_TPX(T0, P0, X0);
// set up reactor object
Reactor reactor1;
Expand All @@ -60,7 +60,7 @@ TEST(zerodim, test_individual_reactor_initialization)
network.initialize();
network.advance(1.0);
// secondary gas for comparison
std::shared_ptr<Solution> sol2 = newSolution("h2o2.yaml");
shared_ptr<Solution> sol2 = newSolution("h2o2.yaml");
sol2->thermo()->setState_TPX(T0, P0, X0);
sol2->thermo()->equilibrate("UV");
// secondary reactor for comparison
Expand Down Expand Up @@ -172,7 +172,7 @@ TEST(AdaptivePreconditionerTests, test_precon_solver_stats)
ReactorNet network;
network.addReactor(reactor);
// setup preconditioner
std::shared_ptr<PreconditionerBase> precon_ptr = newPreconditioner("Adaptive");
shared_ptr<PreconditionerBase> precon_ptr = newPreconditioner("Adaptive");
network.setPreconditioner(precon_ptr);
EXPECT_THROW(network.step(), CanteraError);
// take a step
Expand Down

0 comments on commit e482e13

Please sign in to comment.