Class Storage has been eliminated in favor of class Cabinet
This commit is contained in:
parent
2da9603a15
commit
3b1694fdfb
15 changed files with 249 additions and 581 deletions
|
|
@ -8,9 +8,6 @@ from Cantera.Phase import Phase
|
|||
import _cantera
|
||||
import types
|
||||
|
||||
def thermoIndex(id):
|
||||
return _cantera.thermo_thermoIndex(id)
|
||||
|
||||
class ThermoPhase(Phase):
|
||||
"""
|
||||
A phase with an equation of state.
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@
|
|||
#include "cantera/base/FactoryBase.h"
|
||||
#include "cantera/base/logger.h"
|
||||
|
||||
|
||||
#include <fstream>
|
||||
#include <memory>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,147 +0,0 @@
|
|||
/**
|
||||
* @file Storage.cpp
|
||||
*/
|
||||
// Cantera includes
|
||||
#include "cantera/kinetics/Kinetics.h"
|
||||
#include "cantera/transport/TransportFactory.h"
|
||||
|
||||
#include "Storage.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace Cantera;
|
||||
|
||||
|
||||
Storage::Storage()
|
||||
{
|
||||
addThermo(new ThermoPhase);
|
||||
addKinetics(new Kinetics);
|
||||
addTransport(newTransportMgr());
|
||||
}
|
||||
|
||||
Storage::~Storage()
|
||||
{
|
||||
clear();
|
||||
}
|
||||
|
||||
size_t Storage::addThermo(thermo_t* th)
|
||||
{
|
||||
if (th->index() != npos) {
|
||||
return th->index();
|
||||
}
|
||||
__thtable.push_back(th);
|
||||
size_t n = __thtable.size() - 1;
|
||||
th->setIndex(n);
|
||||
//string id = th->id();
|
||||
//if (__thmap.count(id) == 0) {
|
||||
// __thmap[id] = n;
|
||||
// th->setID(id);
|
||||
//}
|
||||
//else {
|
||||
// throw CanteraError("Storage::addThermo","id already used");
|
||||
// return -1;
|
||||
//}
|
||||
return n;
|
||||
}
|
||||
|
||||
size_t Storage::nThermo()
|
||||
{
|
||||
return __thtable.size();
|
||||
}
|
||||
|
||||
size_t Storage::addKinetics(Kinetics* kin)
|
||||
{
|
||||
if (kin->index() != npos) {
|
||||
return kin->index();
|
||||
}
|
||||
__ktable.push_back(kin);
|
||||
size_t n = __ktable.size() - 1;
|
||||
kin->setIndex(n);
|
||||
return n;
|
||||
}
|
||||
|
||||
size_t Storage::addTransport(Transport* tr)
|
||||
{
|
||||
if (tr->index() != npos) {
|
||||
return tr->index();
|
||||
}
|
||||
__trtable.push_back(tr);
|
||||
size_t n = __trtable.size() - 1;
|
||||
tr->setIndex(n);
|
||||
return n;
|
||||
}
|
||||
|
||||
// int Storage::addNewTransport(int model, char* dbase, int th,
|
||||
// int loglevel) {
|
||||
// try {
|
||||
// ThermoPhase* thrm = __thtable[th];
|
||||
// Transport* tr = newTransportMgr(model,
|
||||
// string(dbase), thrm, loglevel);
|
||||
// __trtable.push_back(tr);
|
||||
// return __trtable.size() - 1;
|
||||
// }
|
||||
// catch (CanteraError) {return -1;}
|
||||
// catch (...) {return ERR;}
|
||||
// }
|
||||
|
||||
int Storage::clear()
|
||||
{
|
||||
size_t i, n;
|
||||
n = __thtable.size();
|
||||
for (i = 1; i < n; i++) {
|
||||
if (__thtable[i] != __thtable[0]) {
|
||||
delete __thtable[i];
|
||||
__thtable[i] = __thtable[0];
|
||||
}
|
||||
}
|
||||
n = __ktable.size();
|
||||
for (i = 1; i < n; i++) {
|
||||
if (__ktable[i] != __ktable[0]) {
|
||||
delete __ktable[i];
|
||||
__ktable[i] = __ktable[0];
|
||||
}
|
||||
}
|
||||
n = __trtable.size();
|
||||
for (i = 1; i < n; i++) {
|
||||
if (__trtable[i] != __trtable[0]) {
|
||||
delete __trtable[i];
|
||||
__trtable[i] = __trtable[0];
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Storage::deleteKinetics(int n)
|
||||
{
|
||||
if (n == 0) {
|
||||
return;
|
||||
}
|
||||
if (__ktable[n] != __ktable[0]) {
|
||||
delete __ktable[n];
|
||||
}
|
||||
__ktable[n] = __ktable[0];
|
||||
}
|
||||
|
||||
void Storage::deleteThermo(int n)
|
||||
{
|
||||
if (n == 0) {
|
||||
return;
|
||||
}
|
||||
if (n < 0 || n >= (int) __thtable.size()) {
|
||||
throw CanteraError("deleteThermo","illegal index");
|
||||
}
|
||||
__thtable[n] = __thtable[0];
|
||||
}
|
||||
|
||||
void Storage::deleteTransport(int n)
|
||||
{
|
||||
if (n == 0) {
|
||||
return;
|
||||
}
|
||||
if (__trtable[n] != __trtable[0]) {
|
||||
delete __trtable[n];
|
||||
}
|
||||
__trtable[n] = __trtable[0];
|
||||
}
|
||||
|
||||
Storage* Storage::__storage = 0;
|
||||
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
/**
|
||||
* @file Storage.h
|
||||
*/
|
||||
#ifndef CTC_STORAGE_H
|
||||
#define CTC_STORAGE_H
|
||||
|
||||
// Cantera includes
|
||||
#include "cantera/kinetics/Kinetics.h"
|
||||
#include "cantera/transport/TransportBase.h"
|
||||
|
||||
#include "Cabinet.h"
|
||||
#include "clib_defs.h"
|
||||
|
||||
|
||||
/**
|
||||
* Class to hold pointers to Cantera objects. Only one instance of
|
||||
* this class is needed.
|
||||
*/
|
||||
class Storage
|
||||
{
|
||||
public:
|
||||
Storage();
|
||||
virtual ~Storage();
|
||||
|
||||
// vectors to hold pointers to objects
|
||||
std::vector<Cantera::Kinetics*> __ktable;
|
||||
std::vector<Cantera::thermo_t*> __thtable;
|
||||
std::vector<Cantera::Transport*> __trtable;
|
||||
|
||||
std::map<std::string, int> __thmap;
|
||||
|
||||
static Storage* storage() {
|
||||
if (__storage == 0) {
|
||||
__storage = new Storage;
|
||||
}
|
||||
return __storage;
|
||||
}
|
||||
|
||||
|
||||
size_t addThermo(Cantera::ThermoPhase* th);
|
||||
size_t addKinetics(Cantera::Kinetics* kin);
|
||||
size_t addTransport(Cantera::Transport* tr);
|
||||
// int addNewTransport(int model, char* dbase, int th, int loglevel);
|
||||
int clear();
|
||||
void deleteKinetics(int n);
|
||||
void deleteThermo(int n);
|
||||
void deleteTransport(int n);
|
||||
size_t nThermo();
|
||||
static Storage* __storage;
|
||||
};
|
||||
|
||||
inline Cantera::ThermoPhase* ph(int n)
|
||||
{
|
||||
return Storage::__storage->__thtable[n];
|
||||
}
|
||||
|
||||
inline Cantera::Kinetics* kin(int n)
|
||||
{
|
||||
return Storage::__storage->__ktable[n];
|
||||
}
|
||||
|
||||
inline Cantera::ThermoPhase* th(size_t n)
|
||||
{
|
||||
return Storage::__storage->__thtable[n];
|
||||
}
|
||||
|
||||
inline int thermo_index(std::string id)
|
||||
{
|
||||
return Storage::__storage->__thmap[id];
|
||||
}
|
||||
|
||||
inline Cantera::Transport* trans(int n)
|
||||
{
|
||||
return Storage::__storage->__trtable[n];
|
||||
}
|
||||
|
||||
#endif
|
||||
436
src/clib/ct.cpp
436
src/clib/ct.cpp
File diff suppressed because it is too large
Load diff
|
|
@ -9,28 +9,12 @@
|
|||
#include "cantera/oneD/Inlet1D.h"
|
||||
#include "cantera/kinetics/InterfaceKinetics.h"
|
||||
#include "Cabinet.h"
|
||||
#include "Storage.h"
|
||||
|
||||
|
||||
using namespace std;
|
||||
using namespace Cantera;
|
||||
|
||||
typedef Cabinet<Bdry1D> BoundaryCabinet;
|
||||
template<> BoundaryCabinet* BoundaryCabinet::__storage = 0;
|
||||
|
||||
//inline Phase* _phase(int n) {
|
||||
// return Storage::__storage->__phasetable[n];
|
||||
//}
|
||||
|
||||
inline ThermoPhase* _thermo(int n)
|
||||
{
|
||||
return Storage::__storage->__thtable[n];
|
||||
}
|
||||
|
||||
inline Kinetics* _kin(int n)
|
||||
{
|
||||
return Storage::__storage->__ktable[n];
|
||||
}
|
||||
template<> BoundaryCabinet* BoundaryCabinet::__storage = 0;
|
||||
|
||||
extern "C" {
|
||||
|
||||
|
|
@ -137,8 +121,10 @@ extern "C" {
|
|||
int DLL_EXPORT surf_setkinetics(int i, int j)
|
||||
{
|
||||
try {
|
||||
ReactingSurf1D* srf = dynamic_cast<ReactingSurf1D*>(&BoundaryCabinet::item(i));
|
||||
InterfaceKinetics* k = (InterfaceKinetics*)_kin(j);
|
||||
ReactingSurf1D* srf =
|
||||
dynamic_cast<ReactingSurf1D*>(&BoundaryCabinet::item(i));
|
||||
InterfaceKinetics* k =
|
||||
dynamic_cast<InterfaceKinetics*>(&Cabinet<Kinetics>::item(j));
|
||||
srf->setKineticsMgr(k);
|
||||
} catch (CanteraError) {
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -9,9 +9,7 @@
|
|||
#include "cantera/equil/MultiPhase.h"
|
||||
#include "cantera/equil/MultiPhaseEquil.h"
|
||||
#include "cantera/equil/vcs_MultiPhaseEquil.h"
|
||||
|
||||
#include "Cabinet.h"
|
||||
#include "Storage.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace Cantera;
|
||||
|
|
@ -19,11 +17,6 @@ using namespace Cantera;
|
|||
typedef Cabinet<MultiPhase> mixCabinet;
|
||||
template<> mixCabinet* mixCabinet::__storage = 0;
|
||||
|
||||
inline ThermoPhase* _th(int n)
|
||||
{
|
||||
return Storage::__storage->__thtable[n];
|
||||
}
|
||||
|
||||
static bool checkSpecies(int i, size_t k)
|
||||
{
|
||||
try {
|
||||
|
|
@ -91,7 +84,7 @@ extern "C" {
|
|||
|
||||
int DLL_EXPORT mix_addPhase(int i, int j, double moles)
|
||||
{
|
||||
mixCabinet::item(i).addPhase(_th(j), moles);
|
||||
mixCabinet::item(i).addPhase(&Cabinet<ThermoPhase>::item(j), moles);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,10 +11,7 @@
|
|||
#include "cantera/oneD/StFlow.h"
|
||||
#include "cantera/oneD/Inlet1D.h"
|
||||
#include "cantera/numerics/DenseMatrix.h"
|
||||
|
||||
// local includes
|
||||
#include "Cabinet.h"
|
||||
#include "Storage.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace Cantera;
|
||||
|
|
@ -24,6 +21,10 @@ typedef Cabinet<Domain1D> DomainCabinet;
|
|||
template<> SimCabinet* SimCabinet::__storage = 0;
|
||||
template<> DomainCabinet* DomainCabinet::__storage = 0;
|
||||
|
||||
typedef Cabinet<ThermoPhase> ThermoCabinet;
|
||||
typedef Cabinet<Kinetics> KineticsCabinet;
|
||||
typedef Cabinet<Transport> TransportCabinet;
|
||||
|
||||
static StFlow* _stflow(int i)
|
||||
{
|
||||
Domain1D* d = &DomainCabinet::item(i);
|
||||
|
|
@ -44,27 +45,6 @@ static Bdry1D* _bdry(int i)
|
|||
return dynamic_cast<Bdry1D*>(d);
|
||||
}
|
||||
|
||||
inline ThermoPhase* _phase(int n)
|
||||
{
|
||||
return Storage::__storage->__thtable[n];
|
||||
}
|
||||
|
||||
inline Kinetics* _kinetics(int n)
|
||||
{
|
||||
return Storage::__storage->__ktable[n];
|
||||
}
|
||||
|
||||
inline ThermoPhase* _thermo(int n)
|
||||
{
|
||||
return Storage::__storage->__thtable[n];
|
||||
}
|
||||
|
||||
inline Transport* _transport(int n)
|
||||
{
|
||||
return Storage::__storage->__trtable[n];
|
||||
}
|
||||
|
||||
|
||||
extern "C" {
|
||||
|
||||
int DLL_EXPORT domain_clear()
|
||||
|
|
@ -349,7 +329,8 @@ extern "C" {
|
|||
{
|
||||
try {
|
||||
ReactingSurf1D* srf = (ReactingSurf1D*)_bdry(i);
|
||||
InterfaceKinetics* k = (InterfaceKinetics*)_kinetics(j);
|
||||
InterfaceKinetics* k =
|
||||
dynamic_cast<InterfaceKinetics*>(&Cabinet<Kinetics>::item(j));
|
||||
srf->setKineticsMgr(k);
|
||||
return 0;
|
||||
} catch (CanteraError) {
|
||||
|
|
@ -388,16 +369,16 @@ extern "C" {
|
|||
int DLL_EXPORT stflow_new(int iph, int ikin, int itr, int itype)
|
||||
{
|
||||
try {
|
||||
IdealGasPhase* ph = (IdealGasPhase*)_thermo(iph);
|
||||
IdealGasPhase* ph = dynamic_cast<IdealGasPhase*>(&ThermoCabinet::item(iph));
|
||||
if (itype == 1) {
|
||||
AxiStagnFlow* x = new AxiStagnFlow(ph, ph->nSpecies(), 2);
|
||||
x->setKinetics(*_kinetics(ikin));
|
||||
x->setTransport(*_transport(itr));
|
||||
x->setKinetics(KineticsCabinet::item(ikin));
|
||||
x->setTransport(TransportCabinet::item(itr));
|
||||
return DomainCabinet::add(x);
|
||||
} else if (itype == 2) {
|
||||
FreeFlame* x = new FreeFlame(ph, ph->nSpecies(), 2);
|
||||
x->setKinetics(*_kinetics(ikin));
|
||||
x->setTransport(*_transport(itr));
|
||||
x->setKinetics(KineticsCabinet::item(ikin));
|
||||
x->setTransport(TransportCabinet::item(itr));
|
||||
return DomainCabinet::add(x);
|
||||
} else {
|
||||
return -2;
|
||||
|
|
@ -415,7 +396,7 @@ extern "C" {
|
|||
withSoret = true;
|
||||
}
|
||||
try {
|
||||
_stflow(i)->setTransport(*_transport(itr), withSoret);
|
||||
_stflow(i)->setTransport(TransportCabinet::item(itr), withSoret);
|
||||
return 0;
|
||||
} catch (CanteraError) {
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -12,9 +12,7 @@
|
|||
#include "cantera/zeroD/Reservoir.h"
|
||||
#include "cantera/zeroD/Wall.h"
|
||||
#include "cantera/zeroD/flowControllers.h"
|
||||
|
||||
#include "Cabinet.h"
|
||||
#include "Storage.h"
|
||||
|
||||
using namespace Cantera;
|
||||
using namespace std;
|
||||
|
|
@ -24,16 +22,8 @@ typedef Cabinet<ReactorNet> NetworkCabinet;
|
|||
typedef Cabinet<FlowDevice> FlowDeviceCabinet;
|
||||
typedef Cabinet<Wall> WallCabinet;
|
||||
typedef Cabinet<Func1> FuncCabinet;
|
||||
|
||||
inline Kinetics* _kin(int n)
|
||||
{
|
||||
return Storage::__storage->__ktable[n];
|
||||
}
|
||||
|
||||
inline ThermoPhase* _th(int n)
|
||||
{
|
||||
return Storage::__storage->__thtable[n];
|
||||
}
|
||||
typedef Cabinet<ThermoPhase> ThermoCabinet;
|
||||
typedef Cabinet<Kinetics> KineticsCabinet;
|
||||
|
||||
template<> ReactorCabinet* ReactorCabinet::__storage = 0;
|
||||
template<> NetworkCabinet* NetworkCabinet::__storage = 0;
|
||||
|
|
@ -91,7 +81,7 @@ extern "C" {
|
|||
|
||||
int DLL_EXPORT reactor_setThermoMgr(int i, int n)
|
||||
{
|
||||
ReactorCabinet::item(i).setThermoMgr(*_th(n));
|
||||
ReactorCabinet::item(i).setThermoMgr(ThermoCabinet::item(n));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -99,7 +89,7 @@ extern "C" {
|
|||
{
|
||||
ReactorBase* r = &ReactorCabinet::item(i);
|
||||
if (r->type() >= ReactorType) {
|
||||
((Reactor*)r)->setKineticsMgr(*_kin(n));
|
||||
((Reactor*)r)->setKineticsMgr(KineticsCabinet::item(n));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -423,12 +413,12 @@ extern "C" {
|
|||
{
|
||||
Kinetics* left=0, *right=0;
|
||||
if (n > 0)
|
||||
if (_kin(n)->type() == cInterfaceKinetics) {
|
||||
left = _kin(n);
|
||||
if (KineticsCabinet::item(n).type() == cInterfaceKinetics) {
|
||||
left = &KineticsCabinet::item(n);
|
||||
}
|
||||
if (m > 0)
|
||||
if (_kin(m)->type() == cInterfaceKinetics) {
|
||||
right = _kin(m);
|
||||
if (KineticsCabinet::item(m).type() == cInterfaceKinetics) {
|
||||
right = &KineticsCabinet::item(m);
|
||||
}
|
||||
WallCabinet::item(i).setKinetics(left, right);
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -7,22 +7,16 @@
|
|||
// Cantera includes
|
||||
#include "cantera/kinetics/ReactionPath.h"
|
||||
#include "Cabinet.h"
|
||||
#include "Storage.h"
|
||||
|
||||
using namespace Cantera;
|
||||
using namespace std;
|
||||
|
||||
typedef ReactionPathBuilder builder_t;
|
||||
|
||||
typedef Cabinet<ReactionPathBuilder> BuilderCabinet;
|
||||
typedef Cabinet<ReactionPathDiagram> DiagramCabinet;
|
||||
template<> DiagramCabinet* DiagramCabinet::__storage = 0;
|
||||
template<> BuilderCabinet* BuilderCabinet::__storage = 0;
|
||||
|
||||
inline Kinetics* _kin(int n)
|
||||
{
|
||||
return Storage::__storage->__ktable[n];
|
||||
}
|
||||
typedef Cabinet<Kinetics> KineticsCabinet;
|
||||
|
||||
extern "C" {
|
||||
|
||||
|
|
@ -188,7 +182,7 @@ extern "C" {
|
|||
int DLL_EXPORT rbuild_init(int i, char* logfile, int k)
|
||||
{
|
||||
ofstream flog(logfile);
|
||||
BuilderCabinet::item(i).init(flog, *_kin(k));
|
||||
BuilderCabinet::item(i).init(flog, KineticsCabinet::item(k));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -200,7 +194,7 @@ extern "C" {
|
|||
if (iquiet > 0) {
|
||||
quiet = true;
|
||||
}
|
||||
BuilderCabinet::item(i).build(*_kin(k), string(el), fdot,
|
||||
BuilderCabinet::item(i).build(KineticsCabinet::item(k), string(el), fdot,
|
||||
DiagramCabinet::item(idiag), quiet);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,21 +9,19 @@
|
|||
#include "cantera/thermo/SurfPhase.h"
|
||||
#include "cantera/kinetics/InterfaceKinetics.h"
|
||||
#include "kinetics/ImplicitSurfChem.h"
|
||||
|
||||
#include "Cabinet.h"
|
||||
#include "Storage.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace Cantera;
|
||||
|
||||
inline SurfPhase* _surfphase(int n)
|
||||
{
|
||||
return (SurfPhase*)Storage::__storage->__thtable[n];
|
||||
return dynamic_cast<SurfPhase*>(&Cabinet<ThermoPhase>::item(n));
|
||||
}
|
||||
|
||||
inline InterfaceKinetics* _surfkin(int n)
|
||||
{
|
||||
return (InterfaceKinetics*)Storage::__storage->__ktable[n];
|
||||
return dynamic_cast<InterfaceKinetics*>(&Cabinet<Kinetics>::item(n));
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
// Cantera includes
|
||||
#include "cantera/base/ctml.h"
|
||||
#include "Cabinet.h"
|
||||
#include "Storage.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
|
|
@ -15,9 +14,6 @@ using namespace std;
|
|||
using namespace Cantera;
|
||||
using namespace ctml;
|
||||
|
||||
// Assign storage for the static member of the Templated Cabinet class
|
||||
// class Cabinet<XML_Node>;
|
||||
|
||||
typedef Cabinet<XML_Node, false> XmlCabinet;
|
||||
template<> XmlCabinet* XmlCabinet::__storage = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@
|
|||
#include "cantera/thermo/ThermoFactory.h"
|
||||
#include "cantera/base/ctml.h"
|
||||
#include "cantera/kinetics/importKinetics.h"
|
||||
#include "clib/Storage.h"
|
||||
#include "clib/Cabinet.h"
|
||||
#include "cantera/kinetics/InterfaceKinetics.h"
|
||||
#include "cantera/thermo/PureFluidPhase.h"
|
||||
|
|
@ -23,6 +22,9 @@
|
|||
using namespace Cantera;
|
||||
|
||||
typedef Cabinet<XML_Node, false> XmlCabinet;
|
||||
typedef Cabinet<ThermoPhase> ThermoCabinet;
|
||||
typedef Cabinet<Kinetics> KineticsCabinet;
|
||||
typedef Cabinet<Transport> TransportCabinet;
|
||||
|
||||
inline XML_Node* _xml(const integer* n)
|
||||
{
|
||||
|
|
@ -31,27 +33,27 @@ inline XML_Node* _xml(const integer* n)
|
|||
|
||||
inline ThermoPhase* _fph(const integer* n)
|
||||
{
|
||||
return th(*n);
|
||||
return &ThermoCabinet::item(*n);
|
||||
}
|
||||
|
||||
static Kinetics* _fkin(const integer* n)
|
||||
{
|
||||
if (*n >= 0) {
|
||||
return kin(*n);
|
||||
return &KineticsCabinet::item(*n);
|
||||
} else {
|
||||
error("_fkin: negative kinetics index");
|
||||
return kin(0);
|
||||
return &KineticsCabinet::item(0);
|
||||
}
|
||||
}
|
||||
|
||||
inline ThermoPhase* _fth(const integer* n)
|
||||
{
|
||||
return th(*n);
|
||||
return &ThermoCabinet::item(*n);
|
||||
}
|
||||
|
||||
inline Transport* _ftrans(const integer* n)
|
||||
{
|
||||
return trans(*n);
|
||||
return &TransportCabinet::item(*n);
|
||||
}
|
||||
|
||||
std::string f2string(const char* s, ftnlen n)
|
||||
|
|
@ -310,17 +312,12 @@ extern "C" {
|
|||
|
||||
//-------------- Thermo --------------------//
|
||||
|
||||
|
||||
// status_t DLL_EXPORT th_thermoIndex(char* id) {
|
||||
// return thermo_index(id);
|
||||
//}
|
||||
|
||||
integer DLL_EXPORT newthermofromxml_(integer* mxml)
|
||||
{
|
||||
try {
|
||||
XML_Node* x = _xml(mxml);
|
||||
thermo_t* th = newPhase(*x);
|
||||
return Storage::storage()->addThermo(th);
|
||||
return ThermoCabinet::add(th);
|
||||
} catch (CanteraError) {
|
||||
handleError();
|
||||
return -1;
|
||||
|
|
@ -602,8 +599,8 @@ extern "C" {
|
|||
}
|
||||
Kinetics* kin = newKineticsMgr(*x, phases);
|
||||
if (kin) {
|
||||
int k = Storage::storage()->addKinetics(kin);
|
||||
return k; //Storage::storage()->addKinetics(kin);
|
||||
int k = KineticsCabinet::add(kin);
|
||||
return k;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -762,10 +759,6 @@ extern "C" {
|
|||
return _fkin(n)->multiplier(*i);
|
||||
}
|
||||
|
||||
//status_t DLL_EXPORT kin_phase_(const integer* n, integer* i) {
|
||||
// return thermo_index(_fkin(n)->thermo(*i).id());
|
||||
//}
|
||||
|
||||
status_t DLL_EXPORT kin_getequilibriumconstants_(const integer* n, doublereal* kc)
|
||||
{
|
||||
try {
|
||||
|
|
@ -832,7 +825,7 @@ extern "C" {
|
|||
thermo_t* t = _fth(ith);
|
||||
try {
|
||||
Transport* tr = newTransportMgr(mstr, t, *loglevel);
|
||||
return Storage::storage()->addTransport(tr);
|
||||
return TransportCabinet::add(tr);
|
||||
} catch (CanteraError) {
|
||||
handleError();
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -25,16 +25,6 @@ thermo_delete(PyObject* self, PyObject* args)
|
|||
return Py_BuildValue("i",0);
|
||||
}
|
||||
|
||||
static PyObject*
|
||||
thermo_index(PyObject* self, PyObject* args)
|
||||
{
|
||||
char* id;
|
||||
if (!PyArg_ParseTuple(args, "s:index", &id)) {
|
||||
return NULL;
|
||||
}
|
||||
return Py_BuildValue("i",th_thermoIndex(id));
|
||||
}
|
||||
|
||||
static PyObject*
|
||||
thermo_refpressure(PyObject* self, PyObject* args)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ static PyMethodDef ct_methods[] = {
|
|||
{"thermo_delete", thermo_delete, METH_VARARGS},
|
||||
{"thermo_mintemp", thermo_mintemp, METH_VARARGS},
|
||||
{"thermo_maxtemp", thermo_maxtemp, METH_VARARGS},
|
||||
{"thermo_thermoIndex", thermo_index, METH_VARARGS},
|
||||
{"thermo_refpressure", thermo_refpressure, METH_VARARGS},
|
||||
{"thermo_getfp", thermo_getfp, METH_VARARGS},
|
||||
{"thermo_setfp", thermo_setfp, METH_VARARGS},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue