Merge branch 'scons' into 'trunk'
Conflicts: Cantera/Makefile.in Cantera/clib/src/clib_defs.h Cantera/clib/src/ctreactor.cpp Cantera/clib/src/ctstagn.cpp Cantera/clib/src/ctstagn.h Cantera/cxx/Makefile.in Cantera/cxx/demos/combustor/combustor.cpp Cantera/cxx/demos/flamespeed/flamespeed.cpp Cantera/cxx/demos/kinetics1/example_utils.h Cantera/cxx/demos/kinetics1/kinetics1.cpp Cantera/cxx/include/Cantera.h Cantera/cxx/include/Cantera.mak.in Cantera/cxx/include/Cantera_bt.mak.in Cantera/cxx/include/Edge.h Cantera/cxx/include/GRI30.h Cantera/cxx/include/Interface.h Cantera/cxx/include/zerodim.h Cantera/fortran/f77demos/Makefile.in Cantera/fortran/src/Makefile.in Cantera/fortran/src/fct.cpp Cantera/fortran/src/fctxml.cpp Cantera/fortran/src/flib_defs.h Cantera/matlab/Makefile.in Cantera/matlab/cantera/Contents.m Cantera/matlab/setup_winmatlab.py Cantera/matlab/src/ctfunctions.cpp Cantera/matlab/src/ctmatutils.h Cantera/matlab/src/mixturemethods.cpp Cantera/matlab/src/mllogger.h Cantera/matlab/src/phasemethods.cpp Cantera/matlab/src/reactormethods.cpp Cantera/matlab/src/reactornetmethods.cpp Cantera/matlab/src/thermomethods.cpp Cantera/matlab/src/wallmethods.cpp Cantera/matlab/src/xmlmethods.cpp Cantera/python/Cantera/Edge.py Cantera/python/Cantera/Interface.py Cantera/python/Cantera/Phase.py Cantera/python/Cantera/importFromFile.py Cantera/python/Makefile.in Cantera/python/ctml_writer.py Cantera/python/setup.py.in Cantera/python/src/Makefile.in Cantera/python/src/ctkinetics_methods.cpp Cantera/python/src/ctonedim_methods.cpp Cantera/python/src/pylogger.h Cantera/src/Makefile.in Cantera/src/base/config.h.in Cantera/src/base/ctml.cpp Cantera/src/base/ctml.h Cantera/src/base/mdp_allo.cpp Cantera/src/base/mdp_allo.h Cantera/src/base/vec_functions.h Cantera/src/base/xml.cpp Cantera/src/base/xml.h Cantera/src/converters/CKParser.h Cantera/src/converters/Element.h Cantera/src/converters/Reaction.h Cantera/src/converters/RxnSpecies.h Cantera/src/converters/Species.h Cantera/src/converters/ckr_defs.h Cantera/src/converters/ckr_utils.h Cantera/src/equil/BasisOptimize.cpp Cantera/src/equil/Makefile.in Cantera/src/equil/MultiPhase.cpp Cantera/src/equil/vcs_MultiPhaseEquil.cpp Cantera/src/equil/vcs_VolPhase.cpp Cantera/src/equil/vcs_VolPhase.h Cantera/src/equil/vcs_linmaxc.cpp Cantera/src/equil/vcs_phaseStability.cpp Cantera/src/equil/vcs_rxnadj.cpp Cantera/src/equil/vcs_solve.cpp Cantera/src/equil/vcs_solve.h Cantera/src/equil/vcs_solve_TP.cpp Cantera/src/equil/vcs_util.cpp Cantera/src/equil/vcs_xerror.c Cantera/src/kinetics/GasKinetics.cpp Cantera/src/kinetics/GasKinetics.h Cantera/src/kinetics/InterfaceKinetics.cpp Cantera/src/kinetics/InterfaceKinetics.h Cantera/src/kinetics/Kinetics.h Cantera/src/kinetics/ReactionStoichMgr.h Cantera/src/kinetics/RxnRates.h Cantera/src/kinetics/StoichManager.h Cantera/src/numerics/BandMatrix.cpp Cantera/src/numerics/BandMatrix.h Cantera/src/numerics/DAE_Solver.h Cantera/src/numerics/DAE_solvers.cpp Cantera/src/numerics/DenseMatrix.cpp Cantera/src/numerics/DenseMatrix.h Cantera/src/numerics/FuncEval.h Cantera/src/numerics/IDA_Solver.cpp Cantera/src/numerics/IDA_Solver.h Cantera/src/numerics/Integrator.h Cantera/src/numerics/Makefile.in Cantera/src/numerics/NonlinearSolver.cpp Cantera/src/numerics/NonlinearSolver.h Cantera/src/numerics/ResidEval.h Cantera/src/numerics/ResidJacEval.cpp Cantera/src/numerics/ResidJacEval.h Cantera/src/numerics/SquareMatrix.cpp Cantera/src/numerics/SquareMatrix.h Cantera/src/numerics/ctlapack.h Cantera/src/oneD/Domain1D.h Cantera/src/oneD/OneDim.cpp Cantera/src/oneD/OneDim.h Cantera/src/oneD/Resid1D.h Cantera/src/oneD/Solid1D.cpp Cantera/src/oneD/Solid1D.h Cantera/src/oneD/StFlow.cpp Cantera/src/oneD/Surf1D.h Cantera/src/spectra/LineBroadener.h Cantera/src/thermo/Constituents.cpp Cantera/src/thermo/GibbsExcessVPSSTP.cpp Cantera/src/thermo/IonsFromNeutralVPSSTP.cpp Cantera/src/thermo/IonsFromNeutralVPSSTP.h Cantera/src/thermo/LatticePhase.cpp Cantera/src/thermo/LatticeSolidPhase.cpp Cantera/src/thermo/LatticeSolidPhase.h Cantera/src/thermo/Makefile.in Cantera/src/thermo/MargulesVPSSTP.cpp Cantera/src/thermo/MargulesVPSSTP.h Cantera/src/thermo/NasaThermo.h Cantera/src/thermo/PDSS_IonsFromNeutral.cpp Cantera/src/thermo/PDSS_IonsFromNeutral.h Cantera/src/thermo/PDSS_SSVol.cpp Cantera/src/thermo/Phase.cpp Cantera/src/thermo/PseudoBinaryVPSSTP.cpp Cantera/src/thermo/PseudoBinaryVPSSTP.h Cantera/src/thermo/PureFluidPhase.cpp Cantera/src/thermo/ShomateThermo.h Cantera/src/thermo/SimpleThermo.h Cantera/src/thermo/SpeciesThermoFactory.cpp Cantera/src/thermo/State.h Cantera/src/thermo/StoichSubstance.h Cantera/src/thermo/ThermoFactory.cpp Cantera/src/thermo/ThermoPhase.cpp Cantera/src/thermo/ThermoPhase.h Cantera/src/transport/AqueousTransport.cpp Cantera/src/transport/AqueousTransport.h Cantera/src/transport/DustyGasTransport.cpp Cantera/src/transport/DustyGasTransport.h Cantera/src/transport/L_matrix.h Cantera/src/transport/LiquidTransport.cpp Cantera/src/transport/LiquidTransport.h Cantera/src/transport/LiquidTransportData.h Cantera/src/transport/MMCollisionInt.cpp Cantera/src/transport/MMCollisionInt.h Cantera/src/transport/Makefile.in Cantera/src/transport/MixTransport.cpp Cantera/src/transport/MixTransport.h Cantera/src/transport/MultiTransport.cpp Cantera/src/transport/MultiTransport.h Cantera/src/transport/SimpleTransport.cpp Cantera/src/transport/SimpleTransport.h Cantera/src/transport/SolidTransport.cpp Cantera/src/transport/SolidTransport.h Cantera/src/transport/TransportBase.h Cantera/src/transport/TransportFactory.cpp Cantera/src/transport/TransportFactory.h Cantera/src/transport/TransportParams.h Cantera/src/transport/WaterTransport.h Cantera/src/zeroD/FlowDevice.h Cantera/src/zeroD/Reactor.h Cantera/src/zeroD/ReactorBase.cpp Cantera/src/zeroD/ReactorBase.h Cantera/src/zeroD/ReactorNet.h Cantera/src/zeroD/Wall.h Cantera/user/Makefile.in License.rtf Makefile.in apps/bvp/stagnation.cpp configure configure.in data/transport/misc_tran.dat docs/Makefile.in docs/install_examples/README.txt docs/install_examples/cygwin_gcc434_dbg_f2c_numpy.sh docs/install_examples/linux_64_gcc424_dbg_python252_numpy docs/install_examples/linux_64_gcc424_opt_python252_numpy docs/install_examples/mac_gcc401_python251_numpy docs/python/.cvsignore ext/Makefile.in ext/blas/Makefile.in ext/cvode/Makefile.in ext/f2c_blas/Makefile.in ext/f2c_lapack/Makefile.in ext/f2c_math/Makefile.in ext/f2c_math/xersve.c ext/f2c_recipes/Makefile.in ext/lapack/Makefile.in ext/math/Makefile.in ext/recipes/Makefile.in ext/tpx/CarbonDioxide.cpp ext/tpx/Makefile.in ext/tpx/Sub.cpp ext/tpx/utils.cpp preconfig test_problems/ChemEquil_gri_matrix/gri_matrix.cpp test_problems/ChemEquil_gri_pairs/gri_pairs.cpp test_problems/ChemEquil_ionizedGas/ionizedGasEquil.cpp test_problems/ChemEquil_ionizedGas/runtest test_problems/ChemEquil_red1/basopt_red1.cpp test_problems/CpJump/CpJump.cpp test_problems/Makefile.in test_problems/VCSnonideal/Makefile.in test_problems/VCSnonideal/NaCl_equil/HMW_NaCl.xml test_problems/VCSnonideal/NaCl_equil/nacl_equil.cpp test_problems/VPsilane_test/silane_equil.cpp test_problems/cathermo/DH_graph_1/DH_graph_1.cpp test_problems/cathermo/DH_graph_NM/DH_graph_1.cpp test_problems/cathermo/DH_graph_Pitzer/DH_graph_1.cpp test_problems/cathermo/DH_graph_acommon/DH_graph_1.cpp test_problems/cathermo/DH_graph_bdotak/DH_graph_1.cpp test_problems/cathermo/HMW_dupl_test/HMW_NaCl_sp1977_alt.xml test_problems/cathermo/HMW_dupl_test/HMW_dupl_test.cpp test_problems/cathermo/HMW_dupl_test/TemperatureTable.h test_problems/cathermo/HMW_dupl_test/sortAlgorithms.cpp test_problems/cathermo/HMW_dupl_test/sortAlgorithms.h test_problems/cathermo/HMW_graph_CpvT/HMW_NaCl_sp1977_alt.xml test_problems/cathermo/HMW_graph_CpvT/HMW_graph_CpvT.cpp test_problems/cathermo/HMW_graph_CpvT/TemperatureTable.h test_problems/cathermo/HMW_graph_CpvT/sortAlgorithms.cpp test_problems/cathermo/HMW_graph_CpvT/sortAlgorithms.h test_problems/cathermo/HMW_graph_GvI/HMW_NaCl.xml test_problems/cathermo/HMW_graph_GvI/HMW_graph_GvI.cpp test_problems/cathermo/HMW_graph_GvI/TemperatureTable.h test_problems/cathermo/HMW_graph_GvI/sortAlgorithms.cpp test_problems/cathermo/HMW_graph_GvI/sortAlgorithms.h test_problems/cathermo/HMW_graph_GvT/HMW_NaCl_sp1977_alt.xml test_problems/cathermo/HMW_graph_GvT/HMW_graph_GvT.cpp test_problems/cathermo/HMW_graph_GvT/TemperatureTable.h test_problems/cathermo/HMW_graph_GvT/sortAlgorithms.cpp test_problems/cathermo/HMW_graph_GvT/sortAlgorithms.h test_problems/cathermo/HMW_graph_HvT/HMW_NaCl_sp1977_alt.xml test_problems/cathermo/HMW_graph_HvT/HMW_graph_HvT.cpp test_problems/cathermo/HMW_graph_HvT/TemperatureTable.h test_problems/cathermo/HMW_graph_HvT/sortAlgorithms.cpp test_problems/cathermo/HMW_graph_HvT/sortAlgorithms.h test_problems/cathermo/HMW_graph_VvT/HMW_NaCl_sp1977_alt.xml test_problems/cathermo/HMW_graph_VvT/HMW_graph_VvT.cpp test_problems/cathermo/HMW_graph_VvT/TemperatureTable.h test_problems/cathermo/HMW_graph_VvT/sortAlgorithms.cpp test_problems/cathermo/HMW_graph_VvT/sortAlgorithms.h test_problems/cathermo/HMW_test_1/HMW_test_1.cpp test_problems/cathermo/HMW_test_3/HMW_test_3.cpp test_problems/cathermo/Makefile.in test_problems/cathermo/VPissp/ISSPTester.cpp test_problems/cathermo/ims/IMSTester.cpp test_problems/cathermo/issp/ISSPTester.cpp test_problems/cathermo/stoichSubSSTP/TemperatureTable.h test_problems/cathermo/stoichSubSSTP/sortAlgorithms.cpp test_problems/cathermo/stoichSubSSTP/sortAlgorithms.h test_problems/cathermo/stoichSubSSTP/stoichSubSSTP.cpp test_problems/cathermo/testIAPWS/testIAPWSphi.cpp test_problems/cathermo/testWaterPDSS/testWaterPDSS.cpp test_problems/cathermo/testWaterTP/testWaterSSTP.cpp test_problems/cathermo/wtWater/wtWater.cpp test_problems/ck2cti_test/Makefile.in test_problems/ck2cti_test/runtest.in test_problems/cxx_ex/Makefile.in test_problems/cxx_ex/equil_example1.cpp test_problems/cxx_ex/example_utils.h test_problems/cxx_ex/kinetics_example1.cpp test_problems/cxx_ex/kinetics_example2.cpp test_problems/cxx_ex/kinetics_example3.cpp test_problems/cxx_ex/runtest test_problems/cxx_ex/rxnpath_example1.cpp test_problems/cxx_ex/transport_example1.cpp test_problems/cxx_ex/transport_example2.cpp test_problems/min_python/Makefile.in test_problems/min_python/minDiamond/Makefile.in test_problems/min_python/negATest/negATest.cpp test_problems/mixGasTransport/runtest test_problems/nasa9_reader/Makefile.in test_problems/nasa9_reader/runtest.in test_problems/negATest/negATest.cpp test_problems/printUtilUnitTest/pUtest.cpp test_problems/pureFluidTest/testPureWater.cpp test_problems/silane_equil/silane_equil.cpp test_problems/surfkin/surfdemo.cpp tools/Makefile.in tools/bin/cvs2cl.pl tools/src/ck2cti.cpp tools/templates/f77/demo_ftnlib.cpp win32/vc7/Sundials/sundials/sundials_config.h win32/vc9/Sundials/SUNDIALS_SHARED/sundials_config.h winconfig.h
This commit is contained in:
commit
7c171631af
1306 changed files with 40851 additions and 228978 deletions
20
.cvsignore
20
.cvsignore
|
|
@ -1,20 +0,0 @@
|
|||
Makefile
|
||||
configure.sol
|
||||
configure.linux
|
||||
build
|
||||
win32_old
|
||||
configure.vc++
|
||||
configure.my_vc++
|
||||
config.h
|
||||
set_cant_env
|
||||
autom4te.cache
|
||||
config.log
|
||||
config.status
|
||||
linux.my.32
|
||||
.DS_Store
|
||||
win32
|
||||
prepreconfig*
|
||||
CMakeCache.txt
|
||||
CMakeFiles
|
||||
mt.mod
|
||||
cygwin.my
|
||||
31
.gitignore
vendored
Normal file
31
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
*~
|
||||
*.o
|
||||
*.so
|
||||
*.os
|
||||
*.pyc
|
||||
*.obj
|
||||
*.exe.manifest
|
||||
build
|
||||
stage
|
||||
.sconsign.dblite
|
||||
.sconf_temp
|
||||
cantera.conf
|
||||
config.log
|
||||
*.lib
|
||||
*.exp
|
||||
*.manifest
|
||||
*.pdb
|
||||
*.ilk
|
||||
*.suo
|
||||
*.dll
|
||||
*.msi
|
||||
*.mex*
|
||||
.cproject
|
||||
.project
|
||||
.pydevproject
|
||||
.settings
|
||||
Cantera/matlab/build_cantera.m
|
||||
*.gcda
|
||||
*.gcno
|
||||
coverage
|
||||
coverage.info
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
PROJECT (Cantera)
|
||||
|
||||
#----------------------------
|
||||
# user-configurable settings
|
||||
#----------------------------
|
||||
INCLUDE (config_cantera.cmake)
|
||||
|
||||
|
||||
#----------------------------
|
||||
# Python
|
||||
#----------------------------
|
||||
#if (PYTHON_CMD STREQUAL "default")
|
||||
INCLUDE( FindPythonInterp )
|
||||
INCLUDE( FindPythonLibs)
|
||||
SET( PYTHON_EXE ${PYTHON_EXECUTABLE} )
|
||||
#else (PYTHON_CMD STREQUAL "default")
|
||||
# SET( PYTHON_EXE ${PYTHON_CMD} )
|
||||
#endif (PYTHON_CMD STREQUAL "default")
|
||||
|
||||
|
||||
#---------------------------------------
|
||||
# configuration
|
||||
#---------------------------------------
|
||||
CONFIGURE_FILE (
|
||||
${PROJECT_SOURCE_DIR}/config.h_cmake.in
|
||||
${PROJECT_BINARY_DIR}/config.h )
|
||||
|
||||
|
||||
#----------------------------------------
|
||||
# output paths
|
||||
#----------------------------------------
|
||||
SET (LIBRARY_OUTPUT_PATH
|
||||
${PROJECT_BINARY_DIR}/build/lib/${CMAKE_SYSTEM_PROCESSOR}-${CMAKE_SYSTEM_VERSION} CACHE PATH "Single directory for all libraries"
|
||||
)
|
||||
|
||||
SET (EXECUTABLE_OUTPUT_PATH
|
||||
${PROJECT_BINARY_DIR}/build/bin/${CMAKE_SYSTEM_PROCESSOR}-${CMAKE_SYSTEM_VERSION} CACHE PATH "Single directory for all executables"
|
||||
)
|
||||
|
||||
MARK_AS_ADVANCED (
|
||||
LIBRARY_OUTPUT_PATH
|
||||
EXECUTABLE_OUTPUT_PATH
|
||||
)
|
||||
|
||||
INSTALL_FILES(/include/cantera/kernel FILES config.h)
|
||||
INSTALL_FILES(/include/cantera FILES config.h)
|
||||
ADD_SUBDIRECTORY (ext)
|
||||
ADD_SUBDIRECTORY (Cantera)
|
||||
|
||||
SET(CMAKE_INSTALL_PREFIX /Applications/Cantera )
|
||||
INSTALL_FILES ( /include/cantera .h ${CANTERA_CXX_HEADERS} )
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
#-------------------------------------------------
|
||||
# Build the kernel
|
||||
#-------------------------------------------------
|
||||
add_subdirectory(src)
|
||||
|
||||
#-------------------------------------------------
|
||||
# Build clib
|
||||
#-------------------------------------------------
|
||||
add_subdirectory(clib)
|
||||
|
||||
#-------------------------------------------------
|
||||
# Build C++ user interface
|
||||
#-------------------------------------------------
|
||||
add_subdirectory(cxx)
|
||||
|
||||
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
#/bin/sh
|
||||
###############################################################
|
||||
# $Author$
|
||||
# $Date$
|
||||
# $Revision$
|
||||
#
|
||||
# Copyright 2001 California Institute of Technology
|
||||
# See file License.txt for licensing information
|
||||
#
|
||||
###############################################################
|
||||
|
||||
build_f90=@BUILD_F90@
|
||||
build_python=@BUILD_PYTHON@
|
||||
build_matlab = @BUILD_MATLAB@
|
||||
|
||||
all:
|
||||
cd src; @MAKE@
|
||||
cd cxx; @MAKE@
|
||||
cd clib/src; @MAKE@
|
||||
ifeq ($(build_f90),1)
|
||||
cd fortran/src; @MAKE@
|
||||
endif
|
||||
cd user; @MAKE@
|
||||
|
||||
clean:
|
||||
cd src; @MAKE@ clean
|
||||
cd cxx; @MAKE@ clean
|
||||
cd clib/src; $(RM) .depends ; @MAKE@ clean
|
||||
cd python; @MAKE@ clean
|
||||
ifeq ($(build_f90),1)
|
||||
cd fortran/src; $(RM) .depends ; @MAKE@ clean
|
||||
endif
|
||||
cd user; $(RM) .depends ; @MAKE@ clean
|
||||
|
||||
depends:
|
||||
cd src; @MAKE@ depends
|
||||
cd cxx/src; @MAKE@ depends
|
||||
cd clib/src; @MAKE@ depends
|
||||
ifeq ($(build_f90),1)
|
||||
cd fortran/src; @MAKE@ depends
|
||||
endif
|
||||
ifeq ($(build_matlab),1)
|
||||
cd matlab; @MAKE@ depends
|
||||
endif
|
||||
cd user; @MAKE@ depends
|
||||
|
||||
install:
|
||||
cd src; @MAKE@ install
|
||||
cd cxx/src; @MAKE@ install
|
||||
cd clib/src; @MAKE@ install
|
||||
ifeq ($(build_f90),1)
|
||||
cd fortran/src; @MAKE@ install
|
||||
endif
|
||||
cd user; @MAKE@ install
|
||||
|
||||
# end of file
|
||||
|
||||
|
|
@ -1 +0,0 @@
|
|||
add_subdirectory(src)
|
||||
20
Cantera/clib/SConscript
Normal file
20
Cantera/clib/SConscript
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
from buildutils import *
|
||||
|
||||
Import('env', 'buildTargets', 'installTargets')
|
||||
|
||||
localenv = env.Clone()
|
||||
|
||||
if localenv['OS'] == 'Windows':
|
||||
lib = localenv.SharedLibrary(pjoin('../../lib', 'clib'),
|
||||
source=mglob(localenv, 'src', 'cpp'),
|
||||
LIBS=env['cantera_libs'])
|
||||
env['clib_shared'] = lib
|
||||
inst = localenv.Install('$inst_libdir', lib)
|
||||
buildTargets.extend(lib)
|
||||
installTargets.extend(inst)
|
||||
else:
|
||||
static_lib = localenv.Library(pjoin('../../lib', 'clib'),
|
||||
source=mglob(localenv, 'src', 'cpp'))
|
||||
inst_static = localenv.Install('$inst_libdir', static_lib)
|
||||
buildTargets.extend(static_lib)
|
||||
installTargets.extend(inst_static)
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
Makefile
|
||||
.depends
|
||||
SunWS_cache
|
||||
*.d
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
SET (CLIB_SRCS ct.cpp Storage.cpp ctsurf.cpp ctrpath.cpp ctreactor.cpp
|
||||
ctfunc.cpp ctxml.cpp ctonedim.cpp ctmultiphase.cpp )
|
||||
|
||||
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR})
|
||||
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/Cantera/src/base)
|
||||
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/Cantera/src/thermo)
|
||||
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/Cantera/src/equil)
|
||||
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/Cantera/src/numerics)
|
||||
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/Cantera/src/kinetics)
|
||||
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/Cantera/src/transport)
|
||||
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/Cantera/src/converters)
|
||||
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/Cantera/src/zeroD)
|
||||
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/Cantera/src/oneD)
|
||||
|
||||
# INCLUDE_DIRECTORIES (${PROJECT_BINARY_DIR}/build/include/cantera)
|
||||
|
||||
ADD_LIBRARY ( clib ${CLIB_SRCS} )
|
||||
|
||||
TARGET_LINK_LIBRARIES (clib oneD zeroD equil kinetics thermo ctbase)
|
||||
|
||||
SET (CLIB_H ct.h Storage.h ctsurf.h ctrpath.h ctreactor.h
|
||||
ctfunc.h ctxml.h ctonedim.h ctmultiphase.h )
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,17 +1,12 @@
|
|||
/**
|
||||
* @file Cabinet.h
|
||||
*/
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CT_CABINET_H
|
||||
#define CT_CABINET_H
|
||||
|
||||
#include <vector>
|
||||
#include "stringUtils.h"
|
||||
#include "config.h"
|
||||
#include "kernel/stringUtils.h"
|
||||
#include "kernel/config.h"
|
||||
|
||||
/**
|
||||
* Template for classes to hold pointers to objects. The Cabinet<M>
|
||||
|
|
@ -164,11 +159,11 @@ public:
|
|||
/**
|
||||
* Return a pointer to object n.
|
||||
*/
|
||||
M* item(int n) {
|
||||
if (n >= 0 && n < int(__table.size()))
|
||||
M* item(size_t n) {
|
||||
if (n < __table.size())
|
||||
return __table[n];
|
||||
else {
|
||||
throw Cantera::CanteraError("item","index out of range"+Cantera::int2str(n));
|
||||
throw Cantera::CanteraError("item","index out of range"+Cantera::int2str(int(n)));
|
||||
//return __table[0];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,120 +0,0 @@
|
|||
#/bin/sh
|
||||
###############################################################
|
||||
# $Author$
|
||||
# $Date$
|
||||
# $Revision$
|
||||
#
|
||||
# Copyright 2001 California Institute of Technology
|
||||
#
|
||||
###############################################################
|
||||
|
||||
|
||||
.SUFFIXES :
|
||||
.SUFFIXES : .cpp .d .o
|
||||
|
||||
INSTALL_TSC = ../../../bin/install_tsc
|
||||
do_ranlib = @DO_RANLIB@
|
||||
|
||||
PURIFY=@PURIFY@
|
||||
|
||||
PIC_FLAG=@PIC@
|
||||
|
||||
CXX_FLAGS = @CXXFLAGS@ $(CXX_OPT) $(PIC_FLAG)
|
||||
|
||||
OBJS = ct.o Storage.o ctsurf.o ctrpath.o \
|
||||
ctreactor.o ctfunc.o ctxml.o ctonedim.o ctmultiphase.o
|
||||
CLIB_H= Cabinet.h ctreactor.h clib_defs.h ctfunc.h \
|
||||
ctnum.h ctsurf.h ct.h ctrpath.h Storage.h \
|
||||
ctbdry.h ctonedim.h ctxml.h ctmultiphase.h ctstagn.h
|
||||
|
||||
DEPENDS = $(OBJS:.o=.d)
|
||||
|
||||
# Fortran libraries
|
||||
FORT_LIBS = @FLIBS@
|
||||
|
||||
shared_ctlib = @SHARED_CTLIB@
|
||||
|
||||
# the C++ compiler
|
||||
CXX = @CXX@
|
||||
|
||||
# external libraries
|
||||
EXT_LIBS = -lzeroD -loneD @LOCAL_LIBS@
|
||||
|
||||
# the directory where the Cantera libraries are located
|
||||
CANTERA_LIBDIR=@buildlib@
|
||||
# ../../../lib
|
||||
LIB_DEPS = $(CANTERA_LIBDIR)/libctbase.a \
|
||||
$(CANTERA_LIBDIR)/libequil.a \
|
||||
$(CANTERA_LIBDIR)/libtransport.a \
|
||||
$(CANTERA_LIBDIR)/libthermo.a \
|
||||
$(CANTERA_LIBDIR)/libctnumerics.a \
|
||||
$(CANTERA_LIBDIR)/libzeroD.a \
|
||||
$(CANTERA_LIBDIR)/liboneD.a
|
||||
|
||||
# the directory where Cantera include files may be found.
|
||||
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@
|
||||
|
||||
# how to compile C++ source files to object files
|
||||
.@CXX_EXT@.@OBJ_EXT@:
|
||||
$(PURIFY) $(CXX) -c $< $(CXX_INCLUDES) $(CXX_FLAGS)
|
||||
|
||||
%.d: Makefile %.o
|
||||
@CXX_DEPENDS@ $(CXX_FLAGS) $(CXX_INCLUDES) $*.cpp > $*.d
|
||||
|
||||
LIB_NAME=lib@CT_SHARED_LIB@
|
||||
|
||||
ifeq ($(shared_ctlib),1)
|
||||
CTLIB = @buildlib@/$(LIB_NAME)@SO@
|
||||
else
|
||||
CTLIB = @buildlib@/$(LIB_NAME).a
|
||||
endif
|
||||
|
||||
all: $(CTLIB) .depends
|
||||
|
||||
$(CTLIB): $(OBJS) $(LIB_DEPS)
|
||||
$(RM) $(CTLIB)
|
||||
ifeq ($(shared_ctlib),1)
|
||||
$(PURIFY) $(CXX) -o $(CTLIB) $(OBJS) $(LCXX_FLAGS)\
|
||||
@SHARED@ $(LINK_OPTIONS) \
|
||||
$(EXT_LIBS) @LIBS@ $(FORT_LIBS)
|
||||
else
|
||||
@ARCHIVE@ $(CTLIB) $(OBJS)
|
||||
ifeq ($(do_ranlib),1)
|
||||
@RANLIB@ $(CTLIB)
|
||||
endif
|
||||
endif
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJS) *.d $(CTLIB) .depends
|
||||
(if test -d SunWS_cache ; then \
|
||||
$(RM) -rf SunWS_cache ; \
|
||||
fi )
|
||||
|
||||
|
||||
install:
|
||||
@INSTALL@ -d @ct_libdir@
|
||||
@INSTALL@ -c -m 644 $(CTLIB) @ct_libdir@
|
||||
ifeq ($(do_ranlib),1)
|
||||
ifeq ($(shared_ctlib),0)
|
||||
@RANLIB@ @ct_libdir@/$(LIB_NAME).a
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
win-install:
|
||||
@INSTALL@ -c ../../../lib/clib.lib @prefix@/lib/cantera
|
||||
|
||||
depends:
|
||||
@MAKE@ .depends
|
||||
|
||||
.depends: $(DEPENDS)
|
||||
cat *.d > .depends
|
||||
|
||||
$(OBJS): Makefile
|
||||
|
||||
ifeq ($(wildcard .depends), .depends)
|
||||
include .depends
|
||||
endif
|
||||
|
|
@ -1,15 +1,9 @@
|
|||
/**
|
||||
* @file Storage.cpp
|
||||
*/
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
|
||||
// Cantera includes
|
||||
#include "Kinetics.h"
|
||||
#include "TransportFactory.h"
|
||||
#include "kernel/Kinetics.h"
|
||||
#include "kernel/TransportFactory.h"
|
||||
|
||||
#include "Storage.h"
|
||||
|
||||
|
|
@ -25,11 +19,11 @@ Storage::Storage() {
|
|||
|
||||
Storage::~Storage() { clear(); }
|
||||
|
||||
int Storage::addThermo(thermo_t* th) {
|
||||
if (th->index() >= 0)
|
||||
size_t Storage::addThermo(thermo_t* th) {
|
||||
if (th->index() != npos)
|
||||
return th->index();
|
||||
__thtable.push_back(th);
|
||||
int n = static_cast<int>(__thtable.size()) - 1;
|
||||
size_t n = __thtable.size() - 1;
|
||||
th->setIndex(n);
|
||||
//string id = th->id();
|
||||
//if (__thmap.count(id) == 0) {
|
||||
|
|
@ -43,24 +37,24 @@ int Storage::addThermo(thermo_t* th) {
|
|||
return n;
|
||||
}
|
||||
|
||||
int Storage::nThermo() {
|
||||
return static_cast<int>(__thtable.size());
|
||||
size_t Storage::nThermo() {
|
||||
return __thtable.size();
|
||||
}
|
||||
|
||||
int Storage::addKinetics(Kinetics* kin) {
|
||||
if (kin->index() >= 0)
|
||||
size_t Storage::addKinetics(Kinetics* kin) {
|
||||
if (kin->index() != npos)
|
||||
return kin->index();
|
||||
__ktable.push_back(kin);
|
||||
int n = static_cast<int>(__ktable.size()) - 1;
|
||||
size_t n = __ktable.size() - 1;
|
||||
kin->setIndex(n);
|
||||
return n;
|
||||
}
|
||||
|
||||
int Storage::addTransport(Transport* tr) {
|
||||
if (tr->index() >= 0)
|
||||
size_t Storage::addTransport(Transport* tr) {
|
||||
if (tr->index() != npos)
|
||||
return tr->index();
|
||||
__trtable.push_back(tr);
|
||||
int n = static_cast<int>(__trtable.size()) - 1;
|
||||
size_t n = __trtable.size() - 1;
|
||||
tr->setIndex(n);
|
||||
return n;
|
||||
}
|
||||
|
|
@ -79,22 +73,22 @@ int Storage::addTransport(Transport* tr) {
|
|||
// }
|
||||
|
||||
int Storage::clear() {
|
||||
int i, n;
|
||||
n = static_cast<int>(__thtable.size());
|
||||
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 = static_cast<int>(__ktable.size());
|
||||
n = __ktable.size();
|
||||
for (i = 1; i < n; i++) {
|
||||
if (__ktable[i] != __ktable[0]) {
|
||||
delete __ktable[i];
|
||||
__ktable[i] = __ktable[0];
|
||||
}
|
||||
}
|
||||
n = static_cast<int>(__trtable.size());
|
||||
n = __trtable.size();
|
||||
for (i = 1; i < n; i++) {
|
||||
if (__trtable[i] != __trtable[0]) {
|
||||
delete __trtable[i];
|
||||
|
|
|
|||
|
|
@ -1,16 +1,12 @@
|
|||
/**
|
||||
* @file Storage.h
|
||||
*/
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef CTC_STORAGE_H
|
||||
#define CTC_STORAGE_H
|
||||
|
||||
// Cantera includes
|
||||
#include "Kinetics.h"
|
||||
#include "TransportBase.h"
|
||||
#include "kernel/Kinetics.h"
|
||||
#include "kernel/TransportBase.h"
|
||||
|
||||
#include "Cabinet.h"
|
||||
#include "clib_defs.h"
|
||||
|
|
@ -40,15 +36,15 @@ public:
|
|||
}
|
||||
|
||||
|
||||
int addThermo(Cantera::ThermoPhase* th);
|
||||
int addKinetics(Cantera::Kinetics* kin);
|
||||
int addTransport(Cantera::Transport* tr);
|
||||
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);
|
||||
int nThermo();
|
||||
size_t nThermo();
|
||||
static Storage* __storage;
|
||||
};
|
||||
|
||||
|
|
@ -60,7 +56,7 @@ inline Cantera::Kinetics* kin(int n) {
|
|||
return Storage::__storage->__ktable[n];
|
||||
}
|
||||
|
||||
inline Cantera::ThermoPhase* th(int n) {
|
||||
inline Cantera::ThermoPhase* th(size_t n) {
|
||||
return Storage::__storage->__thtable[n];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,16 +1,12 @@
|
|||
/**
|
||||
* @file clib_defs.h
|
||||
*/
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CTC_DEFS_H
|
||||
#define CTC_DEFS_H
|
||||
|
||||
#include "kernel/ct_defs.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
// Either build as a DLL under Windows or not.
|
||||
// the decision relies upon whether the NO_DLL_BUILD define is
|
||||
// set or not.
|
||||
|
|
@ -21,10 +17,6 @@
|
|||
#define DLL_IMPORT __declspec(dllimport)
|
||||
#define DLL_EXPORT __declspec(dllexport)
|
||||
#endif
|
||||
|
||||
#pragma warning(disable:4786)
|
||||
#pragma warning(disable:4267)
|
||||
#pragma warning(disable:4503)
|
||||
#else
|
||||
// On other platforms, we turn off the DLL macros.
|
||||
#define DLL_EXPORT
|
||||
|
|
|
|||
|
|
@ -8,35 +8,27 @@
|
|||
* pointers are passed to or from the calling application.
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
// turn off warnings under Windows
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
#pragma warning(disable:4503)
|
||||
#endif
|
||||
|
||||
#define CANTERA_USE_INTERNAL
|
||||
#include "ct.h"
|
||||
|
||||
// Cantera includes
|
||||
#include "equil.h"
|
||||
#include "KineticsFactory.h"
|
||||
#include "TransportFactory.h"
|
||||
#include "ctml.h"
|
||||
#include "importKinetics.h"
|
||||
#include "ThermoFactory.h"
|
||||
#include "ck2ct.h"
|
||||
#include "kernel/equil.h"
|
||||
#include "kernel/KineticsFactory.h"
|
||||
#include "kernel/TransportFactory.h"
|
||||
#include "kernel/ctml.h"
|
||||
#include "kernel/importKinetics.h"
|
||||
#include "kernel/ThermoFactory.h"
|
||||
#include "kernel/ck2ct.h"
|
||||
#include "Storage.h"
|
||||
#include "Cabinet.h"
|
||||
#include "InterfaceKinetics.h"
|
||||
#include "PureFluidPhase.h"
|
||||
#include "kernel/InterfaceKinetics.h"
|
||||
#include "kernel/PureFluidPhase.h"
|
||||
|
||||
|
||||
using namespace std;
|
||||
using namespace Cantera;
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
#include "windows.h"
|
||||
#endif
|
||||
|
||||
|
|
@ -92,7 +84,7 @@ static double pfprop(int n, int i, double v=0.0, double x=0.0) {
|
|||
#endif
|
||||
|
||||
|
||||
inline int nThermo() {
|
||||
inline size_t nThermo() {
|
||||
return Storage::storage()->nThermo();
|
||||
}
|
||||
|
||||
|
|
@ -105,7 +97,7 @@ namespace Cantera {
|
|||
*/
|
||||
extern "C" {
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
#ifndef NO_DLL_BUILD
|
||||
/*
|
||||
* The microsoft docs says we may need this in some
|
||||
|
|
@ -138,11 +130,11 @@ extern "C" {
|
|||
|
||||
//--------------- Phase ---------------------//
|
||||
|
||||
int DLL_EXPORT phase_nElements(int n) {
|
||||
size_t DLL_EXPORT phase_nElements(int n) {
|
||||
return ph(n)->nElements();
|
||||
}
|
||||
|
||||
int DLL_EXPORT phase_nSpecies(int n) {
|
||||
size_t DLL_EXPORT phase_nSpecies(int n) {
|
||||
return ph(n)->nSpecies();
|
||||
}
|
||||
|
||||
|
|
@ -182,17 +174,17 @@ extern "C" {
|
|||
return ph(n)->meanMolecularWeight();
|
||||
}
|
||||
|
||||
int DLL_EXPORT phase_elementIndex(int n, char* nm) {
|
||||
size_t DLL_EXPORT phase_elementIndex(int n, char* nm) {
|
||||
string elnm = string(nm);
|
||||
return ph(n)->elementIndex(elnm);
|
||||
}
|
||||
|
||||
int DLL_EXPORT phase_speciesIndex(int n, char* nm) {
|
||||
size_t DLL_EXPORT phase_speciesIndex(int n, char* nm) {
|
||||
string spnm = string(nm);
|
||||
return ph(n)->speciesIndex(spnm);
|
||||
}
|
||||
|
||||
int DLL_EXPORT phase_getMoleFractions(int n, int lenx, double* x) {
|
||||
int DLL_EXPORT phase_getMoleFractions(int n, size_t lenx, double* x) {
|
||||
ThermoPhase* p = ph(n);
|
||||
if (lenx >= p->nSpecies()) {
|
||||
p->getMoleFractions(x);
|
||||
|
|
@ -202,12 +194,12 @@ extern "C" {
|
|||
return -1;
|
||||
}
|
||||
|
||||
doublereal DLL_EXPORT phase_moleFraction(int n, int k) {
|
||||
doublereal DLL_EXPORT phase_moleFraction(int n, size_t k) {
|
||||
ThermoPhase* p = ph(n);
|
||||
return p->moleFraction(k);
|
||||
}
|
||||
|
||||
int DLL_EXPORT phase_getMassFractions(int n, int leny, double* y) {
|
||||
int DLL_EXPORT phase_getMassFractions(int n, size_t leny, double* y) {
|
||||
ThermoPhase* p = ph(n);
|
||||
if (leny >= p->nSpecies()) {
|
||||
p->getMassFractions(y);
|
||||
|
|
@ -217,12 +209,12 @@ extern "C" {
|
|||
return -1;
|
||||
}
|
||||
|
||||
doublereal DLL_EXPORT phase_massFraction(int n, int k) {
|
||||
doublereal DLL_EXPORT phase_massFraction(int n, size_t k) {
|
||||
ThermoPhase* p = ph(n);
|
||||
return p->massFraction(k);
|
||||
}
|
||||
|
||||
int DLL_EXPORT phase_setMoleFractions(int n, int lenx, double* x, int norm) {
|
||||
int DLL_EXPORT phase_setMoleFractions(int n, size_t lenx, double* x, int norm) {
|
||||
ThermoPhase* p = ph(n);
|
||||
if (lenx >= p->nSpecies()) {
|
||||
if (norm) p->setMoleFractions(x);
|
||||
|
|
@ -237,8 +229,8 @@ extern "C" {
|
|||
try {
|
||||
ThermoPhase* p = ph(n);
|
||||
compositionMap xx;
|
||||
int nsp = p->nSpecies();
|
||||
for (int n = 0; n < nsp; n++) {
|
||||
size_t nsp = p->nSpecies();
|
||||
for (size_t n = 0; n < nsp; n++) {
|
||||
xx[p->speciesName(n)] = -1;
|
||||
}
|
||||
parseCompString(string(x), xx);
|
||||
|
|
@ -249,7 +241,7 @@ extern "C" {
|
|||
//catch (...) {return ERR;}
|
||||
}
|
||||
|
||||
int DLL_EXPORT phase_setMassFractions(int n, int leny,
|
||||
int DLL_EXPORT phase_setMassFractions(int n, size_t leny,
|
||||
double* y, int norm) {
|
||||
ThermoPhase* p = ph(n);
|
||||
if (leny >= p->nSpecies()) {
|
||||
|
|
@ -265,8 +257,8 @@ extern "C" {
|
|||
try {
|
||||
ThermoPhase* p = ph(n);
|
||||
compositionMap yy;
|
||||
int nsp = p->nSpecies();
|
||||
for (int n = 0; n < nsp; n++) {
|
||||
size_t nsp = p->nSpecies();
|
||||
for (size_t n = 0; n < nsp; n++) {
|
||||
yy[p->speciesName(n)] = -1;
|
||||
}
|
||||
parseCompString(string(y), yy);
|
||||
|
|
@ -277,7 +269,7 @@ extern "C" {
|
|||
}
|
||||
|
||||
int DLL_EXPORT phase_getAtomicWeights(int n,
|
||||
int lenm, double* atw) {
|
||||
size_t lenm, double* atw) {
|
||||
ThermoPhase* p = ph(n);
|
||||
if (lenm >= p->nElements()) {
|
||||
const vector_fp& wt = p->atomicWeights();
|
||||
|
|
@ -289,7 +281,7 @@ extern "C" {
|
|||
}
|
||||
|
||||
int DLL_EXPORT phase_getMolecularWeights(int n,
|
||||
int lenm, double* mw) {
|
||||
size_t lenm, double* mw) {
|
||||
ThermoPhase* p = ph(n);
|
||||
if (lenm >= p->nSpecies()) {
|
||||
const vector_fp& wt = p->molecularWeights();
|
||||
|
|
@ -300,9 +292,9 @@ extern "C" {
|
|||
return -10;
|
||||
}
|
||||
|
||||
int DLL_EXPORT phase_getName(int n, int lennm, char* nm) {
|
||||
int DLL_EXPORT phase_getName(int n, size_t lennm, char* nm) {
|
||||
string name = ph(n)->name();
|
||||
int lout = (int) min(lennm, (int) name.size());
|
||||
size_t lout = min(lennm, name.size());
|
||||
copy(name.c_str(), name.c_str() + lout, nm);
|
||||
nm[lout] = '\0';
|
||||
return 0;
|
||||
|
|
@ -314,10 +306,10 @@ extern "C" {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int DLL_EXPORT phase_getSpeciesName(int n, int k, int lennm, char* nm) {
|
||||
int DLL_EXPORT phase_getSpeciesName(int n, size_t k, size_t lennm, char* nm) {
|
||||
try {
|
||||
string spnm = ph(n)->speciesName(k);
|
||||
int lout = min(lennm, (int) spnm.size());
|
||||
size_t lout = min(lennm, spnm.size());
|
||||
copy(spnm.c_str(), spnm.c_str() + lout, nm);
|
||||
nm[lout] = '\0';
|
||||
return 0;
|
||||
|
|
@ -326,10 +318,10 @@ extern "C" {
|
|||
//catch (...) {return ERR;}
|
||||
}
|
||||
|
||||
int DLL_EXPORT phase_getElementName(int n, int m, int lennm, char* nm) {
|
||||
int DLL_EXPORT phase_getElementName(int n, size_t m, size_t lennm, char* nm) {
|
||||
try {
|
||||
string elnm = ph(n)->elementName(m);
|
||||
int lout = min(lennm, (int) elnm.size());
|
||||
size_t lout = min(lennm, elnm.size());
|
||||
copy(elnm.c_str(), elnm.c_str() + lout, nm);
|
||||
nm[lout] = '\0';
|
||||
return 0;
|
||||
|
|
@ -338,7 +330,7 @@ extern "C" {
|
|||
}
|
||||
|
||||
|
||||
doublereal DLL_EXPORT phase_nAtoms(int n, int k, int m) {
|
||||
doublereal DLL_EXPORT phase_nAtoms(int n, size_t k, size_t m) {
|
||||
try {
|
||||
return ph(n)->nAtoms(k,m);
|
||||
}
|
||||
|
|
@ -392,7 +384,7 @@ extern "C" {
|
|||
// catch (CanteraError) { return -1; }
|
||||
// }
|
||||
|
||||
int DLL_EXPORT newThermoFromXML(int mxml) {
|
||||
size_t DLL_EXPORT newThermoFromXML(int mxml) {
|
||||
try {
|
||||
XML_Node* x = _xml(mxml);
|
||||
thermo_t* th = newPhase(*x);
|
||||
|
|
@ -405,7 +397,7 @@ extern "C" {
|
|||
// return th(n)->phase().index();
|
||||
// }
|
||||
|
||||
int DLL_EXPORT th_nSpecies(int n) {
|
||||
size_t DLL_EXPORT th_nSpecies(size_t n) {
|
||||
return th(n)->nSpecies();
|
||||
}
|
||||
|
||||
|
|
@ -483,9 +475,9 @@ extern "C" {
|
|||
catch (CanteraError) {return DERR;}
|
||||
}
|
||||
|
||||
int DLL_EXPORT th_chemPotentials(int n, int lenm, double* murt) {
|
||||
int DLL_EXPORT th_chemPotentials(int n, size_t lenm, double* murt) {
|
||||
thermo_t* thrm = th(n);
|
||||
int nsp = thrm->nSpecies();
|
||||
size_t nsp = thrm->nSpecies();
|
||||
if (lenm >= nsp) {
|
||||
thrm->getChemPotentials(murt);
|
||||
return 0;
|
||||
|
|
@ -494,9 +486,9 @@ extern "C" {
|
|||
return -10;
|
||||
}
|
||||
|
||||
int DLL_EXPORT th_elementPotentials(int n, int lenm, double* lambda) {
|
||||
int DLL_EXPORT th_elementPotentials(int n, size_t lenm, double* lambda) {
|
||||
thermo_t* thrm = th(n);
|
||||
int nel = thrm->nElements();
|
||||
size_t nel = thrm->nElements();
|
||||
if (lenm >= nel) {
|
||||
equilibrate(*thrm, "TP", 0);
|
||||
thrm->getElementPotentials(lambda);
|
||||
|
|
@ -584,10 +576,10 @@ extern "C" {
|
|||
}
|
||||
|
||||
|
||||
int DLL_EXPORT th_getEnthalpies_RT(int n, int lenm, double* h_rt) {
|
||||
int DLL_EXPORT th_getEnthalpies_RT(int n, size_t lenm, double* h_rt) {
|
||||
try {
|
||||
thermo_t* thrm = th(n);
|
||||
int nsp = thrm->nSpecies();
|
||||
size_t nsp = thrm->nSpecies();
|
||||
if (lenm >= nsp) {
|
||||
thrm->getEnthalpy_RT_ref(h_rt);
|
||||
return 0;
|
||||
|
|
@ -598,10 +590,10 @@ extern "C" {
|
|||
catch (CanteraError) {return -1;}
|
||||
}
|
||||
|
||||
int DLL_EXPORT th_getEntropies_R(int n, int lenm, double* s_r) {
|
||||
int DLL_EXPORT th_getEntropies_R(int n, size_t lenm, double* s_r) {
|
||||
try {
|
||||
thermo_t* thrm = th(n);
|
||||
int nsp = thrm->nSpecies();
|
||||
size_t nsp = thrm->nSpecies();
|
||||
if (lenm >= nsp) {
|
||||
thrm->getEntropy_R_ref(s_r);
|
||||
return 0;
|
||||
|
|
@ -612,10 +604,10 @@ extern "C" {
|
|||
catch (CanteraError) {return -1;}
|
||||
}
|
||||
|
||||
int DLL_EXPORT th_getCp_R(int n, int lenm, double* cp_r) {
|
||||
int DLL_EXPORT th_getCp_R(int n, size_t lenm, double* cp_r) {
|
||||
try {
|
||||
thermo_t* thrm = th(n);
|
||||
int nsp = thrm->nSpecies();
|
||||
size_t nsp = thrm->nSpecies();
|
||||
if (lenm >= nsp) {
|
||||
thrm->getCp_R_ref(cp_r);
|
||||
return 0;
|
||||
|
|
@ -718,7 +710,7 @@ extern "C" {
|
|||
|
||||
//-------------- Kinetics ------------------//
|
||||
|
||||
int DLL_EXPORT newKineticsFromXML(int mxml, int iphase,
|
||||
size_t DLL_EXPORT newKineticsFromXML(int mxml, int iphase,
|
||||
int neighbor1, int neighbor2, int neighbor3,
|
||||
int neighbor4) {
|
||||
try {
|
||||
|
|
@ -763,33 +755,33 @@ extern "C" {
|
|||
return kin(n)->type();
|
||||
}
|
||||
|
||||
int DLL_EXPORT kin_start(int n, int p) {
|
||||
size_t DLL_EXPORT kin_start(int n, int p) {
|
||||
return kin(n)->kineticsSpeciesIndex(0,p);
|
||||
}
|
||||
|
||||
int DLL_EXPORT kin_speciesIndex(int n, const char* nm, const char* ph) {
|
||||
size_t DLL_EXPORT kin_speciesIndex(int n, const char* nm, const char* ph) {
|
||||
return kin(n)->kineticsSpeciesIndex(string(nm), string(ph));
|
||||
}
|
||||
|
||||
//---------------------------------------
|
||||
|
||||
int DLL_EXPORT kin_nSpecies(int n) {
|
||||
size_t DLL_EXPORT kin_nSpecies(int n) {
|
||||
return kin(n)->nTotalSpecies();
|
||||
}
|
||||
|
||||
int DLL_EXPORT kin_nReactions(int n) {
|
||||
size_t DLL_EXPORT kin_nReactions(int n) {
|
||||
return kin(n)->nReactions();
|
||||
}
|
||||
|
||||
int DLL_EXPORT kin_nPhases(int n) {
|
||||
size_t DLL_EXPORT kin_nPhases(int n) {
|
||||
return kin(n)->nPhases();
|
||||
}
|
||||
|
||||
int DLL_EXPORT kin_phaseIndex(int n, char* ph) {
|
||||
size_t DLL_EXPORT kin_phaseIndex(int n, char* ph) {
|
||||
return kin(n)->phaseIndex(string(ph));
|
||||
}
|
||||
|
||||
int DLL_EXPORT kin_reactionPhaseIndex(int n) {
|
||||
size_t DLL_EXPORT kin_reactionPhaseIndex(int n) {
|
||||
return kin(n)->reactionPhaseIndex();
|
||||
}
|
||||
|
||||
|
|
@ -805,7 +797,7 @@ extern "C" {
|
|||
return kin(n)->reactionType(i);
|
||||
}
|
||||
|
||||
int DLL_EXPORT kin_getFwdRatesOfProgress(int n, int len, double* fwdROP) {
|
||||
int DLL_EXPORT kin_getFwdRatesOfProgress(int n, size_t len, double* fwdROP) {
|
||||
Kinetics* k = kin(n);
|
||||
try {
|
||||
if (len >= k->nReactions()) {
|
||||
|
|
@ -818,7 +810,7 @@ extern "C" {
|
|||
catch (CanteraError) {return -1;}
|
||||
}
|
||||
|
||||
int DLL_EXPORT kin_getRevRatesOfProgress(int n, int len, double* revROP) {
|
||||
int DLL_EXPORT kin_getRevRatesOfProgress(int n, size_t len, double* revROP) {
|
||||
Kinetics* k = kin(n);
|
||||
try {
|
||||
if (len >= k->nReactions()) {
|
||||
|
|
@ -835,7 +827,7 @@ extern "C" {
|
|||
return (int)kin(n)->isReversible(i);
|
||||
}
|
||||
|
||||
int DLL_EXPORT kin_getNetRatesOfProgress(int n, int len, double* netROP) {
|
||||
int DLL_EXPORT kin_getNetRatesOfProgress(int n, size_t len, double* netROP) {
|
||||
try {
|
||||
Kinetics* k = kin(n);
|
||||
if (len >= k->nReactions()) {
|
||||
|
|
@ -848,7 +840,7 @@ extern "C" {
|
|||
catch (CanteraError) {return -1;}
|
||||
}
|
||||
|
||||
int DLL_EXPORT kin_getFwdRateConstants(int n, int len, double* kfwd) {
|
||||
int DLL_EXPORT kin_getFwdRateConstants(int n, size_t len, double* kfwd) {
|
||||
try {
|
||||
Kinetics* k = kin(n);
|
||||
if (len >= k->nReactions()) {
|
||||
|
|
@ -861,7 +853,7 @@ extern "C" {
|
|||
catch (CanteraError) {return -1;}
|
||||
}
|
||||
|
||||
int DLL_EXPORT kin_getRevRateConstants(int n, int doIrreversible, int len, double* krev) {
|
||||
int DLL_EXPORT kin_getRevRateConstants(int n, int doIrreversible, size_t len, double* krev) {
|
||||
try {
|
||||
Kinetics* k = kin(n);
|
||||
bool doirrev = false;
|
||||
|
|
@ -877,7 +869,7 @@ extern "C" {
|
|||
}
|
||||
|
||||
|
||||
int DLL_EXPORT kin_getActivationEnergies(int n, int len, double* E) {
|
||||
int DLL_EXPORT kin_getActivationEnergies(int n, size_t len, double* E) {
|
||||
try {
|
||||
Kinetics* k = kin(n);
|
||||
if (len >= k->nReactions()) {
|
||||
|
|
@ -891,7 +883,7 @@ extern "C" {
|
|||
}
|
||||
|
||||
|
||||
int DLL_EXPORT kin_getDelta(int n, int job, int len, double* delta) {
|
||||
int DLL_EXPORT kin_getDelta(int n, int job, size_t len, double* delta) {
|
||||
try {
|
||||
Kinetics* k = kin(n);
|
||||
if (len < k->nReactions()) return ERR;
|
||||
|
|
@ -917,7 +909,7 @@ extern "C" {
|
|||
}
|
||||
|
||||
|
||||
int DLL_EXPORT kin_getDeltaEntropy(int n, int len, double* deltaS) {
|
||||
int DLL_EXPORT kin_getDeltaEntropy(int n, size_t len, double* deltaS) {
|
||||
try {
|
||||
Kinetics* k = kin(n);
|
||||
if (len >= k->nReactions()) {
|
||||
|
|
@ -931,7 +923,7 @@ extern "C" {
|
|||
}
|
||||
|
||||
|
||||
int DLL_EXPORT kin_getCreationRates(int n, int len, double* cdot) {
|
||||
int DLL_EXPORT kin_getCreationRates(int n, size_t len, double* cdot) {
|
||||
try {
|
||||
Kinetics* k = kin(n);
|
||||
if (len >= k->nTotalSpecies()) {
|
||||
|
|
@ -944,7 +936,7 @@ extern "C" {
|
|||
catch (CanteraError) {return -1;}
|
||||
}
|
||||
|
||||
int DLL_EXPORT kin_getDestructionRates(int n, int len, double* ddot) {
|
||||
int DLL_EXPORT kin_getDestructionRates(int n, size_t len, double* ddot) {
|
||||
try {
|
||||
Kinetics* k = kin(n);
|
||||
if (len >= k->nTotalSpecies()) {
|
||||
|
|
@ -958,7 +950,7 @@ extern "C" {
|
|||
//catch (...) {return ERR;}
|
||||
}
|
||||
|
||||
int DLL_EXPORT kin_getNetProductionRates(int n, int len, double* wdot) {
|
||||
int DLL_EXPORT kin_getNetProductionRates(int n, size_t len, double* wdot) {
|
||||
try {
|
||||
Kinetics* k = kin(n);
|
||||
if (len >= k->nTotalSpecies()) {
|
||||
|
|
@ -971,12 +963,12 @@ extern "C" {
|
|||
catch (CanteraError) {return -1;}
|
||||
}
|
||||
|
||||
int DLL_EXPORT kin_getSourceTerms(int n, int len, double* ydot) {
|
||||
int DLL_EXPORT kin_getSourceTerms(int n, size_t len, double* ydot) {
|
||||
try {
|
||||
Kinetics* k = kin(n);
|
||||
ThermoPhase* p = &k->thermo();
|
||||
const vector_fp& mw = p->molecularWeights();
|
||||
int nsp = static_cast<int>(mw.size());
|
||||
size_t nsp = mw.size();
|
||||
double rrho = 1.0/p->density();
|
||||
if (len >= nsp) {
|
||||
k->getNetProductionRates(ydot);
|
||||
|
|
@ -994,12 +986,11 @@ extern "C" {
|
|||
return kin(n)->multiplier(i);
|
||||
}
|
||||
|
||||
int DLL_EXPORT kin_phase(int n, int i) {
|
||||
size_t DLL_EXPORT kin_phase(int n, size_t i) {
|
||||
return kin(n)->thermo(i).index();
|
||||
// return thermo_index(kin(n)->thermo(i).id());
|
||||
}
|
||||
|
||||
int DLL_EXPORT kin_getEquilibriumConstants(int n, int len, double* kc) {
|
||||
int DLL_EXPORT kin_getEquilibriumConstants(int n, size_t len, double* kc) {
|
||||
try {
|
||||
Kinetics* k = kin(n);
|
||||
if (len >= k->nReactions()) {
|
||||
|
|
@ -1052,7 +1043,7 @@ extern "C" {
|
|||
|
||||
//------------------- Transport ---------------------------
|
||||
|
||||
int DLL_EXPORT newTransport(char* model,
|
||||
size_t DLL_EXPORT newTransport(char* model,
|
||||
int ith, int loglevel) {
|
||||
string mstr = string(model);
|
||||
thermo_t* t = th(ith);
|
||||
|
|
@ -1194,7 +1185,7 @@ extern "C" {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int DLL_EXPORT addCanteraDirectory(int buflen, char* buf) {
|
||||
int DLL_EXPORT addCanteraDirectory(size_t buflen, char* buf) {
|
||||
addDirectory(string(buf));
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,27 +1,23 @@
|
|||
/**
|
||||
* @file ct.h
|
||||
*/
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef CTC_CT_H
|
||||
#define CTC_CT_H
|
||||
|
||||
#include "clib_defs.h"
|
||||
|
||||
#ifdef CANTERA_USE_INTERNAL
|
||||
#include "config.h"
|
||||
#include "kernel/config.h"
|
||||
#else
|
||||
#include "cantera/config.h"
|
||||
#include "cantera/kernel/config.h"
|
||||
#endif
|
||||
|
||||
|
||||
extern "C" {
|
||||
EEXXTT int DLL_CPREFIX ct_appdelete();
|
||||
|
||||
EEXXTT int DLL_CPREFIX phase_nElements(int n);
|
||||
EEXXTT int DLL_CPREFIX phase_nSpecies(int n);
|
||||
EEXXTT size_t DLL_CPREFIX phase_nElements(int n);
|
||||
EEXXTT size_t DLL_CPREFIX phase_nSpecies(int n);
|
||||
EEXXTT double DLL_CPREFIX phase_temperature(int n);
|
||||
EEXXTT int DLL_CPREFIX phase_setTemperature(int n, double t);
|
||||
EEXXTT double DLL_CPREFIX phase_density(int n);
|
||||
|
|
@ -29,29 +25,29 @@ extern "C" {
|
|||
EEXXTT double DLL_CPREFIX phase_molarDensity(int n);
|
||||
EEXXTT int DLL_CPREFIX phase_setMolarDensity(int n, double ndens);
|
||||
EEXXTT double DLL_CPREFIX phase_meanMolecularWeight(int n);
|
||||
EEXXTT double DLL_CPREFIX phase_moleFraction(int n, int k);
|
||||
EEXXTT double DLL_CPREFIX phase_massFraction(int n, int k);
|
||||
EEXXTT int DLL_CPREFIX phase_getMoleFractions(int n, int lenx, double* x);
|
||||
EEXXTT int DLL_CPREFIX phase_getMassFractions(int n, int leny, double* y);
|
||||
EEXXTT int DLL_CPREFIX phase_setMoleFractions(int n, int lenx,
|
||||
EEXXTT double DLL_CPREFIX phase_moleFraction(int n, size_t k);
|
||||
EEXXTT double DLL_CPREFIX phase_massFraction(int n, size_t k);
|
||||
EEXXTT int DLL_CPREFIX phase_getMoleFractions(int n, size_t lenx, double* x);
|
||||
EEXXTT int DLL_CPREFIX phase_getMassFractions(int n, size_t leny, double* y);
|
||||
EEXXTT int DLL_CPREFIX phase_setMoleFractions(int n, size_t lenx,
|
||||
double* x, int norm);
|
||||
EEXXTT int DLL_CPREFIX phase_setMassFractions(int n, int leny,
|
||||
EEXXTT int DLL_CPREFIX phase_setMassFractions(int n, size_t leny,
|
||||
double* y, int norm);
|
||||
EEXXTT int DLL_CPREFIX phase_setMoleFractionsByName(int n, char* x);
|
||||
EEXXTT int DLL_CPREFIX phase_setMassFractionsByName(int n, char* y);
|
||||
EEXXTT int DLL_CPREFIX phase_getAtomicWeights(int n, int lenm, double* atw);
|
||||
EEXXTT int DLL_CPREFIX phase_getMolecularWeights(int n, int lenm, double* mw);
|
||||
EEXXTT int DLL_CPREFIX phase_getElementName(int n, int k, int lennm, char* nm);
|
||||
EEXXTT int DLL_CPREFIX phase_getSpeciesName(int n, int m, int lennm, char* nm);
|
||||
EEXXTT int DLL_CPREFIX phase_getName(int n, int lennm, char* nm);
|
||||
EEXXTT int DLL_CPREFIX phase_getAtomicWeights(int n, size_t lenm, double* atw);
|
||||
EEXXTT int DLL_CPREFIX phase_getMolecularWeights(int n, size_t lenm, double* mw);
|
||||
EEXXTT int DLL_CPREFIX phase_getElementName(int n, size_t k, size_t lennm, char* nm);
|
||||
EEXXTT int DLL_CPREFIX phase_getSpeciesName(int n, size_t m, size_t lennm, char* nm);
|
||||
EEXXTT int DLL_CPREFIX phase_getName(int n, size_t lennm, char* nm);
|
||||
EEXXTT int DLL_CPREFIX phase_setName(int n, const char* nm);
|
||||
EEXXTT int DLL_CPREFIX phase_elementIndex(int n, char* nm);
|
||||
EEXXTT int DLL_CPREFIX phase_speciesIndex(int n, char* nm);
|
||||
EEXXTT size_t DLL_CPREFIX phase_elementIndex(int n, char* nm);
|
||||
EEXXTT size_t DLL_CPREFIX phase_speciesIndex(int n, char* nm);
|
||||
EEXXTT int DLL_CPREFIX phase_report(int nth,
|
||||
int ibuf, char* buf, int show_thermo);
|
||||
EEXXTT int DLL_EXPORT write_phase(int nth, int show_thermo);
|
||||
|
||||
EEXXTT double DLL_CPREFIX phase_nAtoms(int n, int k, int m);
|
||||
EEXXTT double DLL_CPREFIX phase_nAtoms(int n, size_t k, size_t m);
|
||||
|
||||
EEXXTT int DLL_CPREFIX phase_addElement(int n, char* name, double weight);
|
||||
EEXXTT int DLL_CPREFIX phase_addSpecies(int n, char* name, int phase,
|
||||
|
|
@ -60,10 +56,10 @@ extern "C" {
|
|||
double charge, double weight);
|
||||
|
||||
//int DLL_CPREFIX newThermo(char* model);
|
||||
EEXXTT int DLL_CPREFIX newThermoFromXML(int mxml);
|
||||
EEXXTT size_t DLL_CPREFIX newThermoFromXML(int mxml);
|
||||
EEXXTT int DLL_CPREFIX th_thermoIndex(char* id);
|
||||
EEXXTT int DLL_CPREFIX th_phase(int n);
|
||||
EEXXTT int DLL_CPREFIX th_nSpecies(int n);
|
||||
EEXXTT size_t DLL_CPREFIX th_nSpecies(size_t n);
|
||||
EEXXTT int DLL_CPREFIX th_eosType(int n);
|
||||
EEXXTT double DLL_CPREFIX th_refPressure(int n);
|
||||
EEXXTT double DLL_CPREFIX th_minTemp(int n, int k=-1);
|
||||
|
|
@ -83,11 +79,11 @@ extern "C" {
|
|||
EEXXTT double DLL_CPREFIX th_cp_mass(int n);
|
||||
EEXXTT double DLL_CPREFIX th_cv_mass(int n);
|
||||
EEXXTT double DLL_CPREFIX th_electricPotential(int n);
|
||||
EEXXTT int DLL_CPREFIX th_chemPotentials(int n, int lenm, double* murt);
|
||||
EEXXTT int DLL_CPREFIX th_elementPotentials(int n, int lenm, double* lambda);
|
||||
EEXXTT int DLL_CPREFIX th_getEnthalpies_RT(int n, int lenm, double* h_rt);
|
||||
EEXXTT int DLL_CPREFIX th_getEntropies_R(int n, int lenm, double* s_r);
|
||||
EEXXTT int DLL_CPREFIX th_getCp_R(int n, int lenm, double* cp_r);
|
||||
EEXXTT int DLL_CPREFIX th_chemPotentials(int n, size_t lenm, double* murt);
|
||||
EEXXTT int DLL_CPREFIX th_elementPotentials(int n, size_t lenm, double* lambda);
|
||||
EEXXTT int DLL_CPREFIX th_getEnthalpies_RT(int n, size_t lenm, double* h_rt);
|
||||
EEXXTT int DLL_CPREFIX th_getEntropies_R(int n, size_t lenm, double* s_r);
|
||||
EEXXTT int DLL_CPREFIX th_getCp_R(int n, size_t lenm, double* cp_r);
|
||||
EEXXTT int DLL_CPREFIX th_setElectricPotential(int n, double v);
|
||||
EEXXTT int DLL_CPREFIX get_eos(char* fname, char* phase_id);
|
||||
|
||||
|
|
@ -107,44 +103,44 @@ extern "C" {
|
|||
EEXXTT int DLL_CPREFIX th_setState_Psat(int n, double p, double x);
|
||||
EEXXTT int DLL_CPREFIX th_setState_Tsat(int n, double t, double x);
|
||||
|
||||
EEXXTT int DLL_CPREFIX newKineticsFromXML(int mxml, int iphase,
|
||||
EEXXTT size_t DLL_CPREFIX newKineticsFromXML(int mxml, int iphase,
|
||||
int neighbor1=-1, int neighbor2=-1, int neighbor3=-1,
|
||||
int neighbor4=-1);
|
||||
EEXXTT int DLL_CPREFIX installRxnArrays(int pxml, int ikin,
|
||||
char* default_phase);
|
||||
EEXXTT int DLL_CPREFIX kin_nSpecies(int n);
|
||||
EEXXTT int DLL_CPREFIX kin_nReactions(int n);
|
||||
EEXXTT int DLL_CPREFIX kin_nPhases(int n);
|
||||
EEXXTT int DLL_CPREFIX kin_phaseIndex(int n, char* ph);
|
||||
EEXXTT int DLL_CPREFIX kin_reactionPhaseIndex(int n);
|
||||
EEXXTT size_t DLL_CPREFIX kin_nSpecies(int n);
|
||||
EEXXTT size_t DLL_CPREFIX kin_nReactions(int n);
|
||||
EEXXTT size_t DLL_CPREFIX kin_nPhases(int n);
|
||||
EEXXTT size_t DLL_CPREFIX kin_phaseIndex(int n, char* ph);
|
||||
EEXXTT size_t DLL_CPREFIX kin_reactionPhaseIndex(int n);
|
||||
EEXXTT double DLL_CPREFIX kin_reactantStoichCoeff(int n, int i, int k);
|
||||
EEXXTT double DLL_CPREFIX kin_productStoichCoeff(int n, int i, int k);
|
||||
EEXXTT int DLL_CPREFIX kin_reactionType(int n, int i);
|
||||
EEXXTT int DLL_CPREFIX kin_getFwdRatesOfProgress(int n, int len, double* fwdROP);
|
||||
EEXXTT int DLL_CPREFIX kin_getRevRatesOfProgress(int n, int len, double* revROP);
|
||||
EEXXTT int DLL_CPREFIX kin_getNetRatesOfProgress(int n, int len, double* netROP);
|
||||
EEXXTT int DLL_CPREFIX kin_getEquilibriumConstants(int n, int len, double* kc);
|
||||
EEXXTT int DLL_CPREFIX kin_getFwdRatesOfProgress(int n, size_t len, double* fwdROP);
|
||||
EEXXTT int DLL_CPREFIX kin_getRevRatesOfProgress(int n, size_t len, double* revROP);
|
||||
EEXXTT int DLL_CPREFIX kin_getNetRatesOfProgress(int n, size_t len, double* netROP);
|
||||
EEXXTT int DLL_CPREFIX kin_getEquilibriumConstants(int n, size_t len, double* kc);
|
||||
|
||||
EEXXTT int DLL_CPREFIX kin_getFwdRateConstants(int n, int len, double* kfwd);
|
||||
EEXXTT int DLL_CPREFIX kin_getRevRateConstants(int n, int doIrreversible, int len, double* krev);
|
||||
EEXXTT int DLL_CPREFIX kin_getActivationEnergies(int n, int len, double* E);
|
||||
EEXXTT int DLL_CPREFIX kin_getDelta(int n, int job, int len, double* delta);
|
||||
EEXXTT int DLL_CPREFIX kin_getCreationRates(int n, int len, double* cdot);
|
||||
EEXXTT int DLL_CPREFIX kin_getDestructionRates(int n, int len, double* ddot);
|
||||
EEXXTT int DLL_CPREFIX kin_getNetProductionRates(int n, int len, double* wdot);
|
||||
EEXXTT int DLL_CPREFIX kin_getSourceTerms(int n, int len, double* ydot);
|
||||
EEXXTT int DLL_CPREFIX kin_getFwdRateConstants(int n, size_t len, double* kfwd);
|
||||
EEXXTT int DLL_CPREFIX kin_getRevRateConstants(int n, int doIrreversible, size_t len, double* krev);
|
||||
EEXXTT int DLL_CPREFIX kin_getActivationEnergies(int n, size_t len, double* E);
|
||||
EEXXTT int DLL_CPREFIX kin_getDelta(int n, int job, size_t len, double* delta);
|
||||
EEXXTT int DLL_CPREFIX kin_getCreationRates(int n, size_t len, double* cdot);
|
||||
EEXXTT int DLL_CPREFIX kin_getDestructionRates(int n, size_t len, double* ddot);
|
||||
EEXXTT int DLL_CPREFIX kin_getNetProductionRates(int n, size_t len, double* wdot);
|
||||
EEXXTT int DLL_CPREFIX kin_getSourceTerms(int n, size_t len, double* ydot);
|
||||
EEXXTT double DLL_CPREFIX kin_multiplier(int n, int i);
|
||||
EEXXTT int DLL_CPREFIX kin_getReactionString(int n, int i, int len, char* buf);
|
||||
EEXXTT int DLL_CPREFIX kin_setMultiplier(int n, int i, double v);
|
||||
|
||||
EEXXTT int DLL_CPREFIX kin_isReversible(int n, int i);
|
||||
EEXXTT int DLL_CPREFIX kin_type(int n);
|
||||
EEXXTT int DLL_CPREFIX kin_start(int n, int p);
|
||||
EEXXTT int DLL_CPREFIX kin_speciesIndex(int n, const char* nm, const char* ph);
|
||||
EEXXTT size_t DLL_CPREFIX kin_start(int n, int p);
|
||||
EEXXTT size_t DLL_CPREFIX kin_speciesIndex(int n, const char* nm, const char* ph);
|
||||
EEXXTT int DLL_CPREFIX kin_advanceCoverages(int n, double tstep);
|
||||
EEXXTT int DLL_CPREFIX kin_phase(int n, int i);
|
||||
EEXXTT size_t DLL_CPREFIX kin_phase(int n, size_t i);
|
||||
|
||||
EEXXTT int DLL_CPREFIX newTransport(char* model,
|
||||
EEXXTT size_t DLL_CPREFIX newTransport(char* model,
|
||||
int th, int loglevel);
|
||||
EEXXTT double DLL_CPREFIX trans_viscosity(int n);
|
||||
EEXXTT double DLL_CPREFIX trans_thermalConductivity(int n);
|
||||
|
|
@ -167,7 +163,7 @@ extern "C" {
|
|||
EEXXTT int DLL_CPREFIX showCanteraErrors();
|
||||
EEXXTT int DLL_CPREFIX write_HTML_log(char* file);
|
||||
EEXXTT int DLL_CPREFIX setLogWriter(void* logger);
|
||||
EEXXTT int DLL_CPREFIX addCanteraDirectory(int buflen, char* buf);
|
||||
EEXXTT int DLL_CPREFIX addCanteraDirectory(size_t buflen, char* buf);
|
||||
EEXXTT int DLL_CPREFIX clearStorage();
|
||||
EEXXTT int DLL_CPREFIX delPhase(int n);
|
||||
EEXXTT int DLL_CPREFIX delThermo(int n);
|
||||
|
|
|
|||
|
|
@ -1,25 +1,13 @@
|
|||
/**
|
||||
* @file ctbdry.cpp
|
||||
*/
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
#define CANTERA_USE_INTERNAL
|
||||
#include "ctbdry.h"
|
||||
|
||||
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
#pragma warning(disable:4503)
|
||||
#endif
|
||||
|
||||
|
||||
// Cantera includes
|
||||
#include "OneDim.h"
|
||||
#include "Inlet1D.h"
|
||||
#include "InterfaceKinetics.h"
|
||||
#include "kernel/OneDim.h"
|
||||
#include "kernel/Inlet1D.h"
|
||||
#include "kernel/InterfaceKinetics.h"
|
||||
#include "Cabinet.h"
|
||||
#include "Storage.h"
|
||||
|
||||
|
|
@ -27,7 +15,7 @@
|
|||
using namespace std;
|
||||
using namespace Cantera;
|
||||
|
||||
Cabinet<Bdry1D>* Cabinet<Bdry1D>::__storage = 0;
|
||||
template<> Cabinet<Bdry1D>* Cabinet<Bdry1D>::__storage = 0;
|
||||
|
||||
inline Bdry1D* _bndry(int i) {
|
||||
return Cabinet<Bdry1D>::cabinet()->item(i);
|
||||
|
|
|
|||
|
|
@ -1,10 +1,6 @@
|
|||
/**
|
||||
* @file ctbdry.h
|
||||
*/
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef CTC_BDRY_H
|
||||
#define CTC_BDRY_H
|
||||
|
||||
|
|
|
|||
|
|
@ -1,21 +1,11 @@
|
|||
/**
|
||||
* @file ctfunc.cpp
|
||||
*/
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
#pragma warning(disable:4503)
|
||||
#pragma warning(disable:4996)
|
||||
#endif
|
||||
|
||||
#define CANTERA_USE_INTERNAL
|
||||
#include "ctfunc.h"
|
||||
|
||||
#include "Func1.h"
|
||||
#include "ctexceptions.h"
|
||||
#include "kernel/Func1.h"
|
||||
#include "kernel/ctexceptions.h"
|
||||
|
||||
|
||||
#include "Cabinet.h"
|
||||
|
|
@ -28,7 +18,7 @@ typedef Func1 func_t;
|
|||
// Assign storage to the Cabinet<Func1> static member
|
||||
template<> Cabinet<func_t>* Cabinet<func_t>::__storage = 0;
|
||||
|
||||
inline func_t* _func(int i) {
|
||||
inline func_t* _func(size_t i) {
|
||||
return Cabinet<func_t>::cabinet()->item(i);
|
||||
}
|
||||
|
||||
|
|
@ -36,9 +26,9 @@ extern "C" {
|
|||
|
||||
// functions
|
||||
|
||||
int DLL_EXPORT func_new(int type, int n, int lenp, double* params) {
|
||||
int DLL_EXPORT func_new(int type, size_t n, size_t lenp, double* params) {
|
||||
func_t* r=0;
|
||||
int m = lenp;
|
||||
size_t m = lenp;
|
||||
try {
|
||||
if (type == SinFuncType) {
|
||||
r = new Sin1(params[0]);
|
||||
|
|
@ -151,12 +141,12 @@ extern "C" {
|
|||
return Cabinet<func_t>::cabinet()->add(r);
|
||||
}
|
||||
|
||||
int DLL_EXPORT func_write(int i, int lennm, const char* arg, char* nm) {
|
||||
int DLL_EXPORT func_write(int i, size_t lennm, const char* arg, char* nm) {
|
||||
try {
|
||||
string a = string(arg);
|
||||
string w = _func(i)->write(a);
|
||||
int ws = w.size();
|
||||
int lout = (lennm > ws ? ws : lennm);
|
||||
std::string a = std::string(arg);
|
||||
std::string w = _func(i)->write(a);
|
||||
size_t ws = w.size();
|
||||
size_t lout = (lennm > ws ? ws : lennm);
|
||||
std::copy(w.c_str(), w.c_str() + lout, nm);
|
||||
nm[lout] = '\0';
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -1,24 +1,20 @@
|
|||
/**
|
||||
* @file ctfunc.h
|
||||
*/
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef CTC_FUNC1_H
|
||||
#define CTC_FUNC1_H
|
||||
|
||||
#include "clib_defs.h"
|
||||
|
||||
extern "C" {
|
||||
EEXXTT int DLL_CPREFIX func_new(int type, int n, int lenp, double* p);
|
||||
EEXXTT int DLL_CPREFIX func_new(int type, size_t n, size_t lenp, double* p);
|
||||
EEXXTT int DLL_CPREFIX func_del(int i);
|
||||
EEXXTT int DLL_CPREFIX func_copy(int i);
|
||||
EEXXTT int DLL_CPREFIX func_assign(int i, int j);
|
||||
EEXXTT double DLL_CPREFIX func_value(int i, double t);
|
||||
EEXXTT int DLL_CPREFIX func_derivative(int i);
|
||||
EEXXTT int DLL_CPREFIX func_duplicate(int i);
|
||||
EEXXTT int DLL_CPREFIX func_write(int i, int lennm, const char* arg, char* nm);
|
||||
EEXXTT int DLL_CPREFIX func_write(int i, size_t lennm, const char* arg, char* nm);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,19 +1,14 @@
|
|||
/**
|
||||
* @file ctmultiphase.cpp
|
||||
*/
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
#define CANTERA_USE_INTERNAL
|
||||
#include "ctmultiphase.h"
|
||||
|
||||
// Cantera includes
|
||||
#include "equil.h"
|
||||
#include "MultiPhase.h"
|
||||
#include "MultiPhaseEquil.h"
|
||||
#include "vcs_MultiPhaseEquil.h"
|
||||
#include "kernel/equil.h"
|
||||
#include "kernel/MultiPhase.h"
|
||||
#include "kernel/MultiPhaseEquil.h"
|
||||
#include "kernel/vcs_MultiPhaseEquil.h"
|
||||
|
||||
#include "Cabinet.h"
|
||||
#include "Storage.h"
|
||||
|
|
@ -33,11 +28,11 @@ inline ThermoPhase* _th(int n) {
|
|||
return Storage::__storage->__thtable[n];
|
||||
}
|
||||
|
||||
static bool checkSpecies(int i, int k) {
|
||||
static bool checkSpecies(int i, size_t k) {
|
||||
try {
|
||||
if (k < 0 || k >= _mix(i)->nSpecies())
|
||||
if (k >= _mix(i)->nSpecies())
|
||||
throw CanteraError("checkSpecies",
|
||||
"illegal species index ("+int2str(k)+") ");
|
||||
"illegal species index ("+int2str(int(k))+") ");
|
||||
return true;
|
||||
}
|
||||
catch (CanteraError) {
|
||||
|
|
@ -45,11 +40,11 @@ static bool checkSpecies(int i, int k) {
|
|||
}
|
||||
}
|
||||
|
||||
static bool checkElement(int i, int m) {
|
||||
static bool checkElement(int i, size_t m) {
|
||||
try {
|
||||
if (m < 0 || m >= _mix(i)->nElements())
|
||||
if (m >= _mix(i)->nElements())
|
||||
throw CanteraError("checkElement",
|
||||
"illegal element index ("+int2str(m)+") ");
|
||||
"illegal element index ("+int2str(int(m))+") ");
|
||||
return true;
|
||||
}
|
||||
catch (CanteraError) {
|
||||
|
|
@ -103,19 +98,19 @@ extern "C" {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int DLL_EXPORT mix_nElements(int i) {
|
||||
size_t DLL_EXPORT mix_nElements(int i) {
|
||||
return _mix(i)->nElements();
|
||||
}
|
||||
|
||||
int DLL_EXPORT mix_elementIndex(int i, char* name) {
|
||||
size_t DLL_EXPORT mix_elementIndex(int i, char* name) {
|
||||
return _mix(i)->elementIndex(string(name));
|
||||
}
|
||||
|
||||
int DLL_EXPORT mix_nSpecies(int i) {
|
||||
size_t DLL_EXPORT mix_nSpecies(int i) {
|
||||
return _mix(i)->nSpecies();
|
||||
}
|
||||
|
||||
int DLL_EXPORT mix_speciesIndex(int i, int k, int p) {
|
||||
size_t DLL_EXPORT mix_speciesIndex(int i, int k, int p) {
|
||||
return _mix(i)->speciesIndex(k, p);
|
||||
}
|
||||
|
||||
|
|
@ -127,7 +122,7 @@ extern "C" {
|
|||
return DERR;
|
||||
}
|
||||
|
||||
double DLL_EXPORT mix_nPhases(int i) {
|
||||
size_t DLL_EXPORT mix_nPhases(int i) {
|
||||
return _mix(i)->nPhases();
|
||||
}
|
||||
|
||||
|
|
@ -143,7 +138,7 @@ extern "C" {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int DLL_EXPORT mix_setMoles(int i, int nlen, double* n) {
|
||||
int DLL_EXPORT mix_setMoles(int i, size_t nlen, double* n) {
|
||||
try {
|
||||
if (nlen < _mix(i)->nSpecies())
|
||||
throw CanteraError("setMoles","array size too small.");
|
||||
|
|
@ -246,7 +241,7 @@ extern "C" {
|
|||
}
|
||||
}
|
||||
|
||||
int DLL_EXPORT mix_getChemPotentials(int i, int lenmu, double* mu) {
|
||||
int DLL_EXPORT mix_getChemPotentials(int i, size_t lenmu, double* mu) {
|
||||
try {
|
||||
if (lenmu < _mix(i)->nSpecies())
|
||||
throw CanteraError("getChemPotentials","array too small");
|
||||
|
|
@ -259,7 +254,7 @@ extern "C" {
|
|||
}
|
||||
|
||||
int DLL_EXPORT mix_getValidChemPotentials(int i, double bad_mu,
|
||||
int standard, int lenmu, double* mu) {
|
||||
int standard, size_t lenmu, double* mu) {
|
||||
bool st = (standard == 1);
|
||||
try {
|
||||
if (lenmu < _mix(i)->nSpecies())
|
||||
|
|
@ -293,7 +288,7 @@ extern "C" {
|
|||
return _mix(i)->volume();
|
||||
}
|
||||
|
||||
int DLL_EXPORT mix_speciesPhaseIndex(int i, int k) {
|
||||
size_t DLL_EXPORT mix_speciesPhaseIndex(int i, int k) {
|
||||
return _mix(i)->speciesPhaseIndex(k);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,6 @@
|
|||
/**
|
||||
* @file ctmultiphase.h
|
||||
*/
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef CTC_MULTIPHASE_H
|
||||
#define CTC_MULTIPHASE_H
|
||||
|
||||
|
|
@ -18,10 +14,10 @@ extern "C" {
|
|||
EEXXTT int DLL_CPREFIX mix_assign(int i, int j);
|
||||
EEXXTT int DLL_CPREFIX mix_addPhase(int i, int j, double moles);
|
||||
EEXXTT int DLL_CPREFIX mix_init(int i);
|
||||
EEXXTT int DLL_CPREFIX mix_nElements(int i);
|
||||
EEXXTT int DLL_CPREFIX mix_elementIndex(int i, char* name);
|
||||
EEXXTT int DLL_CPREFIX mix_speciesIndex(int i, int k, int p);
|
||||
EEXXTT int DLL_CPREFIX mix_nSpecies(int i);
|
||||
EEXXTT size_t DLL_CPREFIX mix_nElements(int i);
|
||||
EEXXTT size_t DLL_CPREFIX mix_elementIndex(int i, char* name);
|
||||
EEXXTT size_t DLL_CPREFIX mix_speciesIndex(int i, int k, int p);
|
||||
EEXXTT size_t DLL_CPREFIX mix_nSpecies(int i);
|
||||
EEXXTT int DLL_CPREFIX mix_setTemperature(int i, double t);
|
||||
EEXXTT double DLL_CPREFIX mix_temperature(int i);
|
||||
EEXXTT double DLL_CPREFIX mix_minTemp(int i);
|
||||
|
|
@ -31,10 +27,10 @@ extern "C" {
|
|||
EEXXTT int DLL_CPREFIX mix_setPressure(int i, double p);
|
||||
EEXXTT double DLL_CPREFIX mix_pressure(int i);
|
||||
EEXXTT double DLL_CPREFIX mix_nAtoms(int i, int k, int m);
|
||||
EEXXTT double DLL_CPREFIX mix_nPhases(int i);
|
||||
EEXXTT size_t DLL_CPREFIX mix_nPhases(int i);
|
||||
EEXXTT double DLL_CPREFIX mix_phaseMoles(int i, int n);
|
||||
EEXXTT int DLL_CPREFIX mix_setPhaseMoles(int i, int n, double v);
|
||||
EEXXTT int DLL_CPREFIX mix_setMoles(int i, int nlen, double* n);
|
||||
EEXXTT int DLL_CPREFIX mix_setMoles(int i, size_t nlen, double* n);
|
||||
EEXXTT int DLL_CPREFIX mix_setMolesByName(int i, char* n);
|
||||
EEXXTT double DLL_CPREFIX mix_speciesMoles(int i, int k);
|
||||
EEXXTT double DLL_CPREFIX mix_elementMoles(int i, int m);
|
||||
|
|
@ -44,9 +40,9 @@ extern "C" {
|
|||
int printLvl, int solver,
|
||||
double rtol, int maxsteps,
|
||||
int maxiter, int loglevel);
|
||||
EEXXTT int DLL_CPREFIX mix_getChemPotentials(int i, int lenmu, double* mu);
|
||||
EEXXTT int DLL_CPREFIX mix_getChemPotentials(int i, size_t lenmu, double* mu);
|
||||
EEXXTT int DLL_CPREFIX mix_getValidChemPotentials(int i, double bad_mu,
|
||||
int standard, int lenmu, double* mu);
|
||||
int standard, size_t lenmu, double* mu);
|
||||
|
||||
EEXXTT double DLL_CPREFIX mix_enthalpy(int i);
|
||||
EEXXTT double DLL_CPREFIX mix_entropy(int i);
|
||||
|
|
@ -54,7 +50,7 @@ extern "C" {
|
|||
EEXXTT double DLL_CPREFIX mix_cp(int i);
|
||||
EEXXTT double DLL_CPREFIX mix_volume(int i);
|
||||
|
||||
EEXXTT int DLL_CPREFIX mix_speciesPhaseIndex(int i, int k);
|
||||
EEXXTT size_t DLL_CPREFIX mix_speciesPhaseIndex(int i, int k);
|
||||
EEXXTT double DLL_CPREFIX mix_moleFraction(int i, int k);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,183 +0,0 @@
|
|||
|
||||
// Cantera includes
|
||||
#include "numerics.h"
|
||||
#include "Cabinet.h"
|
||||
inline DenseMatrix* _matrix(int i) {
|
||||
return Cabinet<DenseMatrix>::cabinet()->item(i);
|
||||
}
|
||||
|
||||
inline BandMatrix* _bmatrix(int i) {
|
||||
return Cabinet<BandMatrix>::cabinet()->item(i);
|
||||
}
|
||||
|
||||
// Build as a DLL under Windows
|
||||
#ifdef WIN32
|
||||
#ifdef NO_DLL_BUILD
|
||||
#define DLL_EXPORT
|
||||
#else
|
||||
#define DLL_EXPORT __declspec(dllexport)
|
||||
#endif
|
||||
#pragma warning(disable:4786)
|
||||
#pragma warning(disable:4503)
|
||||
#else
|
||||
#define DLL_EXPORT
|
||||
#endif
|
||||
|
||||
// Values returned for error conditions
|
||||
#define ERR -999
|
||||
#define DERR -999.999
|
||||
|
||||
Cabinet<DenseMatrix>* Cabinet<DenseMatrix>::__storage = 0;
|
||||
Cabinet<BandMatrix>* Cabinet<BandMatrix>::__storage = 0;
|
||||
|
||||
extern "C" {
|
||||
|
||||
|
||||
///// Matrix //////
|
||||
|
||||
int DLL_EXPORT newMatrix(int m, int n) {
|
||||
DenseMatrix* x = new DenseMatrix(m,n);
|
||||
return Cabinet<DenseMatrix>::cabinet()->add(x);
|
||||
}
|
||||
|
||||
int DLL_EXPORT delMatrix(int i) {
|
||||
Cabinet<DenseMatrix>::cabinet()->del(i);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int DLL_EXPORT matrix_copy(int i) {
|
||||
return Cabinet<DenseMatrix>::cabinet()->newCopy(i);
|
||||
}
|
||||
|
||||
int DLL_EXPORT matrix_assign(int i, int j) {
|
||||
return Cabinet<DenseMatrix>::cabinet()->assign(i,j);
|
||||
}
|
||||
|
||||
int DLL_EXPORT matrix_nRows(int i) {
|
||||
return _matrix(i)->nRows();
|
||||
}
|
||||
|
||||
int DLL_EXPORT matrix_nColumns(int i) {
|
||||
return _matrix(i)->nColumns();
|
||||
}
|
||||
|
||||
int DLL_EXPORT matrix_resize(int i, int m, int n, double v) {
|
||||
_matrix(i)->resize(m,n,v);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int DLL_EXPORT matrix_appendColumn(int i, double* c) {
|
||||
_matrix(i)->appendColumn(c);
|
||||
return 0;
|
||||
}
|
||||
|
||||
double DLL_EXPORT matrix_value(int i, int m, int n) {
|
||||
return _matrix(i)->value(m,n);
|
||||
}
|
||||
|
||||
double DLL_EXPORT matrix_setvalue(int i, int m, int n, double v) {
|
||||
_matrix(i)->value(m,n) = v;
|
||||
return v;
|
||||
}
|
||||
|
||||
int DLL_EXPORT matrix_solve(int i1, int i2) {
|
||||
try {
|
||||
int info = solve(*_matrix(i1), *_matrix(i2));
|
||||
return info;
|
||||
}
|
||||
catch (CanteraError) { return -1; }
|
||||
catch (...) { return ERR; }
|
||||
}
|
||||
|
||||
int DLL_EXPORT matrix_multiply(int ma, int mb, int mp) {
|
||||
try {
|
||||
DenseMatrix* a = _matrix(ma);
|
||||
DenseMatrix* b = _matrix(mb);
|
||||
DenseMatrix* p = _matrix(mp);
|
||||
multiply(*a, b->begin(), p->begin());
|
||||
return 0;
|
||||
}
|
||||
catch (CanteraError) { return -1; }
|
||||
catch (...) { return ERR; }
|
||||
}
|
||||
|
||||
int DLL_EXPORT matrix_invert(int ma) {
|
||||
try {
|
||||
invert(*_matrix(ma));
|
||||
return 0;
|
||||
}
|
||||
catch (CanteraError) { return -1; }
|
||||
catch (...) { return ERR; }
|
||||
}
|
||||
|
||||
|
||||
///////////////// BandMatrix //////////////////////
|
||||
|
||||
|
||||
int DLL_EXPORT bmatrix_new(int n, int kl, int ku) {
|
||||
BandMatrix* x = new BandMatrix(n, kl, ku);
|
||||
return Cabinet<BandMatrix>::cabinet()->add(x);
|
||||
}
|
||||
|
||||
int DLL_EXPORT bmatrix_del(int i) {
|
||||
Cabinet<BandMatrix>::cabinet()->del(i);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int DLL_EXPORT bmatrix_copy(int i) {
|
||||
return Cabinet<BandMatrix>::cabinet()->newCopy(i);
|
||||
}
|
||||
|
||||
int DLL_EXPORT bmatrix_assign(int i, int j) {
|
||||
return Cabinet<BandMatrix>::cabinet()->assign(i,j);
|
||||
}
|
||||
|
||||
int DLL_EXPORT bmatrix_nRows(int i) {
|
||||
return _bmatrix(i)->rows();
|
||||
}
|
||||
|
||||
int DLL_EXPORT bmatrix_nColumns(int i) {
|
||||
return _bmatrix(i)->columns();
|
||||
}
|
||||
|
||||
int DLL_EXPORT bmatrix_resize(int i, int m, int n, double v) {
|
||||
_bmatrix(i)->resize(m,n,v);
|
||||
return 0;
|
||||
}
|
||||
|
||||
double DLL_EXPORT bmatrix_value(int i, int m, int n) {
|
||||
return _bmatrix(i)->value(m,n);
|
||||
}
|
||||
|
||||
double DLL_EXPORT bmatrix_setvalue(int i, int m, int n, double v) {
|
||||
try {
|
||||
_bmatrix(i)->value(m,n) = v;
|
||||
return v;
|
||||
}
|
||||
catch (...) { return ERR; }
|
||||
}
|
||||
|
||||
int DLL_EXPORT bmatrix_solve(int ma, int mb) {
|
||||
try {
|
||||
int n = _bmatrix(ma)->nColumns();
|
||||
_bmatrix(ma)->solve(n,
|
||||
_matrix(mb)->begin());
|
||||
return 0;
|
||||
}
|
||||
catch (CanteraError) { return -1; }
|
||||
catch (...) { return ERR; }
|
||||
}
|
||||
|
||||
int DLL_EXPORT bmatrix_multiply(int ma, int mb, int mp) {
|
||||
try {
|
||||
BandMatrix* a = _bmatrix(ma);
|
||||
DenseMatrix* b = _matrix(mb);
|
||||
DenseMatrix* p = _matrix(mp);
|
||||
a->mult(b->begin(), p->begin());
|
||||
return 0;
|
||||
}
|
||||
catch (CanteraError) { return -1; }
|
||||
catch (...) { return ERR; }
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
/**
|
||||
* @file ctnum.h
|
||||
*/
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef CTC_CTNUM_H
|
||||
#define CTC_CTNUM_H
|
||||
|
||||
#include "clib_defs.h"
|
||||
|
||||
extern "C" {
|
||||
|
||||
EEXXTT int DLL_CPREFIX newMatrix(int m, int n);
|
||||
EEXXTT int DLL_CPREFIX delMatrix(int i);
|
||||
EEXXTT int DLL_CPREFIX matrix_copy(int i);
|
||||
EEXXTT int DLL_CPREFIX matrix_assign(int i, int j);
|
||||
EEXXTT int DLL_CPREFIX matrix_nRows(int i);
|
||||
EEXXTT int DLL_CPREFIX matrix_nColumns(int i);
|
||||
EEXXTT int DLL_CPREFIX matrix_resize(int i, int m, int n, double v);
|
||||
EEXXTT int DLL_CPREFIX matrix_appendColumn(int i, double* c);
|
||||
EEXXTT double DLL_CPREFIX matrix_value(int i, int m, int n);
|
||||
EEXXTT double DLL_CPREFIX matrix_setvalue(int i, int m, int n, double v);
|
||||
EEXXTT int DLL_CPREFIX matrix_solve(int i1, int i2);
|
||||
EEXXTT int DLL_CPREFIX matrix_multiply(int ma, int mb, int mp);
|
||||
EEXXTT int DLL_CPREFIX matrix_invert(int ma);
|
||||
|
||||
EEXXTT int DLL_CPREFIX bmatrix_new(int n, int kl, int ku);
|
||||
EEXXTT int DLL_CPREFIX bmatrix_del(int i);
|
||||
EEXXTT int DLL_CPREFIX bmatrix_copy(int i);
|
||||
EEXXTT int DLL_CPREFIX bmatrix_assign(int i, int j);
|
||||
EEXXTT int DLL_CPREFIX bmatrix_nRows(int i);
|
||||
EEXXTT int DLL_CPREFIX bmatrix_nColumns(int i);
|
||||
EEXXTT int DLL_CPREFIX bmatrix_resize(int i, int m, int n, double v);
|
||||
EEXXTT double DLL_CPREFIX bmatrix_value(int i, int m, int n);
|
||||
EEXXTT double DLL_CPREFIX bmatrix_setvalue(int i, int m, int n, double v);
|
||||
EEXXTT int DLL_CPREFIX bmatrix_solve(int ma, int mb);
|
||||
EEXXTT int DLL_CPREFIX bmatrix_multiply(int ma, int mb, int mp);
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -1,29 +1,16 @@
|
|||
/**
|
||||
* @file ctonedim.cpp
|
||||
*/
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
// turn off warnings under Windows
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
#pragma warning(disable:4503)
|
||||
#pragma warning(disable:4800)
|
||||
#endif
|
||||
|
||||
#define CANTERA_USE_INTERNAL
|
||||
|
||||
#include "ctonedim.h"
|
||||
|
||||
|
||||
// Cantera includes
|
||||
#include "config.h"
|
||||
#include "Sim1D.h"
|
||||
#include "StFlow.h"
|
||||
#include "Inlet1D.h"
|
||||
#include "DenseMatrix.h"
|
||||
|
||||
|
||||
#include "kernel/config.h"
|
||||
#include "kernel/Sim1D.h"
|
||||
#include "kernel/StFlow.h"
|
||||
#include "kernel/Inlet1D.h"
|
||||
#include "kernel/DenseMatrix.h"
|
||||
|
||||
// local includes
|
||||
#include "Cabinet.h"
|
||||
|
|
@ -97,15 +84,15 @@ extern "C" {
|
|||
return _domain(i)->domainType();
|
||||
}
|
||||
|
||||
int DLL_EXPORT domain_index(int i) {
|
||||
size_t DLL_EXPORT domain_index(int i) {
|
||||
return _domain(i)->domainIndex();
|
||||
}
|
||||
|
||||
int DLL_EXPORT domain_nComponents(int i) {
|
||||
size_t DLL_EXPORT domain_nComponents(int i) {
|
||||
return _domain(i)->nComponents();
|
||||
}
|
||||
|
||||
int DLL_EXPORT domain_nPoints(int i) {
|
||||
size_t DLL_EXPORT domain_nPoints(int i) {
|
||||
return _domain(i)->nPoints();
|
||||
}
|
||||
|
||||
|
|
@ -121,9 +108,9 @@ extern "C" {
|
|||
catch (CanteraError) { return -1; }
|
||||
}
|
||||
|
||||
int DLL_EXPORT domain_componentIndex(int i, char* name) {
|
||||
size_t DLL_EXPORT domain_componentIndex(int i, char* name) {
|
||||
try {
|
||||
int n = _domain(i)->componentIndex(string(name));
|
||||
size_t n = _domain(i)->componentIndex(string(name));
|
||||
return n;
|
||||
}
|
||||
catch (CanteraError) { return -1; }
|
||||
|
|
@ -181,7 +168,7 @@ extern "C" {
|
|||
catch (CanteraError) { return DERR; }
|
||||
}
|
||||
|
||||
int DLL_EXPORT domain_setupGrid(int i, int npts, double* grid) {
|
||||
int DLL_EXPORT domain_setupGrid(int i, size_t npts, double* grid) {
|
||||
try {
|
||||
_domain(i)->setupGrid(npts, grid);
|
||||
return 0;
|
||||
|
|
@ -316,7 +303,7 @@ extern "C" {
|
|||
int DLL_EXPORT reactingsurf_enableCoverageEqs(int i, int onoff) {
|
||||
try {
|
||||
ReactingSurf1D* srf = (ReactingSurf1D*)_bdry(i);
|
||||
srf->enableCoverageEquations(bool(onoff));
|
||||
srf->enableCoverageEquations(onoff != 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -386,12 +373,11 @@ extern "C" {
|
|||
catch (CanteraError) { return -1; }
|
||||
}
|
||||
|
||||
int DLL_EXPORT stflow_setFixedTempProfile(int i, int n, double* pos,
|
||||
int m, double* temp) {
|
||||
int DLL_EXPORT stflow_setFixedTempProfile(int i, size_t n, double* pos,
|
||||
size_t m, double* temp) {
|
||||
try {
|
||||
int j;
|
||||
vector_fp vpos(n), vtemp(n);
|
||||
for (j = 0; j < n; j++) {
|
||||
for (size_t j = 0; j < n; j++) {
|
||||
vpos[j] = pos[j];
|
||||
vtemp[j] = temp[j];
|
||||
}
|
||||
|
|
@ -428,11 +414,11 @@ extern "C" {
|
|||
|
||||
//------------------- Sim1D --------------------------------------
|
||||
|
||||
int DLL_EXPORT sim1D_new(int nd, int* domains) {
|
||||
int DLL_EXPORT sim1D_new(size_t nd, int* domains) {
|
||||
vector<Domain1D*> d;
|
||||
try {
|
||||
// cout << "nd = " << nd << endl;
|
||||
for (int n = 0; n < nd; n++) {
|
||||
for (size_t n = 0; n < nd; n++) {
|
||||
//writelog("n = "+int2str(n)+"\n");
|
||||
//writelog("dom = "+int2str(domains[n])+"\n");
|
||||
d.push_back(_domain(domains[n]));
|
||||
|
|
@ -468,10 +454,10 @@ extern "C" {
|
|||
}
|
||||
|
||||
int DLL_EXPORT sim1D_setProfile(int i, int dom, int comp,
|
||||
int np, double* pos, int nv, double* v) {
|
||||
size_t np, double* pos, size_t nv, double* v) {
|
||||
try {
|
||||
vector_fp vv, pv;
|
||||
for (int n = 0; n < np; n++) {
|
||||
for (size_t n = 0; n < np; n++) {
|
||||
vv.push_back(v[n]);
|
||||
pv.push_back(pos[n]);
|
||||
}
|
||||
|
|
@ -501,7 +487,7 @@ extern "C" {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int DLL_EXPORT sim1D_setTimeStep(int i, double stepsize, int ns, integer* nsteps) {
|
||||
int DLL_EXPORT sim1D_setTimeStep(int i, double stepsize, size_t ns, integer* nsteps) {
|
||||
try {
|
||||
_sim1D(i)->setTimeStep(stepsize, ns, nsteps);
|
||||
return 0;
|
||||
|
|
@ -576,7 +562,7 @@ extern "C" {
|
|||
|
||||
int DLL_EXPORT sim1D_domainIndex(int i, char* name) {
|
||||
try {
|
||||
return _sim1D(i)->domainIndex(string(name));
|
||||
return (int) _sim1D(i)->domainIndex(string(name));
|
||||
}
|
||||
catch (CanteraError) { return -1; }
|
||||
}
|
||||
|
|
@ -653,7 +639,7 @@ extern "C" {
|
|||
catch (CanteraError) { return DERR; }
|
||||
}
|
||||
|
||||
int DLL_EXPORT sim1D_size(int i) {
|
||||
size_t DLL_EXPORT sim1D_size(int i) {
|
||||
try {
|
||||
return _sim1D(i)->size();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,19 +1,15 @@
|
|||
/**
|
||||
* @file ctonedim.h
|
||||
*/
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef CTC_ONEDIM_H
|
||||
#define CTC_ONEDIM_H
|
||||
|
||||
#include "clib_defs.h"
|
||||
|
||||
#ifdef CANTERA_USE_INTERNAL
|
||||
#include "config.h"
|
||||
#include "kernel/config.h"
|
||||
#else
|
||||
#include "cantera/config.h"
|
||||
#include "cantera/kernel/config.h"
|
||||
#endif
|
||||
|
||||
extern "C" {
|
||||
|
|
@ -21,11 +17,11 @@ extern "C" {
|
|||
EEXXTT int DLL_CPREFIX domain_clear();
|
||||
EEXXTT int DLL_CPREFIX domain_del(int i);
|
||||
EEXXTT int DLL_CPREFIX domain_type(int i);
|
||||
EEXXTT int DLL_CPREFIX domain_index(int i);
|
||||
EEXXTT int DLL_CPREFIX domain_nComponents(int i);
|
||||
EEXXTT int DLL_CPREFIX domain_nPoints(int i);
|
||||
EEXXTT size_t DLL_CPREFIX domain_index(int i);
|
||||
EEXXTT size_t DLL_CPREFIX domain_nComponents(int i);
|
||||
EEXXTT size_t DLL_CPREFIX domain_nPoints(int i);
|
||||
EEXXTT int DLL_CPREFIX domain_componentName(int i, int n, int sz, char* nameout);
|
||||
EEXXTT int DLL_CPREFIX domain_componentIndex(int i, char* name);
|
||||
EEXXTT size_t DLL_CPREFIX domain_componentIndex(int i, char* name);
|
||||
EEXXTT int DLL_CPREFIX domain_setBounds(int i, int n, double lower,
|
||||
double upper);
|
||||
EEXXTT double DLL_EXPORT domain_lowerBound(int i, int n);
|
||||
|
|
@ -34,7 +30,7 @@ extern "C" {
|
|||
double atol, int itime);
|
||||
EEXXTT double DLL_CPREFIX domain_rtol(int i, int n);
|
||||
EEXXTT double DLL_CPREFIX domain_atol(int i, int n);
|
||||
EEXXTT int DLL_CPREFIX domain_setupGrid(int i, int npts, double* grid);
|
||||
EEXXTT int DLL_CPREFIX domain_setupGrid(int i, size_t npts, double* grid);
|
||||
EEXXTT int DLL_CPREFIX domain_setID(int i, char* id);
|
||||
EEXXTT int DLL_CPREFIX domain_setDesc(int i, char* desc);
|
||||
EEXXTT double DLL_CPREFIX domain_grid(int i, int n);
|
||||
|
|
@ -62,20 +58,20 @@ extern "C" {
|
|||
EEXXTT int DLL_CPREFIX stflow_setTransport(int i, int itr, int iSoret);
|
||||
EEXXTT int DLL_CPREFIX stflow_enableSoret(int i, int iSoret);
|
||||
EEXXTT int DLL_CPREFIX stflow_setPressure(int i, double p);
|
||||
EEXXTT int DLL_CPREFIX stflow_setFixedTempProfile(int i, int n, double* pos,
|
||||
int m, double* temp);
|
||||
EEXXTT int DLL_CPREFIX stflow_setFixedTempProfile(int i, size_t n, double* pos,
|
||||
size_t m, double* temp);
|
||||
EEXXTT int DLL_CPREFIX stflow_solveSpeciesEqs(int i, int flag);
|
||||
EEXXTT int DLL_CPREFIX stflow_solveEnergyEqn(int i, int flag);
|
||||
|
||||
EEXXTT int DLL_CPREFIX sim1D_clear();
|
||||
EEXXTT int DLL_CPREFIX sim1D_new(int nd, int* domains);
|
||||
EEXXTT int DLL_CPREFIX sim1D_new(size_t nd, int* domains);
|
||||
EEXXTT int DLL_CPREFIX sim1D_del(int i);
|
||||
EEXXTT int DLL_CPREFIX sim1D_setValue(int i, int dom, int comp, int localPoint, double value);
|
||||
EEXXTT int DLL_CPREFIX sim1D_setProfile(int i, int dom, int comp,
|
||||
int np, double* pos, int nv, double* v);
|
||||
size_t np, double* pos, size_t nv, double* v);
|
||||
EEXXTT int DLL_CPREFIX sim1D_setFlatProfile(int i, int dom, int comp, double v);
|
||||
EEXXTT int DLL_CPREFIX sim1D_showSolution(int i, char* fname);
|
||||
EEXXTT int DLL_CPREFIX sim1D_setTimeStep(int i, double stepsize, int ns, integer* nsteps);
|
||||
EEXXTT int DLL_CPREFIX sim1D_setTimeStep(int i, double stepsize, size_t ns, integer* nsteps);
|
||||
EEXXTT int DLL_CPREFIX sim1D_getInitialSoln(int i);
|
||||
EEXXTT int DLL_CPREFIX sim1D_solve(int i, int loglevel, int refine_grid);
|
||||
EEXXTT int DLL_CPREFIX sim1D_refine(int i, int loglevel);
|
||||
|
|
@ -96,7 +92,7 @@ extern "C" {
|
|||
EEXXTT int DLL_CPREFIX sim1D_setFixedTemperature(int i, double temp);
|
||||
EEXXTT int DLL_CPREFIX sim1D_evalSSJacobian(int i);
|
||||
EEXXTT double DLL_CPREFIX sim1D_jacobian(int i, int m, int n);
|
||||
EEXXTT int DLL_CPREFIX sim1D_size(int i);
|
||||
EEXXTT size_t DLL_CPREFIX sim1D_size(int i);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,27 +1,17 @@
|
|||
/**
|
||||
* @file ctreactor.cpp
|
||||
*/
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
#pragma warning(disable:4503)
|
||||
#endif
|
||||
|
||||
#define CANTERA_USE_INTERNAL
|
||||
#include "ctreactor.h"
|
||||
|
||||
// Cantera includes
|
||||
#include "Reactor.h"
|
||||
#include "FlowReactor.h"
|
||||
#include "ConstPressureReactor.h"
|
||||
#include "ReactorNet.h"
|
||||
#include "Reservoir.h"
|
||||
#include "Wall.h"
|
||||
#include "flowControllers.h"
|
||||
#include "kernel/Reactor.h"
|
||||
#include "kernel/FlowReactor.h"
|
||||
#include "kernel/ConstPressureReactor.h"
|
||||
#include "kernel/ReactorNet.h"
|
||||
#include "kernel/Reservoir.h"
|
||||
#include "kernel/Wall.h"
|
||||
#include "kernel/flowControllers.h"
|
||||
|
||||
#include "Cabinet.h"
|
||||
#include "Storage.h"
|
||||
|
|
@ -184,12 +174,12 @@ extern "C" {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int DLL_EXPORT reactor_nSensParams(int i) {
|
||||
size_t DLL_EXPORT reactor_nSensParams(int i) {
|
||||
reactor_t* r = _reactor(i);
|
||||
if (r->type() >= ReactorType)
|
||||
return ((Reactor*)r)->nSensParams();
|
||||
else {
|
||||
cout << "type problem..." << r->type() << endl;
|
||||
std::cout << "type problem..." << r->type() << std::endl;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,6 @@
|
|||
/**
|
||||
* @file ctreactor.h
|
||||
*/
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef CTC_REACTOR_H
|
||||
#define CTC_REACTOR_H
|
||||
|
||||
|
|
@ -32,7 +28,7 @@ extern "C" {
|
|||
EEXXTT double DLL_CPREFIX reactor_intEnergy_mass(int i);
|
||||
EEXXTT double DLL_CPREFIX reactor_pressure(int i);
|
||||
EEXXTT double DLL_CPREFIX reactor_massFraction(int i, int k);
|
||||
EEXXTT int DLL_CPREFIX reactor_nSensParams(int i);
|
||||
EEXXTT size_t DLL_CPREFIX reactor_nSensParams(int i);
|
||||
EEXXTT int DLL_CPREFIX reactor_addSensitivityReaction(int i, int rxn);
|
||||
EEXXTT int DLL_CPREFIX flowReactor_setMassFlowRate(int i, double mdot);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,17 +1,13 @@
|
|||
/**
|
||||
* @file ctrpath.cpp
|
||||
*/
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#define CANTERA_USE_INTERNAL
|
||||
#include "ctrpath.h"
|
||||
|
||||
|
||||
// Cantera includes
|
||||
|
||||
#include "ReactionPath.h"
|
||||
#include "kernel/ReactionPath.h"
|
||||
#include "Cabinet.h"
|
||||
#include "Storage.h"
|
||||
|
||||
|
|
@ -142,7 +138,7 @@ extern "C" {
|
|||
}
|
||||
|
||||
int DLL_EXPORT rdiag_findMajor(int i, double threshold,
|
||||
int lda, double* a) {
|
||||
size_t lda, double* a) {
|
||||
_diag(i)->findMajorPaths(threshold, lda, a);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,6 @@
|
|||
/**
|
||||
* @file ctrpath.h
|
||||
*/
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef CTC_RXNPATH_H
|
||||
#define CTC_RXNPATH_H
|
||||
|
||||
|
|
@ -30,7 +26,7 @@ extern "C" {
|
|||
EEXXTT int DLL_CPREFIX rdiag_setTitle(int i, char* title);
|
||||
EEXXTT int DLL_CPREFIX rdiag_write(int i, int fmt, char* fname);
|
||||
EEXXTT int DLL_CPREFIX rdiag_add(int i, int n);
|
||||
EEXXTT int DLL_CPREFIX rdiag_findMajor(int i, double threshold, int lda, double* a);
|
||||
EEXXTT int DLL_CPREFIX rdiag_findMajor(int i, double threshold, size_t lda, double* a);
|
||||
EEXXTT int DLL_CPREFIX rdiag_setFont(int i, char* font);
|
||||
EEXXTT int DLL_CPREFIX rdiag_displayOnly(int i, int k);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,25 +1,14 @@
|
|||
/**
|
||||
* @file ctsurf.cpp
|
||||
*/
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
// turn off warnings under Windows
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
#pragma warning(disable:4503)
|
||||
#endif
|
||||
|
||||
// clib header information
|
||||
#define CANTERA_USE_INTERNAL
|
||||
#include "ctsurf.h"
|
||||
|
||||
|
||||
// Cantera includes
|
||||
#include "SurfPhase.h"
|
||||
#include "InterfaceKinetics.h"
|
||||
#include "ImplicitSurfChem.h"
|
||||
#include "kernel/SurfPhase.h"
|
||||
#include "kernel/InterfaceKinetics.h"
|
||||
#include "kernel/ImplicitSurfChem.h"
|
||||
|
||||
#include "Cabinet.h"
|
||||
#include "Storage.h"
|
||||
|
|
@ -27,8 +16,6 @@
|
|||
using namespace std;
|
||||
using namespace Cantera;
|
||||
|
||||
|
||||
|
||||
//Cabinet<Surf1D>* Cabinet<Surf1D>::__storage = 0;
|
||||
|
||||
//inline Surf1D* _surface(int i) {
|
||||
|
|
|
|||
|
|
@ -1,10 +1,6 @@
|
|||
/**
|
||||
* @file ctsurf.h
|
||||
*/
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef CTC_SURF_H
|
||||
#define CTC_SURF_H
|
||||
|
||||
|
|
@ -12,9 +8,9 @@
|
|||
#include "clib_defs.h"
|
||||
|
||||
#ifdef CANTERA_USE_INTERNAL
|
||||
#include "config.h"
|
||||
#include "kernel/config.h"
|
||||
#else
|
||||
#include "cantera/config.h"
|
||||
#include "cantera/kernel/config.h"
|
||||
#endif
|
||||
|
||||
extern "C" {
|
||||
|
|
|
|||
|
|
@ -1,22 +1,11 @@
|
|||
/**
|
||||
* @file ctxml.cpp
|
||||
*/
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
#pragma warning(disable:4503)
|
||||
#endif
|
||||
|
||||
#define CANTERA_USE_INTERNAL
|
||||
#include "ctxml.h"
|
||||
|
||||
|
||||
// Cantera includes
|
||||
#include "ctml.h"
|
||||
#include "kernel/ctml.h"
|
||||
#include "Cabinet.h"
|
||||
#include "Storage.h"
|
||||
|
||||
|
|
@ -216,7 +205,7 @@ extern "C" {
|
|||
int DLL_EXPORT xml_nChildren(int i) {
|
||||
try {
|
||||
XML_Node& node = *_xml(i);
|
||||
return node.nChildren();
|
||||
return (int) node.nChildren();
|
||||
}
|
||||
catch (CanteraError) { return -1; }
|
||||
}
|
||||
|
|
@ -259,25 +248,24 @@ extern "C" {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int DLL_EXPORT ctml_getFloatArray(int i, int n, doublereal* data, int iconvert) {
|
||||
int DLL_EXPORT ctml_getFloatArray(int i, size_t n, doublereal* data, int iconvert) {
|
||||
try {
|
||||
XML_Node& node = *_xml(i);
|
||||
vector_fp v;
|
||||
bool conv = false;
|
||||
if (iconvert > 0) conv = true;
|
||||
getFloatArray(node, v, conv);
|
||||
int nv = v.size();
|
||||
size_t nv = v.size();
|
||||
|
||||
// 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 "+int2str(int(nv)));
|
||||
}
|
||||
|
||||
for (int i = 0; i < nv; i++) {
|
||||
for (size_t i = 0; i < nv; i++) {
|
||||
data[i] = v[i];
|
||||
}
|
||||
n = nv;
|
||||
}
|
||||
catch (CanteraError) { return -1; }
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -1,19 +1,15 @@
|
|||
/**
|
||||
* @file ctxml.h
|
||||
*/
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef CTC_XML_H
|
||||
#define CTC_XML_H
|
||||
|
||||
#include "clib_defs.h"
|
||||
|
||||
#ifdef CANTERA_USE_INTERNAL
|
||||
#include "config.h"
|
||||
#include "kernel/config.h"
|
||||
#else
|
||||
#include "cantera/config.h"
|
||||
#include "cantera/kernel/config.h"
|
||||
#endif
|
||||
|
||||
extern "C" {
|
||||
|
|
@ -40,7 +36,7 @@ extern "C" {
|
|||
EEXXTT int DLL_CPREFIX xml_addChildNode(int i, int j);
|
||||
EEXXTT int DLL_CPREFIX xml_write(int i, const char* file);
|
||||
EEXXTT int DLL_CPREFIX xml_removeChild(int i, int j);
|
||||
EEXXTT int DLL_CPREFIX ctml_getFloatArray(int i, int n, double* data, int iconvert=0);
|
||||
EEXXTT int DLL_CPREFIX ctml_getFloatArray(int i, size_t n, double* data, int iconvert=0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,198 +0,0 @@
|
|||
""" Python script to generate a Python extension module from a clib
|
||||
header file. """
|
||||
|
||||
import sys
|
||||
|
||||
_class = ''
|
||||
_newclass = 1
|
||||
|
||||
def getargs(line):
|
||||
"""Get the function name and arguments."""
|
||||
i1 = line.find('(')
|
||||
i2 = line.find(')')
|
||||
if (i1 < 0 or i2 < 0):
|
||||
raise 'syntax error: missing open or close quote'
|
||||
nm = line[:i1].split()
|
||||
nm = nm[-1]
|
||||
argline = line[i1+1:i2]
|
||||
args = argline.split(',')
|
||||
for n in range(len(args)): args[n] = args[n].split()
|
||||
v = []
|
||||
for a in args:
|
||||
if len(a) == 2: v.append(a)
|
||||
return nm, v
|
||||
|
||||
_itype = {'int':'i', 'double':'d', 'char*':'s', 'double*':'O', 'int*':'O'}
|
||||
|
||||
|
||||
def isoutput(name):
|
||||
if len(name) >= 3 and name[-3:] == 'out':
|
||||
return 1
|
||||
else:
|
||||
return 0
|
||||
|
||||
def writepyfunc(rtype, name, args):
|
||||
"""Write the Python extension module function."""
|
||||
|
||||
print """
|
||||
static PyObject *
|
||||
py_"""+name+"""(PyObject *self, PyObject *args)
|
||||
{
|
||||
"""+rtype+""" _val;"""
|
||||
|
||||
global _class, _newclass
|
||||
toks = name.split('_')
|
||||
cls = toks[0]
|
||||
if len(toks) == 2:
|
||||
func = toks[1]
|
||||
else:
|
||||
func = toks[1] + toks[2]
|
||||
|
||||
if cls != _class:
|
||||
_class = cls
|
||||
_newclass = 1
|
||||
else:
|
||||
_newclass = 0
|
||||
|
||||
na = len(args)
|
||||
ain = []
|
||||
output = []
|
||||
if na > 0:
|
||||
vtype = []
|
||||
for a in args:
|
||||
# if the argument is an array, then the previous argument
|
||||
# must have been the array size. The Python argument list
|
||||
# will not include the size
|
||||
if a[0] == 'double*' or a[0] == 'int*':
|
||||
if not isoutput(a[1]):
|
||||
vtype[-1] = 'PyObject*'
|
||||
ain[-1] = a
|
||||
else:
|
||||
output.append(a)
|
||||
elif a[0] == 'char*' and isoutput(a[1]):
|
||||
output.append(a)
|
||||
ain.pop()
|
||||
else:
|
||||
vtype.append(a[0])
|
||||
ain.append(a)
|
||||
for n in range(len(ain)):
|
||||
print ' ',vtype[n],ain[n][1]+';'
|
||||
print ' if (!PyArg_ParseTuple(args,',
|
||||
s = '"'
|
||||
for a in ain:
|
||||
s += _itype[a[0]]
|
||||
s += ':'+name+'",'
|
||||
for a in ain:
|
||||
s += ' &'+a[1]+','
|
||||
s = s[:-1]+'))'
|
||||
print s,
|
||||
print """
|
||||
return NULL;
|
||||
"""
|
||||
v = []
|
||||
for a in output:
|
||||
if a[0] == 'char*':
|
||||
print ' int '+a[1]+'_sz = 80;'
|
||||
print ' char* '+a[1]+' = new char['+a[1]+'_sz];'
|
||||
print
|
||||
|
||||
for a in args:
|
||||
if a[0] == 'double*' or a[0] == 'int*':
|
||||
v[-1] = a[1]+'_len'
|
||||
v.append(a[1]+'_data')
|
||||
array = a[1]+'_array'
|
||||
print
|
||||
print ' PyArrayObject* '+array+' = (PyArrayObject*)'+a[1]+';'
|
||||
print ' '+a[0]+' '+a[1]+'_data = ('+a[0]+')'+array+'->data;'
|
||||
print ' int '+a[1]+'_len = '+array+'->dimensions[0];'
|
||||
print
|
||||
elif a[0] == 'char*' and isoutput(a[1]):
|
||||
v[-1] = a[1]+'_sz'
|
||||
v.append(a[1])
|
||||
else:
|
||||
v.append(a[1])
|
||||
|
||||
s = ' _val = '+name+'('
|
||||
for a in v:
|
||||
s += a+','
|
||||
if s[-1] == ',': s = s[:-1]
|
||||
s += ');'
|
||||
print s,
|
||||
if (output):
|
||||
print '\n PyObject* _ret = Py_BuildValue("'+_itype[output[0][0]]+'",'+output[0][1]+');'
|
||||
print ' delete '+output[0][1]+';'
|
||||
print ' if (int(_val) == -1) return reportCanteraError();'
|
||||
print """ return _ret;\n
|
||||
}
|
||||
"""
|
||||
else:
|
||||
print """
|
||||
if (int(_val) == -1) return reportCanteraError();
|
||||
"""+'return Py_BuildValue("'+_itype[rtype]+'",_val);'+"""
|
||||
}
|
||||
"""
|
||||
return ain
|
||||
|
||||
|
||||
def writepyclass(f, name, args):
|
||||
global _newclass
|
||||
if _newclass == 1:
|
||||
f.write("class "+_class.capitalize()+":\n")
|
||||
f.write(" def __init__(self):\n")
|
||||
f.write(" pass\n");
|
||||
_newclass = 0
|
||||
|
||||
toks = name.split('_')
|
||||
cls = toks[0]
|
||||
if len(toks) == 2:
|
||||
nm = toks[1]
|
||||
else:
|
||||
nm = toks[1] + toks[2]
|
||||
|
||||
f.write(' def '+nm+'(self')
|
||||
for a in args[1:]:
|
||||
f.write(', '+a[1])
|
||||
f.write('):\n')
|
||||
f.write(' return _cantera.'+name+'(self._index')
|
||||
for a in args[1:]:
|
||||
f.write(', '+a[1])
|
||||
f.write(')\n')
|
||||
|
||||
fname = sys.argv[1]
|
||||
base, ext = fname.split('.')
|
||||
mfile = 'py'+base+'_methods.h'
|
||||
pfile = base+'.py'
|
||||
|
||||
_rtypes = ['int', 'double']
|
||||
|
||||
f = open(fname,'r')
|
||||
fm = open(mfile,'w')
|
||||
fp = open(pfile,'w')
|
||||
|
||||
lines = f.readlines()
|
||||
f.close()
|
||||
|
||||
infunc = 0
|
||||
funcline = ''
|
||||
for line in lines:
|
||||
toks = line.split()
|
||||
if len(toks) > 0:
|
||||
if not infunc and toks[0] in _rtypes:
|
||||
infunc = 1
|
||||
funcline = line
|
||||
elif infunc:
|
||||
funcline += line
|
||||
last = toks[-1]
|
||||
if last[-1] == ';':
|
||||
infunc = 0
|
||||
name, args = getargs(funcline)
|
||||
toks = funcline.split()
|
||||
a = writepyfunc(toks[0], name, args)
|
||||
writepyclass(fp, name, a)
|
||||
fm.write(' {"'+name+'", py_'+name+', METH_VARARGS},\n')
|
||||
funcline = ''
|
||||
|
||||
fm.close()
|
||||
fp.close()
|
||||
|
||||
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
# Install script for directory: /Users/dgg/dv/sf/cantera/Cantera
|
||||
|
||||
# Set the install prefix
|
||||
IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
|
||||
SET(CMAKE_INSTALL_PREFIX "/usr/local")
|
||||
ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX)
|
||||
STRING(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
# Set the install configuration name.
|
||||
IF(NOT CMAKE_INSTALL_CONFIG_NAME)
|
||||
IF(BUILD_TYPE)
|
||||
STRING(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
|
||||
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
|
||||
ELSE(BUILD_TYPE)
|
||||
SET(CMAKE_INSTALL_CONFIG_NAME "Debug")
|
||||
ENDIF(BUILD_TYPE)
|
||||
MESSAGE(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
|
||||
ENDIF(NOT CMAKE_INSTALL_CONFIG_NAME)
|
||||
|
||||
# Set the component getting installed.
|
||||
IF(NOT CMAKE_INSTALL_COMPONENT)
|
||||
IF(COMPONENT)
|
||||
MESSAGE(STATUS "Install component: \"${COMPONENT}\"")
|
||||
SET(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
|
||||
ELSE(COMPONENT)
|
||||
SET(CMAKE_INSTALL_COMPONENT)
|
||||
ENDIF(COMPONENT)
|
||||
ENDIF(NOT CMAKE_INSTALL_COMPONENT)
|
||||
|
||||
IF(NOT CMAKE_INSTALL_LOCAL_ONLY)
|
||||
# Include the install script for each subdirectory.
|
||||
INCLUDE("/Users/dgg/dv/sf/cantera/Cantera/src/cmake_install.cmake")
|
||||
INCLUDE("/Users/dgg/dv/sf/cantera/Cantera/clib/cmake_install.cmake")
|
||||
INCLUDE("/Users/dgg/dv/sf/cantera/Cantera/cxx/cmake_install.cmake")
|
||||
|
||||
ENDIF(NOT CMAKE_INSTALL_LOCAL_ONLY)
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
Makefile
|
||||
CMakeFiles
|
||||
cmake_install.cmake
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
|
||||
add_subdirectory( include )
|
||||
add_subdirectory( src )
|
||||
add_subdirectory( demos )
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
#/bin/sh
|
||||
###############################################################
|
||||
# $Author$
|
||||
# $Date$
|
||||
# $Revision$
|
||||
#
|
||||
# Copyright 2001 California Institute of Technology
|
||||
# See file License.txt for licensing information
|
||||
#
|
||||
###############################################################
|
||||
|
||||
build_f90=@BUILD_F90@
|
||||
build_python=@BUILD_PYTHON@
|
||||
|
||||
INCDIR = ../../build/include/cantera
|
||||
INSTALL_TSC = ../../../bin/install_tsc
|
||||
|
||||
CXX_H = Cantera.h equilibrium.h IncompressibleSolid.h \
|
||||
kinetics.h onedim.h surface.h GRI30.h integrators.h \
|
||||
Metal.h PureFluid.h transport.h Edge.h \
|
||||
IdealGasMix.h Interface.h numerics.h solvers.h \
|
||||
reactionpaths.h zerodim.h importPhase.h thermo.h \
|
||||
radiation.h spectra.h electrolyteThermo.h Cantera.mak Cantera_bt.mak
|
||||
|
||||
all:
|
||||
@(cd include ; \
|
||||
for lh in $(CXX_H) ; do \
|
||||
$(INSTALL_TSC) "$${lh}" "../"$(INCDIR) ; \
|
||||
done)
|
||||
cd src; @MAKE@
|
||||
# cd demos; @MAKE@
|
||||
|
||||
clean:
|
||||
@(for lh in $(CXX_H) ; do \
|
||||
th=$(INCDIR)/"$${lh}" ; \
|
||||
if test -f "$${th}" ; then \
|
||||
$(RM) "$${th}" ; \
|
||||
echo "$(RM) $${th}" ; \
|
||||
fi \
|
||||
done)
|
||||
cd src; $(RM) .depends ; @MAKE@ clean
|
||||
cd demos; $(RM) .depends ; @MAKE@ clean
|
||||
|
||||
depends:
|
||||
cd src; @MAKE@ depends
|
||||
# cd demos; @MAKE@ depends
|
||||
|
||||
install:
|
||||
cd src; @MAKE@ install
|
||||
cd demos; @MAKE@ install
|
||||
|
||||
demos:
|
||||
cd demos; @MAKE@
|
||||
|
||||
|
||||
# end of file
|
||||
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
This directory contains files that are part of the C++ user
|
||||
interface. For the kernel C++ files, see directory ../src.
|
||||
|
||||
26
Cantera/cxx/SConscript
Normal file
26
Cantera/cxx/SConscript
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
from buildutils import *
|
||||
|
||||
Import('env', 'buildTargets', 'installTargets', 'demoTargets')
|
||||
|
||||
localenv = env.Clone()
|
||||
|
||||
### Demos ###
|
||||
|
||||
# (subdir, program name, [source extensions])
|
||||
demos = [('combustor', 'combustor', ['cpp']),
|
||||
('flamespeed', 'flamespeed', ['cpp']),
|
||||
('kinetics1', 'kinetics1', ['cpp']),
|
||||
('NASA_coeffs', 'NASA_coeffs', ['cpp']),
|
||||
('rankine', 'rankine', ['cpp'])]
|
||||
|
||||
for subdir, name, extensions in demos:
|
||||
prog = localenv.Program(pjoin('demos',subdir, name),
|
||||
mglob(localenv, pjoin('demos',subdir), *extensions),
|
||||
LIBS=env['cantera_libs'])
|
||||
demoTargets.extend(prog)
|
||||
|
||||
inst = localenv.Install(pjoin('$inst_demodir', 'cxx', subdir),
|
||||
mglob(localenv, pjoin('demos', subdir),
|
||||
'csv','txt','cpp','h','^runtest'))
|
||||
|
||||
installTargets.extend(inst)
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
# Install script for directory: /Users/dgg/dv/sf/cantera/Cantera/cxx
|
||||
|
||||
# Set the install prefix
|
||||
IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
|
||||
SET(CMAKE_INSTALL_PREFIX "/usr/local")
|
||||
ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX)
|
||||
STRING(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
# Set the install configuration name.
|
||||
IF(NOT CMAKE_INSTALL_CONFIG_NAME)
|
||||
IF(BUILD_TYPE)
|
||||
STRING(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
|
||||
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
|
||||
ELSE(BUILD_TYPE)
|
||||
SET(CMAKE_INSTALL_CONFIG_NAME "Debug")
|
||||
ENDIF(BUILD_TYPE)
|
||||
MESSAGE(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
|
||||
ENDIF(NOT CMAKE_INSTALL_CONFIG_NAME)
|
||||
|
||||
# Set the component getting installed.
|
||||
IF(NOT CMAKE_INSTALL_COMPONENT)
|
||||
IF(COMPONENT)
|
||||
MESSAGE(STATUS "Install component: \"${COMPONENT}\"")
|
||||
SET(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
|
||||
ELSE(COMPONENT)
|
||||
SET(CMAKE_INSTALL_COMPONENT)
|
||||
ENDIF(COMPONENT)
|
||||
ENDIF(NOT CMAKE_INSTALL_COMPONENT)
|
||||
|
||||
IF(NOT CMAKE_INSTALL_LOCAL_ONLY)
|
||||
# Include the install script for each subdirectory.
|
||||
INCLUDE("/Users/dgg/dv/sf/cantera/Cantera/cxx/include/cmake_install.cmake")
|
||||
INCLUDE("/Users/dgg/dv/sf/cantera/Cantera/cxx/src/cmake_install.cmake")
|
||||
INCLUDE("/Users/dgg/dv/sf/cantera/Cantera/cxx/demos/cmake_install.cmake")
|
||||
|
||||
ENDIF(NOT CMAKE_INSTALL_LOCAL_ONLY)
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
Makefile
|
||||
kin1.dat
|
||||
kin1.csv
|
||||
gri30.xml
|
||||
*.log
|
||||
.cttmp.py
|
||||
kinetics1
|
||||
SunWS_cache
|
||||
demos
|
||||
*.d
|
||||
.depends
|
||||
liquidvapor.xml
|
||||
CMakeFiles
|
||||
cmake_install.cmake
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
SET (COMBUST_SRCS combustor.cpp)
|
||||
|
||||
INCLUDE_DIRECTORIES (${PROJECT_BINARY_DIR}/build/include)
|
||||
INCLUDE_DIRECTORIES (${PROJECT_BINARY_DIR})
|
||||
|
||||
ADD_EXECUTABLE(combustor.x ${COMBUST_SRCS})
|
||||
TARGET_LINK_LIBRARIES ( combustor.x zeroD kinetics thermo ctbase tpx cvode )
|
||||
|
||||
ADD_EXECUTABLE(flamespeed.x flamespeed.cpp )
|
||||
TARGET_LINK_LIBRARIES ( flamespeed.x oneD equil transport kinetics numerics
|
||||
thermo ctbase tpx ctmath ctlapack ctblas ctf2c )
|
||||
|
||||
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
############################################################################
|
||||
#
|
||||
# Makefile to compile and link a C++ application to
|
||||
# Cantera.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
all:
|
||||
cd combustor; @MAKE@
|
||||
cd kinetics1; @MAKE@
|
||||
cd flamespeed; @MAKE@
|
||||
cd NASA_coeffs; @MAKE@
|
||||
|
||||
test:
|
||||
cd combustor; @MAKE@ -s test
|
||||
cd kinetics1; @MAKE@ -s test
|
||||
cd NASA_coeffs; @MAKE@ -s test
|
||||
cd flamespeed; @MAKE@ -s test
|
||||
|
||||
install:
|
||||
@INSTALL@ -d @ct_demodir@/cxx
|
||||
@INSTALL@ -m ug+rw,o+r Makefile @ct_demodir@/cxx
|
||||
cd combustor; @MAKE@ install
|
||||
cd flamespeed; @MAKE@ install
|
||||
cd kinetics1; @MAKE@ install
|
||||
cd NASA_coeffs; @MAKE@ install
|
||||
|
||||
depends:
|
||||
cd combustor; @MAKE@ depends
|
||||
cd kinetics1; @MAKE@ depends
|
||||
cd flamespeed; @MAKE@ depends
|
||||
cd NASA_coeffs; @MAKE@ depends
|
||||
|
||||
|
||||
clean:
|
||||
cd combustor; @MAKE@ clean
|
||||
cd kinetics1; @MAKE@ clean
|
||||
cd flamespeed; @MAKE@ clean
|
||||
cd NASA_coeffs; @MAKE@ clean
|
||||
|
||||
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
############################################################################
|
||||
#
|
||||
# Makefile to run vc++ test programs under cygwin
|
||||
# on the pc
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
all:
|
||||
|
||||
test:
|
||||
cd combustor; make -s test
|
||||
cd kinetics1; make -s test
|
||||
cd NASA_coeffs; make -s test
|
||||
cd flamespeed; make -s test
|
||||
|
||||
clean:
|
||||
cd combustor; make clean
|
||||
cd kinetics1; make clean
|
||||
cd NASA_coeffs; make clean
|
||||
cd flamespeed; make clean
|
||||
|
||||
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
Makefile
|
||||
Makefile.install
|
||||
NASA_coeffs
|
||||
ct2ctml.log
|
||||
diff_out_0.txt
|
||||
gri30.xml
|
||||
h2o2.xml
|
||||
output_0.txt
|
||||
transport_log.xml
|
||||
*.d
|
||||
.depends
|
||||
|
|
@ -1,118 +0,0 @@
|
|||
############################################################################
|
||||
#
|
||||
# Makefile to compile and link a C++ application to
|
||||
# Cantera.
|
||||
#
|
||||
#############################################################################
|
||||
.SUFFIXES :
|
||||
.SUFFIXES : .cpp .d .o .d .h
|
||||
|
||||
|
||||
# the name of the executable program to be created
|
||||
PROG_NAME = NASA_coeffs
|
||||
|
||||
# the object files to be linked together. List those generated from Fortran
|
||||
# and from C/C++ separately
|
||||
OBJS = NASA_coeffs.o
|
||||
|
||||
# additional flags to be passed to the linker. If your program
|
||||
# requires other external libraries, put them here
|
||||
LINK_OPTIONS = @EXTRA_LINK@
|
||||
|
||||
#############################################################################
|
||||
# True if we are in the source directory tree
|
||||
srcdirtree=1
|
||||
|
||||
# Fortran libraries
|
||||
FORT_LIBS = @FLIBS@
|
||||
|
||||
# Purify options
|
||||
PURIFY=@PURIFY@
|
||||
|
||||
# the C++ compiler
|
||||
CXX = @CXX@
|
||||
|
||||
# C++ compile flags
|
||||
CXX_FLAGS = @CXXFLAGS@ @CXX_INCLUDES@
|
||||
|
||||
# external libraries
|
||||
EXT_LIBS = @LOCAL_LIBS@ -ltpx -lctcxx
|
||||
|
||||
# Ending C++ linking libraries
|
||||
LCXX_END_LIBS = @LCXX_END_LIBS@
|
||||
|
||||
# the directory where the Cantera libraries are located
|
||||
CANTERA_LIBDIR=@buildlib@
|
||||
|
||||
# required Cantera libraries
|
||||
CANTERA_LIBS =
|
||||
|
||||
# Depends
|
||||
ifeq ($srcdirtree, 1)
|
||||
LOCAL_DEFNS = -DSRCDIRTREE
|
||||
else
|
||||
LOCAL_DEFNS =
|
||||
endif
|
||||
|
||||
# the directory where Cantera include files may be found.
|
||||
CANTERA_INCDIR=@ctroot@/build/include
|
||||
|
||||
# flags passed to the C++ compiler/linker for the linking step
|
||||
LCXX_FLAGS = -L$(CANTERA_LIBDIR) @LOCAL_LIB_DIRS@ @CXXFLAGS@
|
||||
|
||||
# how to compile C++ source files to object files
|
||||
.@CXX_EXT@.@OBJ_EXT@:
|
||||
$(PURIFY) $(CXX) -c $< -I$(CANTERA_INCDIR) $(CXX_FLAGS) $(LOCAL_DEFNS)
|
||||
|
||||
# how to create a dependency file
|
||||
.@CXX_EXT@.d:
|
||||
@CXX_DEPENDS@ -I$(CANTERA_INCDIR) $(CXX_FLAGS) $(LOCAL_DEFNS) $*.cpp > $*.d
|
||||
|
||||
PROGRAM = $(PROG_NAME)$(EXE_EXT)
|
||||
|
||||
DEPENDS = $(OBJS:.o=.d)
|
||||
|
||||
all: $(PROGRAM) .depends
|
||||
|
||||
$(PROGRAM): $(OBJS)
|
||||
$(PURIFY) $(CXX) -o $(PROGRAM) $(OBJS) $(LCXX_FLAGS) $(CANTERA_LIBS) \
|
||||
$(LINK_OPTIONS) $(EXT_LIBS) @LIBS@ $(FORT_LIBS) \
|
||||
$(LCXX_END_LIBS)
|
||||
|
||||
test:
|
||||
@MAKE@ $(PROGRAM)
|
||||
./runtest
|
||||
|
||||
INSTALL_DIR=@ct_demodir@/cxx/NASA_coeffs
|
||||
|
||||
install:
|
||||
@INSTALL@ -d $(INSTALL_DIR)
|
||||
@INSTALL@ -c -m ug+rw,o+r Makefile.install $(INSTALL_DIR)/Makefile
|
||||
@(for ihhh in *.cpp *blessed* ; do \
|
||||
@INSTALL@ $${ihhh} -m ug+rw,o+r $(INSTALL_DIR) ; \
|
||||
echo "@INSTALL@ $${ihhh} -m ug+rw,o+r $(INSTALL_DIR)" ; \
|
||||
done )
|
||||
@INSTALL@ runtest $(INSTALL_DIR) ;
|
||||
|
||||
|
||||
depends: $(DEPENDS)
|
||||
@MAKE@ .depends
|
||||
|
||||
.depends: $(DEPENDS)
|
||||
cat $(DEPENDS) > .depends
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJS) $(PROGRAM) .depends *.d
|
||||
$(RM) ct2ctml.log diff* output_0.txt transport_log.xml \
|
||||
NASA_coeffs.csv
|
||||
(if test -d SunWS_cache ; then \
|
||||
$(RM) -rf SunWS_cache ; \
|
||||
fi )
|
||||
|
||||
TAGS:
|
||||
etags *.h *.cpp
|
||||
|
||||
ifeq ($(wildcard .depends), .depends)
|
||||
include .depends
|
||||
endif
|
||||
|
||||
|
|
@ -1,97 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
############################################################################
|
||||
#
|
||||
# Makefile to compile and link a C++ application to
|
||||
# Cantera.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
# addition to suffixes
|
||||
.SUFFIXES : .d
|
||||
|
||||
# the name of the executable program to be created
|
||||
PROG_NAME = NASA_coeffs
|
||||
|
||||
# the object files to be linked together. List those generated from Fortran
|
||||
# and from C/C++ separately
|
||||
OBJS = NASA_coeffs.o
|
||||
|
||||
# additional flags to be passed to the linker. If your program
|
||||
# requires other external libraries, put them here
|
||||
LINK_OPTIONS =
|
||||
|
||||
#############################################################################
|
||||
# These links are to Cantera's install space
|
||||
CANTERA_INCROOT = @ct_incroot@
|
||||
#
|
||||
# Bring in the Cantera includes through the .mak file
|
||||
#
|
||||
include $(CANTERA_INCROOT)/cantera/Cantera.mak
|
||||
|
||||
# Check to see whether we are in the msvc++ environment
|
||||
os_is_win = @OS_IS_WIN@
|
||||
|
||||
# Fortran libraries
|
||||
FORT_LIBS = @FLIBS@
|
||||
|
||||
# the C++ compiler
|
||||
CXX = @CXX@
|
||||
#
|
||||
# The directory where Cantera include files may be found.
|
||||
#
|
||||
INCLUDE_DIRS = -I../../src -I$(CANTERA_INCROOT)
|
||||
#
|
||||
# C++ compile flags
|
||||
CXX_FLAGS = @CXXFLAGS@ $(INCLUDE_DIRS) -DUSE_VCSNONIDEAL
|
||||
#
|
||||
# Ending C++ linking libraries
|
||||
LCXX_END_LIBS = @LCXX_END_LIBS@
|
||||
|
||||
# flags passed to the C++ compiler/linker for the linking step
|
||||
LCXX_FLAGS = @CXXFLAGS@
|
||||
|
||||
# How to compile C++ source files to object files
|
||||
.cpp.o:
|
||||
$(CXX) $(CXX_FLAGS) -c $<
|
||||
|
||||
# How to compile the dependency file
|
||||
.cpp.d:
|
||||
@CXX_DEPENDS@ $(CXX_FLAGS) $*.cpp > $*.d
|
||||
|
||||
# List of dependency files to be created
|
||||
DEPENDS=$(OBJS:.o=.d)
|
||||
|
||||
# Program Name
|
||||
PROGRAM = $(PROG_NAME)$(EXE_EXT)
|
||||
|
||||
all: $(PROGRAM) .depends
|
||||
|
||||
$(PROGRAM): $(OBJS) $(CANTERA_CORE_LIBS_DEP)
|
||||
$(CXX) -o $(PROGRAM) $(OBJS) $(LCXX_FLAGS) $(LINK_OPTIONS) \
|
||||
$(CANTERA_TOTAL_LIBS) $(LCXX_END_LIBS)
|
||||
|
||||
# depends target -> forces recalculation of dependencies
|
||||
depends:
|
||||
$(RM) *.d .depends
|
||||
@MAKE@ .depends
|
||||
|
||||
.depends: $(DEPENDS)
|
||||
cat *.d > .depends
|
||||
|
||||
# Do the test -> For the windows vc++ environment, we have to skip checking on
|
||||
# whether the program is uptodate, because we don't utilize make
|
||||
# in that environment to build programs.
|
||||
test:
|
||||
ifeq ($(os_is_win), 1)
|
||||
else
|
||||
@MAKE@ $(PROGRAM)
|
||||
endif
|
||||
./runtest
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJS) *.o $(PROGRAM) $(DEPENDS) .depends
|
||||
(if test -d SunWS_cache ; then \
|
||||
$(RM) -rf SunWS_cache ; \
|
||||
fi )
|
||||
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
############################################################################
|
||||
#
|
||||
# Makefile to compile and link a C++ application to
|
||||
# Cantera.
|
||||
#
|
||||
PROG_NAME=NASA_coeffs
|
||||
EXE_EXT=.exe
|
||||
|
||||
# Program Name
|
||||
PROGRAM = $(PROG_NAME)$(EXE_EXT)
|
||||
|
||||
|
||||
# Do the test -> For the windows vc++ environment, we have to skip checking on
|
||||
# whether the program is uptodate, because we don't utilize make
|
||||
# in that environment to build programs.
|
||||
test:
|
||||
./runtest
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJS) *.o $(PROGRAM) $(DEPENDS) .depends
|
||||
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
diff_out_0.txt
|
||||
Makefile
|
||||
Makefile.install
|
||||
air.xml
|
||||
combustor
|
||||
combustor_cxx.csv
|
||||
ct2ctml.log
|
||||
diff_csv.txt
|
||||
gri30.xml
|
||||
output_0.txt
|
||||
*.d
|
||||
.depends
|
||||
|
|
@ -1,117 +0,0 @@
|
|||
############################################################################
|
||||
#
|
||||
# Makefile to compile and link a C++ application to
|
||||
# Cantera.
|
||||
#
|
||||
#############################################################################
|
||||
.SUFFIXES :
|
||||
.SUFFIXES : .cpp .d .o .h
|
||||
|
||||
# the name of the executable program to be created
|
||||
PROG_NAME = combustor
|
||||
|
||||
# the object files to be linked together. List those generated from Fortran
|
||||
# and from C/C++ separately
|
||||
OBJS = combustor.o
|
||||
|
||||
# additional flags to be passed to the linker. If your program
|
||||
# requires other external libraries, put them here
|
||||
LINK_OPTIONS = @EXTRA_LINK@
|
||||
|
||||
#############################################################################
|
||||
# True if we are in the source directory tree
|
||||
srcdirtree=1
|
||||
|
||||
# Fortran libraries
|
||||
FORT_LIBS = @FLIBS@
|
||||
|
||||
# Purify options
|
||||
PURIFY=@PURIFY@
|
||||
|
||||
# the C++ compiler
|
||||
CXX = @CXX@
|
||||
|
||||
# C++ compile flags
|
||||
CXX_FLAGS = @CXXFLAGS@ @CXX_INCLUDES@
|
||||
|
||||
# external libraries
|
||||
EXT_LIBS = @LOCAL_LIBS@ -ltpx -lctcxx
|
||||
|
||||
# Ending C++ linking libraries
|
||||
LCXX_END_LIBS = @LCXX_END_LIBS@
|
||||
|
||||
# the directory where the Cantera libraries are located
|
||||
CANTERA_LIBDIR=@buildlib@
|
||||
|
||||
# required Cantera libraries
|
||||
CANTERA_LIBS =
|
||||
|
||||
# Depends
|
||||
ifeq ($srcdirtree, 1)
|
||||
LOCAL_DEFNS = -DSRCDIRTREE
|
||||
else
|
||||
LOCAL_DEFNS =
|
||||
endif
|
||||
|
||||
# the directory where Cantera include files may be found.
|
||||
CANTERA_INCDIR=@ctroot@/build/include
|
||||
|
||||
# flags passed to the C++ compiler/linker for the linking step
|
||||
LCXX_FLAGS = -L$(CANTERA_LIBDIR) @LOCAL_LIB_DIRS@ @CXXFLAGS@
|
||||
|
||||
# how to compile C++ source files to object files
|
||||
.@CXX_EXT@.@OBJ_EXT@:
|
||||
$(PURIFY) $(CXX) -c $< -I$(CANTERA_INCDIR) $(CXX_FLAGS) $(LOCAL_DEFNS)
|
||||
|
||||
# how to create a dependency file
|
||||
.@CXX_EXT@.d:
|
||||
@CXX_DEPENDS@ -I$(CANTERA_INCDIR) $(CXX_FLAGS) $(LOCAL_DEFNS) $*.cpp > $*.d
|
||||
|
||||
PROGRAM = $(PROG_NAME)$(EXE_EXT)
|
||||
|
||||
DEPENDS = $(OBJS:.o=.d)
|
||||
|
||||
all: $(PROGRAM) .depends
|
||||
|
||||
$(PROGRAM): $(OBJS)
|
||||
$(PURIFY) $(CXX) -o $(PROGRAM) $(OBJS) $(LCXX_FLAGS) $(CANTERA_LIBS) \
|
||||
$(LINK_OPTIONS) $(EXT_LIBS) @LIBS@ $(FORT_LIBS) \
|
||||
$(LCXX_END_LIBS)
|
||||
|
||||
test:
|
||||
@MAKE@ $(PROGRAM)
|
||||
./runtest
|
||||
|
||||
INSTALL_DIR=@ct_demodir@/cxx/combustor
|
||||
|
||||
install:
|
||||
@INSTALL@ -d $(INSTALL_DIR)
|
||||
@INSTALL@ -c -m ug+rw,o+r Makefile.install $(INSTALL_DIR)/Makefile
|
||||
@(for ihhh in *.cpp *blessed* ; do \
|
||||
@INSTALL@ $${ihhh} -m ug+rw,o+r $(INSTALL_DIR) ; \
|
||||
echo "@INSTALL@ $${ihhh} -m ug+rw,o+r $(INSTALL_DIR)" ; \
|
||||
done )
|
||||
@INSTALL@ runtest $(INSTALL_DIR) ;
|
||||
|
||||
|
||||
depends: $(DEPENDS)
|
||||
@MAKE@ .depends
|
||||
|
||||
.depends: $(DEPENDS)
|
||||
cat $(DEPENDS) > .depends
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJS) $(PROGRAM) .depends *.d
|
||||
$(RM) ct2ctml.log diff* output_0.txt transport_log.xml \
|
||||
combustor_cxx.csv
|
||||
(if test -d SunWS_cache ; then \
|
||||
$(RM) -rf SunWS_cache ; \
|
||||
fi )
|
||||
|
||||
TAGS:
|
||||
etags *.h *.cpp
|
||||
|
||||
ifeq ($(wildcard .depends), .depends)
|
||||
include .depends
|
||||
endif
|
||||
|
||||
|
|
@ -1,97 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
############################################################################
|
||||
#
|
||||
# Makefile to compile and link a C++ application to
|
||||
# Cantera.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
# addition to suffixes
|
||||
.SUFFIXES : .d
|
||||
|
||||
# the name of the executable program to be created
|
||||
PROG_NAME = combustor
|
||||
|
||||
# the object files to be linked together. List those generated from Fortran
|
||||
# and from C/C++ separately
|
||||
OBJS = combustor.o
|
||||
|
||||
# additional flags to be passed to the linker. If your program
|
||||
# requires other external libraries, put them here
|
||||
LINK_OPTIONS =
|
||||
|
||||
#############################################################################
|
||||
# These links are to Cantera's install space
|
||||
CANTERA_INCROOT = @ct_incroot@
|
||||
#
|
||||
# Bring in the Cantera includes through the .mak file
|
||||
#
|
||||
include $(CANTERA_INCROOT)/cantera/Cantera.mak
|
||||
|
||||
# Check to see whether we are in the msvc++ environment
|
||||
os_is_win = @OS_IS_WIN@
|
||||
|
||||
# Fortran libraries
|
||||
FORT_LIBS = @FLIBS@
|
||||
|
||||
# the C++ compiler
|
||||
CXX = @CXX@
|
||||
#
|
||||
# The directory where Cantera include files may be found.
|
||||
#
|
||||
INCLUDE_DIRS = -I../../src -I$(CANTERA_INCROOT)
|
||||
#
|
||||
# C++ compile flags
|
||||
CXX_FLAGS = @CXXFLAGS@ $(INCLUDE_DIRS) -DUSE_VCSNONIDEAL
|
||||
#
|
||||
# Ending C++ linking libraries
|
||||
LCXX_END_LIBS = @LCXX_END_LIBS@
|
||||
|
||||
# flags passed to the C++ compiler/linker for the linking step
|
||||
LCXX_FLAGS = @CXXFLAGS@
|
||||
|
||||
# How to compile C++ source files to object files
|
||||
.cpp.o:
|
||||
$(CXX) $(CXX_FLAGS) -c $<
|
||||
|
||||
# How to compile the dependency file
|
||||
.cpp.d:
|
||||
@CXX_DEPENDS@ $(CXX_FLAGS) $*.cpp > $*.d
|
||||
|
||||
# List of dependency files to be created
|
||||
DEPENDS=$(OBJS:.o=.d)
|
||||
|
||||
# Program Name
|
||||
PROGRAM = $(PROG_NAME)$(EXE_EXT)
|
||||
|
||||
all: $(PROGRAM) .depends
|
||||
|
||||
$(PROGRAM): $(OBJS) $(CANTERA_CORE_LIBS_DEP)
|
||||
$(CXX) -o $(PROGRAM) $(OBJS) $(LCXX_FLAGS) $(LINK_OPTIONS) \
|
||||
$(CANTERA_TOTAL_LIBS) $(LCXX_END_LIBS)
|
||||
|
||||
# depends target -> forces recalculation of dependencies
|
||||
depends:
|
||||
$(RM) *.d .depends
|
||||
@MAKE@ .depends
|
||||
|
||||
.depends: $(DEPENDS)
|
||||
cat *.d > .depends
|
||||
|
||||
# Do the test -> For the windows vc++ environment, we have to skip checking on
|
||||
# whether the program is uptodate, because we don't utilize make
|
||||
# in that environment to build programs.
|
||||
test:
|
||||
ifeq ($(os_is_win), 1)
|
||||
else
|
||||
@MAKE@ $(PROGRAM)
|
||||
endif
|
||||
./runtest
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJS) *.o $(PROGRAM) $(DEPENDS) .depends
|
||||
(if test -d SunWS_cache ; then \
|
||||
$(RM) -rf SunWS_cache ; \
|
||||
fi )
|
||||
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
############################################################################
|
||||
#
|
||||
# Makefile to compile and link a C++ application to
|
||||
# Cantera.
|
||||
#
|
||||
PROG_NAME=combustor
|
||||
EXE_EXT=.exe
|
||||
|
||||
# Program Name
|
||||
PROGRAM = $(PROG_NAME)$(EXE_EXT)
|
||||
|
||||
|
||||
# Do the test -> For the windows vc++ environment, we have to skip checking on
|
||||
# whether the program is uptodate, because we don't utilize make
|
||||
# in that environment to build programs.
|
||||
test:
|
||||
./runtest
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJS) *.o $(PROGRAM) $(DEPENDS) .depends
|
||||
|
||||
|
|
@ -11,10 +11,7 @@
|
|||
#include <cantera/zerodim.h>
|
||||
#include <cantera/IdealGasMix.h>
|
||||
|
||||
using namespace CanteraZeroD;
|
||||
using namespace Cantera;
|
||||
using namespace Cantera_CXX;
|
||||
using namespace std;
|
||||
|
||||
void runexample() {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +0,0 @@
|
|||
Makefile
|
||||
.depends
|
||||
Makefile.install
|
||||
ct2ctml.log
|
||||
diff_csv.txt
|
||||
diff_out_0.txt
|
||||
flamespeed
|
||||
flamespeed.csv
|
||||
flamespeed.d
|
||||
gri30.xml
|
||||
output_0.txt
|
||||
transport_log.xml
|
||||
*.d
|
||||
|
|
@ -1,119 +0,0 @@
|
|||
############################################################################
|
||||
#
|
||||
# Makefile to compile and link a C++ application to
|
||||
# Cantera.
|
||||
#
|
||||
#############################################################################
|
||||
.SUFFIXES :
|
||||
.SUFFIXES : .cpp .d .o .d .h
|
||||
|
||||
|
||||
# the name of the executable program to be created
|
||||
PROG_NAME = flamespeed
|
||||
|
||||
# the object files to be linked together. List those generated from Fortran
|
||||
# and from C/C++ separately
|
||||
OBJS = flamespeed.o
|
||||
|
||||
# additional flags to be passed to the linker. If your program
|
||||
# requires other external libraries, put them here
|
||||
LINK_OPTIONS = @EXTRA_LINK@
|
||||
|
||||
#############################################################################
|
||||
# True if we are in the source directory tree
|
||||
srcdirtree=1
|
||||
|
||||
# Fortran libraries
|
||||
FORT_LIBS = @FLIBS@
|
||||
|
||||
# Purify options
|
||||
PURIFY=@PURIFY@
|
||||
|
||||
# the C++ compiler
|
||||
CXX = @CXX@
|
||||
|
||||
# C++ compile flags
|
||||
CXX_FLAGS = @CXXFLAGS@ @CXX_INCLUDES@
|
||||
|
||||
# external libraries
|
||||
EXT_LIBS = @LOCAL_LIBS@ -ltpx -lctcxx
|
||||
|
||||
# Ending C++ linking libraries
|
||||
LCXX_END_LIBS = @LCXX_END_LIBS@
|
||||
|
||||
# the directory where the Cantera libraries are located
|
||||
CANTERA_LIBDIR=@buildlib@
|
||||
|
||||
# required Cantera libraries
|
||||
CANTERA_LIBS =
|
||||
|
||||
# Depends
|
||||
ifeq ($srcdirtree, 1)
|
||||
LOCAL_DEFNS = -DSRCDIRTREE
|
||||
else
|
||||
LOCAL_DEFNS =
|
||||
endif
|
||||
|
||||
# the directory where Cantera include files may be found.
|
||||
CANTERA_INCDIR=@ctroot@/build/include
|
||||
|
||||
# flags passed to the C++ compiler/linker for the linking step
|
||||
LCXX_FLAGS = -L$(CANTERA_LIBDIR) @LOCAL_LIB_DIRS@ @CXXFLAGS@
|
||||
|
||||
# how to compile C++ source files to object files
|
||||
.@CXX_EXT@.@OBJ_EXT@:
|
||||
$(PURIFY) $(CXX) -c $< -I$(CANTERA_INCDIR) $(CXX_FLAGS) $(LOCAL_DEFNS)
|
||||
|
||||
# how to create a dependency file
|
||||
.@CXX_EXT@.d:
|
||||
@CXX_DEPENDS@ -I$(CANTERA_INCDIR) $(CXX_FLAGS) $(LOCAL_DEFNS) $*.cpp > $*.d
|
||||
|
||||
PROGRAM = $(PROG_NAME)$(EXE_EXT)
|
||||
|
||||
DEPENDS = $(OBJS:.o=.d)
|
||||
|
||||
all: $(PROGRAM) .depends
|
||||
|
||||
$(PROGRAM): $(OBJS)
|
||||
$(PURIFY) $(CXX) -o $(PROGRAM) $(OBJS) $(LCXX_FLAGS) $(CANTERA_LIBS) \
|
||||
$(LINK_OPTIONS) $(EXT_LIBS) @LIBS@ $(FORT_LIBS) \
|
||||
$(LCXX_END_LIBS)
|
||||
|
||||
test:
|
||||
@MAKE@ $(PROGRAM)
|
||||
./runtest
|
||||
|
||||
INSTALL_DIR=@ct_demodir@/cxx/flamespeed
|
||||
|
||||
install:
|
||||
@INSTALL@ -d $(INSTALL_DIR)
|
||||
@INSTALL@ -c -m ug+rw,o+r Makefile.install $(INSTALL_DIR)/Makefile
|
||||
@(for ihhh in *.cpp *blessed* ; do \
|
||||
@INSTALL@ $${ihhh} -m ug+rw,o+r $(INSTALL_DIR) ; \
|
||||
echo "@INSTALL@ $${ihhh} -m ug+rw,o+r $(INSTALL_DIR)" ; \
|
||||
done )
|
||||
@INSTALL@ runtest $(INSTALL_DIR) ;
|
||||
@INSTALL@ phi_input.txt $(INSTALL_DIR) ;
|
||||
|
||||
|
||||
depends: $(DEPENDS)
|
||||
@MAKE@ .depends
|
||||
|
||||
.depends: $(DEPENDS)
|
||||
cat $(DEPENDS) > .depends
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJS) $(PROGRAM) .depends *.d
|
||||
$(RM) ct2ctml.log diff* output_0.txt transport_log.xml \
|
||||
flamespeed.csv
|
||||
(if test -d SunWS_cache ; then \
|
||||
$(RM) -rf SunWS_cache ; \
|
||||
fi )
|
||||
|
||||
TAGS:
|
||||
etags *.h *.cpp
|
||||
|
||||
ifeq ($(wildcard .depends), .depends)
|
||||
include .depends
|
||||
endif
|
||||
|
||||
|
|
@ -1,97 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
############################################################################
|
||||
#
|
||||
# Makefile to compile and link a C++ application to
|
||||
# Cantera.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
# addition to suffixes
|
||||
.SUFFIXES : .d
|
||||
|
||||
# the name of the executable program to be created
|
||||
PROG_NAME = flamespeed
|
||||
|
||||
# the object files to be linked together. List those generated from Fortran
|
||||
# and from C/C++ separately
|
||||
OBJS = flamespeed.o
|
||||
|
||||
# additional flags to be passed to the linker. If your program
|
||||
# requires other external libraries, put them here
|
||||
LINK_OPTIONS =
|
||||
|
||||
#############################################################################
|
||||
# These links are to Cantera's install space
|
||||
CANTERA_INCROOT = @ct_incroot@
|
||||
#
|
||||
# Bring in the Cantera includes through the .mak file
|
||||
#
|
||||
include $(CANTERA_INCROOT)/cantera/Cantera.mak
|
||||
|
||||
# Check to see whether we are in the msvc++ environment
|
||||
os_is_win = @OS_IS_WIN@
|
||||
|
||||
# Fortran libraries
|
||||
FORT_LIBS = @FLIBS@
|
||||
|
||||
# the C++ compiler
|
||||
CXX = @CXX@
|
||||
#
|
||||
# The directory where Cantera include files may be found.
|
||||
#
|
||||
INCLUDE_DIRS = -I../../src -I$(CANTERA_INCROOT)
|
||||
#
|
||||
# C++ compile flags
|
||||
CXX_FLAGS = @CXXFLAGS@ $(INCLUDE_DIRS) -DUSE_VCSNONIDEAL
|
||||
#
|
||||
# Ending C++ linking libraries
|
||||
LCXX_END_LIBS = @LCXX_END_LIBS@
|
||||
|
||||
# flags passed to the C++ compiler/linker for the linking step
|
||||
LCXX_FLAGS = @CXXFLAGS@
|
||||
|
||||
# How to compile C++ source files to object files
|
||||
.cpp.o:
|
||||
$(CXX) $(CXX_FLAGS) -c $<
|
||||
|
||||
# How to compile the dependency file
|
||||
.cpp.d:
|
||||
@CXX_DEPENDS@ $(CXX_FLAGS) $*.cpp > $*.d
|
||||
|
||||
# List of dependency files to be created
|
||||
DEPENDS=$(OBJS:.o=.d)
|
||||
|
||||
# Program Name
|
||||
PROGRAM = $(PROG_NAME)$(EXE_EXT)
|
||||
|
||||
all: $(PROGRAM) .depends
|
||||
|
||||
$(PROGRAM): $(OBJS) $(CANTERA_CORE_LIBS_DEP)
|
||||
$(CXX) -o $(PROGRAM) $(OBJS) $(LCXX_FLAGS) $(LINK_OPTIONS) \
|
||||
$(CANTERA_TOTAL_LIBS) $(LCXX_END_LIBS)
|
||||
|
||||
# depends target -> forces recalculation of dependencies
|
||||
depends:
|
||||
$(RM) *.d .depends
|
||||
@MAKE@ .depends
|
||||
|
||||
.depends: $(DEPENDS)
|
||||
cat *.d > .depends
|
||||
|
||||
# Do the test -> For the windows vc++ environment, we have to skip checking on
|
||||
# whether the program is uptodate, because we don't utilize make
|
||||
# in that environment to build programs.
|
||||
test:
|
||||
ifeq ($(os_is_win), 1)
|
||||
else
|
||||
@MAKE@ $(PROGRAM)
|
||||
endif
|
||||
./runtest
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJS) *.o $(PROGRAM) $(DEPENDS) .depends
|
||||
(if test -d SunWS_cache ; then \
|
||||
$(RM) -rf SunWS_cache ; \
|
||||
fi )
|
||||
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
############################################################################
|
||||
#
|
||||
# Makefile to compile and link a C++ application to
|
||||
# Cantera.
|
||||
#
|
||||
PROG_NAME=flamespeed
|
||||
EXE_EXT=.exe
|
||||
|
||||
# Program Name
|
||||
PROGRAM = $(PROG_NAME)$(EXE_EXT)
|
||||
|
||||
|
||||
# Do the test -> For the windows vc++ environment, we have to skip checking on
|
||||
# whether the program is uptodate, because we don't utilize make
|
||||
# in that environment to build programs.
|
||||
test:
|
||||
./runtest
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJS) *.o $(PROGRAM) $(DEPENDS) .depends
|
||||
|
||||
|
|
@ -1,14 +1,3 @@
|
|||
//
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
/*Warning messages that are identified as Warning C4786: are created
|
||||
when MSVC generates extremely long names that it uses for debugging
|
||||
purposes. The long names are generated by the template expansion
|
||||
process and the warning messages normally can be ignored. Since these
|
||||
warnings tend to hide more interesting warning/error messages, you may
|
||||
wish to suppress the warning*/
|
||||
#endif
|
||||
|
||||
#include <cantera/Cantera.h>
|
||||
#include <cantera/onedim.h>
|
||||
#include <cantera/IdealGasMix.h>
|
||||
|
|
@ -16,8 +5,6 @@
|
|||
#include <cantera/transport.h>
|
||||
|
||||
using namespace Cantera;
|
||||
using namespace Cantera_CXX;
|
||||
using namespace std;
|
||||
|
||||
int flamespeed(int np, void* p) {
|
||||
try {
|
||||
|
|
@ -214,7 +201,6 @@ int flamespeed(int np, void* p) {
|
|||
cout << "Flame speed with multicomponent transport + Soret: " <<
|
||||
flame.value(flowdomain,flow.componentIndex("u"),0) << " m/s" << endl;
|
||||
|
||||
//
|
||||
int np=flow.nPoints();
|
||||
vector<doublereal> zvec,Tvec,COvec,CO2vec,Uvec;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +0,0 @@
|
|||
Makefile
|
||||
Makefile.install
|
||||
ct2ctml.log
|
||||
diff_csv.txt
|
||||
diff_out_0.txt
|
||||
gri30.xml
|
||||
kin1.csv
|
||||
kin1.dat
|
||||
kinetics1
|
||||
output_0.txt
|
||||
transport_log.xml
|
||||
.depends
|
||||
*.d
|
||||
|
|
@ -1,118 +0,0 @@
|
|||
############################################################################
|
||||
#
|
||||
# Makefile to compile and link a C++ application to
|
||||
# Cantera.
|
||||
#
|
||||
#############################################################################
|
||||
.SUFFIXES :
|
||||
.SUFFIXES : .cpp .d .o .d .h
|
||||
|
||||
|
||||
# the name of the executable program to be created
|
||||
PROG_NAME = kinetics1
|
||||
|
||||
# the object files to be linked together. List those generated from Fortran
|
||||
# and from C/C++ separately
|
||||
OBJS = kinetics1.o
|
||||
|
||||
# additional flags to be passed to the linker. If your program
|
||||
# requires other external libraries, put them here
|
||||
LINK_OPTIONS = @EXTRA_LINK@
|
||||
|
||||
#############################################################################
|
||||
# True if we are in the source directory tree
|
||||
srcdirtree=1
|
||||
|
||||
# Fortran libraries
|
||||
FORT_LIBS = @FLIBS@
|
||||
|
||||
# Purify options
|
||||
PURIFY=@PURIFY@
|
||||
|
||||
# the C++ compiler
|
||||
CXX = @CXX@
|
||||
|
||||
# C++ compile flags
|
||||
CXX_FLAGS = @CXXFLAGS@ @CXX_INCLUDES@
|
||||
|
||||
# external libraries
|
||||
EXT_LIBS = @LOCAL_LIBS@ -ltpx -lctcxx
|
||||
|
||||
# Ending C++ linking libraries
|
||||
LCXX_END_LIBS = @LCXX_END_LIBS@
|
||||
|
||||
# the directory where the Cantera libraries are located
|
||||
CANTERA_LIBDIR=@buildlib@
|
||||
|
||||
# required Cantera libraries
|
||||
CANTERA_LIBS =
|
||||
|
||||
# Depends
|
||||
ifeq ($srcdirtree, 1)
|
||||
LOCAL_DEFNS = -DSRCDIRTREE
|
||||
else
|
||||
LOCAL_DEFNS =
|
||||
endif
|
||||
|
||||
# the directory where Cantera include files may be found.
|
||||
CANTERA_INCDIR=@ctroot@/build/include
|
||||
|
||||
# flags passed to the C++ compiler/linker for the linking step
|
||||
LCXX_FLAGS = -L$(CANTERA_LIBDIR) @LOCAL_LIB_DIRS@ @CXXFLAGS@
|
||||
|
||||
# how to compile C++ source files to object files
|
||||
.@CXX_EXT@.@OBJ_EXT@:
|
||||
$(PURIFY) $(CXX) -c $< -I$(CANTERA_INCDIR) $(CXX_FLAGS) $(LOCAL_DEFNS)
|
||||
|
||||
# how to create a dependency file
|
||||
.@CXX_EXT@.d:
|
||||
@CXX_DEPENDS@ -I$(CANTERA_INCDIR) $(CXX_FLAGS) $(LOCAL_DEFNS) $*.cpp > $*.d
|
||||
|
||||
PROGRAM = $(PROG_NAME)$(EXE_EXT)
|
||||
|
||||
DEPENDS = $(OBJS:.o=.d)
|
||||
|
||||
all: $(PROGRAM) .depends
|
||||
|
||||
$(PROGRAM): $(OBJS)
|
||||
$(PURIFY) $(CXX) -o $(PROGRAM) $(OBJS) $(LCXX_FLAGS) $(CANTERA_LIBS) \
|
||||
$(LINK_OPTIONS) $(EXT_LIBS) @LIBS@ $(FORT_LIBS) \
|
||||
$(LCXX_END_LIBS)
|
||||
|
||||
test:
|
||||
@MAKE@ $(PROGRAM)
|
||||
./runtest
|
||||
|
||||
INSTALL_DIR=@ct_demodir@/cxx/kinetics1
|
||||
|
||||
install:
|
||||
@INSTALL@ -d $(INSTALL_DIR)
|
||||
@INSTALL@ -c -m ug+rw,o+r Makefile.install $(INSTALL_DIR)/Makefile
|
||||
@(for ihhh in *.cpp *.h *blessed* ; do \
|
||||
@INSTALL@ $${ihhh} -m ug+rw,o+r $(INSTALL_DIR) ; \
|
||||
echo "@INSTALL@ $${ihhh} -m ug+rw,o+r $(INSTALL_DIR)" ; \
|
||||
done )
|
||||
@INSTALL@ runtest $(INSTALL_DIR) ;
|
||||
|
||||
|
||||
depends: $(DEPENDS)
|
||||
@MAKE@ .depends
|
||||
|
||||
.depends: $(DEPENDS)
|
||||
cat $(DEPENDS) > .depends
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJS) $(PROGRAM) .depends *.d
|
||||
$(RM) ct2ctml.log diff* output_0.txt transport_log.xml \
|
||||
kinetics1.csv
|
||||
(if test -d SunWS_cache ; then \
|
||||
$(RM) -rf SunWS_cache ; \
|
||||
fi )
|
||||
|
||||
TAGS:
|
||||
etags *.h *.cpp
|
||||
|
||||
ifeq ($(wildcard .depends), .depends)
|
||||
include .depends
|
||||
endif
|
||||
|
||||
|
|
@ -1,97 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
############################################################################
|
||||
#
|
||||
# Makefile to compile and link a C++ application to
|
||||
# Cantera.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
# addition to suffixes
|
||||
.SUFFIXES : .d
|
||||
|
||||
# the name of the executable program to be created
|
||||
PROG_NAME = kinetics1
|
||||
|
||||
# the object files to be linked together. List those generated from Fortran
|
||||
# and from C/C++ separately
|
||||
OBJS = kinetics1.o
|
||||
|
||||
# additional flags to be passed to the linker. If your program
|
||||
# requires other external libraries, put them here
|
||||
LINK_OPTIONS =
|
||||
|
||||
#############################################################################
|
||||
# These links are to Cantera's install space
|
||||
CANTERA_INCROOT = @ct_incroot@
|
||||
#
|
||||
# Bring in the Cantera includes through the .mak file
|
||||
#
|
||||
include $(CANTERA_INCROOT)/cantera/Cantera.mak
|
||||
|
||||
# Check to see whether we are in the msvc++ environment
|
||||
os_is_win = @OS_IS_WIN@
|
||||
|
||||
# Fortran libraries
|
||||
FORT_LIBS = @FLIBS@
|
||||
|
||||
# the C++ compiler
|
||||
CXX = @CXX@
|
||||
#
|
||||
# The directory where Cantera include files may be found.
|
||||
#
|
||||
INCLUDE_DIRS = -I../../src -I$(CANTERA_INCROOT)
|
||||
#
|
||||
# C++ compile flags
|
||||
CXX_FLAGS = @CXXFLAGS@ $(INCLUDE_DIRS) -DUSE_VCSNONIDEAL
|
||||
#
|
||||
# Ending C++ linking libraries
|
||||
LCXX_END_LIBS = @LCXX_END_LIBS@
|
||||
|
||||
# flags passed to the C++ compiler/linker for the linking step
|
||||
LCXX_FLAGS = @CXXFLAGS@
|
||||
|
||||
# How to compile C++ source files to object files
|
||||
.cpp.o:
|
||||
$(CXX) $(CXX_FLAGS) -c $<
|
||||
|
||||
# How to compile the dependency file
|
||||
.cpp.d:
|
||||
@CXX_DEPENDS@ $(CXX_FLAGS) $*.cpp > $*.d
|
||||
|
||||
# List of dependency files to be created
|
||||
DEPENDS=$(OBJS:.o=.d)
|
||||
|
||||
# Program Name
|
||||
PROGRAM = $(PROG_NAME)$(EXE_EXT)
|
||||
|
||||
all: $(PROGRAM) .depends
|
||||
|
||||
$(PROGRAM): $(OBJS) $(CANTERA_CORE_LIBS_DEP)
|
||||
$(CXX) -o $(PROGRAM) $(OBJS) $(LCXX_FLAGS) $(LINK_OPTIONS) \
|
||||
$(CANTERA_TOTAL_LIBS) $(LCXX_END_LIBS)
|
||||
|
||||
# depends target -> forces recalculation of dependencies
|
||||
depends:
|
||||
$(RM) *.d .depends
|
||||
@MAKE@ .depends
|
||||
|
||||
.depends: $(DEPENDS)
|
||||
cat *.d > .depends
|
||||
|
||||
# Do the test -> For the windows vc++ environment, we have to skip checking on
|
||||
# whether the program is uptodate, because we don't utilize make
|
||||
# in that environment to build programs.
|
||||
test:
|
||||
ifeq ($(os_is_win), 1)
|
||||
else
|
||||
@MAKE@ $(PROGRAM)
|
||||
endif
|
||||
./runtest
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJS) *.o $(PROGRAM) $(DEPENDS) .depends
|
||||
(if test -d SunWS_cache ; then \
|
||||
$(RM) -rf SunWS_cache ; \
|
||||
fi )
|
||||
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
############################################################################
|
||||
#
|
||||
# Makefile to compile and link a C++ application to
|
||||
# Cantera.
|
||||
#
|
||||
PROG_NAME=kinetics1
|
||||
EXE_EXT=.exe
|
||||
|
||||
# Program Name
|
||||
PROGRAM = $(PROG_NAME)$(EXE_EXT)
|
||||
|
||||
|
||||
# Do the test -> For the windows vc++ environment, we have to skip checking on
|
||||
# whether the program is uptodate, because we don't utilize make
|
||||
# in that environment to build programs.
|
||||
test:
|
||||
./runtest
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJS) *.o $(PROGRAM) $(DEPENDS) .depends
|
||||
|
||||
|
|
@ -4,10 +4,6 @@
|
|||
#include <cantera/kernel/Array.h>
|
||||
#include <cantera/kernel/plots.h>
|
||||
|
||||
namespace Cantera{}
|
||||
namespace std{}
|
||||
namespace CanteraZeroD{}
|
||||
|
||||
// Save the temperature, density, pressure, and mole fractions at one
|
||||
// time
|
||||
template<class G, class A>
|
||||
|
|
|
|||
|
|
@ -2,20 +2,10 @@
|
|||
//
|
||||
// zero-dimensional kinetics example program
|
||||
//
|
||||
// $Author$
|
||||
// $Revision$
|
||||
// $Date$
|
||||
//
|
||||
// copyright California Institute of Technology 2002
|
||||
//
|
||||
/////////////////////////////////////////////////////////////
|
||||
|
||||
// turn off warnings under Windows
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
#pragma warning(disable:4503)
|
||||
#endif
|
||||
|
||||
#include <cantera/Cantera.h>
|
||||
#include <cantera/zerodim.h>
|
||||
#include <cantera/IdealGasMix.h>
|
||||
|
|
@ -24,10 +14,6 @@
|
|||
#include <time.h>
|
||||
#include "example_utils.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace Cantera;
|
||||
using namespace CanteraZeroD;
|
||||
using namespace Cantera_CXX;
|
||||
|
||||
int kinetics1(int np, void* p) {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
Makefile
|
||||
Makefile.install
|
||||
ct2ctml.log
|
||||
diff_out_0.txt
|
||||
gri30.xml
|
||||
liquidvapor.xml
|
||||
output_0.txt
|
||||
rankine
|
||||
transport_log.xml
|
||||
*.d
|
||||
.depends
|
||||
|
|
@ -1,117 +0,0 @@
|
|||
############################################################################
|
||||
#
|
||||
# Makefile to compile and link a C++ application to
|
||||
# Cantera.
|
||||
#
|
||||
#############################################################################
|
||||
.SUFFIXES :
|
||||
.SUFFIXES : .cpp .d .o .d .h
|
||||
|
||||
|
||||
# the name of the executable program to be created
|
||||
PROG_NAME = rankine
|
||||
|
||||
# the object files to be linked together. List those generated from Fortran
|
||||
# and from C/C++ separately
|
||||
OBJS = rankine.o
|
||||
|
||||
# additional flags to be passed to the linker. If your program
|
||||
# requires other external libraries, put them here
|
||||
LINK_OPTIONS = @EXTRA_LINK@
|
||||
|
||||
#############################################################################
|
||||
# True if we are in the source directory tree
|
||||
srcdirtree=1
|
||||
|
||||
# Fortran libraries
|
||||
FORT_LIBS = @FLIBS@
|
||||
|
||||
# Purify options
|
||||
PURIFY=@PURIFY@
|
||||
|
||||
# the C++ compiler
|
||||
CXX = @CXX@
|
||||
|
||||
# C++ compile flags
|
||||
CXX_FLAGS = @CXXFLAGS@ @CXX_INCLUDES@
|
||||
|
||||
# external libraries
|
||||
EXT_LIBS = @LOCAL_LIBS@ -ltpx -lctcxx
|
||||
|
||||
# Ending C++ linking libraries
|
||||
LCXX_END_LIBS = @LCXX_END_LIBS@
|
||||
|
||||
# the directory where the Cantera libraries are located
|
||||
CANTERA_LIBDIR=@buildlib@
|
||||
|
||||
# required Cantera libraries
|
||||
CANTERA_LIBS =
|
||||
|
||||
# Depends
|
||||
ifeq ($srcdirtree, 1)
|
||||
LOCAL_DEFNS = -DSRCDIRTREE
|
||||
else
|
||||
LOCAL_DEFNS =
|
||||
endif
|
||||
|
||||
# the directory where Cantera include files may be found.
|
||||
CANTERA_INCDIR=@ctroot@/build/include
|
||||
|
||||
# flags passed to the C++ compiler/linker for the linking step
|
||||
LCXX_FLAGS = -L$(CANTERA_LIBDIR) @LOCAL_LIB_DIRS@ @CXXFLAGS@
|
||||
|
||||
# how to compile C++ source files to object files
|
||||
.@CXX_EXT@.@OBJ_EXT@:
|
||||
$(PURIFY) $(CXX) -c $< -I$(CANTERA_INCDIR) $(CXX_FLAGS) $(LOCAL_DEFNS)
|
||||
|
||||
# how to create a dependency file
|
||||
.@CXX_EXT@.d:
|
||||
@CXX_DEPENDS@ -I$(CANTERA_INCDIR) $(CXX_FLAGS) $(LOCAL_DEFNS) $*.cpp > $*.d
|
||||
|
||||
PROGRAM = $(PROG_NAME)$(EXE_EXT)
|
||||
|
||||
DEPENDS = $(OBJS:.o=.d)
|
||||
|
||||
all: $(PROGRAM) .depends
|
||||
|
||||
$(PROGRAM): $(OBJS)
|
||||
$(PURIFY) $(CXX) -o $(PROGRAM) $(OBJS) $(LCXX_FLAGS) $(CANTERA_LIBS) \
|
||||
$(LINK_OPTIONS) $(EXT_LIBS) @LIBS@ $(FORT_LIBS) \
|
||||
$(LCXX_END_LIBS)
|
||||
|
||||
test:
|
||||
@MAKE@ $(PROGRAM)
|
||||
./runtest
|
||||
|
||||
INSTALL_DIR=@ct_demodir@/cxx/rankine
|
||||
|
||||
install:
|
||||
@INSTALL@ -d $(INSTALL_DIR)
|
||||
@INSTALL@ -c -m ug+rw,o+r Makefile.install $(INSTALL_DIR)/Makefile
|
||||
@(for ihhh in *.cpp *blessed* ; do \
|
||||
@INSTALL@ $${ihhh} -m ug+rw,o+r $(INSTALL_DIR) ; \
|
||||
echo "@INSTALL@ $${ihhh} -m ug+rw,o+r $(INSTALL_DIR)" ; \
|
||||
done )
|
||||
@INSTALL@ runtest $(INSTALL_DIR) ;
|
||||
|
||||
|
||||
depends: $(DEPENDS)
|
||||
@MAKE@ .depends
|
||||
|
||||
.depends: $(DEPENDS)
|
||||
cat $(DEPENDS) > .depends
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJS) $(PROGRAM) .depends *.d
|
||||
$(RM) ct2ctml.log diff* output_0.txt transport_log.xml
|
||||
(if test -d SunWS_cache ; then \
|
||||
$(RM) -rf SunWS_cache ; \
|
||||
fi )
|
||||
|
||||
TAGS:
|
||||
etags *.h *.cpp
|
||||
|
||||
ifeq ($(wildcard .depends), .depends)
|
||||
include .depends
|
||||
endif
|
||||
|
||||
|
|
@ -1,97 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
############################################################################
|
||||
#
|
||||
# Makefile to compile and link a C++ application to
|
||||
# Cantera.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
# addition to suffixes
|
||||
.SUFFIXES : .d
|
||||
|
||||
# the name of the executable program to be created
|
||||
PROG_NAME = rankine
|
||||
|
||||
# the object files to be linked together. List those generated from Fortran
|
||||
# and from C/C++ separately
|
||||
OBJS = rankine.o
|
||||
|
||||
# additional flags to be passed to the linker. If your program
|
||||
# requires other external libraries, put them here
|
||||
LINK_OPTIONS =
|
||||
|
||||
#############################################################################
|
||||
# These links are to Cantera's install space
|
||||
CANTERA_INCROOT = @ct_incroot@
|
||||
#
|
||||
# Bring in the Cantera includes through the .mak file
|
||||
#
|
||||
include $(CANTERA_INCROOT)/cantera/Cantera.mak
|
||||
|
||||
# Check to see whether we are in the msvc++ environment
|
||||
os_is_win = @OS_IS_WIN@
|
||||
|
||||
# Fortran libraries
|
||||
FORT_LIBS = @FLIBS@
|
||||
|
||||
# the C++ compiler
|
||||
CXX = @CXX@
|
||||
#
|
||||
# The directory where Cantera include files may be found.
|
||||
#
|
||||
INCLUDE_DIRS = -I../../src -I$(CANTERA_INCROOT)
|
||||
#
|
||||
# C++ compile flags
|
||||
CXX_FLAGS = @CXXFLAGS@ $(INCLUDE_DIRS) -DUSE_VCSNONIDEAL
|
||||
#
|
||||
# Ending C++ linking libraries
|
||||
LCXX_END_LIBS = @LCXX_END_LIBS@
|
||||
|
||||
# flags passed to the C++ compiler/linker for the linking step
|
||||
LCXX_FLAGS = @CXXFLAGS@
|
||||
|
||||
# How to compile C++ source files to object files
|
||||
.cpp.o:
|
||||
$(CXX) $(CXX_FLAGS) -c $<
|
||||
|
||||
# How to compile the dependency file
|
||||
.cpp.d:
|
||||
@CXX_DEPENDS@ $(CXX_FLAGS) $*.cpp > $*.d
|
||||
|
||||
# List of dependency files to be created
|
||||
DEPENDS=$(OBJS:.o=.d)
|
||||
|
||||
# Program Name
|
||||
PROGRAM = $(PROG_NAME)$(EXE_EXT)
|
||||
|
||||
all: $(PROGRAM) .depends
|
||||
|
||||
$(PROGRAM): $(OBJS) $(CANTERA_CORE_LIBS_DEP)
|
||||
$(CXX) -o $(PROGRAM) $(OBJS) $(LCXX_FLAGS) $(LINK_OPTIONS) \
|
||||
$(CANTERA_TOTAL_LIBS) $(LCXX_END_LIBS)
|
||||
|
||||
# depends target -> forces recalculation of dependencies
|
||||
depends:
|
||||
$(RM) *.d .depends
|
||||
@MAKE@ .depends
|
||||
|
||||
.depends: $(DEPENDS)
|
||||
cat *.d > .depends
|
||||
|
||||
# Do the test -> For the windows vc++ environment, we have to skip checking on
|
||||
# whether the program is uptodate, because we don't utilize make
|
||||
# in that environment to build programs.
|
||||
test:
|
||||
ifeq ($(os_is_win), 1)
|
||||
else
|
||||
@MAKE@ $(PROGRAM)
|
||||
endif
|
||||
./runtest
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJS) *.o $(PROGRAM) $(DEPENDS) .depends
|
||||
(if test -d SunWS_cache ; then \
|
||||
$(RM) -rf SunWS_cache ; \
|
||||
fi )
|
||||
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
############################################################################
|
||||
#
|
||||
# Makefile to compile and link a C++ application to
|
||||
# Cantera.
|
||||
#
|
||||
PROG_NAME=rankine
|
||||
EXE_EXT=.exe
|
||||
|
||||
# Program Name
|
||||
PROGRAM = $(PROG_NAME)$(EXE_EXT)
|
||||
|
||||
|
||||
# Do the test -> For the windows vc++ environment, we have to skip checking on
|
||||
# whether the program is uptodate, because we don't utilize make
|
||||
# in that environment to build programs.
|
||||
test:
|
||||
./runtest
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJS) *.o $(PROGRAM) $(DEPENDS) .depends
|
||||
|
||||
|
|
@ -74,13 +74,6 @@ int openRankine(int np, void* p) {
|
|||
double efficiency = work/heat_in;
|
||||
|
||||
cout << "efficiency = " << efficiency << endl;
|
||||
#ifdef WIN32
|
||||
#ifndef CXX_DEMO
|
||||
cout << "press any key to end" << endl;
|
||||
char ch;
|
||||
cin >> ch;
|
||||
#endif
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +0,0 @@
|
|||
Cantera_bt.mak
|
||||
Cantera.mak
|
||||
CMakeFiles
|
||||
cmake_install.cmake
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
SET(CXX_H Cantera.h equilibrium.h IncompressibleSolid.h
|
||||
kinetics.h onedim.h surface.h GRI30.h integrators.h
|
||||
Metal.h PureFluid.h transport.h Edge.h
|
||||
IdealGasMix.h Interface.h numerics.h
|
||||
reactionpaths.h zerodim.h importPhase.h thermo.h
|
||||
radiation.h spectra.h)
|
||||
|
||||
INSTALL_FILES(/include/cantera FILES ${CXX_H})
|
||||
|
|
@ -2,32 +2,11 @@
|
|||
* @file Cantera.h
|
||||
* Basic include file to be used in all Cantera application environments.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Revision$
|
||||
* $Date$
|
||||
*/
|
||||
|
||||
// Copyright 2001 California Institute of Technology
|
||||
|
||||
/*
|
||||
* Note, this include should be the first include that code containing the
|
||||
* Cantera namespace sees when in the Cantera application environment.
|
||||
*/
|
||||
|
||||
#ifndef CANTERA_H_INCL
|
||||
#define CANTERA_H_INCL
|
||||
|
||||
// If we are using this file, then we are in the Cantera Apps environment.
|
||||
// Define a variable to signify this fact.
|
||||
#ifndef CANTERA_APP
|
||||
#define CANTERA_APP
|
||||
#endif
|
||||
|
||||
// define the presence of the Cantera_CXX namespace
|
||||
namespace Cantera_CXX{ }
|
||||
|
||||
// Include global typedefs and values for physical constants using SI units
|
||||
#include "kernel/ct_defs.h"
|
||||
|
||||
// some useful functions
|
||||
|
|
@ -48,9 +27,6 @@ namespace Cantera_CXX{ }
|
|||
// Include string utility routines
|
||||
#include "kernel/stringUtils.h"
|
||||
|
||||
// Include the array object
|
||||
#include "kernel/Array.h"
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,153 +0,0 @@
|
|||
#######################################################################
|
||||
# Include Snipet for Makefiles
|
||||
#
|
||||
# To create Cantera C++ applications from the install environment
|
||||
# include this file into your Makefile environment
|
||||
#
|
||||
# Main Variables:
|
||||
#
|
||||
# CANTERA_INCLUDES = Variable containing the include path
|
||||
#
|
||||
#
|
||||
# CANTERA_LIBS = List of libraries to include on the link line
|
||||
#
|
||||
# CANTERA_LIBS_DEP = dependency line for Cantera libs
|
||||
#
|
||||
#
|
||||
#####################################################################
|
||||
# $Id$
|
||||
#
|
||||
#
|
||||
# This variable determines whether we are making this example in the
|
||||
# build tree environment or in the install tree environment.
|
||||
#
|
||||
in_CanteraBuildTree = 0
|
||||
#
|
||||
CANTERA_VERSION=@ctversion@
|
||||
#
|
||||
###############################################################################
|
||||
# CANTERA CORE
|
||||
###############################################################################
|
||||
#
|
||||
# The directory where Cantera include files may be found.
|
||||
# Include files in application programs should start with:
|
||||
# #include "cantera/thermo.h"
|
||||
# #include "cantera/kernel/HMWSoln.h"
|
||||
#
|
||||
CANTERA_INCROOTDIR= @ct_incroot@
|
||||
|
||||
CANTERA_CORE_INCLUDES=-I$(CANTERA_INCROOTDIR)
|
||||
#
|
||||
# Library location
|
||||
#
|
||||
CANTERA_LIBSDIR= @ct_libdir@
|
||||
|
||||
#
|
||||
# Required Cantera libraries
|
||||
#
|
||||
CANTERA_CORE_LIBS= -L$(CANTERA_LIBSDIR) @CANTERA_CORE_LIBS@ -lctcxx
|
||||
|
||||
#
|
||||
# Cantera Core Lib Dependencies
|
||||
#
|
||||
CANTERA_CORE_LIBS_DEP= @CANTERA_CORE_LIBS_DEP@ $(CANTERA_LIBSDIR)/libctcxx.a
|
||||
|
||||
#####################################################################
|
||||
# BOOST
|
||||
####################################################################
|
||||
#
|
||||
# Cantera Boost Include
|
||||
#
|
||||
CANTERA_BOOST_INCLUDES=@BOOST_INCLUDE@
|
||||
#
|
||||
# Location of the boost library that Cantera linked against
|
||||
#
|
||||
CANTERA_BOOST_LIB_DIR=@BOOST_LIB_DIR@
|
||||
#
|
||||
# Linkage extras for linking against boost
|
||||
#
|
||||
ifeq ("x$(CANTERA_BOOST_LIB_DIR)","x")
|
||||
CANTERA_BOOST_LIBS=
|
||||
else
|
||||
CANTERA_BOOST_LIBS= -L$(CANTERA_BOOST_LIB_DIR) -l@BOOST_LIB@
|
||||
endif
|
||||
|
||||
#####################################################################
|
||||
# CVODE/SUNDIALS LINKAGE
|
||||
####################################################################
|
||||
#
|
||||
CANTERA_use_sundials = @use_sundials@
|
||||
#
|
||||
# Includes for Sundials - none for cvode
|
||||
#
|
||||
CANTERA_CVODE_INCLUDE=@sundials_include@
|
||||
CANTERA_SUNDIALS_LIB_DIR=@sundials_lib_dir@
|
||||
#
|
||||
# Link line for cvode and sundials
|
||||
#
|
||||
ifeq ($(CANTERA_use_sundials), 1)
|
||||
CANTERA_CVODE_LIBS=-L$(CANTERA_SUNDIALS_LIB_DIR) @CVODE_LIBS@
|
||||
CANTERA_CVODE_LIBS_DEP=@sundials_lib_dep@
|
||||
CANTERA_SUNDIALS_LIBS=-L$(CANTERA_SUNDIALS_LIB_DIR) @sundials_lib@
|
||||
CANTERA_SUNDIALS_LIBS_DEP=@sundials_lib_dep@
|
||||
else
|
||||
CANTERA_CVODE_LIBS= -L$(CANTERA_LIBSDIR) -lcvode
|
||||
CANTERA_CVODE_LIBS_DEP=$(CANTERA_LIBSDIR)/libcvode.a
|
||||
CANTERA_SUNDIALS_LIBS=-L$(CANTERA_LIBSDIR) -lcvode
|
||||
CANTERA_SUNDIALS_LIBS_DEP=-L$(CANTERA_LIBSDIR)/libcvode.a
|
||||
endif
|
||||
#
|
||||
#######################################################################
|
||||
# BLAS LAPACK LINKAGE
|
||||
#######################################################################
|
||||
#
|
||||
CANTERA_build_lapack= @build_lapack@
|
||||
CANTERA_build_blas= @build_blas@
|
||||
|
||||
CANTERA_BLAS_LAPACK_DIR= @ct_libdir@
|
||||
|
||||
CANTERA_BLAS_LAPACK_LIBS = -L$(CANTERA_BLAS_LAPACK_DIR) @BLAS_LAPACK_LIBS@
|
||||
CANTERA_BLAS_LAPACK_LIBS_DEP=
|
||||
#
|
||||
#######################################################################
|
||||
# CANTERA's F2C Linkage
|
||||
#######################################################################
|
||||
#
|
||||
CANTERA_build_with_f2c= @build_with_f2c@
|
||||
CANTERA_build_f2c_lib= @build_f2c_lib@
|
||||
|
||||
ifeq ($(CANTERA_build_f2c_lib), 1)
|
||||
CANTERA_F2C_LIBS= -L$(CANTERA_LIBSDIR) -lctf2c
|
||||
else
|
||||
CANTERA_F2C_LIBS= @F2C_SYSTEMLIB@
|
||||
endif
|
||||
#
|
||||
#####################################################################
|
||||
# COMBINATIONS OF INCLUDES AND LIBS
|
||||
####################################################################
|
||||
#
|
||||
CANTERA_TOTAL_INCLUDES= $(CANTERA_CORE_INCLUDES) $(CANTERA_BOOST_INCLUDES) $(CANTERA_CVODE_INCLUDE)
|
||||
#
|
||||
# You can add this into the compilation environment to identify the version number
|
||||
#
|
||||
CANTERA_DEFINES = -DCANTERA_VERSION=@ctversion@
|
||||
#
|
||||
# LIBS and LIBS should be the same ...
|
||||
#
|
||||
CANTERA_TOTAL_LIBS2 = -L$(CANTERA_LIBSDIR) @LOCAL_LIBS@
|
||||
#
|
||||
CANTERA_TOTAL_LIBS= $(CANTERA_CORE_LIBS) $(CANTERA_BOOST_LIBS) \
|
||||
$(CANTERA_SUNDIALS_LIBS) $(CANTERA_BLAS_LAPACK_LIBS) \
|
||||
$(CANTERA_F2C_LIBS)
|
||||
#
|
||||
CANTERA_TOTAL_LIBS_DEP= $(CANTERA_CORE_LIBS_DEP) \
|
||||
$(CANTERA_SUNDIALS_LIBS_DEP) \
|
||||
$(CANTERA_BLAS_LAPACK_LIBS_DEP)
|
||||
#
|
||||
# Dependency Line
|
||||
#
|
||||
CANTERA_LIBS_DEP= @INSTALL_LIBS_DEP@ $(CANTERA_LIBDIR)/libctcxx.a
|
||||
#
|
||||
#####################################################################
|
||||
# END
|
||||
####################################################################
|
||||
|
|
@ -1,140 +0,0 @@
|
|||
#######################################################################
|
||||
# Include Snipet for Makefiles
|
||||
#
|
||||
# To create Cantera C++ applications from the build tree environment
|
||||
# include this file into your Makefile environment
|
||||
#
|
||||
# Main Variables:
|
||||
#
|
||||
# CANTERA_INCLUDES = Variable containing the include path
|
||||
#
|
||||
#
|
||||
# CANTERA_LIBS = List of libraries to include on the link line
|
||||
#
|
||||
# CANTERA_LIBS_DEP = dependency line for Cantera libs
|
||||
#
|
||||
#
|
||||
#####################################################################
|
||||
# $Id$
|
||||
#
|
||||
#
|
||||
# This variable determines whether we are making this example in the
|
||||
# build tree environment or in the install tree environment.
|
||||
#
|
||||
in_CanteraBuildTree = 0
|
||||
#
|
||||
CANTERA_VERSION=@ctversion@
|
||||
#
|
||||
CANTERA_VERSION=@ctversion@
|
||||
|
||||
CANTERA_VERSION=@ctversion@
|
||||
|
||||
###############################################################################
|
||||
# CANTERA CORE
|
||||
###############################################################################
|
||||
#
|
||||
# The directory where Cantera include files may be found.
|
||||
# Include files in application programs should start with:
|
||||
# #include "cantera/thermo.h"
|
||||
# #include "cantera/kernel/HMWSoln.h"
|
||||
#
|
||||
CANTERA_INCROOTDIR= @ct_incroot@
|
||||
|
||||
CANTERA_CORE_INCLUDES=-I$(CANTERA_INCROOTDIR)
|
||||
#
|
||||
# Library location
|
||||
#
|
||||
CANTERA_LIBSDIR= @ct_libdir@
|
||||
|
||||
#
|
||||
# Required Cantera libraries
|
||||
#
|
||||
CANTERA_CORE_LIBS= -L$(CANTERA_LIBSDIR) @CANTERA_CORE_LIBS@ -lctcxx
|
||||
|
||||
#
|
||||
# Cantera Core Lib Dependencies
|
||||
#
|
||||
CANTERA_CORE_LIBS_DEP= @CANTERA_CORE_LIBS_DEP@ $(CANTERA_LIBSDIR)/libctcxx.a
|
||||
|
||||
#####################################################################
|
||||
# BOOST
|
||||
####################################################################
|
||||
#
|
||||
# Cantera Boost Include
|
||||
#
|
||||
CANTERA_BOOST_INCLUDES= @BOOST_INCLUDE@
|
||||
#
|
||||
# Location of the boost library that Cantera linked against
|
||||
#
|
||||
CANTERA_BOOST_LIB_DIR= @BOOST_LIB_DIR@
|
||||
#
|
||||
# Linkage extras for linking against boost
|
||||
#
|
||||
ifeq ("x$(CANTERA_BOOST_LIB_DIR)","x")
|
||||
CANTERA_BOOST_LIBS=
|
||||
else
|
||||
CANTERA_BOOST_LIBS= -L$(CANTERA_BOOST_LIB_DIR) -l@BOOST_LIB@
|
||||
endif
|
||||
|
||||
#####################################################################
|
||||
# CVODE/SUNDIALS LINKAGE
|
||||
####################################################################
|
||||
CANTERA_use_sundials = @use_sundials@
|
||||
|
||||
#
|
||||
# Includes for Sundials - none for cvode
|
||||
#
|
||||
CANTERA_CVODE_INCLUDE=@sundials_include@
|
||||
#
|
||||
# Link line for cvode and sundials
|
||||
#
|
||||
ifeq ($(CANTERA_user_sundials), 1)
|
||||
|
||||
else
|
||||
CANTERA_CVODE_LIBS= -L$(CANTERA_LIBSDIR) @CVODE_LIBS@
|
||||
endif
|
||||
|
||||
|
||||
#######################################################################
|
||||
# BLAS LAPACK LINKAGE
|
||||
#######################################################################
|
||||
CANTERA_build_lapack= @build_lapack@
|
||||
CANTERA_build_blas= @build_blas@
|
||||
|
||||
CANTERA_BLAS_LAPACK_DIR= @BLAS_LAPACK_DIR@
|
||||
|
||||
CANTERA_BLAS_LAPACK_LIBS = -L$(CANTERA_BLAS_LAPACK_DIR) @BLAS_LAPACK_LIBS@
|
||||
|
||||
#######################################################################
|
||||
# CANTERA's F2C Linkage
|
||||
#######################################################################
|
||||
CANTERA_build_with_f2c= @build_with_f2c@
|
||||
CANTERA_build_f2c_lib= @build_f2c_lib@
|
||||
|
||||
ifeq ($(CANTERA_build_f2c_lib), 1)
|
||||
CANTERA_F2C_LIBS= -L$(CANTERA_LIBSDIR) -lctf2c
|
||||
else
|
||||
CANTERA_F2C_LIBS= @F2C_SYSTEMLIB@
|
||||
endif
|
||||
#
|
||||
#####################################################################
|
||||
# COMBINATIONS OF INCLUDES AND LIBS
|
||||
####################################################################
|
||||
#
|
||||
CANTERA_TOTAL_INCLUDES= $(CANTERA_CORE_INCLUDES) $(CANTERA_BOOST_INCLUDES) $(CANTERA_CVODE_INCLUDE)
|
||||
#
|
||||
# You can add this into the compilation environment to identify the version number
|
||||
#
|
||||
CANTERA_DEFINES = -DCANTERA_VERSION=@ctversion@
|
||||
#
|
||||
CANTERA_TOTAL_LIBS2 = @LOCAL_LIB_DIRS@ @LOCAL_LIBS@
|
||||
|
||||
CANTERA_TOTAL_LIBS= $(CANTERA_CORE_LIBS) $(CANTERA_BOOST_LIBS) \
|
||||
$(CANTERA_CVODE_LIBS) $(CANTERA_BLAS_LAPACK_LIBS) \
|
||||
$(CANTERA_F2C_LIBS)
|
||||
|
||||
#
|
||||
# Dependency Line
|
||||
#
|
||||
CANTERA_LIBS_DEP= @INSTALL_LIBS_DEP@ $(CANTERA_LIBDIR)/libctcxx.a
|
||||
|
||||
|
|
@ -7,10 +7,10 @@
|
|||
#include "kernel/EdgeKinetics.h"
|
||||
#include "kernel/importKinetics.h"
|
||||
|
||||
namespace Cantera_CXX {
|
||||
namespace Cantera {
|
||||
|
||||
class Edge :
|
||||
public Cantera::EdgePhase, public Cantera::EdgeKinetics
|
||||
public EdgePhase, public EdgeKinetics
|
||||
{
|
||||
public:
|
||||
Edge(std::string infile, std::string id, std::vector<ThermoPhase*> phases)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,3 @@
|
|||
/*
|
||||
* $Id$
|
||||
*/
|
||||
#ifndef CXX_GRI30H
|
||||
#define CXX_GRI30H
|
||||
|
||||
|
|
@ -11,8 +8,7 @@
|
|||
#include "kernel/importKinetics.h"
|
||||
#include "kernel/stringUtils.h"
|
||||
|
||||
|
||||
namespace Cantera_CXX {
|
||||
namespace Cantera {
|
||||
|
||||
/**
|
||||
* This class is a convenience class for use in C++ programs that
|
||||
|
|
@ -24,15 +20,15 @@ namespace Cantera_CXX {
|
|||
* methods like "getNetReactionRates."
|
||||
*/
|
||||
class GRI30 :
|
||||
public Cantera::IdealGasPhase,
|
||||
public Cantera::GRI_30_Kinetics
|
||||
public IdealGasPhase,
|
||||
public GRI_30_Kinetics
|
||||
{
|
||||
public:
|
||||
GRI30() : m_ok(false), m_r(0) {
|
||||
m_r = Cantera::get_XML_File("gri30.xml");
|
||||
m_ok = Cantera::buildSolutionFromXML(*m_r, "gri30",
|
||||
m_r = get_XML_File("gri30.xml");
|
||||
m_ok = buildSolutionFromXML(*m_r, "gri30",
|
||||
"phase", this, this);
|
||||
if (!m_ok) throw Cantera::CanteraError("GRI30",
|
||||
if (!m_ok) throw CanteraError("GRI30",
|
||||
"buildSolutionFromXML returned false");
|
||||
}
|
||||
|
||||
|
|
@ -41,7 +37,7 @@ namespace Cantera_CXX {
|
|||
bool operator!() { return !m_ok;}
|
||||
bool ready() const { return m_ok; }
|
||||
friend std::ostream& operator<<(std::ostream& s, GRI30& mix) {
|
||||
std::string r = Cantera::report(mix, true);
|
||||
std::string r = mix.report(true);
|
||||
s << r;
|
||||
return s;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,11 +8,11 @@
|
|||
#include "kernel/importKinetics.h"
|
||||
#include "kernel/stringUtils.h"
|
||||
|
||||
namespace Cantera_CXX {
|
||||
namespace Cantera {
|
||||
|
||||
class IdealGasMix :
|
||||
public Cantera::IdealGasPhase,
|
||||
public Cantera::GasKinetics
|
||||
public IdealGasPhase,
|
||||
public GasKinetics
|
||||
{
|
||||
public:
|
||||
|
||||
|
|
@ -21,36 +21,33 @@ namespace Cantera_CXX {
|
|||
IdealGasMix(std::string infile, std::string id="") :
|
||||
m_ok(false), m_r(0) {
|
||||
|
||||
m_r = Cantera::get_XML_File(infile);
|
||||
m_r = get_XML_File(infile);
|
||||
m_id = id;
|
||||
if (id == "-") id = "";
|
||||
m_ok = Cantera::buildSolutionFromXML(*m_r,
|
||||
m_ok = buildSolutionFromXML(*m_r,
|
||||
m_id, "phase", this, this);
|
||||
if (!m_ok) throw Cantera::CanteraError("IdealGasMix",
|
||||
if (!m_ok) throw CanteraError("IdealGasMix",
|
||||
"Cantera::buildSolutionFromXML returned false");
|
||||
}
|
||||
|
||||
|
||||
IdealGasMix(Cantera::XML_Node& root,
|
||||
IdealGasMix(XML_Node& root,
|
||||
std::string id) : m_ok(false), m_r(&root), m_id(id) {
|
||||
m_ok = Cantera::buildSolutionFromXML(root, id,
|
||||
"phase", this, this);
|
||||
m_ok = buildSolutionFromXML(root, id, "phase", this, this);
|
||||
}
|
||||
|
||||
IdealGasMix(const IdealGasMix& other) : m_ok(false),
|
||||
m_r(other.m_r),
|
||||
m_id(other.m_id) {
|
||||
m_ok = Cantera::buildSolutionFromXML(*m_r, m_id,
|
||||
"phase", this, this);
|
||||
m_ok = buildSolutionFromXML(*m_r, m_id, "phase", this, this);
|
||||
}
|
||||
|
||||
|
||||
virtual ~IdealGasMix() {}
|
||||
|
||||
bool operator!() { return !m_ok;}
|
||||
bool ready() const { return m_ok; }
|
||||
friend std::ostream& operator<<(std::ostream& s, IdealGasMix& mix) {
|
||||
std::string r = Cantera::report(mix, true);
|
||||
std::string r = mix.report(true);
|
||||
s << r;
|
||||
return s;
|
||||
}
|
||||
|
|
@ -58,7 +55,7 @@ namespace Cantera_CXX {
|
|||
|
||||
protected:
|
||||
bool m_ok;
|
||||
Cantera::XML_Node* m_r;
|
||||
XML_Node* m_r;
|
||||
std::string m_id;
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -6,22 +6,21 @@
|
|||
#include "kernel/ConstDensityThermo.h"
|
||||
#include "kernel/importKinetics.h"
|
||||
|
||||
namespace Cantera_CXX {
|
||||
namespace Cantera {
|
||||
|
||||
class IncompressibleSolid : public Cantera::ConstDensityThermo
|
||||
class IncompressibleSolid : public ConstDensityThermo
|
||||
{
|
||||
public:
|
||||
IncompressibleSolid(std::string infile,
|
||||
std::string id="") : m_ok(false), m_r(0) {
|
||||
|
||||
m_r = Cantera::get_XML_File(infile);
|
||||
m_r = get_XML_File(infile);
|
||||
if (id == "-") id = "";
|
||||
m_ok = Cantera::buildSolutionFromXML(*m_r, id, "phase", this, 0);
|
||||
if (!m_ok) throw Cantera::CanteraError("IncompressibleSolid",
|
||||
m_ok = buildSolutionFromXML(*m_r, id, "phase", this, 0);
|
||||
if (!m_ok) throw CanteraError("IncompressibleSolid",
|
||||
"buildSolutionFromXML returned false");
|
||||
}
|
||||
|
||||
|
||||
virtual ~IncompressibleSolid() {}
|
||||
|
||||
bool operator!() { return !m_ok;}
|
||||
|
|
@ -34,7 +33,7 @@ namespace Cantera_CXX {
|
|||
|
||||
protected:
|
||||
bool m_ok;
|
||||
Cantera::XML_Node* m_r;
|
||||
XML_Node* m_r;
|
||||
|
||||
private:
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,13 +1,7 @@
|
|||
/**
|
||||
* @file Interface.h
|
||||
* Declaration and Definition for the class Interface, part of
|
||||
* Cantera's Cantera_CXX namespace.
|
||||
* Declaration and Definition for the class Interface.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef CXX_INTERFACE
|
||||
#define CXX_INTERFACE
|
||||
|
||||
|
|
@ -16,13 +10,8 @@
|
|||
#include "thermo.h"
|
||||
#include "kinetics.h"
|
||||
|
||||
namespace Cantera {
|
||||
|
||||
/**
|
||||
* This namespace is used for the Cantera C++ user interface.
|
||||
*/
|
||||
namespace Cantera_CXX {
|
||||
|
||||
|
||||
//! An interface between multiple bulk phases.
|
||||
/*!
|
||||
* This class isdefined mostly for convenience. It inherits both from
|
||||
|
|
@ -32,12 +21,10 @@ namespace Cantera_CXX {
|
|||
* involving species from other phases.
|
||||
*/
|
||||
class Interface :
|
||||
public Cantera::SurfPhase,
|
||||
public Cantera::InterfaceKinetics
|
||||
public SurfPhase,
|
||||
public InterfaceKinetics
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
//! Constructor.
|
||||
/*!
|
||||
* Construct an Interface instance from a specification in an input file.
|
||||
|
|
|
|||
|
|
@ -6,17 +6,17 @@
|
|||
#include "kernel/MetalPhase.h"
|
||||
#include "kernel/importKinetics.h"
|
||||
|
||||
namespace Cantera_CXX {
|
||||
namespace Cantera {
|
||||
|
||||
class Metal : public Cantera::MetalPhase
|
||||
class Metal : public MetalPhase
|
||||
{
|
||||
public:
|
||||
Metal(std::string infile, std::string id="") : m_ok(false), m_r(0) {
|
||||
|
||||
m_r = Cantera::get_XML_File(infile);
|
||||
m_r = get_XML_File(infile);
|
||||
if (id == "-") id = "";
|
||||
m_ok = Cantera::buildSolutionFromXML(*m_r, id, "phase", this, 0);
|
||||
if (!m_ok) throw Cantera::CanteraError("Metal",
|
||||
m_ok = buildSolutionFromXML(*m_r, id, "phase", this, 0);
|
||||
if (!m_ok) throw CanteraError("Metal",
|
||||
"buildSolutionFromXML returned false");
|
||||
}
|
||||
|
||||
|
|
@ -27,7 +27,7 @@ namespace Cantera_CXX {
|
|||
|
||||
protected:
|
||||
bool m_ok;
|
||||
Cantera::XML_Node* m_r;
|
||||
XML_Node* m_r;
|
||||
|
||||
private:
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,6 +1,3 @@
|
|||
/*
|
||||
* $Id$
|
||||
*/
|
||||
#ifndef CXX_PUREFLUID
|
||||
#define CXX_PUREFLUID
|
||||
|
||||
|
|
@ -38,7 +35,7 @@ namespace Cantera {
|
|||
bool operator!() { return !m_ok;}
|
||||
bool ready() const { return m_ok; }
|
||||
friend std::ostream& operator<<(std::ostream& s, PureFluid& mix) {
|
||||
std::string r = Cantera::report(mix, true);
|
||||
std::string r = mix.report(true);
|
||||
s << r;
|
||||
return s;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,9 +3,6 @@
|
|||
* cxx layer - Header file providing support for chemical equilibrium calculations
|
||||
* (see \ref equilfunctions)
|
||||
*/
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
#ifndef CT_EQUIL_INCL
|
||||
#define CT_EQUIL_INCL
|
||||
#include "kernel/equil.h"
|
||||
|
|
|
|||
|
|
@ -1,25 +0,0 @@
|
|||
#ifndef CXX_IMPORTPHASE
|
||||
#define CXX_IMPORTPHASE
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "kernel/ThermoPhase.h"
|
||||
#include "kernel/ThermoFactory.h"
|
||||
|
||||
/*
|
||||
* The Definitions for these functions are all located in
|
||||
* libctxx.a
|
||||
*/
|
||||
|
||||
namespace Cantera_CXX {
|
||||
Cantera::ThermoPhase* importPhase(std::string infile, std::string id="");
|
||||
|
||||
// -> this is a duplicate of a src/thermo/phasereport function
|
||||
// We'll leave it here so that these are available externally
|
||||
std::string report(const Cantera::ThermoPhase& th, bool show_thermo);
|
||||
|
||||
std::string formatCompList(const Cantera::Phase& mix, int xyc);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
|
@ -1,6 +1,3 @@
|
|||
/*
|
||||
* $Id$
|
||||
*/
|
||||
#ifndef CXX_INCL_KINETICS
|
||||
#define CXX_INCL_KINETICS
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
#define CT_THERMO_INCL
|
||||
|
||||
#include "kernel/ThermoFactory.h"
|
||||
#include "importPhase.h"
|
||||
#include "kernel/SurfPhase.h"
|
||||
#include "kernel/EdgePhase.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,3 @@
|
|||
/*
|
||||
* $Id$
|
||||
*/
|
||||
#ifndef CT_INCL_ZERODIM_H
|
||||
#define CT_INCL_ZERODIM_H
|
||||
#include "kernel/Reactor.h"
|
||||
|
|
@ -11,6 +8,5 @@
|
|||
#include "kernel/FlowReactor.h"
|
||||
#include "kernel/ConstPressureReactor.h"
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
Makefile
|
||||
.depends
|
||||
SunWS_cache
|
||||
*.d
|
||||
CMakeFiles
|
||||
cmake_install.cmake
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
SET ( CXX_SRCS importPhase.cpp )
|
||||
|
||||
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR})
|
||||
INCLUDE_DIRECTORIES (${PROJECT_BINARY_DIR}/build/include/cantera/kernel)
|
||||
|
||||
ADD_LIBRARY (ctcxx ${CXX_SRCS})
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
#/bin/sh
|
||||
###############################################################
|
||||
# $Author$
|
||||
# $Date$
|
||||
# $Revision$
|
||||
#
|
||||
# Copyright 2001 California Institute of Technology
|
||||
#
|
||||
###############################################################
|
||||
|
||||
|
||||
.SUFFIXES :
|
||||
.SUFFIXES : .cpp .d .o .h
|
||||
|
||||
PIC_FLAG=@PIC@
|
||||
CXX_FLAGS = @CXXFLAGS@ $(CXX_OPT) $(PIC_FLAG)
|
||||
|
||||
OBJS = importPhase.o
|
||||
|
||||
DEPENDS = $(OBJS:.o=.d)
|
||||
|
||||
PURIFY=@PURIFY@
|
||||
|
||||
PIC_FLAG=@PIC@
|
||||
CXX_FLAGS = @CXXFLAGS@ $(CXX_OPT) $(PIC_FLAG)
|
||||
|
||||
|
||||
# the directory where Cantera include files may be found.
|
||||
CXX_INCLUDES = -I../../src/base -I../../src/thermo @CXX_INCLUDES@
|
||||
|
||||
# how to compile C++ source files to object files
|
||||
.cpp.o:
|
||||
$(PURIFY) @CXX@ -c $< $(CXX_INCLUDES) $(CXX_FLAGS)
|
||||
|
||||
%.d: Makefile %.o
|
||||
@CXX_DEPENDS@ $(CXX_FLAGS) $(CXX_INCLUDES) $*.cpp > $*.d
|
||||
|
||||
LIB_NAME=libctcxx
|
||||
CXXLIB=@buildlib@/$(LIB_NAME).a
|
||||
|
||||
all: .depends $(CXXLIB)
|
||||
|
||||
$(CXXLIB): $(OBJS)
|
||||
@ARCHIVE@ $(CXXLIB) $(OBJS)
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJS) *.d $(CXXLIB)
|
||||
(if test -d SunWS_cache ; then \
|
||||
$(RM) -rf SunWS_cache ; \
|
||||
fi )
|
||||
|
||||
install:
|
||||
@INSTALL@ $(CXXLIB) @prefix@/lib/cantera
|
||||
|
||||
depends:
|
||||
@MAKE@ .depends
|
||||
|
||||
.depends: $(DEPENDS)
|
||||
cat $(DEPENDS) > .depends
|
||||
|
||||
$(OBJS): Makefile
|
||||
|
||||
ifeq ($(wildcard .depends), .depends)
|
||||
include .depends
|
||||
endif
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
// turn off warnings under Windows
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
#pragma warning(disable:4503)
|
||||
#endif
|
||||
|
||||
#include "ThermoPhase.h"
|
||||
#include <stdio.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace Cantera {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
/**
|
||||
* @file cxx/src/importPhase.cpp
|
||||
*/
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "ThermoPhase.h"
|
||||
#include "ThermoFactory.h"
|
||||
//#include "../include/importPhase.h"
|
||||
|
||||
namespace Cantera {}
|
||||
|
||||
namespace Cantera_CXX {
|
||||
|
||||
Cantera::ThermoPhase* importPhase(std::string infile, std::string id) {
|
||||
Cantera::ThermoPhase* p = Cantera::newPhase(infile, id);
|
||||
return p;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
45
Cantera/fortran/SConscript
Normal file
45
Cantera/fortran/SConscript
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
from buildutils import *
|
||||
|
||||
Import('env', 'buildTargets', 'installTargets', 'demoTargets')
|
||||
|
||||
localenv = env.Clone()
|
||||
|
||||
f90_src = mglob(localenv, 'src', 'f90', 'cpp')
|
||||
|
||||
artifacts = localenv.Object(f90_src)
|
||||
mods = [o for o in artifacts if o.path.endswith('.mod')]
|
||||
objs = [o for o in artifacts if not o.path.endswith('.mod')]
|
||||
|
||||
lib = localenv.Library(target=pjoin('..','..','lib','fct'),
|
||||
source=objs)
|
||||
buildTargets.extend(lib)
|
||||
inst = localenv.Install('$inst_libdir', lib)
|
||||
installTargets.extend(inst)
|
||||
|
||||
installTargets.extend(localenv.Install('$inst_incdir', mods))
|
||||
|
||||
# Copy the mod files to the include directory
|
||||
for mod in mods:
|
||||
copy = localenv.Command(target=pjoin('..','..','include','cantera', mod.name),
|
||||
source=mod,
|
||||
action=Copy('$TARGET', '$SOURCE'))
|
||||
localenv.AddPostAction(lib, copy)
|
||||
buildTargets.extend(copy)
|
||||
|
||||
# (subdir, program name, [source extensions])
|
||||
demos = [('f77demos', 'ctlib', ['^ctlib.f']),
|
||||
('f77demos', 'isentropic', ['^isentropic.f'])]
|
||||
|
||||
ftn_demo = localenv.Object(pjoin('f77demos','demo_ftnlib.cpp'))
|
||||
for subdir, name, extensions in demos:
|
||||
prog = localenv.Program(pjoin(subdir, name),
|
||||
mglob(localenv, subdir, *extensions) + ftn_demo,
|
||||
LIBS=env['cantera_libs']+['fct']+['stdc++'],
|
||||
LINK='$F77')
|
||||
demoTargets.extend(prog)
|
||||
|
||||
inst = localenv.Install(pjoin('$inst_demodir', 'f77'),
|
||||
mglob(localenv, 'f77demos',
|
||||
'csv','txt','cpp','f','^runtest'))
|
||||
|
||||
installTargets.extend(inst)
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
isentropic.dsp
|
||||
f77demos.mak
|
||||
Makefile
|
||||
ct2ctml.log
|
||||
ctlib
|
||||
diff_out_0.txt
|
||||
diff_out_1.txt
|
||||
gri30.xml
|
||||
isentropic
|
||||
output_0.txt
|
||||
output_1.txt
|
||||
*.d
|
||||
.depends
|
||||
|
|
@ -1,120 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
.SUFFIXES :
|
||||
.SUFFIXES : .cpp .d .o .h .f
|
||||
|
||||
|
||||
# the object files to be linked together.
|
||||
OBJS = demo_ftnlib.o isentropic.o ctlib.o
|
||||
|
||||
# additional flags to be passed to the linker. If your program
|
||||
# requires other external libraries, put them here
|
||||
LINK_OPTIONS =
|
||||
|
||||
|
||||
# the Fortran compiler
|
||||
FORT = @F77@
|
||||
|
||||
# Fortran compile flags
|
||||
FORT_FLAGS = @FFLAGS@
|
||||
|
||||
FCLIBS= @FCLIBS@
|
||||
FLIBS = @FLIBS@
|
||||
|
||||
|
||||
# Fortran libraries
|
||||
FORT_LIBS = @LCXX_FLIBS@ @LCXX_END_LIBS@ @FLIBS@
|
||||
|
||||
# the C++ compiler
|
||||
CXX = @CXX@
|
||||
|
||||
# C++ compile flags
|
||||
CXX_FLAGS = @CXXFLAGS@
|
||||
|
||||
# external libraries
|
||||
EXT_LIBS = @LOCAL_LIBS@ -lctcxx
|
||||
|
||||
# the directory where the Cantera libraries are located
|
||||
CANTERA_LIBDIR=@buildlib@
|
||||
|
||||
# the directory where Cantera include files may be found.
|
||||
CANTERA_INCDIR=@ctroot@/build/include
|
||||
|
||||
# flags passed to the C++ compiler/linker for the linking step
|
||||
LCXX_FLAGS = -L$(CANTERA_LIBDIR) @LOCAL_LIB_DIRS@ @CXXFLAGS@
|
||||
|
||||
# how to compile C++ source files to object files
|
||||
.@CXX_EXT@.@OBJ_EXT@:
|
||||
$(CXX) -c $< -I$(CANTERA_INCDIR) $(CXX_FLAGS)
|
||||
|
||||
# how to create a dependency file
|
||||
.@CXX_EXT@.d:
|
||||
@CXX_DEPENDS@ -I$(CANTERA_INCDIR) $(CXX_FLAGS) $(LOCAL_DEFNS) $*.cpp > $*.d
|
||||
|
||||
|
||||
# how to compile Fortran source files to object files
|
||||
.@F77_EXT@.@OBJ_EXT@:
|
||||
$(FORT) -c $< $(FORT_FLAGS)
|
||||
|
||||
.f.d:
|
||||
@echo "$*.o: $*.f" | cat > $*.d
|
||||
|
||||
|
||||
PROGRAM = $(PROG_NAME)$(EXE_EXT)
|
||||
|
||||
DEPENDS = $(OBJS:.o=.d)
|
||||
|
||||
all: isentropic ctlib
|
||||
|
||||
demo_ftnlib.o: @ctroot@/tools/templates/f77/demo_ftnlib.cpp
|
||||
$(CXX) -c $< -I$(CANTERA_INCDIR) $(CXX_FLAGS)
|
||||
|
||||
demo_ftnlib.d: @ctroot@/tools/templates/f77/demo_ftnlib.cpp
|
||||
@CXX_DEPENDS@ -I$(CANTERA_INCDIR) $(CXX_FLAGS) $< > $*.d
|
||||
|
||||
isentropic: isentropic.o demo_ftnlib.o
|
||||
$(CXX) -o isentropic isentropic.o demo_ftnlib.o $(LCXX_FLAGS) $(CANTERA_LIBS) \
|
||||
$(LINK_OPTIONS) $(EXT_LIBS) @LIBS@ $(FORT_LIBS)
|
||||
|
||||
ctlib: ctlib.o demo_ftnlib.o
|
||||
$(CXX) -o ctlib ctlib.o demo_ftnlib.o $(LCXX_FLAGS) $(CANTERA_LIBS) \
|
||||
$(LINK_OPTIONS) $(EXT_LIBS) @LIBS@ $(FORT_LIBS)
|
||||
|
||||
test:
|
||||
@MAKE@
|
||||
./runtest
|
||||
|
||||
INSTALL_DIR=@ct_demodir@/f77
|
||||
|
||||
install:
|
||||
@INSTALL@ -d $(INSTALL_DIR)
|
||||
@INSTALL@ -c -m ug+rw,o+r f77demos.mak $(INSTALL_DIR)/Makefile
|
||||
@INSTALL@ -c -m ug+rw,o+r @ctroot@/tools/templates/f77/demo_ftnlib.cpp $(INSTALL_DIR)
|
||||
@(for ihhh in *.f *blessed* README.txt ; do \
|
||||
@INSTALL@ $${ihhh} -m ug+rw,o+r $(INSTALL_DIR) ; \
|
||||
echo "@INSTALL@ $${ihhh} -m ug+rw,o+r $(INSTALL_DIR)" ; \
|
||||
done )
|
||||
@INSTALL@ runtest $(INSTALL_DIR) ;
|
||||
|
||||
|
||||
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJS) isentropic ctlib *.d .depends \
|
||||
diff* output_0.txt output_1.txt gri30.xml ct2ctml.log \
|
||||
isentropic.dsp
|
||||
|
||||
depends:
|
||||
$(MAKE) .depends
|
||||
|
||||
|
||||
.depends: $(DEPENDS)
|
||||
cat *.d > .depends
|
||||
|
||||
TAGS:
|
||||
etags *.h *.cpp
|
||||
|
||||
ifeq ($(wildcard .depends), .depends)
|
||||
include .depends
|
||||
endif
|
||||
|
||||
408
Cantera/fortran/f77demos/demo_ftnlib.cpp
Normal file
408
Cantera/fortran/f77demos/demo_ftnlib.cpp
Normal file
|
|
@ -0,0 +1,408 @@
|
|||
/*!
|
||||
A simple Fortran 77 interface
|
||||
|
||||
This file is an example of how to write an interface to use Cantera
|
||||
in Fortran 77 programs. The basic idea is to store pointers to
|
||||
Cantera objects in global storage, and then create Fortran-callable
|
||||
functions that access the objects through the pointers.
|
||||
|
||||
This particular example defines functions that return thermodynamic
|
||||
properties, transport properties, and kinetic rates for reacting
|
||||
ideal gas mixtures. Only a single pointer to an IdealGasMix object is
|
||||
stored, so only one reaction mechanism may be used at any one time in
|
||||
the application. Of course, it is a simple modification to store
|
||||
multiple objects if it is desired to use multiple reaction
|
||||
mechanisms.
|
||||
|
||||
The functions defined here are ones commonly needed in application
|
||||
programs that simulate gas-phase combustion or similar
|
||||
processes. Similar libraries to access other capabilities of Cantera
|
||||
(surface chemistry, etc.) could be written in the same way.
|
||||
|
||||
This library is designed for Fortran compilers that expect external
|
||||
procedure na,es to be lowercase with a trailing underscore. If this
|
||||
is not the case, the procedure names must be edited before use.
|
||||
|
||||
*/
|
||||
|
||||
// add any other Cantera header files you need here
|
||||
#include <cantera/Cantera.h>
|
||||
#include <cantera/IdealGasMix.h>
|
||||
|
||||
using namespace Cantera;
|
||||
|
||||
// store a pointer to an IdealGasMix object
|
||||
static IdealGasMix* _gas = 0;
|
||||
|
||||
// provides access to the pointers for functions in other libraries
|
||||
IdealGasMix* _gasptr()
|
||||
{
|
||||
return _gas;
|
||||
}
|
||||
|
||||
// comment these out to produce a smaller executable if not needed
|
||||
#define WITH_EQUIL
|
||||
#define WITH_TRANSPORT
|
||||
|
||||
#ifdef WITH_EQUIL
|
||||
#include <cantera/equilibrium.h>
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef WITH_TRANSPORT
|
||||
#include <cantera/transport.h>
|
||||
|
||||
// store a pointer to a transport manager
|
||||
static Transport* _trans = 0;
|
||||
Transport* _transptr()
|
||||
{
|
||||
return _trans;
|
||||
}
|
||||
#endif
|
||||
|
||||
// error handler
|
||||
void handleError()
|
||||
{
|
||||
showErrors(cout);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
// extern "C" turns off C++ name-mangling, so that the procedure names
|
||||
// in the object file are exactly as shown here.
|
||||
|
||||
extern "C" {
|
||||
|
||||
/// This is the Fortran main program. This works for g77; it may
|
||||
/// need to be modified for other Fortran compilers
|
||||
#ifdef NEED_ALT_MAIN
|
||||
extern int MAIN__();
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Read in a reaction mechanism file and create an IdealGasMix
|
||||
* object. The file may be in Cantera input format or in CTML. (If
|
||||
* you have a file in Chemkin-compatible format, use utility
|
||||
* program ck2cti first to convert it into Cantera format.)
|
||||
*/
|
||||
void newidealgasmix_(char* file, char* id, char* transport,
|
||||
ftnlen lenfile, ftnlen lenid, ftnlen lentr)
|
||||
{
|
||||
string trmodel = "";
|
||||
try {
|
||||
string fin = string(file, lenfile);
|
||||
string fth = string(id, lenid);
|
||||
trmodel = string(transport, lentr);
|
||||
if (_gas) delete _gas;
|
||||
_gas = new IdealGasMix(fin, fth);
|
||||
} catch (CanteraError) {
|
||||
handleError();
|
||||
}
|
||||
#ifdef WITH_TRANSPORT
|
||||
try {
|
||||
if (_trans) delete _trans;
|
||||
_trans = newTransportMgr(trmodel,_gas,1);
|
||||
} catch (CanteraError) {
|
||||
_trans = newTransportMgr("",_gas,1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/// integer function nElements()
|
||||
integer nelements_()
|
||||
{
|
||||
return _gas->nElements();
|
||||
}
|
||||
|
||||
/// integer function nSpecies()
|
||||
integer nspecies_()
|
||||
{
|
||||
return _gas->nSpecies();
|
||||
}
|
||||
|
||||
/// integer function nReactions()
|
||||
integer nreactions_()
|
||||
{
|
||||
return _gas->nReactions();
|
||||
}
|
||||
|
||||
void getspeciesname_(integer* k, char* name, ftnlen n)
|
||||
{
|
||||
int ik = *k - 1;
|
||||
fill(name, name + n, ' ');
|
||||
string spnm = _gas->speciesName(ik);
|
||||
int ns = spnm.size();
|
||||
unsigned int nmx = (ns > n ? n : ns);
|
||||
copy(spnm.begin(), spnm.begin()+nmx, name);
|
||||
}
|
||||
|
||||
//-------------- setting the state ----------------------------
|
||||
|
||||
/// subroutine setState_TPX(T, P, X)
|
||||
void setstate_tpx_(doublereal* T, doublereal* P, doublereal* X)
|
||||
{
|
||||
try {
|
||||
_gas->setState_TPX(*T, *P, X);
|
||||
} catch (CanteraError) {
|
||||
handleError();
|
||||
}
|
||||
}
|
||||
|
||||
/// subroutine setState_TPX_String(T, P, X)
|
||||
void setstate_tpx_string_(doublereal* T, doublereal* P,
|
||||
char* X, ftnlen lenx)
|
||||
{
|
||||
try {
|
||||
_gas->setState_TPX(*T, *P, string(X, lenx));
|
||||
} catch (CanteraError) {
|
||||
handleError();
|
||||
}
|
||||
}
|
||||
|
||||
void setstate_try_(doublereal* T, doublereal* rho, doublereal* Y)
|
||||
{
|
||||
try {
|
||||
_gas->setState_TRY(*T, *rho, Y);
|
||||
} catch (CanteraError) {
|
||||
handleError();
|
||||
}
|
||||
}
|
||||
|
||||
void setstate_tpy_(doublereal* T, doublereal* p, doublereal* Y)
|
||||
{
|
||||
try {
|
||||
_gas->setState_TPY(*T, *p, Y);
|
||||
} catch (CanteraError) {
|
||||
handleError();
|
||||
}
|
||||
}
|
||||
|
||||
void setstate_sp_(doublereal* s, doublereal* p)
|
||||
{
|
||||
try {
|
||||
_gas->setState_SP(*s, *p);
|
||||
} catch (CanteraError) {
|
||||
handleError();
|
||||
}
|
||||
}
|
||||
|
||||
//-------------- thermodynamic properties ----------------------
|
||||
|
||||
/// Temperature (K)
|
||||
doublereal temperature_()
|
||||
{
|
||||
return _gas->temperature();
|
||||
}
|
||||
|
||||
/// Pressure (Pa)
|
||||
doublereal pressure_()
|
||||
{
|
||||
return _gas->pressure();
|
||||
}
|
||||
|
||||
/// Density (kg/m^3)
|
||||
doublereal density_()
|
||||
{
|
||||
return _gas->density();
|
||||
}
|
||||
|
||||
/// Mean molar mass (kg/kmol).
|
||||
doublereal meanmolarmass_()
|
||||
{
|
||||
return _gas->meanMolecularWeight();
|
||||
}
|
||||
|
||||
/// Molar enthalpy (J/kmol)
|
||||
doublereal enthalpy_mole_()
|
||||
{
|
||||
return _gas->enthalpy_mole();
|
||||
}
|
||||
|
||||
/// Molar internal energy (J/kmol)
|
||||
doublereal intenergy_mole_()
|
||||
{
|
||||
return _gas->intEnergy_mole();
|
||||
}
|
||||
|
||||
/// Molar entropy (J/kmol-K)
|
||||
doublereal entropy_mole_()
|
||||
{
|
||||
return _gas->entropy_mole();
|
||||
}
|
||||
|
||||
/// Molar heat capacity at constant P (J/kmol-K)
|
||||
doublereal cp_mole_()
|
||||
{
|
||||
return _gas->cp_mole();
|
||||
}
|
||||
|
||||
/// Molar Gibbs function (J/kmol)
|
||||
doublereal gibbs_mole_()
|
||||
{
|
||||
return _gas->gibbs_mole();
|
||||
}
|
||||
|
||||
doublereal enthalpy_mass_()
|
||||
{
|
||||
return _gas->enthalpy_mass();
|
||||
}
|
||||
|
||||
doublereal intenergy_mass_()
|
||||
{
|
||||
return _gas->intEnergy_mass();
|
||||
}
|
||||
|
||||
doublereal entropy_mass_()
|
||||
{
|
||||
return _gas->entropy_mass();
|
||||
}
|
||||
|
||||
doublereal cp_mass_()
|
||||
{
|
||||
return _gas->cp_mass();
|
||||
}
|
||||
|
||||
doublereal cv_mass_()
|
||||
{
|
||||
return _gas->cv_mass();
|
||||
}
|
||||
|
||||
doublereal gibbs_mass_()
|
||||
{
|
||||
return _gas->gibbs_mass();
|
||||
}
|
||||
|
||||
void gotmolefractions_(doublereal* x)
|
||||
{
|
||||
_gas->getMoleFractions(x);
|
||||
}
|
||||
|
||||
void gotmassfractions_(doublereal* y)
|
||||
{
|
||||
_gas->getMassFractions(y);
|
||||
}
|
||||
|
||||
#ifdef WITH_EQUIL
|
||||
void equilibrate_(char* opt, ftnlen lenopt)
|
||||
{
|
||||
try {
|
||||
if (lenopt != 2) {
|
||||
throw CanteraError("equilibrate",
|
||||
"two-character string required.");
|
||||
}
|
||||
string optstr = string(opt, 2);
|
||||
equilibrate(*_gas, optstr.c_str());
|
||||
} catch (CanteraError) {
|
||||
handleError();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
//---------------- kinetics -------------------------
|
||||
|
||||
void getreactioneqn_(integer* i, char* eqn, ftnlen n)
|
||||
{
|
||||
int irxn = *i - 1;
|
||||
fill(eqn, eqn + n, ' ');
|
||||
string e = _gas->reactionString(irxn);
|
||||
int ns = e.size();
|
||||
unsigned int nmx = (ns > n ? n : ns);
|
||||
copy(e.begin(), e.begin()+nmx, eqn);
|
||||
}
|
||||
|
||||
void getnetproductionrates_(doublereal* wdot)
|
||||
{
|
||||
_gas->getNetProductionRates(wdot);
|
||||
}
|
||||
|
||||
void getcreationrates_(doublereal* cdot)
|
||||
{
|
||||
_gas->getCreationRates(cdot);
|
||||
}
|
||||
|
||||
void getdestructionrates_(doublereal* ddot)
|
||||
{
|
||||
_gas->getDestructionRates(ddot);
|
||||
}
|
||||
|
||||
void getnetratesofprogress_(doublereal* q)
|
||||
{
|
||||
_gas->getNetRatesOfProgress(q);
|
||||
}
|
||||
|
||||
void getfwdratesofprogress_(doublereal* q)
|
||||
{
|
||||
_gas->getFwdRatesOfProgress(q);
|
||||
}
|
||||
|
||||
void getrevratesofprogress_(doublereal* q)
|
||||
{
|
||||
_gas->getRevRatesOfProgress(q);
|
||||
}
|
||||
|
||||
//-------------------- transport properties --------------------
|
||||
|
||||
#ifdef WITH_TRANSPORT
|
||||
double viscosity_()
|
||||
{
|
||||
try {
|
||||
return _trans->viscosity();
|
||||
} catch (CanteraError) {
|
||||
handleError();
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
double thermalconductivity_()
|
||||
{
|
||||
try {
|
||||
return _trans->thermalConductivity();
|
||||
} catch (CanteraError) {
|
||||
handleError();
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void getmixdiffcoeffs_(double* diff)
|
||||
{
|
||||
try {
|
||||
_trans->getMixDiffCoeffs(diff);
|
||||
} catch (CanteraError) {
|
||||
handleError();
|
||||
}
|
||||
}
|
||||
|
||||
void getthermaldiffcoeffs_(double* dt)
|
||||
{
|
||||
try {
|
||||
_trans->getThermalDiffCoeffs(dt);
|
||||
} catch (CanteraError) {
|
||||
handleError();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* HKM 7/22/09:
|
||||
* I'm skeptical that you need this for any system.
|
||||
* Definately creates an error (dupl main()) for the solaris
|
||||
* system
|
||||
*/
|
||||
#ifdef NEED_ALT_MAIN
|
||||
/**
|
||||
* This C++ main program simply calls the Fortran main program.
|
||||
*/
|
||||
int main()
|
||||
{
|
||||
try {
|
||||
return MAIN__();
|
||||
} catch (CanteraError) {
|
||||
showErrors(cerr);
|
||||
exit(-1);
|
||||
} catch (...) {
|
||||
cout << "An exception was trapped. Program terminating." << endl;
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1,98 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
.SUFFIXES :
|
||||
.SUFFIXES : .cpp .d .o .h .f
|
||||
|
||||
|
||||
# the object files to be linked together.
|
||||
OBJS = isentropic.o ctlib.o demo_ftnlib.o
|
||||
|
||||
# additional flags to be passed to the linker. If your program
|
||||
# requires other external libraries, put them here
|
||||
LINK_OPTIONS =
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# You probably don't need to edit anything below.
|
||||
|
||||
|
||||
# the Fortran compiler
|
||||
FORT = @F77@
|
||||
|
||||
# Fortran compile flags
|
||||
FORT_FLAGS = @FFLAGS@
|
||||
|
||||
# Fortran libraries
|
||||
FORT_LIBS = @LCXX_FLIBS@ @FLIBS@ @LCXX_END_LIBS@
|
||||
|
||||
# the C++ compiler
|
||||
CXX = @CXX@
|
||||
|
||||
# C++ compile flags
|
||||
CXX_FLAGS = @CXXFLAGS@
|
||||
|
||||
# external libraries
|
||||
EXT_LIBS = @LOCAL_LIBS@ -lctcxx
|
||||
|
||||
# the directory where the Cantera libraries are located
|
||||
CANTERA_LIBDIR=@ct_libdir@
|
||||
|
||||
# the directory where Cantera include files may be found.
|
||||
CANTERA_INCDIR=@ct_incroot@
|
||||
|
||||
# flags passed to the C++ compiler/linker for the linking step
|
||||
LCXX_FLAGS = -L$(CANTERA_LIBDIR) @LOCAL_LIB_DIRS@ @CXXFLAGS@
|
||||
|
||||
# how to compile C++ source files to object files
|
||||
.@CXX_EXT@.@OBJ_EXT@:
|
||||
$(CXX) -c $< -I$(CANTERA_INCDIR) $(CXX_FLAGS)
|
||||
|
||||
# how to compile Fortran source files to object files
|
||||
.@F77_EXT@.@OBJ_EXT@:
|
||||
$(FORT) -c $< $(FORT_FLAGS)
|
||||
|
||||
PROGRAM = $(PROG_NAME)$(EXE_EXT)
|
||||
|
||||
DEPENDS = $(OBJS:.o=.d)
|
||||
|
||||
all: isentropic ctlib
|
||||
|
||||
isentropic: isentropic.o demo_ftnlib.o
|
||||
$(CXX) -o isentropic isentropic.o demo_ftnlib.o $(LCXX_FLAGS) $(CANTERA_LIBS) $(LINK_OPTIONS) $(EXT_LIBS) @LIBS@ $(FORT_LIBS)
|
||||
|
||||
ctlib: ctlib.o demo_ftnlib.o
|
||||
$(CXX) -o ctlib ctlib.o demo_ftnlib.o $(LCXX_FLAGS) $(CANTERA_LIBS) $(LINK_OPTIONS) $(EXT_LIBS) @LIBS@ $(FORT_LIBS)
|
||||
|
||||
.cpp.d:
|
||||
@CXX_DEPENDS@ -I$(CANTERA_INCDIR) $(CXX_FLAGS) $*.cpp > $*.d
|
||||
|
||||
.f.d:
|
||||
@echo "$*.o: $*.f" | cat > $*.d
|
||||
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJS) isentropic ctlib *.d .depends \
|
||||
diff* output_0.txt output_1.txt gri30.xml ct2ctml.log \
|
||||
isentropic.dsp
|
||||
|
||||
test:
|
||||
@MAKE@
|
||||
./runtest
|
||||
|
||||
depends:
|
||||
@MAKE@ .depends
|
||||
|
||||
.depends: $(DEPENDS)
|
||||
cat *.d > .depends
|
||||
|
||||
TAGS:
|
||||
etags *.h *.cpp
|
||||
|
||||
ifeq ($(wildcard .depends), .depends)
|
||||
include .depends
|
||||
endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
Makefile
|
||||
*.mod
|
||||
SunWS_cache
|
||||
.depends
|
||||
|
|
@ -1,124 +0,0 @@
|
|||
#/bin/sh
|
||||
###############################################################
|
||||
# $Author$
|
||||
# $Date$
|
||||
# $Revision$
|
||||
#
|
||||
# Copyright 2001 California Institute of Technology
|
||||
#
|
||||
###############################################################
|
||||
|
||||
.SUFFIXES :
|
||||
.SUFFIXES : .cpp .d .o .f90 .mod
|
||||
|
||||
CXX_FLAGS = @CXXFLAGS@ $(CXX_OPT)
|
||||
FORT_FLAGS = @F90BUILDFLAGS@
|
||||
|
||||
PURIFY=@PURIFY@
|
||||
|
||||
CXX_OBJS = fct.o fctxml.o
|
||||
|
||||
BUILDINCDIR = ../../../build/include/cantera
|
||||
|
||||
INTERFACE_MODULE_OBJS = fct_interface.o fctxml_interface.o
|
||||
|
||||
USER_MODULE_OBJS = cantera_xml.o cantera_thermo.o cantera_kinetics.o \
|
||||
cantera_transport.o cantera_iface.o cantera_funcs.o cantera.o
|
||||
|
||||
MODULES = $(INTERFACE_MODULE_OBJS:_interface.o=.mod) $(USER_MODULE_OBJS)
|
||||
OBJS = $(CXX_OBJS) $(USER_MODULE_OBJS)
|
||||
|
||||
DEPENDS = $(CXX_OBJS:.o=.d)
|
||||
MODFILES = $(MODULES:.o=.mod)
|
||||
|
||||
# Fortran libraries
|
||||
FORT_LIBS = @FLIBS@
|
||||
|
||||
# the C++ compiler
|
||||
CXX = @CXX@
|
||||
|
||||
# the Fortran 90/95 compiler
|
||||
F90 = @F90@
|
||||
|
||||
# external libraries
|
||||
EXT_LIBS = @LOCAL_LIBS@
|
||||
|
||||
# the directory where the Cantera libraries are located
|
||||
CANTERA_LIBDIR=@buildlib@
|
||||
|
||||
LIB_DEPS = $(CANTERA_LIBDIR)/libctbase.a \
|
||||
$(CANTERA_LIBDIR)/libequil.a \
|
||||
$(CANTERA_LIBDIR)/libtransport.a \
|
||||
$(CANTERA_LIBDIR)/libthermo.a \
|
||||
$(CANTERA_LIBDIR)/libctnumerics.a \
|
||||
$(CANTERA_LIBDIR)/libzeroD.a \
|
||||
$(CANTERA_LIBDIR)/liboneD.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@
|
||||
|
||||
# flags passed to the C++ compiler/linker for the linking step
|
||||
LCXX_FLAGS = -L$(CANTERA_LIBDIR) @CXXFLAGS@
|
||||
|
||||
# how to compile C++ source files to object files
|
||||
%.o : %.cpp
|
||||
$(PURIFY) $(CXX) -c $< $(CXX_INCLUDES) $(CXX_FLAGS)
|
||||
|
||||
%.o : %.f90
|
||||
$(PURIFY) $(F90) -c $< $(FORT_FLAGS)
|
||||
|
||||
%.mod : %_interface.f90
|
||||
$(PURIFY) $(F90) -c $< $(FORT_FLAGS)
|
||||
|
||||
%.mod : %.f90
|
||||
$(PURIFY) $(F90) -c $< $(FORT_FLAGS)
|
||||
|
||||
LIB_NAME=libfct.a
|
||||
|
||||
FTLIB = @buildlib@/$(LIB_NAME)
|
||||
|
||||
all: $(FTLIB)
|
||||
|
||||
$(FTLIB): $(MODFILES) $(USER_MODULE_OBJS) $(CXX_OBJS) $(LIB_DEPS)
|
||||
$(RM) $(FTLIB)
|
||||
@ARCHIVE@ $(FTLIB) $(OBJS)
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJS) $(FTLIB) $(MODFILES) *~
|
||||
(if test -d SunWS_cache ; then \
|
||||
$(RM) -rf SunWS_cache ; \
|
||||
fi )
|
||||
@(for lh in $(MODFILES); do \
|
||||
th=$(BUILDINCDIR)/"$${lh}" ; \
|
||||
if test -f "$${th}" ; then \
|
||||
$(RM) "$${th}" ; \
|
||||
echo "$(RM) $${th}" ; \
|
||||
fi \
|
||||
done)
|
||||
|
||||
|
||||
install:
|
||||
@INSTALL@ -m ug+rw,o+r $(FTLIB) @ct_libdir@
|
||||
@INSTALL@ -m ug+rw,o+r $(MODFILES) @ct_incdir@
|
||||
|
||||
win-install:
|
||||
@INSTALL@ -m ug+rw,o+r ../../../lib/fct.lib @ct_libdir@
|
||||
|
||||
%.d: %.cpp
|
||||
@CXX_DEPENDS@ $(CXX_INCLUDES) $*.cpp > $*.d
|
||||
|
||||
depends:
|
||||
$(MAKE) .depends
|
||||
|
||||
.depends: $(DEPENDS)
|
||||
cat *.d > .depends
|
||||
|
||||
cantera_thermo.o: fct.mod cantera_xml.mod cantera_thermo.f90
|
||||
fct.mod: fct_interface.f90
|
||||
fctxml.mod: fctxml_interface.f90
|
||||
|
||||
ifeq ($(wildcard .depends), .depends)
|
||||
include .depends
|
||||
endif
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue