Skip to content

Commit

Permalink
[clib] Switch TransportCabinet to smart pointers
Browse files Browse the repository at this point in the history
  • Loading branch information
ischoegl committed Mar 1, 2023
1 parent f0e9d65 commit 67e26bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
9 changes: 4 additions & 5 deletions src/clib/ct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ using namespace Cantera;

typedef Cabinet<ThermoPhase> ThermoCabinet;
typedef Cabinet<Kinetics> KineticsCabinet;
typedef Cabinet<Transport> TransportCabinet;
typedef Cabinet3<Transport> TransportCabinet;
typedef Cabinet3<Solution> SolutionCabinet;

template<> ThermoCabinet* ThermoCabinet::s_storage = 0;
template<> KineticsCabinet* KineticsCabinet::s_storage = 0;
template<> TransportCabinet* TransportCabinet::s_storage = 0;
template<> int TransportCabinet::count = 0;

template<> SolutionCabinet* SolutionCabinet::s_storage = 0;
template<> int SolutionCabinet::count = 0;
Expand Down Expand Up @@ -1299,8 +1300,7 @@ extern "C" {
int trans_newDefault(int ith, int loglevel)
{
try {
Transport* tr = newDefaultTransportMgr(&ThermoCabinet::item(ith),
loglevel);
auto tr = newTransport(&ThermoCabinet::item(ith), "default");
return TransportCabinet::add(tr);
} catch (...) {
return handleAllExceptions(-1, ERR);
Expand All @@ -1310,8 +1310,7 @@ extern "C" {
int trans_new(const char* model, int ith, int loglevel)
{
try {
Transport* tr = newTransportMgr(model, &ThermoCabinet::item(ith),
loglevel);
auto tr = newTransport(&ThermoCabinet::item(ith), model);
return TransportCabinet::add(tr);
} catch (...) {
return handleAllExceptions(-1, ERR);
Expand Down
3 changes: 2 additions & 1 deletion src/clib/ctonedim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "cantera/oneD/Boundary1D.h"
#include "cantera/transport/Transport.h"
#include "Cabinet.h"
#include "Cabinet3.h"
#include "cantera/base/stringUtils.h"

#include <fstream>
Expand All @@ -26,7 +27,7 @@ template<> DomainCabinet* DomainCabinet::s_storage = 0;

typedef Cabinet<ThermoPhase> ThermoCabinet;
typedef Cabinet<Kinetics> KineticsCabinet;
typedef Cabinet<Transport> TransportCabinet;
typedef Cabinet3<Transport> TransportCabinet;
template<> ThermoCabinet* ThermoCabinet::s_storage; // defined in ct.cpp
template<> KineticsCabinet* KineticsCabinet::s_storage; // defined in ct.cpp
template<> TransportCabinet* TransportCabinet::s_storage; // defined in ct.cpp
Expand Down

0 comments on commit 67e26bf

Please sign in to comment.