From 855f2ec77b1babf70c23096f500caf40b9a3ec8f Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Wed, 15 Feb 2012 01:01:15 +0000 Subject: [PATCH] Eliminated the unnecessary Cantera.h header from sample code --- doc/doxygen/bindings.txt | 2 -- doc/doxygen/cxx-headers.txt | 6 ----- doc/doxygen/demo1.cpp | 2 -- doc/doxygen/demo1a.cpp | 4 +--- doc/doxygen/demoequil.cpp | 3 +-- doc/doxygen/edemo.cpp | 2 +- doc/doxygen/ex1.cpp | 4 +++- doc/doxygen/except.cpp | 2 +- doc/doxygen/introcxx.txt | 13 ---------- doc/doxygen/thermodemo.cpp | 2 +- include/cantera/Cantera.h | 32 ------------------------- include/cantera/Interface.h | 1 - samples/cxx/NASA_coeffs/NASA_coeffs.cpp | 2 -- samples/cxx/combustor/combustor.cpp | 1 - samples/cxx/demo.cpp | 10 +++----- samples/cxx/flamespeed/flamespeed.cpp | 1 - samples/cxx/kinetics1/kinetics1.cpp | 1 - samples/cxx/rankine/rankine.cpp | 1 - samples/f77/demo_ftnlib.cpp | 1 - src/equil/vcs_internal.h | 3 +-- src/equil/vcs_root1d.cpp | 3 +-- 21 files changed, 13 insertions(+), 83 deletions(-) delete mode 100755 include/cantera/Cantera.h diff --git a/doc/doxygen/bindings.txt b/doc/doxygen/bindings.txt index a5b06e681..3a2b31fd5 100644 --- a/doc/doxygen/bindings.txt +++ b/doc/doxygen/bindings.txt @@ -60,8 +60,6 @@ To see how this works, consider the class Droplet, shown below, that models a si // parameters taken from Example 3.2, p. 103, in "An Introduction to // Combustion" by S.R. Turns -#include - namespace DropletNamespace { const double Dab_0 = 8.1e-6; // m2/s diff --git a/doc/doxygen/cxx-headers.txt b/doc/doxygen/cxx-headers.txt index aa46a4715..8722db80e 100644 --- a/doc/doxygen/cxx-headers.txt +++ b/doc/doxygen/cxx-headers.txt @@ -35,10 +35,4 @@ These are: - zerodim.h - Zero-dimensional reactor networks. -These must be included \e after Cantera.h, for example: -\code -#include -#include -\endcode - */ diff --git a/doc/doxygen/demo1.cpp b/doc/doxygen/demo1.cpp index 14ac4478c..2d4a53e58 100644 --- a/doc/doxygen/demo1.cpp +++ b/doc/doxygen/demo1.cpp @@ -1,5 +1,3 @@ - -#include #include // defines class IdealGasMix #include // chemical equilibrium #include // transport properties diff --git a/doc/doxygen/demo1a.cpp b/doc/doxygen/demo1a.cpp index 6a5488a89..2830df2d1 100644 --- a/doc/doxygen/demo1a.cpp +++ b/doc/doxygen/demo1a.cpp @@ -1,6 +1,4 @@ - -// This header must alway be included. -#include +#include // The actual code is put into a function that diff --git a/doc/doxygen/demoequil.cpp b/doc/doxygen/demoequil.cpp index 37895e1ce..5f6b6e6b8 100644 --- a/doc/doxygen/demoequil.cpp +++ b/doc/doxygen/demoequil.cpp @@ -1,6 +1,5 @@ - -#include #include +#include void equil_demo() { diff --git a/doc/doxygen/edemo.cpp b/doc/doxygen/edemo.cpp index 7516691cd..1125d5e56 100644 --- a/doc/doxygen/edemo.cpp +++ b/doc/doxygen/edemo.cpp @@ -1,4 +1,4 @@ -#include +#include void demoprog() { diff --git a/doc/doxygen/ex1.cpp b/doc/doxygen/ex1.cpp index d530b8870..a671b549f 100644 --- a/doc/doxygen/ex1.cpp +++ b/doc/doxygen/ex1.cpp @@ -1,4 +1,6 @@ -#include +#include "cantera/thermo.h" +#include + int main() { ThermoPhase* gas = newPhase("h2o2.cti","ohmech"); diff --git a/doc/doxygen/except.cpp b/doc/doxygen/except.cpp index 8be72bfe2..329c20d31 100644 --- a/doc/doxygen/except.cpp +++ b/doc/doxygen/except.cpp @@ -1,4 +1,4 @@ -#include +#include "cantera/thermo.h" // // artifical example of throwing and catching a CanteraError exception. // diff --git a/doc/doxygen/introcxx.txt b/doc/doxygen/introcxx.txt index e180cfcdb..ef393f32f 100644 --- a/doc/doxygen/introcxx.txt +++ b/doc/doxygen/introcxx.txt @@ -46,19 +46,6 @@ equivalent of the "Hello, World" program most programming textbooks begin with. But it illustrates some important points in writing %Cantera C++ programs. -- The Cantera.h header\n -Note that the program begins with -\code -#include -\endcode -All %Cantera application programs must begin by including this header -file. The syntax of the include statement shown here is recommended, -since usually the %Cantera header files are installed within a -subdirectory named "cantera" in a directory on the search path -used by the compiler. If you need to include additional %Cantera headers, -always include Cantera.h first. -\see \ref cxx-headers - - Catching CanteraError exceptions\n The entire body of the program is put inside a function that is invoked within a \c try block in the main program. In this way, exceptions diff --git a/doc/doxygen/thermodemo.cpp b/doc/doxygen/thermodemo.cpp index b74a47298..5e3541dc0 100644 --- a/doc/doxygen/thermodemo.cpp +++ b/doc/doxygen/thermodemo.cpp @@ -1,5 +1,5 @@ +#include "cantera/thermo.h" -#include void thermo_demo(string file, string phase) { diff --git a/include/cantera/Cantera.h b/include/cantera/Cantera.h deleted file mode 100755 index 5019b8b18..000000000 --- a/include/cantera/Cantera.h +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @file Cantera.h - * Basic include file to be used in all Cantera application environments. - */ -// Copyright 2001 California Institute of Technology - -#ifndef CANTERA_H_INCL -#define CANTERA_H_INCL - -#include "base/ct_defs.h" - -// some useful functions -#include "base/global.h" - -// the CanteraError exception class -#include "base/ctexceptions.h" - -// The Cantera logger class -#include "base/logger.h" - -// Include the timer -#include "base/clockWC.h" - -// Include routines for reading and writing XML files -#include "base/xml.h" - -// Include string utility routines -#include "base/stringUtils.h" - -#endif - - diff --git a/include/cantera/Interface.h b/include/cantera/Interface.h index 719986c52..00c40a42b 100644 --- a/include/cantera/Interface.h +++ b/include/cantera/Interface.h @@ -6,7 +6,6 @@ #define CXX_INTERFACE #include -#include "Cantera.h" #include "thermo.h" #include "kinetics.h" diff --git a/samples/cxx/NASA_coeffs/NASA_coeffs.cpp b/samples/cxx/NASA_coeffs/NASA_coeffs.cpp index d8968bb11..c1f2295f6 100644 --- a/samples/cxx/NASA_coeffs/NASA_coeffs.cpp +++ b/samples/cxx/NASA_coeffs/NASA_coeffs.cpp @@ -1,5 +1,3 @@ - -#include #include // defines class IdealGasMix #include diff --git a/samples/cxx/combustor/combustor.cpp b/samples/cxx/combustor/combustor.cpp index 65a3f1dd8..5ca6502ee 100644 --- a/samples/cxx/combustor/combustor.cpp +++ b/samples/cxx/combustor/combustor.cpp @@ -7,7 +7,6 @@ // igniter is a pulsed flow of atomic hydrogen. After the igniter is // turned off, the system approaches the steady burning solution.""" -#include #include #include diff --git a/samples/cxx/demo.cpp b/samples/cxx/demo.cpp index db287c1ab..a46615ec4 100644 --- a/samples/cxx/demo.cpp +++ b/samples/cxx/demo.cpp @@ -6,15 +6,11 @@ // /////////////////////////////////////////////////////////////////////// - // Include cantera header files. They should be included in the form -// , and Cantera.h should always be included first. -// These headers are designed for use in C++ programs and provide a -// simplified interface to the Cantera kernel header files. If you -// need to include kernel headers directly, use the format -// . +// "cantera/*.h". These headers are designed for use in C++ programs and +// provide a simplified interface to the Cantera header files. If you need +// to include core headers directly, use the format "cantera/module/*.h". -#include #include // defines class IdealGasMix #include // chemical equilibrium #include // transport properties diff --git a/samples/cxx/flamespeed/flamespeed.cpp b/samples/cxx/flamespeed/flamespeed.cpp index ef15e9b57..c80a84dde 100644 --- a/samples/cxx/flamespeed/flamespeed.cpp +++ b/samples/cxx/flamespeed/flamespeed.cpp @@ -1,4 +1,3 @@ -#include #include #include #include diff --git a/samples/cxx/kinetics1/kinetics1.cpp b/samples/cxx/kinetics1/kinetics1.cpp index a7503056a..19076bc47 100644 --- a/samples/cxx/kinetics1/kinetics1.cpp +++ b/samples/cxx/kinetics1/kinetics1.cpp @@ -6,7 +6,6 @@ // ///////////////////////////////////////////////////////////// -#include #include #include #include diff --git a/samples/cxx/rankine/rankine.cpp b/samples/cxx/rankine/rankine.cpp index b847416a1..816f472a5 100644 --- a/samples/cxx/rankine/rankine.cpp +++ b/samples/cxx/rankine/rankine.cpp @@ -3,7 +3,6 @@ #include #include -#include #include // defines class Water using namespace Cantera; diff --git a/samples/f77/demo_ftnlib.cpp b/samples/f77/demo_ftnlib.cpp index 90453f99e..55665037b 100644 --- a/samples/f77/demo_ftnlib.cpp +++ b/samples/f77/demo_ftnlib.cpp @@ -26,7 +26,6 @@ */ // add any other Cantera header files you need here -#include #include using namespace Cantera; diff --git a/src/equil/vcs_internal.h b/src/equil/vcs_internal.h index 0ac17680a..f50888493 100644 --- a/src/equil/vcs_internal.h +++ b/src/equil/vcs_internal.h @@ -283,8 +283,7 @@ typedef double(*VCS_FUNC_PTR)(double xval, double Vtarget, #include #include - #include "cantera/Cantera.h" - #include "kernel/vcs_internal.h" + #include "equil/vcs_internal.h" const double g_cgs = 980.; const double mass_cyl = 0.066; diff --git a/src/equil/vcs_root1d.cpp b/src/equil/vcs_root1d.cpp index 88644b9fc..cb1ffc5cc 100644 --- a/src/equil/vcs_root1d.cpp +++ b/src/equil/vcs_root1d.cpp @@ -53,8 +53,7 @@ static void print_funcEval(FILE* fp, double xval, double fval, int its) * #include * #include * - * #include "cantera/Cantera.h" - * #include "kernel/vcs_internal.h" + * #include "equil/vcs_internal.h" * * const double g_cgs = 980.; * const double mass_cyl = 0.066;