Skip to content

Commit

Permalink
[fortran] Switch to smart clib cabinets
Browse files Browse the repository at this point in the history
  • Loading branch information
ischoegl committed Mar 1, 2023
1 parent 67e26bf commit 317a5db
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/fortran/fct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "cantera/base/NoExitLogger.h"
#include "cantera/base/stringUtils.h"
#include "clib/Cabinet.h"
#include "clib/Cabinet3.h"
#include "cantera/kinetics/InterfaceKinetics.h"

#include "cantera/clib/clib_defs.h"
Expand All @@ -26,13 +27,14 @@ using namespace Cantera;

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

typedef integer status_t;

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
template<> int TransportCabinet::count;

namespace {

Expand Down Expand Up @@ -944,7 +946,7 @@ extern "C" {
try {
std::string mstr = f2string(model, lenmodel);
ThermoPhase* t = _fth(ith);
Transport* tr = newTransportMgr(mstr, t, *loglevel);
auto tr = newTransport(t, mstr);
return TransportCabinet::add(tr);
} catch (...) {
return handleAllExceptions(-1, ERR);
Expand All @@ -955,7 +957,7 @@ extern "C" {
{
try {
ThermoPhase* t = _fth(ith);
Transport* tr = newDefaultTransportMgr(t, *loglevel);
auto tr = newTransport(t, "default");
return TransportCabinet::add(tr);
} catch (...) {
return handleAllExceptions(-1, ERR);
Expand Down

0 comments on commit 317a5db

Please sign in to comment.