Added Doxygen comments in tutorials.

This commit is contained in:
Xavier Raynaud 2012-04-16 17:54:42 +02:00
parent d2fcdeec2f
commit c43954548b
2 changed files with 40 additions and 38 deletions

View File

@ -26,43 +26,40 @@
#include "config.h" #include "config.h"
#endif // HAVE_CONFIG_H #endif // HAVE_CONFIG_H
/// \page tutorial1 A simple carthesian grid /// \page tutorial1 A simple cartesian grid
/// This tutorial explains how to construct a simple carthesian grid.\n\n /// This tutorial explains how to construct a simple cartesian grid.
/// We construct a 2x2 two dimensional carthesian grid with 4 blocks of equal size.
#include <opm/core/grid.h> #include <opm/core/grid.h>
#include <opm/core/GridManager.hpp> #include <opm/core/GridManager.hpp>
#include <opm/core/utility/writeVtkData.hpp> #include <opm/core/utility/writeVtkData.hpp>
#include <cassert>
#include <cstddef>
#include <iostream> #include <iostream>
#include <iomanip>
#include <fstream> #include <fstream>
#include <vector> #include <vector>
// ----------------- Main program ----------------- // ----------------- Main program -----------------
/// \page tutorial1 /// \page tutorial1
/// \code /// \code
int main() int main()
{ {
/// \endcode /// \endcode
/// \page tutorial1 /// \page tutorial1
/// By setting <code>nz = 1</code>, we make the grid two dimensional /// We set the number of blocks in each direction.
/// \code /// \code
int nx = 3; int nx = 3;
int ny = 3; int ny = 3;
int nz = 1; int nz = 2;
/// \endcode /// \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 /// \code
double dx = 1.0; double dx = 1.0;
double dy = 1.0; double dy = 1.0;
double dz = 1.0; double dz = 1.0;
/// \endcode /// \endcode
/// \page tutorial1 /// \page tutorial1
/// One of the constructors of the class Opm::GridManager takes <code>nx,ny,nz,dx,dy,dz</code> /// One of the constructors of the class Opm::GridManager takes <code>nx,ny,nz,dx,dy,dz</code>
/// and construct the corresponding carthesian grid. /// and construct the corresponding cartesian grid.
/// \code /// \code
Opm::GridManager grid(nx, ny, nz, dx, dy, dz); Opm::GridManager grid(nx, ny, nz, dx, dy, dz);
/// \endcode /// \endcode
@ -87,7 +84,7 @@ int main()
/// We read the the vtu output file in \a Paraview and obtain the following grid. /// We read the the vtu output file in \a Paraview and obtain the following grid.
/// \image html tutorial1.png /// \image html tutorial1.png
/// \page tutorial1 /// \page tutorial1
/// \section sourcecode Source code. /// \section sourcecode Source code.
/// \include tutorial1.cpp /// \include tutorial1.cpp

View File

@ -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 /// \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[\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 /// \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. /// 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 /// 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 /// \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). /// with opposite sign (inflow equal to outflow).
@ -36,16 +36,14 @@
#include <opm/core/grid.h> #include <opm/core/grid.h>
#include <opm/core/GridManager.hpp> #include <opm/core/GridManager.hpp>
#include <opm/core/utility/writeVtkData.hpp> #include <opm/core/utility/writeVtkData.hpp>
#include <cassert>
#include <cstddef>
#include <iostream> #include <iostream>
#include <iomanip>
#include <fstream> #include <fstream>
#include <vector> #include <vector>
#include <opm/core/linalg/LinearSolverUmfpack.hpp> #include <opm/core/linalg/LinearSolverUmfpack.hpp>
#include <opm/core/pressure/IncompTpfa.hpp> #include <opm/core/pressure/IncompTpfa.hpp>
#include <opm/core/pressure/FlowBCManager.hpp> #include <opm/core/pressure/FlowBCManager.hpp>
#include <opm/core/utility/miscUtilities.hpp> #include <opm/core/utility/miscUtilities.hpp>
#include <opm/core/utility/Units.hpp>
/// \page tutorial2 /// \page tutorial2
/// \section commentedcode Commented code: /// \section commentedcode Commented code:
@ -54,7 +52,7 @@ int main()
{ {
/// \endcode /// \endcode
/// \page tutorial2 /// \page tutorial2
/// We construct a carthesian grid /// We construct a cartesian grid
/// \code /// \code
int dim = 3; int dim = 3;
int nx = 40; int nx = 40;
@ -71,19 +69,25 @@ int main()
int num_faces = grid.c_grid()->number_of_faces; int num_faces = grid.c_grid()->number_of_faces;
/// \endcode /// \endcode
/// \page tutorial2 /// \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 /// \code
double mu = 1.0; using namespace Opm::unit;
using namespace Opm::prefix;
double mu = 1.0*centi*Poise;
/// \endcode /// \endcode
/// \page tutorial2 /// \page tutorial2
/// We define the permeability (unit: mD). /// \details
/// We define a permeability equal to \f$100\,mD\f$.
/// \code /// \code
double k = 100.0; double k = 100.0*milli*darcy;
/// \endcode /// \endcode
/// \page tutorial2 /// \page tutorial2
/// \details /// \details
/// We set up the permeability tensor and compute the mobility for each cell. /// 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 /// \code
std::vector<double> permeability(num_cells*dim*dim, 0.); std::vector<double> permeability(num_cells*dim*dim, 0.);
std::vector<double> mob(num_cells); std::vector<double> mob(num_cells);
@ -96,7 +100,8 @@ int main()
/// \endcode /// \endcode
/// \page tutorial2 /// \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 /// \code
Opm::LinearSolverUmfpack linsolver; Opm::LinearSolverUmfpack linsolver;
/// \endcode /// \endcode
@ -115,7 +120,7 @@ int main()
src[num_cells-1] = -100.; src[num_cells-1] = -100.;
/// \endcode /// \endcode
/// \page tutorial2 /// \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. /// By default, we obtain no outflow boundary conditions.
/// \code /// \code
/// \code /// \code
@ -133,21 +138,21 @@ int main()
std::vector<double> faceflux(num_faces); std::vector<double> faceflux(num_faces);
std::vector<double> well_bhp; std::vector<double> well_bhp;
std::vector<double> well_flux; std::vector<double> well_flux;
/// \endcode /// \endcode
/// \page tutorial2 /// \page tutorial2
/// \details /// \details
/// We declare the gravity term which is required by the pressure solver (see /// 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. /// Opm::IncompTpfa.solve()). In the absence of gravity, an empty vector is required.
/// \code /// \code
std::vector<double> omega; std::vector<double> omega;
/// \endcode /// \endcode
/// \page tutorial2 /// \page tutorial2
/// \details /// \details
/// We declare the wdp term which is required by the pressure solver (see /// 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. /// Opm::IncompTpfa.solve()). In the absence of wells, an empty vector is required.
/// \code /// \code
std::vector<double> wdp; std::vector<double> wdp;
/// \endcode /// \endcode
/// \page tutorial2 /// \page tutorial2
@ -170,10 +175,10 @@ int main()
} }
/// \endcode /// \endcode
/// \page tutorial2 /// \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 /// distribution. \image html tutorial2.png
/// \page tutorial2 /// \page tutorial2
/// \section sourcecode Complete source code. /// \section sourcecode Complete source code.
/// \include tutorial2.cpp /// \include tutorial2.cpp