From c43954548bcce83ba9a7835a343eb54e467c4a5c Mon Sep 17 00:00:00 2001 From: Xavier Raynaud Date: Mon, 16 Apr 2012 17:54:42 +0200 Subject: [PATCH] Added Doxygen comments in tutorials. --- tutorials/tutorial1.cpp | 29 +++++++++++------------- tutorials/tutorial2.cpp | 49 +++++++++++++++++++++++------------------ 2 files changed, 40 insertions(+), 38 deletions(-) diff --git a/tutorials/tutorial1.cpp b/tutorials/tutorial1.cpp index b0bec824c..567a594c8 100644 --- a/tutorials/tutorial1.cpp +++ b/tutorials/tutorial1.cpp @@ -26,43 +26,40 @@ #include "config.h" #endif // HAVE_CONFIG_H -/// \page tutorial1 A simple carthesian grid -/// This tutorial explains how to construct a simple carthesian grid.\n\n -/// We construct a 2x2 two dimensional carthesian grid with 4 blocks of equal size. +/// \page tutorial1 A simple cartesian grid +/// This tutorial explains how to construct a simple cartesian grid. #include #include #include -#include -#include #include -#include #include #include // ----------------- Main program ----------------- -/// \page tutorial1 +/// \page tutorial1 /// \code int main() { /// \endcode /// \page tutorial1 - /// By setting nz = 1, we make the grid two dimensional + /// We set the number of blocks in each direction. /// \code int nx = 3; int ny = 3; - int nz = 1; + int nz = 2; /// \endcode - /// The size of each block is 1x1x1. We use standard units (SI) + /// The size of each block is 1x1x1. The default units are allways the + /// standard units (SI). But other units can easily be dealt with, see Opm::unit. /// \code double dx = 1.0; double dy = 1.0; double dz = 1.0; - /// \endcode - /// \page tutorial1 - /// One of the constructors of the class Opm::GridManager takes nx,ny,nz,dx,dy,dz - /// and construct the corresponding carthesian grid. + /// \endcode + /// \page tutorial1 + /// One of the constructors of the class Opm::GridManager takes nx,ny,nz,dx,dy,dz + /// and construct the corresponding cartesian grid. /// \code Opm::GridManager grid(nx, ny, nz, dx, dy, dz); /// \endcode @@ -87,7 +84,7 @@ int main() /// We read the the vtu output file in \a Paraview and obtain the following grid. /// \image html tutorial1.png -/// \page tutorial1 +/// \page tutorial1 /// \section sourcecode Source code. -/// \include tutorial1.cpp +/// \include tutorial1.cpp diff --git a/tutorials/tutorial2.cpp b/tutorials/tutorial2.cpp index 27f690307..ce3d12337 100644 --- a/tutorials/tutorial2.cpp +++ b/tutorials/tutorial2.cpp @@ -18,14 +18,14 @@ */ -/// \page tutorial2 Flow Solver for a single phase +/// \page tutorial2 Flow Solver for a single phase /// \details The flow equations consist of the mass conservation equation /// \f[\nabla\cdot u=q\f] and the Darcy law \f[u=-\frac{1}{\mu}K\nabla p.\f] Here, /// \f$u\f$ denotes the velocity and \f$p\f$ the pressure. The permeability tensor is -/// given by \f$K\f$ and \f$\mu\f$ denotes the viscosity. -/// -/// We solve the flow equations for a carthesian grid and we set the source term -/// \f$q\f$ be zero except at the left-lower and right-upper corner, where it is equal +/// given by \f$K\f$ and \f$\mu\f$ denotes the viscosity. +/// +/// We solve the flow equations for a cartesian grid and we set the source term +/// \f$q\f$ be zero except at the left-lower and right-upper corner, where it is equal /// with opposite sign (inflow equal to outflow). @@ -36,16 +36,14 @@ #include #include #include -#include -#include #include -#include #include #include #include #include #include #include +#include /// \page tutorial2 /// \section commentedcode Commented code: @@ -54,7 +52,7 @@ int main() { /// \endcode /// \page tutorial2 - /// We construct a carthesian grid + /// We construct a cartesian grid /// \code int dim = 3; int nx = 40; @@ -71,19 +69,25 @@ int main() int num_faces = grid.c_grid()->number_of_faces; /// \endcode /// \page tutorial2 - /// We define the viscosity (unit: cP). + /// \details + /// We define a fluid viscosity equal to \f$1\,cP\f$. We use + /// the namespaces Opm::unit + /// and Opm::prefix to deal with the units. /// \code - double mu = 1.0; + using namespace Opm::unit; + using namespace Opm::prefix; + double mu = 1.0*centi*Poise; /// \endcode /// \page tutorial2 - /// We define the permeability (unit: mD). + /// \details + /// We define a permeability equal to \f$100\,mD\f$. /// \code - double k = 100.0; + double k = 100.0*milli*darcy; /// \endcode /// \page tutorial2 /// \details /// We set up the permeability tensor and compute the mobility for each cell. - /// The permeability tensor is flattened in a vector. + /// The resulting permeability matrix is flattened in a vector. /// \code std::vector permeability(num_cells*dim*dim, 0.); std::vector mob(num_cells); @@ -96,7 +100,8 @@ int main() /// \endcode /// \page tutorial2 - /// We choose the UMFPACK linear solver for the pressure solver. + /// \details + /// We take UMFPACK as the linear solver for the pressure solver (This library has therefore to be installed.) /// \code Opm::LinearSolverUmfpack linsolver; /// \endcode @@ -115,7 +120,7 @@ int main() src[num_cells-1] = -100.; /// \endcode /// \page tutorial2 - /// \details We set up the boundary conditions. We do not modify them. + /// \details We set up the boundary conditions. We do not modify them. /// By default, we obtain no outflow boundary conditions. /// \code /// \code @@ -133,21 +138,21 @@ int main() std::vector faceflux(num_faces); std::vector well_bhp; std::vector well_flux; - /// \endcode + /// \endcode /// \page tutorial2 /// \details /// We declare the gravity term which is required by the pressure solver (see /// Opm::IncompTpfa.solve()). In the absence of gravity, an empty vector is required. /// \code - std::vector omega; + std::vector omega; /// \endcode - + /// \page tutorial2 /// \details /// We declare the wdp term which is required by the pressure solver (see /// Opm::IncompTpfa.solve()). In the absence of wells, an empty vector is required. /// \code - std::vector wdp; + std::vector wdp; /// \endcode /// \page tutorial2 @@ -170,10 +175,10 @@ int main() } /// \endcode /// \page tutorial2 -/// We read the the vtu output file in \a Paraview and obtain the following pressure +/// We read the vtu output file in \a Paraview and obtain the following pressure /// distribution. \image html tutorial2.png /// \page tutorial2 /// \section sourcecode Complete source code. -/// \include tutorial2.cpp +/// \include tutorial2.cpp