diff --git a/Cantera/cxx/src/Makefile.in b/Cantera/cxx/src/Makefile.in index 5efa87258..15136f6be 100644 --- a/Cantera/cxx/src/Makefile.in +++ b/Cantera/cxx/src/Makefile.in @@ -23,7 +23,7 @@ DEPENDS = $(OBJS:.o=.d) CXX = @CXX@ # the directory where Cantera include files may be found. -CXX_INCLUDES = -I../../src/base -I../../src/thermo +CXX_INCLUDES = -I../../src/base -I../../src/thermo @CXX_INCLUDES@ # how to compile C++ source files to object files .@CXX_EXT@.@OBJ_EXT@: diff --git a/Cantera/fortran/src/Makefile.in b/Cantera/fortran/src/Makefile.in index bda667445..e6f46a681 100644 --- a/Cantera/fortran/src/Makefile.in +++ b/Cantera/fortran/src/Makefile.in @@ -54,7 +54,7 @@ LIB_DEPS = $(CANTERA_LIBDIR)/libctbase.a \ # the directory where module .mod files should be put MODULE_DIR = @buildinc@/cantera -CXX_INCLUDES = -I../../src/base -I../../src/thermo -I../../src/kinetics -I../../src/transport -I../../src/numerics -I../../src/oneD -I../../src/zeroD -I../../src/equil -I../../src/converters +CXX_INCLUDES = -I../../src/base -I../../src/thermo -I../../src/kinetics -I../../src/transport -I../../src/numerics -I../../src/oneD -I../../src/zeroD -I../../src/equil -I../../src/converters @CXX_INCLUDES@ # flags passed to the C++ compiler/linker for the linking step LCXX_FLAGS = -L$(CANTERA_LIBDIR) @CXXFLAGS@ diff --git a/Cantera/src/base/utilities.h b/Cantera/src/base/utilities.h index 8a59cdf62..2f0fc2291 100755 --- a/Cantera/src/base/utilities.h +++ b/Cantera/src/base/utilities.h @@ -16,6 +16,15 @@ #include #endif + +template struct timesConstant : public std::unary_function +{ + timesConstant(T c) : m_c(c) {} + double operator()(T x) {return m_c * x;} + T m_c; +}; + + namespace Cantera { /*! @@ -159,8 +168,9 @@ namespace Cantera { template inline void scale(InputIter begin, InputIter end, OutputIter out, S scale_factor) { - for (; begin != end; ++begin, ++out) - *out = scale_factor * *begin; + transform(begin, end, out, timesConstant(scale_factor)); + // for (; begin != end; ++begin, ++out) + //*out = scale_factor * *begin; } /*! diff --git a/Cantera/src/equil/BasisOptimize.cpp b/Cantera/src/equil/BasisOptimize.cpp index 75debe911..638faa208 100644 --- a/Cantera/src/equil/BasisOptimize.cpp +++ b/Cantera/src/equil/BasisOptimize.cpp @@ -4,8 +4,8 @@ * Functions which calculation optimized basis of the * stoichiometric coefficient matrix (see /ref equil functions) */ + /* - /* * $Author$ * $Date$ * $Revision$ diff --git a/Cantera/src/thermo/State.cpp b/Cantera/src/thermo/State.cpp index c9b3e94dc..30971e5b1 100644 --- a/Cantera/src/thermo/State.cpp +++ b/Cantera/src/thermo/State.cpp @@ -28,13 +28,6 @@ using namespace std; -template struct timesConstant : public unary_function -{ - timesConstant(T c) : m_c(c) {} - double operator()(T x) {return m_c * x;} - T m_c; -}; - namespace Cantera { State::State() : m_kk(0), m_temp(0.0), m_dens(0.001), m_mmw(0.0) {} @@ -90,23 +83,23 @@ namespace Cantera { int k; doublereal sum = 0.0, norm = 0.0; sum = dot(x, x + m_kk, m_molwts.begin()); - for (k = 0; k != m_kk; ++k) { - m_ym[k] = x[k] / sum; - m_y[k] = m_molwts[k]*m_ym[k]; - norm += x[k]; - } + doublereal rsum = 1.0/sum; + transform(x, x + m_kk, m_ym.begin(), timesConstant(rsum)); + transform(m_ym.begin(), m_ym.begin() + m_kk, m_molwts.begin(), + m_y.begin(), multiplies()); + norm = accumulate(x, x + m_kk, 0.0); + //for (k = 0; k != m_kk; ++k) { + // m_ym[k] = x[k] / sum; + // m_y[k] = m_molwts[k]*m_ym[k]; + // norm += x[k]; + //} m_mmw = sum/norm; } void State::setMoleFractions_NoNorm(const doublereal* x) { - int k; m_mmw = dot(x, x + m_kk, m_molwts.begin()); doublereal rmmw = 1.0/m_mmw; - //for (k = 0; k != m_kk; ++k) { - // m_ym[k] = x[k]*rmmw; - //m_y[k] = m_ym[k] * m_molwts[k]; - //} - transform(x, x + m_kk, m_ym.begin(), timesConstant(rmmw)); + transform(x, x + m_kk, m_ym.begin(), timesConstant(rmmw)); transform(m_y.begin(), m_y.begin() + m_kk, m_molwts.begin(), m_y.begin(), multiplies()); } @@ -135,28 +128,37 @@ namespace Cantera { doublereal norm = 0.0, sum = 0.0; int k; //cblas_dcopy(m_kk, y, 1, m_y.begin(), 1); - for (k = 0; k != m_kk; ++k) { - norm += y[k]; - m_y[k] = y[k]; - } - //scale(y, y + m_kk, m_y.begin(), 1.0/norm); - scale(m_kk, 1.0/norm, m_y.begin()); + norm = accumulate(y, y + m_kk, 0.0); + copy(y, y + m_kk, m_y.begin()); + scale(y, y + m_kk, m_y.begin(), 1.0/norm); + // for (k = 0; k != m_kk; ++k) { + // norm += y[k]; + // m_y[k] = y[k]; + //} - for (k = 0; k != m_kk; ++k) { - m_ym[k] = m_y[k] * m_rmolwts[k]; - sum += m_ym[k]; - } + //scale(m_kk, 1.0/norm, m_y.begin()); + transform(m_y.begin(), m_y.begin() + m_kk, m_rmolwts.begin(), + m_ym.begin(), multiplies()); + sum = accumulate(m_ym.begin(), m_ym.begin() + m_kk, 0.0); + // for (k = 0; k != m_kk; ++k) { + // m_ym[k] = m_y[k] * m_rmolwts[k]; + // sum += m_ym[k]; + //} m_mmw = 1.0/sum; } void State::setMassFractions_NoNorm(const doublereal* y) { int k; doublereal sum = 0.0; - for (k = 0; k != m_kk; ++k) { - m_y[k] = y[k]; - m_ym[k] = m_y[k] * m_rmolwts[k]; - sum += m_ym[k]; - } + copy(y, y + m_kk, m_y.begin()); + transform(m_y.begin(), m_y.end(), m_rmolwts.begin(), m_ym.begin(), + multiplies()); + sum = accumulate(m_ym.begin(), m_ym.end(), 0.0); + //for (k = 0; k != m_kk; ++k) { + // m_y[k] = y[k]; + // m_ym[k] = m_y[k] * m_rmolwts[k]; + // sum += m_ym[k]; + //} m_mmw = 1.0/sum; } diff --git a/configure b/configure index 1203723d2..842d795e0 100755 --- a/configure +++ b/configure @@ -8840,7 +8840,7 @@ fi - ac_config_files="$ac_config_files Makefile Cantera/Makefile Cantera/src/Makefile Cantera/src/app/Makefile Cantera/src/base/Makefile Cantera/src/zeroD/Makefile Cantera/src/oneD/Makefile Cantera/src/converters/Makefile Cantera/src/transport/Makefile Cantera/src/thermo/Makefile Cantera/src/kinetics/Makefile Cantera/src/numerics/Makefile Cantera/src/equil/Makefile Cantera/clib/src/Makefile Cantera/fortran/src/Makefile Cantera/fortran/f77demos/f77demos.mak Cantera/fortran/f77demos/isentropic.dsp Cantera/matlab/Makefile Cantera/matlab/setup_matlab.py Cantera/matlab/setup_winmatlab.py Cantera/python/Makefile Cantera/python/setup.py Cantera/cxx/Makefile Cantera/cxx/src/Makefile Cantera/cxx/demos/Makefile Cantera/user/Makefile Cantera/python/src/Makefile ext/lapack/Makefile ext/blas/Makefile ext/cvode/Makefile ext/math/Makefile ext/recipes/Makefile ext/tpx/Makefile ext/Makefile ext/f2c_libs/Makefile ext/f2c_blas/Makefile ext/f2c_lapack/Makefile ext/f2c_math/Makefile examples/Makefile examples/cxx/Makefile tools/Makefile tools/doc/Cantera.cfg tools/doc/Makefile tools/src/Makefile tools/src/sample.mak tools/src/finish_install.py tools/src/package4mac tools/templates/f77/demo.mak tools/templates/f90/demo.mak tools/templates/cxx/demo.mak tools/testtools/Makefile data/inputs/Makefile test_problems/Makefile test_problems/cxx_ex/Makefile test_problems/silane_equil/Makefile test_problems/surfkin/Makefile test_problems/diamondSurf/Makefile test_problems/ChemEquil_gri_matrix/Makefile test_problems/ChemEquil_gri_pairs/Makefile test_problems/ChemEquil_ionizedGas/Makefile test_problems/ChemEquil_red1/Makefile test_problems/fracCoeff/Makefile test_problems/negATest/Makefile test_problems/ck2cti_test/Makefile test_problems/ck2cti_test/runtest test_problems/min_python/Makefile test_problems/min_python/minDiamond/Makefile test_problems/min_python/negATest/Makefile test_problems/pureFluidTest/Makefile test_problems/python/Makefile test_problems/cathermo/Makefile test_problems/cathermo/issp/Makefile test_problems/cathermo/ims/Makefile test_problems/cathermo/stoichSubSSTP/Makefile test_problems/cathermo/testIAPWS/Makefile test_problems/cathermo/testIAPWSPres/Makefile test_problems/cathermo/testIAPWSTripP/Makefile test_problems/cathermo/testWaterPDSS/Makefile test_problems/cathermo/testWaterTP/Makefile test_problems/cathermo/HMW_test_1/Makefile test_problems/cathermo/HMW_test_3/Makefile test_problems/cathermo/HMW_graph_GvT/Makefile test_problems/cathermo/HMW_graph_GvI/Makefile test_problems/cathermo/HMW_graph_HvT/Makefile test_problems/cathermo/HMW_graph_CpvT/Makefile test_problems/cathermo/HMW_graph_VvT/Makefile test_problems/cathermo/DH_graph_1/Makefile test_problems/cathermo/DH_graph_acommon/Makefile test_problems/cathermo/DH_graph_NM/Makefile test_problems/cathermo/DH_graph_Pitzer/Makefile test_problems/cathermo/DH_graph_bdotak/Makefile bin/install_tsc" + ac_config_files="$ac_config_files Makefile Cantera/Makefile Cantera/src/Makefile Cantera/src/base/Makefile Cantera/src/zeroD/Makefile Cantera/src/oneD/Makefile Cantera/src/converters/Makefile Cantera/src/transport/Makefile Cantera/src/thermo/Makefile Cantera/src/kinetics/Makefile Cantera/src/numerics/Makefile Cantera/src/equil/Makefile Cantera/clib/src/Makefile Cantera/fortran/src/Makefile Cantera/fortran/f77demos/f77demos.mak Cantera/fortran/f77demos/isentropic.dsp Cantera/matlab/Makefile Cantera/matlab/setup_matlab.py Cantera/matlab/setup_winmatlab.py Cantera/python/Makefile Cantera/python/setup.py Cantera/cxx/Makefile Cantera/cxx/src/Makefile Cantera/cxx/demos/Makefile Cantera/user/Makefile Cantera/python/src/Makefile ext/lapack/Makefile ext/blas/Makefile ext/cvode/Makefile ext/math/Makefile ext/recipes/Makefile ext/tpx/Makefile ext/Makefile ext/f2c_libs/Makefile ext/f2c_blas/Makefile ext/f2c_lapack/Makefile ext/f2c_math/Makefile examples/Makefile examples/cxx/Makefile tools/Makefile tools/doc/Cantera.cfg tools/doc/Makefile tools/src/Makefile tools/src/sample.mak tools/src/finish_install.py tools/src/package4mac tools/templates/f77/demo.mak tools/templates/f90/demo.mak tools/templates/cxx/demo.mak tools/testtools/Makefile data/inputs/Makefile test_problems/Makefile test_problems/cxx_ex/Makefile test_problems/silane_equil/Makefile test_problems/surfkin/Makefile test_problems/diamondSurf/Makefile test_problems/ChemEquil_gri_matrix/Makefile test_problems/ChemEquil_gri_pairs/Makefile test_problems/ChemEquil_ionizedGas/Makefile test_problems/ChemEquil_red1/Makefile test_problems/fracCoeff/Makefile test_problems/negATest/Makefile test_problems/ck2cti_test/Makefile test_problems/ck2cti_test/runtest test_problems/min_python/Makefile test_problems/min_python/minDiamond/Makefile test_problems/min_python/negATest/Makefile test_problems/pureFluidTest/Makefile test_problems/python/Makefile test_problems/cathermo/Makefile test_problems/cathermo/issp/Makefile test_problems/cathermo/ims/Makefile test_problems/cathermo/stoichSubSSTP/Makefile test_problems/cathermo/testIAPWS/Makefile test_problems/cathermo/testIAPWSPres/Makefile test_problems/cathermo/testIAPWSTripP/Makefile test_problems/cathermo/testWaterPDSS/Makefile test_problems/cathermo/testWaterTP/Makefile test_problems/cathermo/HMW_test_1/Makefile test_problems/cathermo/HMW_test_3/Makefile test_problems/cathermo/HMW_graph_GvT/Makefile test_problems/cathermo/HMW_graph_GvI/Makefile test_problems/cathermo/HMW_graph_HvT/Makefile test_problems/cathermo/HMW_graph_CpvT/Makefile test_problems/cathermo/HMW_graph_VvT/Makefile test_problems/cathermo/DH_graph_1/Makefile test_problems/cathermo/DH_graph_acommon/Makefile test_problems/cathermo/DH_graph_NM/Makefile test_problems/cathermo/DH_graph_Pitzer/Makefile test_problems/cathermo/DH_graph_bdotak/Makefile bin/install_tsc" test "x$prefix" = xNONE && prefix=$ac_default_prefix @@ -9316,7 +9316,6 @@ do "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "Cantera/Makefile" ) CONFIG_FILES="$CONFIG_FILES Cantera/Makefile" ;; "Cantera/src/Makefile" ) CONFIG_FILES="$CONFIG_FILES Cantera/src/Makefile" ;; - "Cantera/src/app/Makefile" ) CONFIG_FILES="$CONFIG_FILES Cantera/src/app/Makefile" ;; "Cantera/src/base/Makefile" ) CONFIG_FILES="$CONFIG_FILES Cantera/src/base/Makefile" ;; "Cantera/src/zeroD/Makefile" ) CONFIG_FILES="$CONFIG_FILES Cantera/src/zeroD/Makefile" ;; "Cantera/src/oneD/Makefile" ) CONFIG_FILES="$CONFIG_FILES Cantera/src/oneD/Makefile" ;; diff --git a/configure.in b/configure.in index 47a377854..5a06e1c29 100755 --- a/configure.in +++ b/configure.in @@ -1386,7 +1386,6 @@ dnl Checks for library functions. AC_OUTPUT(Makefile \ Cantera/Makefile \ Cantera/src/Makefile \ - Cantera/src/app/Makefile \ Cantera/src/base/Makefile \ Cantera/src/zeroD/Makefile \ Cantera/src/oneD/Makefile \ diff --git a/ext/f2c_libs/arith.h b/ext/f2c_libs/arith.h index 508eb414f..9841db38a 100644 --- a/ext/f2c_libs/arith.h +++ b/ext/f2c_libs/arith.h @@ -1,4 +1,3 @@ -#define IEEE_MC68k -#define Arith_Kind_ASL 2 -#define Double_Align +#define IEEE_8087 +#define Arith_Kind_ASL 1 #define NANCHECK diff --git a/preconfig b/preconfig index 729aa61e9..06fe97bf3 100755 --- a/preconfig +++ b/preconfig @@ -359,7 +359,7 @@ SHARED=${SHARED:="-dynamic"} # if you don't have it. This is turned off by default, in which case # boost is not required to build Cantera. -BUILD_THREAD_SAFE=${BUILD_THREAD_SAFE:="n"} +BUILD_THREAD_SAFE=${BUILD_THREAD_SAFE:="y"} # where boost header and library files may be found BOOST_INC_DIR=${BOOST_INC_DIR:="/usr/local/include/boost-1_34"} diff --git a/tools/src/Makefile.in b/tools/src/Makefile.in index f00ac0aab..9829595ba 100755 --- a/tools/src/Makefile.in +++ b/tools/src/Makefile.in @@ -26,7 +26,7 @@ exes = $(progs) endif .cpp.o: - @CXX@ -c $< @DEFS@ $(INCDIR)base $(INCDIR)converters @CXXFLAGS@ $(CXX_FLAGS) + @CXX@ -c $< @DEFS@ $(INCDIR)base $(INCDIR)converters @CXX_INCLUDES@ @CXXFLAGS@ $(CXX_FLAGS) all: $(exes) @@ -35,7 +35,7 @@ ck: $(BINDIR)/ck2cti $(BINDIR)/ck2cti: ck2cti.o $(CONVLIB_DEP) $(RM) $(BINDIR)/ck2cti @CXX@ -o $(BINDIR)/ck2cti ck2cti.o $(LCXX_FLAGS) \ - -lconverters -lctbase -ltpx -lctcxx $(LCXX_END_LIBS) + -lconverters -lctbase -ltpx -lctcxx $(LOCAL_LIBS) $(LCXX_END_LIBS) $(BINDIR)/cti2ctml: cti2ctml.o $(RM) $(BINDIR)/cti2ctml @@ -45,7 +45,7 @@ $(BINDIR)/cti2ctml: cti2ctml.o $(BINDIR)/fixtext: fixtext.o $(RM) $(BINDIR)/fixtext @CXX@ -o $(BINDIR)/fixtext fixtext.o $(LCXX_FLAGS) \ - $(LCXX_END_LIBS) + $(LOCAL_LIBS) $(LCXX_END_LIBS) $(CONVLIB_DEP): cd ../../Cantera/src/converters; @MAKE@