Fixed namespace issues with the Fortran module
This commit is contained in:
parent
3625c733ea
commit
51a7fc1278
2 changed files with 12 additions and 10 deletions
|
|
@ -95,7 +95,7 @@ extern "C" {
|
|||
try {
|
||||
std::string pnm = _fph(n)->name();
|
||||
int lout = min(lennm,pnm.size());
|
||||
copy(pnm.c_str(), pnm.c_str() + lout, nm);
|
||||
std::copy(pnm.c_str(), pnm.c_str() + lout, nm);
|
||||
for (int nn = lout; nn < lennm; nn++) nm[nn] = ' ';
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -228,7 +228,7 @@ extern "C" {
|
|||
try {
|
||||
std::string spnm = _fph(n)->speciesName(*k-1);
|
||||
int lout = min(lennm,spnm.size());
|
||||
copy(spnm.c_str(), spnm.c_str() + lout, nm);
|
||||
std::copy(spnm.c_str(), spnm.c_str() + lout, nm);
|
||||
for (int nn = lout; nn < lennm; nn++) nm[nn] = ' ';
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -239,7 +239,7 @@ extern "C" {
|
|||
try {
|
||||
std::string elnm = _fph(n)->elementName(*m-1);
|
||||
int lout = min(lennm,elnm.size());
|
||||
copy(elnm.c_str(), elnm.c_str() + lout, nm);
|
||||
std::copy(elnm.c_str(), elnm.c_str() + lout, nm);
|
||||
for (int nn = lout; nn < lennm; nn++) nm[nn] = ' ';
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -436,7 +436,7 @@ extern "C" {
|
|||
const integer* neighbor4) {
|
||||
try {
|
||||
XML_Node* x = _xml(mxml);
|
||||
vector<thermo_t*> phases;
|
||||
std::vector<thermo_t*> phases;
|
||||
phases.push_back(_fth(iphase));
|
||||
if (*neighbor1 >= 0) {
|
||||
phases.push_back(_fth(neighbor1));
|
||||
|
|
@ -599,7 +599,7 @@ extern "C" {
|
|||
Kinetics* k = _fkin(n);
|
||||
std::string r = k->reactionString(*i-1);
|
||||
int lout = min(lenbuf,r.size());
|
||||
copy(r.c_str(), r.c_str() + lout, buf);
|
||||
std::copy(r.c_str(), r.c_str() + lout, buf);
|
||||
for (int nn = lout; nn < lenbuf; nn++) buf[nn] = ' ';
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@
|
|||
|
||||
using namespace ctml;
|
||||
using namespace std;
|
||||
using Cantera::XML_Node;
|
||||
using Cantera::CanteraError;
|
||||
|
||||
#include "clib/Cabinet.h"
|
||||
|
||||
|
|
@ -24,7 +26,7 @@ inline XML_Node* _xml(const integer* i) {
|
|||
}
|
||||
|
||||
static void handleError() {
|
||||
error(lastErrorMessage());
|
||||
Cantera::error(Cantera::lastErrorMessage());
|
||||
}
|
||||
|
||||
std::string f2string(const char* s, ftnlen n);
|
||||
|
|
@ -42,7 +44,7 @@ extern "C" {
|
|||
|
||||
status_t DLL_EXPORT fxml_get_xml_file_(const char* file, ftnlen filelen) {
|
||||
try {
|
||||
XML_Node* x = get_XML_File(f2string(file, filelen));
|
||||
XML_Node* x = Cantera::get_XML_File(f2string(file, filelen));
|
||||
int ix = Cabinet<XML_Node>::cabinet(false)->add(x);
|
||||
return ix;
|
||||
}
|
||||
|
|
@ -55,7 +57,7 @@ extern "C" {
|
|||
status_t DLL_EXPORT fxml_clear_() {
|
||||
try {
|
||||
Cabinet<XML_Node>::cabinet(false)->clear();
|
||||
close_XML_File("all");
|
||||
Cantera::close_XML_File("all");
|
||||
return 0;
|
||||
}
|
||||
catch (CanteraError) { handleError(); return -1;}
|
||||
|
|
@ -242,7 +244,7 @@ extern "C" {
|
|||
doublereal* data, const integer* iconvert) {
|
||||
try {
|
||||
XML_Node& node = *_xml(i);
|
||||
vector_fp v;
|
||||
Cantera::vector_fp v;
|
||||
bool conv = false;
|
||||
if (*iconvert > 0) conv = true;
|
||||
getFloatArray(node, v, conv);
|
||||
|
|
@ -251,7 +253,7 @@ extern "C" {
|
|||
// array not big enough
|
||||
if (*n < nv) {
|
||||
throw CanteraError("ctml_getfloatarray",
|
||||
"array must be dimensioned at least "+int2str(nv));
|
||||
"array must be dimensioned at least "+Cantera::int2str(nv));
|
||||
}
|
||||
|
||||
for (int i = 0; i < nv; i++) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue