diff --git a/Cantera/src/DenseMatrix.cpp b/Cantera/src/DenseMatrix.cpp index 0ec8e64f4..681fb69f6 100755 --- a/Cantera/src/DenseMatrix.cpp +++ b/Cantera/src/DenseMatrix.cpp @@ -135,7 +135,7 @@ namespace Cantera { */ int invert(DenseMatrix& A, int nn) { integer n = (nn > 0 ? nn : static_cast(A.nRows())); - integer info=0; + int info=0; ct_dgetrf(n, n, A.begin(), static_cast(A.nRows()), A.ipiv().begin(), info); if (info != 0) diff --git a/Cantera/src/GasKinetics.cpp b/Cantera/src/GasKinetics.cpp index 7da4f359b..47171199e 100755 --- a/Cantera/src/GasKinetics.cpp +++ b/Cantera/src/GasKinetics.cpp @@ -612,11 +612,11 @@ namespace Cantera { if (!m_finalized) { int i, j, nr, np; m_kdata->falloff_work.resize( - static_cast(m_falloffn.workSize())); + static_cast(m_falloffn.workSize())); m_kdata->concm_3b_values.resize( - static_cast(m_3b_concm.workSize())); + static_cast(m_3b_concm.workSize())); m_kdata->concm_falloff_values.resize( - static_cast(m_falloff_concm.workSize())); + static_cast(m_falloff_concm.workSize())); for (i = 0; i < m_ii; i++) { nr = m_reactants[i].size(); diff --git a/Cantera/src/converters/CKParser.cpp b/Cantera/src/converters/CKParser.cpp index 98316adac..4d83c8609 100755 --- a/Cantera/src/converters/CKParser.cpp +++ b/Cantera/src/converters/CKParser.cpp @@ -6,7 +6,10 @@ // Copyright 2001 California Institute of Technology // // $Log$ -// Revision 1.14 2004-09-13 11:22:21 dggoodwin +// Revision 1.15 2004-10-10 20:46:36 dggoodwin +// changes to make type integer compatible with f2c +// +// Revision 1.14 2004/09/13 11:22:21 dggoodwin // *** empty log message *** // // Revision 1.13 2004/08/28 16:12:41 dggoodwin @@ -1382,7 +1385,7 @@ next: string::const_iterator begin = s.begin(); string::const_iterator end = s.end(); vector::iterator e; - result.resize(static_cast(esyms.size()),0); + result.resize(static_cast(esyms.size()),0); for (; begin != end; ++begin) { // new element diff --git a/Cantera/src/converters/writelog.cpp b/Cantera/src/converters/writelog.cpp index cf7dded5a..15318dff9 100755 --- a/Cantera/src/converters/writelog.cpp +++ b/Cantera/src/converters/writelog.cpp @@ -50,7 +50,7 @@ namespace ckr { << ", " << c[2] << ", " << c[3] << ")" << endl; } else { - for (ct::ctvector_fp::size_t n = 0; n < c.size(); n++) { + for (size_t n = 0; n < c.size(); n++) { log << c[n] << ", "; log << endl; } log << "###### ERROR ##### incorrect number of parameters" << endl; @@ -70,7 +70,7 @@ namespace ckr { << ")" << endl; } else { - for (ct::ctvector_fp::size_t n = 0; n < c.size(); n++) { + for (size_t n = 0; n < c.size(); n++) { log << c[n] << ", "; log << endl; } log << "##### ERROR ##### incorrect number of parameters" << endl; diff --git a/Cantera/src/ctvector.cpp b/Cantera/src/ctvector.cpp index 327ef0ca4..0d489d989 100755 --- a/Cantera/src/ctvector.cpp +++ b/Cantera/src/ctvector.cpp @@ -119,89 +119,89 @@ namespace ct { void ctvector_fp::clear() { fill(_data, _data + _size, 0.0); resize(0); } - //-------------------------------------// - // ctvector_float // - //-------------------------------------// +// //-------------------------------------// +// // ctvector_float // +// //-------------------------------------// - ctvector_float::ctvector_float(size_t n) : _size(0), _alloc(0), _data(0) { - resize(n); - } +// ctvector_float::ctvector_float(size_t n) : _size(0), _alloc(0), _data(0) { +// resize(n); +// } - ctvector_float::ctvector_float(size_t n, value_type v0) - : _size(0), _alloc(0), _data(0) { - resize(n, v0); - } +// ctvector_float::ctvector_float(size_t n, value_type v0) +// : _size(0), _alloc(0), _data(0) { +// resize(n, v0); +// } - ctvector_float::ctvector_float(const ctvector_float& x) { - if (x._alloc > 0) { - _data = new value_type[x._alloc]; - copy(x._data, x._data + x._alloc, _data); - } - else { - _data = 0; - } - _size = x._size; - _alloc = x._alloc; - } +// ctvector_float::ctvector_float(const ctvector_float& x) { +// if (x._alloc > 0) { +// _data = new value_type[x._alloc]; +// copy(x._data, x._data + x._alloc, _data); +// } +// else { +// _data = 0; +// } +// _size = x._size; +// _alloc = x._alloc; +// } - ctvector_float ctvector_float::operator=(const ctvector_float& x) { - if (this == &x) return *this; - if (_data) delete[] _data; - if (x._alloc > 0) { - _data = new value_type[x._alloc]; - copy(x._data, x._data + x._alloc, _data); - } - else { - _data = 0; - } - _size = x._size; - _alloc = x._alloc; - return *this; - } +// ctvector_float ctvector_float::operator=(const ctvector_float& x) { +// if (this == &x) return *this; +// if (_data) delete[] _data; +// if (x._alloc > 0) { +// _data = new value_type[x._alloc]; +// copy(x._data, x._data + x._alloc, _data); +// } +// else { +// _data = 0; +// } +// _size = x._size; +// _alloc = x._alloc; +// return *this; +// } - ctvector_float::~ctvector_float() { - if (_data) delete[] _data; - _data = 0; - } +// ctvector_float::~ctvector_float() { +// if (_data) delete[] _data; +// _data = 0; +// } - void ctvector_float::resize(size_t n) { - size_t new_alloc = n+1; - value_type* newdata = new value_type[new_alloc]; - size_t datalen = (n > _size ? _size : n); - if (_data) { - copy(_data, _data + datalen, newdata); - } - if (_data) delete[] _data; - _data = newdata; - _alloc = new_alloc; - _size = n; - } +// void ctvector_float::resize(size_t n) { +// size_t new_alloc = n+1; +// value_type* newdata = new value_type[new_alloc]; +// size_t datalen = (n > _size ? _size : n); +// if (_data) { +// copy(_data, _data + datalen, newdata); +// } +// if (_data) delete[] _data; +// _data = newdata; +// _alloc = new_alloc; +// _size = n; +// } - void ctvector_float::resize(size_t n, value_type v0) { - size_t new_alloc = n+1; - value_type* newdata = new value_type[new_alloc]; - fill(newdata, newdata + new_alloc, v0); - size_t datalen = (n > _size ? _size : n); - if (_data) { - copy(_data, _data + datalen, newdata); - } - if (_data) delete[] _data; - _data = newdata; - _alloc = new_alloc; - _size = n; - } +// void ctvector_float::resize(size_t n, value_type v0) { +// size_t new_alloc = n+1; +// value_type* newdata = new value_type[new_alloc]; +// fill(newdata, newdata + new_alloc, v0); +// size_t datalen = (n > _size ? _size : n); +// if (_data) { +// copy(_data, _data + datalen, newdata); +// } +// if (_data) delete[] _data; +// _data = newdata; +// _alloc = new_alloc; +// _size = n; +// } - void ctvector_float::push_back(value_type x) { - size_t loc = _size; - if (_size == _alloc) { - resize(2*_alloc); - } - _data[loc] = x; - _size = loc + 1; - } +// void ctvector_float::push_back(value_type x) { +// size_t loc = _size; +// if (_size == _alloc) { +// resize(2*_alloc); +// } +// _data[loc] = x; +// _size = loc + 1; +// } - void ctvector_float::clear() { fill(_data, _data + _size, 0.0); resize(0); } +// void ctvector_float::clear() { fill(_data, _data + _size, 0.0); resize(0); } diff --git a/Cantera/src/ctvector.h b/Cantera/src/ctvector.h index e94cfb705..96adfaa48 100755 --- a/Cantera/src/ctvector.h +++ b/Cantera/src/ctvector.h @@ -20,6 +20,7 @@ #define CT_CTVECTOR_H #include +#include "config.h" namespace ct { @@ -29,8 +30,8 @@ namespace ct { class ctvector_fp { public: - typedef unsigned int size_t; - typedef double doublereal; + //typedef unsigned int size_t; + //typedef double doublereal; typedef doublereal* iterator; typedef const doublereal* const_iterator; typedef doublereal* pointer; @@ -66,55 +67,55 @@ namespace ct { }; - /** - * A class for single-precision floating-point arrays - */ - class ctvector_float { - public: +// /** +// * A class for single-precision floating-point arrays +// */ +// class ctvector_float { +// public: - typedef unsigned int size_t; - typedef float doublereal; - typedef doublereal* iterator; - typedef const doublereal* const_iterator; - typedef doublereal* pointer; - typedef size_t difference_type; - typedef doublereal value_type; +// //typedef unsigned int size_t; +// //typedef float doublereal; +// typedef real* iterator; +// typedef const real* const_iterator; +// typedef real* pointer; +// typedef size_t difference_type; +// typedef real value_type; - ctvector_float(size_t n=0); - ctvector_float(size_t n, value_type v0); - ctvector_float(const ctvector_float& x); - ctvector_float operator=(const ctvector_float& x); - virtual ~ctvector_float(); +// ctvector_float(size_t n=0); +// ctvector_float(size_t n, value_type v0); +// ctvector_float(const ctvector_float& x); +// ctvector_float operator=(const ctvector_float& x); +// virtual ~ctvector_float(); - value_type operator[](size_t n) const { return _data[n]; } - value_type& operator[](size_t n) { return _data[n]; } +// value_type operator[](size_t n) const { return _data[n]; } +// value_type& operator[](size_t n) { return _data[n]; } - void resize(size_t n); - void resize(size_t n, value_type v0); +// void resize(size_t n); +// void resize(size_t n, value_type v0); - value_type back() const { return _data[_size-1]; } - const_iterator begin() const { return _data; } - iterator begin() { return _data; } - const_iterator end() const { return _data + _size; } - iterator end() { return _data + _size; } - void push_back(value_type x); - size_t size() const { return _size; } - void clear(); - bool empty() const { return (_size == 0); } +// value_type back() const { return _data[_size-1]; } +// const_iterator begin() const { return _data; } +// iterator begin() { return _data; } +// const_iterator end() const { return _data + _size; } +// iterator end() { return _data + _size; } +// void push_back(value_type x); +// size_t size() const { return _size; } +// void clear(); +// bool empty() const { return (_size == 0); } - protected: - size_t _size, _alloc; - iterator _data; - private: - }; +// protected: +// size_t _size, _alloc; +// iterator _data; +// private: +// }; // integer arrays class ctvector_int { public: - typedef unsigned int size_t; - typedef int integer; + //typedef unsigned int size_t; + //typedef long int integer; typedef integer* iterator; typedef const integer* const_iterator; typedef integer* pointer; @@ -156,8 +157,8 @@ namespace ct { std::ostream& operator<<(std::ostream& s, const ct::ctvector_fp& v); std::ostream& operator<<(std::ostream& s, ct::ctvector_fp& v); -std::ostream& operator<<(std::ostream& s, const ct::ctvector_float& v); -std::ostream& operator<<(std::ostream& s, ct::ctvector_float& v); +//std::ostream& operator<<(std::ostream& s, const ct::ctvector_float& v); +//std::ostream& operator<<(std::ostream& s, ct::ctvector_float& v); std::ostream& operator<<(std::ostream& s, const ct::ctvector_int& v); diff --git a/Cantera/src/oneD/StFlow.cpp b/Cantera/src/oneD/StFlow.cpp index 4a795581a..fc5c61e28 100644 --- a/Cantera/src/oneD/StFlow.cpp +++ b/Cantera/src/oneD/StFlow.cpp @@ -905,7 +905,7 @@ namespace Cantera { addFloat(flow, "pressure", m_press, "Pa", "pressure"); addFloatArray(gv,"z",m_z.size(),m_z.begin(), "m","length"); - vector_fp x(static_cast(soln.nColumns())); + vector_fp x(static_cast(soln.nColumns())); soln.getRow(0,x.begin()); addFloatArray(gv,"u",x.size(),x.begin(),"m/s","velocity"); diff --git a/Cantera/src/transport/TransportFactory.cpp b/Cantera/src/transport/TransportFactory.cpp index dae5fd0f9..dd7827778 100755 --- a/Cantera/src/transport/TransportFactory.cpp +++ b/Cantera/src/transport/TransportFactory.cpp @@ -77,6 +77,10 @@ namespace Cantera { const doublereal FiveThirds = 5.0/3.0; + TransportParams::~TransportParams(){ + delete xml; + }; + //////////////////// class Transport methods ///////////////////// void Transport::setThermo(thermo_t& thermo) { diff --git a/Cantera/src/transport/TransportParams.h b/Cantera/src/transport/TransportParams.h index 0a5ba5a01..4cd9f880b 100755 --- a/Cantera/src/transport/TransportParams.h +++ b/Cantera/src/transport/TransportParams.h @@ -21,9 +21,7 @@ namespace Cantera { public: TransportParams() : thermo(0), xml(0) {} - virtual ~TransportParams(){ - delete xml; - } + virtual ~TransportParams(); int nsp; // phase_t* mix; diff --git a/config.h.in b/config.h.in index 09a090006..992d5856c 100755 --- a/config.h.in +++ b/config.h.in @@ -13,8 +13,9 @@ // are OK for most systems typedef double doublereal; // Fortran double precision -typedef int integer; // Fortran integer -typedef int ftnlen; // Fortran hidden string length type +typedef int integer; // Fortran integer +typedef int ftnlen; // Fortran hidden string length type + // Fortran compilers pass character strings in argument lists by diff --git a/ext/f2c_libs/f2c.h b/ext/f2c_libs/f2c.h index f74c7da0f..47e3157d5 100644 --- a/ext/f2c_libs/f2c.h +++ b/ext/f2c_libs/f2c.h @@ -23,8 +23,10 @@ typedef __int64 ulongint; /* HACK ALERT */ #pragma warning(disable:4101) #endif -typedef long int integer; -typedef unsigned long int uinteger; +//typedef long int integer; +typedef int integer; +//typedef unsigned long int uinteger; +typedef unsigned int uinteger; typedef char *address; typedef short int shortint; typedef float real; @@ -58,9 +60,12 @@ typedef short flag; typedef short ftnlen; typedef short ftnint; #else -typedef long int flag; -typedef long int ftnlen; -typedef long int ftnint; +//typedef long int flag; +//typedef long int ftnlen; +//typedef long int ftnint; +typedef int flag; +typedef int ftnlen; +typedef int ftnint; #endif /*external read, write*/ diff --git a/ext/f2c_recipes/simplx.c b/ext/f2c_recipes/simplx.c index e885f42ee..1aa340524 100644 --- a/ext/f2c_recipes/simplx.c +++ b/ext/f2c_recipes/simplx.c @@ -14,7 +14,8 @@ extern "C" { #endif #include "f2c.h" - +#include + /* Table of constant values */ static integer c__0 = 0; @@ -51,6 +52,7 @@ static integer c__1 = 1; /* Function Body */ if (*m != *m1 + *m2 + *m3) { + printf(" %d %d %d %d ", *m, *m1, *m2, *m3); s_paus("Bad input constraint counts.", (ftnlen)28); } nl1 = *n;