mirror of
https://github.com/Cantera/cantera.git
synced 2025-02-25 18:55:29 -06:00
*** empty log message ***
This commit is contained in:
@@ -7,3 +7,7 @@ ctlib An example showing how to write subroutines that emulate those
|
||||
|
||||
isentropic Mach number vs. area ratio for isentropic flow.
|
||||
|
||||
Both of these use the "demo_f77" library that demonstrates one simple
|
||||
scheme to handle interfacing Fortran 77 and C++. Additional functions
|
||||
can be added to this library as needed.
|
||||
|
||||
|
||||
111
Cantera/fortran/f77demos/isentropic.dsp.in
Normal file
111
Cantera/fortran/f77demos/isentropic.dsp.in
Normal file
@@ -0,0 +1,111 @@
|
||||
# Microsoft Developer Studio Project File - Name="isentropic" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=isentropic - Win32 Release
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "isentropic.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "isentropic.mak" CFG="isentropic - Win32 Release"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "isentropic - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "isentropic - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
F90=df.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "isentropic - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "."
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE F90 /compile_only /nologo /warn:nofileopt
|
||||
# ADD F90 /assume:underscore /compile_only /iface:nomixed_str_len_arg /iface:cref /libs:dll /math_library:fast /names:lowercase /nologo /threads /warn:nofileopt
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "@ct_incroot@" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib transport.lib tpx.lib cantera.lib cvode.lib ctlapack.lib ctmath.lib recipes.lib cxxutils.lib /nologo /subsystem:console /machine:I386 /libpath:"@ct_libdir@"
|
||||
|
||||
!ELSEIF "$(CFG)" == "isentropic - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE F90 /check:bounds /compile_only /debug:full /nologo /traceback /warn:argument_checking /warn:nofileopt
|
||||
# ADD F90 /assume:underscore /check:bounds /compile_only /debug:full /iface:nomixed_str_len_arg /iface:cref /libs:dll /names:lowercase /nologo /reentrancy:threaded /threads /traceback /warn:argument_checking /warn:nofileopt
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "@ct_incroot@" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib transport_d.lib tpx_d.lib cantera_d.lib cvode_d.lib ctlapack_d.lib ctmath_d.lib recipes_d.lib cxxutils_d.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /pdbtype:sept /libpath:"@ct_libdir@"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "isentropic - Win32 Release"
|
||||
# Name "isentropic - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;f90;for;f;fpp"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=demo_ftnlib.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=isentropic.f
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -125,7 +125,7 @@ if ntot == 1
|
||||
elseif nv == 1
|
||||
setDensity(a,1.0/vval); % temperature held fixed
|
||||
elseif np == 1
|
||||
setPressure(1, pval); % temperature held fixed
|
||||
setPressure(a, pval); % temperature held fixed
|
||||
else
|
||||
error('pressure, volume, or density must also be specified');
|
||||
end
|
||||
@@ -133,16 +133,27 @@ elseif ntot == 2
|
||||
%
|
||||
% set property pairs
|
||||
%
|
||||
if np == 1 & nh == 1
|
||||
setState_HP(a,[hval,pval]);
|
||||
elseif nu == 1 & nv == 1
|
||||
setState_UV(a,[uval,vval]);
|
||||
elseif ns == 1 & np == 1
|
||||
setState_SP(a,[sval,pval]);
|
||||
elseif ns == 1 & nv == 1
|
||||
setState_SV(a,[sval,vval]);
|
||||
if nt == 1
|
||||
setTemperature(a,tval)
|
||||
if nv == 1
|
||||
setDensity(a,1.0/vval); % temperature held fixed
|
||||
elseif np == 1
|
||||
setPressure(a, pval); % temperature held fixed
|
||||
else
|
||||
error('unimplemented property pair');
|
||||
end
|
||||
else
|
||||
error('unimplemented property pair');
|
||||
if np == 1 & nh == 1
|
||||
setState_HP(a,[hval,pval]);
|
||||
elseif nu == 1 & nv == 1
|
||||
setState_UV(a,[uval,vval]);
|
||||
elseif ns == 1 & np == 1
|
||||
setState_SP(a,[sval,pval]);
|
||||
elseif ns == 1 & nv == 1
|
||||
setState_SV(a,[sval,vval]);
|
||||
else
|
||||
error('unimplemented property pair');
|
||||
end
|
||||
end
|
||||
else
|
||||
error('too many properties specified');
|
||||
|
||||
@@ -7,12 +7,18 @@ mex -I../../../build/include private/ctmethods.cpp ...
|
||||
private/transportmethods.cpp private/reactormethods.cpp ...
|
||||
private/wallmethods.cpp private/flowdevicemethods.cpp ...
|
||||
private/onedimmethods.cpp private/surfmethods.cpp private/write.cpp ...
|
||||
../../../lib/clib.lib ../../../lib/oneD.lib ...
|
||||
../../../lib/zeroD.lib ../../../lib/transport.lib ...
|
||||
../../../lib/cantera.lib ../../../lib/recipes.lib ...
|
||||
../../../lib/cvode.lib ../../../lib/ctlapack.lib ...
|
||||
../../../lib/ctmath.lib ../../../lib/ctblas.lib ...
|
||||
../../../lib/tpx.lib ...
|
||||
../../../lib/dformd.lib ../../../lib/dfconsol.lib ...
|
||||
../../../lib/dfport.lib
|
||||
../../../build/lib/i686-pc-win32/clib.lib ...
|
||||
../../../build/lib/i686-pc-win32/oneD.lib ...
|
||||
../../../build/lib/i686-pc-win32/zeroD.lib ...
|
||||
../../../build/lib/i686-pc-win32/transport.lib ...
|
||||
../../../build/lib/i686-pc-win32/cantera.lib ...
|
||||
../../../build/lib/i686-pc-win32/recipes.lib ...
|
||||
../../../build/lib/i686-pc-win32/cvode.lib ...
|
||||
../../../build/lib/i686-pc-win32/ctlapack.lib ...
|
||||
../../../build/lib/i686-pc-win32/ctmath.lib ...
|
||||
../../../build/lib/i686-pc-win32/ctblas.lib ...
|
||||
../../../build/lib/i686-pc-win32/tpx.lib ...
|
||||
../../../build/lib/i686-pc-win32/dformd.lib ...
|
||||
../../../build/lib/i686-pc-win32/dfconsol.lib ...
|
||||
../../../build/lib/i686-pc-win32/dfport.lib
|
||||
disp('done.');
|
||||
|
||||
@@ -1,3 +1,40 @@
|
||||
|
||||
import sys
|
||||
|
||||
bindir = 'c:/cantera/bin'
|
||||
libdir = 'd:/dgg/dv/sf/cantera/build/lib/i686-pc-win32'
|
||||
incdir = 'd:/dgg/dv/sf/cantera/build/include'
|
||||
dflibdir = 'D:\Program Files\Microsoft Visual Studio\DF98\LIB'
|
||||
|
||||
libs = ['clib', 'oneD', 'zeroD', 'transport', 'cantera', 'recipes',
|
||||
'cvode', 'ctlapack', 'ctmath', 'ctblas', 'tpx']
|
||||
|
||||
f = open('setup.m','w')
|
||||
f.write('cd cantera\nbuildwin\nexit\n')
|
||||
f.write('cd cantera\nbuild_cantera\nexit\n')
|
||||
f.close()
|
||||
|
||||
fb = open('cantera/build_cantera.m','w')
|
||||
fb.write("""
|
||||
disp('building Cantera..');
|
||||
mex -I"""+incdir+""" private/ctmethods.cpp private/ctfunctions.cpp ...
|
||||
private/xmlmethods.cpp private/phasemethods.cpp ...
|
||||
private/thermomethods.cpp private/kineticsmethods.cpp ...
|
||||
private/transportmethods.cpp private/reactormethods.cpp ...
|
||||
private/wallmethods.cpp private/flowdevicemethods.cpp ...
|
||||
private/onedimmethods.cpp private/surfmethods.cpp private/write.cpp ...
|
||||
""")
|
||||
s = ''
|
||||
for lib in libs:
|
||||
s += ' '+libdir+'/'+lib+'.lib ...\n'
|
||||
fb.write(s)
|
||||
fb.write(' "'+dflibdir+'/dformd.lib" ...\n')
|
||||
fb.write(' "'+dflibdir+'/dfconsol.lib" ...\n')
|
||||
fb.write(' "'+dflibdir+'/dfport.lib" \n')
|
||||
fb.close()
|
||||
|
||||
fp = open('cantera/ctbin.m','w')
|
||||
fp.write("""function path = ctbin
|
||||
path = '"""+bindir+"""';
|
||||
""")
|
||||
fp.close()
|
||||
|
||||
|
||||
@@ -30,12 +30,11 @@ class DustyGasTransport(Transport):
|
||||
spheres is used."""
|
||||
self.setParameters(4, 0, [permeability, 0.0])
|
||||
|
||||
def molarFluxes(self,
|
||||
conc = None,
|
||||
gradConc = None,
|
||||
gradPressure = 0.0):
|
||||
self.setConcentrations(concentrations)
|
||||
self.
|
||||
## def molarFluxes(self,
|
||||
## conc = None,
|
||||
## gradConc = None,
|
||||
## gradPressure = 0.0):
|
||||
## self.setConcentrations(concentrations)
|
||||
|
||||
def set(self, **p):
|
||||
"""Set model parameters. This is a convenience method that simply
|
||||
|
||||
@@ -42,7 +42,7 @@ _build: $(SRCS) $(LIB_DEPS)
|
||||
echo 'ok' > _build
|
||||
|
||||
|
||||
_winbuild: $(SRCS) $(LIB_DEPS)
|
||||
_winbuild: $(SRCS) $(WIN_LIB_DEPS)
|
||||
touch src/pycantera.cpp
|
||||
(@PYTHON_CMD@ setup.py build)
|
||||
echo 'ok' > _winbuild
|
||||
|
||||
10
Makefile.in
10
Makefile.in
@@ -65,7 +65,7 @@ kernel-install:
|
||||
win-kernel-install:
|
||||
@INSTALL@ -d @ct_libdir@
|
||||
rm -f @ct_libdir@/*
|
||||
@INSTALL@ -m 644 lib/*.lib @ct_libdir@
|
||||
@INSTALL@ -m 644 @buildlib@/*.lib @ct_libdir@
|
||||
|
||||
data-install:
|
||||
@INSTALL@ -d @ct_datadir@
|
||||
@@ -157,6 +157,7 @@ finish-install:
|
||||
@INSTALL@ Cantera/fortran/f77demos/f77demos.mak @ct_demodir@/f77/Makefile
|
||||
chown -R @username@ @ct_demodir@/f77
|
||||
|
||||
ifeq ($(os_is_win),0)
|
||||
rm -f @prefix@/cantera/demos
|
||||
rm -f @prefix@/cantera/data
|
||||
rm -f @prefix@/cantera/templates
|
||||
@@ -165,13 +166,16 @@ finish-install:
|
||||
ln -s @ct_datadir@ @prefix@/cantera/data
|
||||
ln -s @ct_templdir@ @prefix@/cantera/templates
|
||||
ln -s @ct_tutdir@ @prefix@/cantera/tutorials
|
||||
|
||||
@INSTALL@ README*.txt @prefix@/cantera
|
||||
@INSTALL@ License.* @prefix@/cantera
|
||||
@INSTALL@ tools/src/finish_install.py tools/bin
|
||||
ifeq ($(os_is_win),0)
|
||||
(PYTHONPATH=''; @PYTHON_CMD@ tools/bin/finish_install.py @prefix@ @PYTHON_CMD@)
|
||||
chmod +x @ct_bindir@/ctnew
|
||||
else
|
||||
cd Cantera/fortran/f77demos; sed s'/isentropic/ctlib/g' isentropic.dsp > ctlib.dsp
|
||||
@INSTALL@ Cantera/fortran/f77demos/*.dsp @ct_demodir@/f77
|
||||
@INSTALL@ README.txt @ct_dir@
|
||||
@INSTALL@ @buildbin@/* @ct_bindir@
|
||||
endif
|
||||
|
||||
#@INSTALL@ bin/ctmkmf @ct_bindir@/ctnew
|
||||
|
||||
5310
config/configure
vendored
5310
config/configure
vendored
File diff suppressed because it is too large
Load Diff
@@ -31,19 +31,22 @@ case $ac_sys_system in
|
||||
CYGWIN*) OS_IS_CYGWIN=1; mex_ext=dll;;
|
||||
esac
|
||||
|
||||
CVF_LIBDIR=""
|
||||
if test "x${OS_IS_CYGWIN}" = "x1"; then
|
||||
if test "${WINDOWS_BUILD}" = "y"; then
|
||||
if test "${USE_VISUAL_STUDIO}" = "y"; then
|
||||
OS_IS_WIN=1;
|
||||
CVF_LIBDIR=$FORTRAN_LIB_DIR
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(CVF_LIBDIR)
|
||||
|
||||
#AC_PREFIX_DEFAULT([/usr/local])
|
||||
|
||||
local_inst=1
|
||||
if test "x${prefix}" = "xNONE"; then
|
||||
if test "x${OS_IS_WIN}" = "x1"; then
|
||||
if test "x${OS_IS_CYGWIN}" = "x1"; then
|
||||
prefix="/cygdrive/c/cantera"
|
||||
mkdir ${prefix}
|
||||
# mkdir ${prefix}
|
||||
else
|
||||
prefix=${ac_default_prefix}
|
||||
fi
|
||||
@@ -101,6 +104,20 @@ ct_dir=${prefix}/cantera/${ctversion}
|
||||
ct_mandir=${prefix}/share/man
|
||||
fi
|
||||
|
||||
if test "x${OS_IS_WIN}" = "x1"; then
|
||||
ct_libdir=${prefix}/lib/${ctversion}
|
||||
ct_incdir=${prefix}/include/cantera
|
||||
ct_incroot=${prefix}/include
|
||||
ct_bindir=${prefix}/bin
|
||||
ct_datadir=${prefix}/data
|
||||
ct_demodir=${prefix}/demos
|
||||
ct_templdir=${prefix}/templates
|
||||
ct_tutdir=${prefix}/tutorials
|
||||
ct_docdir=${prefix}/doc
|
||||
ct_dir=${prefix}
|
||||
ct_mandir=${prefix}
|
||||
fi
|
||||
|
||||
AC_SUBST(ct_libdir)
|
||||
AC_SUBST(ct_incdir)
|
||||
AC_SUBST(ct_incroot)
|
||||
@@ -527,8 +544,10 @@ AC_OUTPUT(../Cantera/Makefile \
|
||||
../Cantera/clib/src/Makefile \
|
||||
../Cantera/fortran/src/Makefile \
|
||||
../Cantera/fortran/f77demos/f77demos.mak \
|
||||
../Cantera/fortran/f77demos/isentropic.dsp \
|
||||
../Cantera/matlab/Makefile \
|
||||
../Cantera/matlab/setup_matlab.py \
|
||||
../Cantera/matlab/setup_winmatlab.py \
|
||||
../Cantera/python/Makefile \
|
||||
../Cantera/python/setup.py \
|
||||
../Cantera/cxx/src/Makefile \
|
||||
@@ -566,8 +585,8 @@ if test "x${OS_IS_WIN}" = "x0"; then
|
||||
echo "Now type '${MAKE}' to build Cantera"
|
||||
else
|
||||
echo "Now start Visual Studio, open workspace 'win32/cantera.dsw',"
|
||||
echo "and build project 'all'. When this finishes, type 'make-win'"
|
||||
echo "to build the Python and MATLAB interfaces."
|
||||
echo "and build project 'all'. When this finishes, come back here and "
|
||||
echo "type 'make win' to make the Python and/or MATLAB interfaces."
|
||||
fi
|
||||
echo
|
||||
# $Log: configure.in,v
|
||||
|
||||
12
configure
vendored
12
configure
vendored
@@ -32,12 +32,12 @@ CANTERA_VERSION=${CANTERA_VERSION:="1.5.3"}
|
||||
#
|
||||
# On a PC running MS-Windows, Cantera can be built either using
|
||||
# Microsoft Visual Studio, with the Visual C++ and Visual Fortran
|
||||
# compilers, or using the cygwin g++ and g77 compilers. If you plan to
|
||||
# build the Python and/or MATLAB interfaces, set this to "y". On the
|
||||
# other hand, if you plan to compile your own applications using the
|
||||
# cygwin unix-like environment, then set this to "n".
|
||||
USE_VISUAL_STUDIO=${USE_VISUAL_STUDIO}:="y"}
|
||||
# compilers, or using the linux-like cygwin environment with the
|
||||
# g++ and g77 compilers.
|
||||
USE_VISUAL_STUDIO=${USE_VISUAL_STUDIO:="y"}
|
||||
|
||||
#
|
||||
FORTRAN_LIB_DIR="D:\Program Files\Microsoft Visual Studio\DF98\LIB"
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
# Language Interfaces
|
||||
@@ -304,6 +304,8 @@ export SHARED
|
||||
export SOEXT
|
||||
export MAKE
|
||||
export RPFONT
|
||||
export USE_VISUAL_STUDIO
|
||||
export FORTRAN_LIB_DIR
|
||||
|
||||
cd config
|
||||
chmod +x ./configure
|
||||
|
||||
@@ -3,10 +3,6 @@ prefix = '@prefix@'
|
||||
pycmd = '@PYTHON_CMD@' # sys.argv[2]
|
||||
localinst = @local_inst@
|
||||
|
||||
icyg = prefix.find('/cygdrive/')
|
||||
if icyg == 0:
|
||||
prefix = prefix[10]+':'+prefix[11:]
|
||||
|
||||
bindir = '@ct_bindir@'
|
||||
libdir = '@ct_libdir@'
|
||||
hdrdir = '@ct_incdir@'
|
||||
|
||||
@@ -25,6 +25,12 @@
|
||||
|
||||
*/
|
||||
|
||||
// turn off warnings under Windows
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
#pragma warning(disable:4503)
|
||||
#endif
|
||||
|
||||
// add any other Cantera header files you need here
|
||||
#include <cantera/IdealGasMix.h>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user