*** empty log message ***

This commit is contained in:
Dave Goodwin 2003-04-18 23:20:16 +00:00
parent 6c28f55fd0
commit e93289bcef
26 changed files with 456 additions and 166 deletions

58
Cantera/cxx/Makefile.in Normal file
View File

@ -0,0 +1,58 @@
#/bin/sh
###############################################################
# $Author$
# $Date$
# $Revision$
#
# Copyright 2001 California Institute of Technology
#
###############################################################
SUFFIXES=
SUFFIXES= .cpp .d .o
CXX_FLAGS = @CXXFLAGS@ $(CXX_OPT)
OBJS = cxxutils.o
DEPENDS = $(OBJS:.o=.d)
# the C++ compiler
CXX = @CXX@
# the directory where Cantera include files may be found.
CANTERA_INCDIR=../src
CXX_INCLUDES = -I$(CANTERA_INCDIR)
# 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@:
$(CXX) -c $< $(CXX_INCLUDES) $(CXX_FLAGS)
LIB_NAME=libctcxx
CXXLIB=$(LIB_NAME).a
all: $(OBJS)
@ARCHIVE@ $(CXXLIB) $(OBJS)
clean:
$(RM) $(OBJS) $(CXXLIB)
install:
@INSTALL@ $(CXXLIB) @prefix@/lib/cantera
%.d:
g++ -MM $(CXX_INCLUDES) $*.cpp > $*.d
depends: $(DEPENDS)
cat *.d > .depends
$(RM) $(DEPENDS)
ifeq ($(wildcard .depends), .depends)
include .depends
endif

105
Cantera/cxx/cxxutils.cpp Normal file
View File

@ -0,0 +1,105 @@
#include "ThermoPhase.h"
#include <stdio.h>
namespace Cantera {
/**
* Format a summary of the mixture state for output.
*/
string report(const ThermoPhase& th, bool show_thermo) {
char p[200];
string s = "";
sprintf(p, "\n temperature %12.6g K\n", th.temperature());
s += p;
sprintf(p, " pressure %12.6g Pa\n", th.pressure());
s += p;
sprintf(p, " density %12.6g kg/m^3\n", th.density());
s += p;
sprintf(p, " mean mol. weight %12.6g amu\n", th.meanMolecularWeight());
s += p;
if (show_thermo) {
sprintf(p, "\n");
s += p;
sprintf(p, " 1 kg 1 kmol\n");
s += p;
sprintf(p, " ----------- ------------\n");
s += p;
sprintf(p, " enthalpy %12.6g %12.4g J\n",
th.enthalpy_mass(), th.enthalpy_mole());
s += p;
sprintf(p, " internal energy %12.6g %12.4g J\n",
th.intEnergy_mass(), th.intEnergy_mole());
s += p;
sprintf(p, " entropy %12.6g %12.4g J/K\n",
th.entropy_mass(), th.entropy_mole());
s += p;
sprintf(p, " Gibbs function %12.6g %12.4g J\n",
th.gibbs_mass(), th.gibbs_mole());
s += p;
sprintf(p, " heat capacity c_p %12.6g %12.4g J/K\n",
th.cp_mass(), th.cp_mole());
s += p;
sprintf(p, " heat capacity c_v %12.6g %12.4g J/K\n",
th.cv_mass(), th.cv_mole());
s += p;
}
int kk = th.nSpecies();
array_fp x(kk);
array_fp y(kk);
th.getMoleFractions(x.begin());
th.getMassFractions(y.begin());
int k;
sprintf(p, "\n X Y \n");
s += p;
sprintf(p, " ------------- ------------\n");
s += p;
for (k = 0; k < kk; k++) {
sprintf(p, "%18s %12.6e %12.6e\n",
th.speciesName(k).c_str(), x[k], y[k]);
s += p;
}
return s;
}
/**
* Format a composition list for output.
*/
string formatCompList(const Phase& mix, int xyc) {
const doublereal Threshold = 1.e-20;
char p[200];
string s = "";
int kk = mix.nSpecies();
array_fp zz(kk);
switch (xyc) {
case 0: mix.getMoleFractions(zz.begin()); break;
case 1: mix.getMassFractions(zz.begin()); break;
case 2: mix.getConcentrations(zz.begin()); break;
default: return "error: xyc must be 0, 1, or 2";
}
doublereal z;
int k;
for (k = 0; k < kk; k++) {
z = fabs(zz[k]);
if (z < Threshold) zz[k] = 0.0;
}
for (k = 0; k < kk; k++) {
sprintf(p, "%18s\t %12.6e\n", mix.speciesName(k).c_str(),
zz[k]);
s += p;
}
return s;
}
}

View File

@ -32,7 +32,7 @@ using namespace std;
namespace Cantera {
static int _equilflag(char* xy);
int _equilflag(char* xy);
/**
* Chemical equilibrium options. Used internally by class ChemEquil.

View File

@ -23,7 +23,7 @@ EXT = ../../ext
# basic components always needed
BASE = Elements.o Constituents.o stringUtils.o misc.o importCTML.o plots.o \
xml.o Phase.o DenseMatrix.o ctml.o funcs.o ctvector.o
xml.o Phase.o DenseMatrix.o ctml.o funcs.o ctvector.o phasereport.o
# thermodynamic properties
THERMO = $(BASE) ThermoPhase.o IdealGasPhase.o ConstDensityThermo.o SpeciesThermoFactory.o ThermoFactory.o

105
Cantera/src/phasereport.cpp Normal file
View File

@ -0,0 +1,105 @@
#include "ThermoPhase.h"
#include <stdio.h>
namespace Cantera {
/**
* Format a summary of the mixture state for output.
*/
string report(const ThermoPhase& th, bool show_thermo) {
char p[200];
string s = "";
sprintf(p, "\n temperature %12.6g K\n", th.temperature());
s += p;
sprintf(p, " pressure %12.6g Pa\n", th.pressure());
s += p;
sprintf(p, " density %12.6g kg/m^3\n", th.density());
s += p;
sprintf(p, " mean mol. weight %12.6g amu\n", th.meanMolecularWeight());
s += p;
if (show_thermo) {
sprintf(p, "\n");
s += p;
sprintf(p, " 1 kg 1 kmol\n");
s += p;
sprintf(p, " ----------- ------------\n");
s += p;
sprintf(p, " enthalpy %12.6g %12.4g J\n",
th.enthalpy_mass(), th.enthalpy_mole());
s += p;
sprintf(p, " internal energy %12.6g %12.4g J\n",
th.intEnergy_mass(), th.intEnergy_mole());
s += p;
sprintf(p, " entropy %12.6g %12.4g J/K\n",
th.entropy_mass(), th.entropy_mole());
s += p;
sprintf(p, " Gibbs function %12.6g %12.4g J\n",
th.gibbs_mass(), th.gibbs_mole());
s += p;
sprintf(p, " heat capacity c_p %12.6g %12.4g J/K\n",
th.cp_mass(), th.cp_mole());
s += p;
sprintf(p, " heat capacity c_v %12.6g %12.4g J/K\n",
th.cv_mass(), th.cv_mole());
s += p;
}
int kk = th.nSpecies();
array_fp x(kk);
array_fp y(kk);
th.getMoleFractions(x.begin());
th.getMassFractions(y.begin());
int k;
sprintf(p, "\n X Y \n");
s += p;
sprintf(p, " ------------- ------------\n");
s += p;
for (k = 0; k < kk; k++) {
sprintf(p, "%18s %12.6e %12.6e\n",
th.speciesName(k).c_str(), x[k], y[k]);
s += p;
}
return s;
}
/**
* Format a composition list for output.
*/
string formatCompList(const Phase& mix, int xyc) {
const doublereal Threshold = 1.e-20;
char p[200];
string s = "";
int kk = mix.nSpecies();
array_fp zz(kk);
switch (xyc) {
case 0: mix.getMoleFractions(zz.begin()); break;
case 1: mix.getMassFractions(zz.begin()); break;
case 2: mix.getConcentrations(zz.begin()); break;
default: return "error: xyc must be 0, 1, or 2";
}
doublereal z;
int k;
for (k = 0; k < kk; k++) {
z = fabs(zz[k]);
if (z < Threshold) zz[k] = 0.0;
}
for (k = 0; k < kk; k++) {
sprintf(p, "%18s\t %12.6e\n", mix.speciesName(k).c_str(),
zz[k]);
s += p;
}
return s;
}
}

View File

@ -12,11 +12,7 @@
#endif
#include "ct_defs.h"
//#include "Phase.h"
#include "ThermoPhase.h"
//#include "IdealGasMix.h"
#include "ctexceptions.h"
#include <stdio.h>
namespace Cantera {
@ -137,104 +133,6 @@ namespace Cantera {
return count;
}
/**
* Format a summary of the mixture state for output.
*/
string report(const ThermoPhase& th, bool show_thermo) {
char p[200];
string s = "";
sprintf(p, "\n temperature %12.6g K\n", th.temperature());
s += p;
sprintf(p, " pressure %12.6g Pa\n", th.pressure());
s += p;
sprintf(p, " density %12.6g kg/m^3\n", th.density());
s += p;
sprintf(p, " mean mol. weight %12.6g amu\n", th.meanMolecularWeight());
s += p;
if (show_thermo) {
sprintf(p, "\n");
s += p;
sprintf(p, " 1 kg 1 kmol\n");
s += p;
sprintf(p, " ----------- ------------\n");
s += p;
sprintf(p, " enthalpy %12.6g %12.4g J\n",
th.enthalpy_mass(), th.enthalpy_mole());
s += p;
sprintf(p, " internal energy %12.6g %12.4g J\n",
th.intEnergy_mass(), th.intEnergy_mole());
s += p;
sprintf(p, " entropy %12.6g %12.4g J/K\n",
th.entropy_mass(), th.entropy_mole());
s += p;
sprintf(p, " Gibbs function %12.6g %12.4g J\n",
th.gibbs_mass(), th.gibbs_mole());
s += p;
sprintf(p, " heat capacity c_p %12.6g %12.4g J/K\n",
th.cp_mass(), th.cp_mole());
s += p;
sprintf(p, " heat capacity c_v %12.6g %12.4g J/K\n",
th.cv_mass(), th.cv_mole());
s += p;
}
int kk = th.nSpecies();
array_fp x(kk);
array_fp y(kk);
th.getMoleFractions(x.begin());
th.getMassFractions(y.begin());
int k;
sprintf(p, "\n X Y \n");
s += p;
sprintf(p, " ------------- ------------\n");
s += p;
for (k = 0; k < kk; k++) {
sprintf(p, "%18s %12.6e %12.6e\n",
th.speciesName(k).c_str(), x[k], y[k]);
s += p;
}
return s;
}
/**
* Format a composition list for output.
*/
string formatCompList(const Phase& mix, int xyc) {
const doublereal Threshold = 1.e-20;
char p[200];
string s = "";
int kk = mix.nSpecies();
array_fp zz(kk);
switch (xyc) {
case 0: mix.getMoleFractions(zz.begin()); break;
case 1: mix.getMassFractions(zz.begin()); break;
case 2: mix.getConcentrations(zz.begin()); break;
default: return "error: xyc must be 0, 1, or 2";
}
doublereal z;
int k;
for (k = 0; k < kk; k++) {
z = fabs(zz[k]);
if (z < Threshold) zz[k] = 0.0;
}
for (k = 0; k < kk; k++) {
sprintf(p, "%18s\t %12.6e\n", mix.speciesName(k).c_str(),
zz[k]);
s += p;
}
return s;
}
/**
* Get the file name without the path or extension
*/

View File

@ -25,7 +25,6 @@ namespace Cantera {
void parseCompString(const string ss, compositionMap& x);
int fillArrayFromString(const string& str, doublereal* a, char delim = ' ');
string report(const ThermoPhase& th, bool show_thermo = true);
//void printSummary(IdealGasMix& mix, ostream& s);
string formatCompList(const Phase& mix, int xyc);
string logfileName(const string& infile);
string getFileName(const string& path);

View File

@ -17,7 +17,7 @@ build_matlab = @BUILD_MATLAB@
LIBDIR=@LIB_DIR@
# removed utils temporarily
all: kernel movelibs clib python matlab
all: kernel movelibs hdr-collect clib python matlab utils
install: hdr-install kernel-install data-install python-install matlab-install tools-install finish-install
@ -25,12 +25,15 @@ demos: example_codes
kernel: info
rm -f lib/*.a
rm -f lib/*.so
cd ext; @MAKE@
cd Cantera/src; @MAKE@
clib:
cd Cantera/clib/src; @MAKE@
cxxlib:
cd Cantera/cxx; make
movelibs:
mv -f Cantera/src/*.a lib
@ -43,6 +46,7 @@ utils:
kernel-install:
@INSTALL@ -d @prefix@/lib/cantera
rm -f @prefix@/lib/cantera/*
@INSTALL@ -m 644 lib/*.a @prefix@/lib/cantera
cd Cantera/clib/src; make install
ranlib @prefix@/lib/cantera/*.a
@ -58,19 +62,23 @@ tools-install:
hdr-install:
@INSTALL@ -d @prefix@/include/cantera
@INSTALL@ -d @prefix@/include/kernel
@INSTALL@ -d @prefix@/include/cantera/kernel/oneD
@INSTALL@ -d @prefix@/include/cantera/kernel/zeroD
@INSTALL@ -d @prefix@/include/cantera/kernel/converters
@INSTALL@ -d @prefix@/include/cantera/kernel/transport
rm -r -f @prefix@/include/cantera/*.h
@INSTALL@ include/*.h @prefix@/include/cantera
@INSTALL@ config.h @prefix@/include/cantera
@INSTALL@ Cantera/src/*.h @prefix@/include/cantera/kernel
@INSTALL@ Cantera/src/oneD/*.h @prefix@/include/cantera/kernel/oneD
@INSTALL@ Cantera/src/zeroD/*.h @prefix@/include/cantera/kernel/zeroD
@INSTALL@ Cantera/src/converters/*.h @prefix@/include/cantera/kernel/converters
@INSTALL@ Cantera/src/transport/*.h @prefix@/include/cantera/kernel/transport
cp -r -f build/include/cantera @prefix@/include/cantera
hdr-collect:
@INSTALL@ -d build/include/cantera
rm -r -f build/include/cantera/*
@INSTALL@ -d build/include/cantera/kernel
@INSTALL@ -d build/include/cantera/kernel/oneD
@INSTALL@ -d build/include/cantera/kernel/zeroD
@INSTALL@ -d build/include/cantera/kernel/converters
@INSTALL@ -d build/include/cantera/kernel/transport
@INSTALL@ include/*.h build/include/cantera
@INSTALL@ config.h build/include/cantera
@INSTALL@ Cantera/src/*.h build/include/cantera/kernel
@INSTALL@ Cantera/src/oneD/*.h build/include/cantera/kernel/oneD
@INSTALL@ Cantera/src/zeroD/*.h build/include/cantera/kernel/zeroD
@INSTALL@ Cantera/src/converters/*.h build/include/cantera/kernel/converters
@INSTALL@ Cantera/src/transport/*.h build/include/cantera/kernel/transport
@ -111,6 +119,9 @@ finish-install:
@INSTALL@ -d @prefix@/bin
@INSTALL@ -d @prefix@/cantera/demos/c++
@INSTALL@ examples/cxx/*.cpp @prefix@/cantera/demos/c++
@INSTALL@ examples/cxx/*.h @prefix@/cantera/demos/c++
@INSTALL@ examples/cxx/Makefile @prefix@/cantera/demos/c++
chown -R @username@ @prefix@/cantera/demos/c++
@INSTALL@ -d @prefix@/cantera/demos/f77
@PYTHON_CMD@ tools/bin/finish_install.py @prefix@ @PYTHON_CMD@
#@INSTALL@ bin/ctmkmf @prefix@/bin/ctnew
@ -119,7 +130,7 @@ finish-install:
example_codes:
cd examples; @MAKE@ all
(cd examples/cxx; make)
test: example_codes
cd test_problems; @MAKE@ all
@ -128,10 +139,11 @@ test: example_codes
uninstall:
rm -r -f @prefix@/include/cantera
rm -r -f @prefix@/cantera
rm -f @prefix@/lib/lib@CT_SHARED_LIB@.a
rm -r -f @prefix@/lib/cantera
rm -r -f @prefix@/matlab/toolbox/cantera
clean:
$(RM) *.*~ lib/Cantera.a lib/*.a lib/*.so bin/ck2ctml bin/ctsetup bin/cxx_examples
rm -f *.*~ lib/Cantera.a lib/*.a lib/*.so bin/ck2ctml bin/ctsetup bin/cxx_examples
cd Cantera; @MAKE@ clean
cd tools; @MAKE@ clean
cd ext; @MAKE@ clean

19
config/configure vendored
View File

@ -2884,7 +2884,7 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
ac_config_files="$ac_config_files ../Cantera/Makefile ../Cantera/src/Makefile ../Cantera/src/zeroD/Makefile ../Cantera/src/oneD/Makefile ../Cantera/src/converters/Makefile ../Cantera/src/transport/Makefile ../Cantera/clib/src/Makefile ../Cantera/matlab/Makefile ../Cantera/python/Makefile ../Cantera/python/src/Makefile ../ext/lapack/Makefile ../ext/blas/Makefile ../ext/cvode/Makefile ../ext/math/Makefile ../ext/tpx/Makefile ../ext/Makefile ../ext/recipes/Makefile ../examples/Makefile ../examples/cxx/Makefile ../Makefile ../tools/Makefile ../tools/src/Makefile ../tools/src/sample.mak ../tools/templates/f77/demo.mak ../tools/testtools/Makefile ../data/inputs/Makefile ../test_problems/Makefile ../test_problems/cxx_ex/Makefile ../test_problems/silane_equil/Makefile"
ac_config_files="$ac_config_files ../Cantera/Makefile ../Cantera/src/Makefile ../Cantera/src/zeroD/Makefile ../Cantera/src/oneD/Makefile ../Cantera/src/converters/Makefile ../Cantera/src/transport/Makefile ../Cantera/clib/src/Makefile ../Cantera/matlab/Makefile ../Cantera/python/Makefile ../Cantera/cxx/Makefile ../Cantera/python/src/Makefile ../ext/lapack/Makefile ../ext/blas/Makefile ../ext/cvode/Makefile ../ext/math/Makefile ../ext/tpx/Makefile ../ext/Makefile ../ext/recipes/Makefile ../examples/Makefile ../examples/cxx/Makefile ../Makefile ../tools/Makefile ../tools/src/Makefile ../tools/src/sample.mak ../tools/templates/f77/demo.mak ../tools/testtools/Makefile ../data/inputs/Makefile ../test_problems/Makefile ../test_problems/cxx_ex/Makefile ../test_problems/silane_equil/Makefile"
test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
@ -3146,6 +3146,7 @@ do
"../Cantera/clib/src/Makefile" ) CONFIG_FILES="$CONFIG_FILES ../Cantera/clib/src/Makefile" ;;
"../Cantera/matlab/Makefile" ) CONFIG_FILES="$CONFIG_FILES ../Cantera/matlab/Makefile" ;;
"../Cantera/python/Makefile" ) CONFIG_FILES="$CONFIG_FILES ../Cantera/python/Makefile" ;;
"../Cantera/cxx/Makefile" ) CONFIG_FILES="$CONFIG_FILES ../Cantera/cxx/Makefile" ;;
"../Cantera/python/src/Makefile" ) CONFIG_FILES="$CONFIG_FILES ../Cantera/python/src/Makefile" ;;
"../ext/lapack/Makefile" ) CONFIG_FILES="$CONFIG_FILES ../ext/lapack/Makefile" ;;
"../ext/blas/Makefile" ) CONFIG_FILES="$CONFIG_FILES ../ext/blas/Makefile" ;;
@ -3167,7 +3168,7 @@ do
"../test_problems/cxx_ex/Makefile" ) CONFIG_FILES="$CONFIG_FILES ../test_problems/cxx_ex/Makefile" ;;
"../test_problems/silane_equil/Makefile" ) CONFIG_FILES="$CONFIG_FILES ../test_problems/silane_equil/Makefile" ;;
"../config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ../config.h" ;;
*) { { echo "$as_me:3170: error: invalid argument: $ac_config_target" >&5
*) { { echo "$as_me:3171: error: invalid argument: $ac_config_target" >&5
echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
{ (exit 1); exit 1; }; };;
esac
@ -3437,7 +3438,7 @@ done; }
esac
if test x"$ac_file" != x-; then
{ echo "$as_me:3440: creating $ac_file" >&5
{ echo "$as_me:3441: creating $ac_file" >&5
echo "$as_me: creating $ac_file" >&6;}
rm -f "$ac_file"
fi
@ -3455,7 +3456,7 @@ echo "$as_me: creating $ac_file" >&6;}
-) echo $tmp/stdin ;;
[\\/$]*)
# Absolute (can't be DOS-style, as IFS=:)
test -f "$f" || { { echo "$as_me:3458: error: cannot find input file: $f" >&5
test -f "$f" || { { echo "$as_me:3459: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
echo $f;;
@ -3468,7 +3469,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
echo $srcdir/$f
else
# /dev/null tree
{ { echo "$as_me:3471: error: cannot find input file: $f" >&5
{ { echo "$as_me:3472: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
fi;;
@ -3529,7 +3530,7 @@ for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
* ) ac_file_in=$ac_file.in ;;
esac
test x"$ac_file" != x- && { echo "$as_me:3532: creating $ac_file" >&5
test x"$ac_file" != x- && { echo "$as_me:3533: creating $ac_file" >&5
echo "$as_me: creating $ac_file" >&6;}
# First look for the input files in the build tree, otherwise in the
@ -3540,7 +3541,7 @@ echo "$as_me: creating $ac_file" >&6;}
-) echo $tmp/stdin ;;
[\\/$]*)
# Absolute (can't be DOS-style, as IFS=:)
test -f "$f" || { { echo "$as_me:3543: error: cannot find input file: $f" >&5
test -f "$f" || { { echo "$as_me:3544: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
echo $f;;
@ -3553,7 +3554,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
echo $srcdir/$f
else
# /dev/null tree
{ { echo "$as_me:3556: error: cannot find input file: $f" >&5
{ { echo "$as_me:3557: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
fi;;
@ -3670,7 +3671,7 @@ cat >>$CONFIG_STATUS <<\EOF
rm -f $tmp/in
if test x"$ac_file" != x-; then
if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
{ echo "$as_me:3673: $ac_file is unchanged" >&5
{ echo "$as_me:3674: $ac_file is unchanged" >&5
echo "$as_me: $ac_file is unchanged" >&6;}
else
ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \

View File

@ -378,6 +378,7 @@ AC_OUTPUT(../Cantera/Makefile \
../Cantera/clib/src/Makefile \
../Cantera/matlab/Makefile \
../Cantera/python/Makefile \
../Cantera/cxx/Makefile \
../Cantera/python/src/Makefile \
../ext/lapack/Makefile \
../ext/blas/Makefile \

2
configure vendored
View File

@ -150,7 +150,7 @@ LAPACK_FTN_STRING_LEN_AT_END='y'
CXX=${CXX:=g++}
# C++ compiler flags
CXXFLAGS=${CXXFLAGS:="-O2 -Wall"}
CXXFLAGS=${CXXFLAGS:="-O0 -Wall"}
# the C++ flags required for linking
#LCXX_FLAGS=

View File

@ -50,13 +50,13 @@ LCXX_END_LIBS = @LCXX_END_LIBS@
# the directory where the Cantera libraries are located
CANTERA_LIBDIR=@ctroot@/lib
CANTERA_LIBDIR=@CANTERA_LIBDIR@
# required Cantera libraries
CANTERA_LIBS = -lzeroD -lcantera -lckreader
CANTERA_LIBS = -lctcxx
# the directory where Cantera include files may be found.
CANTERA_INC=-I@ctroot@/include
CANTERA_INC=-I@CANTERA_INCDIR@
# flags passed to the C++ compiler/linker for the linking step
LCXX_FLAGS = -L$(CANTERA_LIBDIR) @CXXFLAGS@
@ -69,7 +69,7 @@ LCXX_FLAGS = -L$(CANTERA_LIBDIR) @CXXFLAGS@
.@F77_EXT@.@OBJ_EXT@:
$(FORT) -c $< $(FORT_FLAGS)
PROGRAM = @CANTERA_BINDIR@/$(PROG_NAME)$(EXE_EXT)
PROGRAM = ./$(PROG_NAME)$(EXE_EXT)
all: $(PROGRAM)

View File

@ -1,8 +1,8 @@
#ifndef CT_EXAMPLE_UTILS_H
#define CT_EXAMPLE_UTILS_H
#include "Array.h"
#include "plots.h"
#include "kernel/Array.h"
#include "kernel/plots.h"
// Save the temperature, density, pressure, and mole fractions at one
// time

View File

@ -1,6 +1,6 @@
#include "Cantera.h"
#include "ctexceptions.h"
//#include "ctexceptions.h"
#define NUM_EXAMPLES 6

View File

@ -11,7 +11,7 @@
/////////////////////////////////////////////////////////////
#include "reactors.h"
#include "zerodim.h"
#include "IdealGasMix.h"
#include <time.h>
#include "example_utils.h"

View File

@ -12,8 +12,8 @@
#include "Cantera.h"
#include "IdealGasMix.h"
#include "reactors.h"
#include "GRI30.h"
#include "zerodim.h"
#include <time.h>
#include "example_utils.h"

View File

@ -12,10 +12,10 @@
#include "Cantera.h"
#include "reactors.h"
#include "zerodim.h"
#include <time.h>
#include "example_utils.h"
#include "ReactionPath.h"
#include "reactionpaths.h"
#include "IdealGasMix.h"
// #include <iostream>

View File

@ -39,10 +39,10 @@ LCXX_END_LIBS = @LCXX_END_LIBS@
CANTERA_LIBDIR=@ctroot@/lib
# required Cantera libraries
CANTERA_LIBS = -lcantera
CANTERA_LIBS =
# the directory where Cantera include files may be found.
CANTERA_INCDIR=@ctroot@/include
CANTERA_INCDIR=@ctroot@/build/include/cantera
# flags passed to the C++ compiler/linker for the linking step
LCXX_FLAGS = -L$(CANTERA_LIBDIR) @CXXFLAGS@

View File

@ -29,4 +29,3 @@
SI3H8 1.244730e-28 5.189160e-27
SI2 1.619905e-05 4.108919e-04
SI3 1.121605e-06 4.267458e-05

View File

@ -10,14 +10,14 @@
//#include "Cantera.h"
#include "IdealGasMix.h"
#include "ChemEquil.h"
#include "equilibrium.h"
int main(int argc, char **argv) {
try {
IdealGasMix g("silane.xml");
g.setState_TPX(2000.0, 100.0, "SIH4:0.01, H2:0.99");
equilibrate(g, TP);
printSummary(g, cout);
cout << g;
return 0;
}
catch (CanteraError) {

View File

@ -11,6 +11,10 @@ kernel:
cd src; @MAKE@
cd testtools; @MAKE@
apps-install:
@INSTALL@ -d @prefix@/bin
@INSTALL@ ../bin/ck2ctml @prefix@/bin
clean:
$(RM) *.*~
cd src; @MAKE@ clean

View File

@ -26,18 +26,31 @@ MixMaster()
""")
f.close()
try:
import Cantera
ctpath = Cantera.__path__[0]
except:
ctpath = "-"
print """
Cantera has been successfully installed.
File locations:
applications """+bindir+"""
library files """+libdir+"""
C++ headers """+hdrdir+"""
demos """+prefix+"""/cantera/demos
data files """+prefix+"""/cantera/data
applications """+bindir+"""
library files """+libdir+"""
C++ headers """+hdrdir+"""
demos """+prefix+"""/cantera/demos
data files """+prefix+"""/cantera/data
Matlab toolbox """+prefix+"""/matlab/toolbox/cantera/cantera
Matlab demos """+prefix+"""/matlab/toolbox/cantera/cantera-demos
Matlab tutorials """+prefix+"""/matlab/toolbox/cantera/cantera-tutorials"""
if ctpath <> "-":
print """
Python package """+ctpath
print """
A shell script 'cantera_init' has been written that configures the
environment for Cantera. It may be found in
"""+prefix+"""/cantera. It is recommended that you run this script

View File

@ -9,18 +9,14 @@ LCXX_FLAGS = -L@ctroot@/lib @CXXFLAGS@
LOCAL_LIBS = -lcantera @math_libs@ @LAPACK_LIBRARY@ @BLAS_LIBRARY@
LCXX_END_LIBS = @LCXX_END_LIBS@
OBJS = ctsetup.o ck2ctml.o
OBJS = ck2ctml.o
DEPENDS = $(OBJS:.o=.d)
.cpp.o:
@CXX@ -c $< @DEFS@ $(INCDIR) @CXXFLAGS@ $(CXX_FLAGS)
all: $(BINDIR)/ctmkmf $(BINDIR)/ck2ctml
$(BINDIR)/ctmkmf: ctmkmf.o
@CXX@ -o $(BINDIR)/ctmkmf ctmkmf.o $(LCXX_FLAGS) $(LOCAL_LIBS) \
$(LCXX_END_LIBS)
all: $(BINDIR)/ck2ctml
$(BINDIR)/ck2ctml: ck2ctml.o
@CXX@ -o $(BINDIR)/ck2ctml ck2ctml.o $(LCXX_FLAGS) -lconverters $(LOCAL_LIBS) \

View File

@ -0,0 +1,99 @@
#!/bin/sh
# This Makefile builds a Fortran 77 application that uses Cantera. By
# default, the main program file is 'demo.f,' which prints out some
# properties of a reacting gas mixture. It uses the library
# 'demo_ftnlib.cpp,' which contains Fortran-callable functions that
# are implemented with C++ calls to Cantera.
# To build program 'demo', simply type 'make', or 'make -f <this
# file>' if this file is named something other than 'Makefile.'
# Once you have verified that the demo runs, edit this file to replace
# object file 'demo.o' with your own object file or files. You may
# continue to use 'demo_ftnlib' if it serves your needs, or else
# replace it with a different interface library.
#------------------------ edit this block ---------------------------------
# the name of the executable program to be created
PROG_NAME = demo
# the object files to be linked together.
OBJS = demo.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 = g77
# Fortran compile flags
FORT_FLAGS = -O2 -fno-second-underscore
# Fortran libraries
FORT_LIBS = -lg2c -lgcc
# the C++ compiler
CXX = g++
# C++ compile flags
CXX_FLAGS = -O0 -Wall
# external libraries
EXT_LIBS = -loneD -lzeroD -ltransport -lconverters -lcantera -lrecipes -lcvode -lctlapack -lctmath -lctblas
# the directory where the Cantera libraries are located
CANTERA_LIBDIR=/usr/local/lib/cantera
# the directory where Cantera include files may be found.
CANTERA_INCDIR=/usr/local/include/cantera
# flags passed to the C++ compiler/linker for the linking step
LCXX_FLAGS = -L$(CANTERA_LIBDIR) -O0 -Wall
# how to compile C++ source files to object files
.cpp.o:
$(CXX) -c $< -I$(CANTERA_INCDIR) $(CXX_FLAGS)
# how to compile Fortran source files to object files
.f.o:
$(FORT) -c $< $(FORT_FLAGS)
PROGRAM = $(PROG_NAME)$(EXE_EXT)
DEPENDS = $(OBJS:.o=.d)
all: $(PROGRAM)
$(PROGRAM): $(OBJS)
$(CXX) -o $(PROGRAM) $(OBJS) $(LCXX_FLAGS) $(CANTERA_LIBS) $(LINK_OPTIONS) $(EXT_LIBS) $(FORT_LIBS)
%.d:
g++ -MM $*.cpp > $*.d
clean:
$(RM) $(OBJS) $(PROGRAM)
depends: $(DEPENDS)
cat *.d > .depends
$(RM) $(DEPENDS)
TAGS:
etags *.h *.cpp
ifeq ($(wildcard .depends), .depends)
include .depends
endif

View File

@ -1,7 +1,7 @@
#/bin/sh
LIBDIR = @ctroot@/lib
INCDIR = @ctroot@/include
INCDIR = @prefix@/include/cantera
BINDIR = @ctroot@/bin
build_ck = @BUILD_CK@

View File

@ -12,7 +12,7 @@
*
* csvdiff File1.csv File2.csv
*
* Compares the variable values in two Excell formatted
* Compares the variable values in two Excel formatted
* comma separated files.
* The comparison is done using a weighted norm basis.
*
@ -451,12 +451,12 @@ static void print_usage() {
printf("\t\n");
printf(" csvdiff [-h] File1.csv File2.csv\n");
printf("\t\n");
printf("\tCompares the variable values in two Excell formatted "
printf("\tCompares the variable values in two Excel formatted "
"comma separated files.\n");
printf("\tThe comparison is done using a weighted norm basis.\n");
printf("\t\n");
printf("\tThe two files should be basically equal. However, File1.csv is\n");
printf("\ttaken as the reference file, that has precedence, when there is\n");
printf("\ttaken as the reference file that has precedence, when there is\n");
printf("\tsomething to be decided upon.\n");
printf("\t\n");
printf("\t Arguments:\n");