From 7e34588c5fe69bcf163f8da6c3b3ee29dc3538e7 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Wed, 4 Apr 2012 18:45:37 +0000 Subject: [PATCH] Reorganizing C++ User's guide documentation --- doc/sphinx/{ => cxx-guide}/demo1a.cpp | 0 doc/sphinx/cxx-guide/index.rst | 11 +++++++++ .../simple-example.rst} | 23 ++++--------------- doc/sphinx/index.rst | 3 +-- 4 files changed, 16 insertions(+), 21 deletions(-) rename doc/sphinx/{ => cxx-guide}/demo1a.cpp (100%) create mode 100644 doc/sphinx/cxx-guide/index.rst rename doc/sphinx/{cxx-intro.rst => cxx-guide/simple-example.rst} (87%) diff --git a/doc/sphinx/demo1a.cpp b/doc/sphinx/cxx-guide/demo1a.cpp similarity index 100% rename from doc/sphinx/demo1a.cpp rename to doc/sphinx/cxx-guide/demo1a.cpp diff --git a/doc/sphinx/cxx-guide/index.rst b/doc/sphinx/cxx-guide/index.rst new file mode 100644 index 000000000..9ef2c7f65 --- /dev/null +++ b/doc/sphinx/cxx-guide/index.rst @@ -0,0 +1,11 @@ + +************************** +C++ Interface User's Guide +************************** + +.. toctree:: + :maxdepth: 2 + + compiling + simple-example + thermo-example diff --git a/doc/sphinx/cxx-intro.rst b/doc/sphinx/cxx-guide/simple-example.rst similarity index 87% rename from doc/sphinx/cxx-intro.rst rename to doc/sphinx/cxx-guide/simple-example.rst index 9023579a6..8f1ea2715 100644 --- a/doc/sphinx/cxx-intro.rst +++ b/doc/sphinx/cxx-guide/simple-example.rst @@ -1,10 +1,7 @@ -*********************************** -Getting Started with Cantera in C++ -*********************************** - +************************* A Very Simple C++ Program -========================= +************************* A short C++ program that uses Cantera is shown below. This program reads in a specification of a gas mixture from an input file, and then builds a new object @@ -47,7 +44,7 @@ the "Hello, World" program most programming textbooks begin with. But it illustrates some important points in writing Cantera C++ programs. Catching :ct:`CanteraError` exceptions --------------------------------------- +====================================== The entire body of the program is put inside a function that is invoked within a ``try`` block in the main program. In this way, exceptions thrown in the @@ -58,22 +55,10 @@ the ``catch`` block, function :ct:`showErrors` may be called to print the error message associated with the exception. The ``report`` function ------------------------ +======================= The :ct:`report` function generates a nicely-formatted report of the properties of a phase, including its composition in both mole (X) and mass (Y) units. For each species present, the non-dimensional chemical potential is also printed. This is handy particularly when doing equilibrium calculations. This function is very useful to see at a glance the state of some phase. - -More Examples -============= - -The program above is simple, but doesn't do much. The links listed below show -how to build on this demo program to do some useful things. - -.. cxx-equildemo -.. cxx-thermodemo - -cxx-ctnew - diff --git a/doc/sphinx/index.rst b/doc/sphinx/index.rst index 2ba0d9126..3d9b1dd4b 100644 --- a/doc/sphinx/index.rst +++ b/doc/sphinx/index.rst @@ -13,9 +13,8 @@ Contents Compiliation Instructions cti/index - python/index - C++ Introduction + cxx-guide/index Cantera Development Homepage