Merge pull request #12 from bska/master

Coding Style and Diagnostics Clean-up.
This commit is contained in:
Atgeirr Flø Rasmussen 2012-08-14 05:01:08 -07:00
commit d89395f486
7 changed files with 46 additions and 38 deletions

View File

@ -11,10 +11,14 @@ AC_DEFUN([OPM_AGMG],dnl
[AS_IF([test -f "$with_agmg/dagmg.f90"],dnl
[AC_SUBST([AGMG_SRCDIR], [$with_agmg])[]dnl
AC_DEFINE([HAVE_AGMG], [1],dnl
[Define to `1' if Notay's AGMG solver is included])[]dnl
[Define to 1 if Notay's AGMG solver is included.])[]dnl
build_agmg="yes"],dnl
[build_agmg="no"])],dnl
[build_agmg="no"])[]dnl
[AC_DEFINE([HAVE_AGMG], [0],dnl
[Define to 0 if Notay's AGMG solver is unavailable.])[]dnl
build_agmg="no"])],dnl
[AC_DEFINE([HAVE_AGMG], [0],dnl
[Define to 0 if Notay's AGMG solver is unwanted.])[]dnl
build_agmg="no"])[]dnl
AS_IF([test x"$build_agmg" = x"yes"],dnl
[AC_PROG_FC_C_O[]dnl

View File

@ -31,7 +31,9 @@ AC_DEFUN([AX_DUNE_ISTL],
"x$ax_cv_dune_common_available" = "xyes"],dnl
[AC_DEFINE([HAVE_DUNE_ISTL], [1],dnl
[Define to 1 if `dune-istl' is available])
])[]dnl
],dnl
[AC_DEFINE([HAVE_DUNE_ISTL], [0],dnl
[Define to 0 if `dune-istl' is unavailable.])])[]dnl
AM_CONDITIONAL([DUNE_ISTL],
[test "x$ax_cv_dune_istl_available" = "xyes" -a \

View File

@ -104,7 +104,7 @@ allocate_grid(size_t ndims ,
nel = ncellfaces;
G->cell_faces = malloc(nel * sizeof *G->cell_faces);
G->cell_facetag = malloc(nel * sizeof *G->cell_facetag);
G->cell_facetag = malloc(nel * sizeof *G->cell_facetag);
nel = ncells + 1;
G->cell_facepos = malloc(nel * sizeof *G->cell_facepos);
@ -123,7 +123,7 @@ allocate_grid(size_t ndims ,
(G->face_normals == NULL) ||
(G->face_areas == NULL) ||
(G->cell_faces == NULL) ||
(G->cell_facetag == NULL) ||
(G->cell_facetag == NULL) ||
(G->cell_facepos == NULL) ||
(G->cell_centroids == NULL) ||
(G->cell_volumes == NULL) )

View File

@ -262,15 +262,13 @@ fill_cart_topology_3d(struct UnstructuredGrid *G)
}
}
}
for (k=0; k< nx*ny*nz;++k){
for (i=0; i < 6; ++i){
G->cell_facetag[k*6+i]=i;
}
for (k = 0; k < nx * ny * nz; ++k) {
for (i = 0; i < 6; ++i) {
G->cell_facetag[k*6 + i] = i;
}
}
fnodes = G->face_nodes;
fnodepos = G->face_nodepos;
fcells = G->face_cells;
@ -572,11 +570,11 @@ fill_cart_topology_2d(struct UnstructuredGrid *G)
}
}
for (j=0; j< nx*ny;++j){
G->cell_facetag[j*4+0]=0;
G->cell_facetag[j*4+1]=2;
G->cell_facetag[j*4+2]=1;
G->cell_facetag[j*4+3]=3;
for (j = 0; j < nx * ny; ++j) {
G->cell_facetag[j*4 + 0] = 0;
G->cell_facetag[j*4 + 1] = 2;
G->cell_facetag[j*4 + 2] = 1;
G->cell_facetag[j*4 + 3] = 3;
}

View File

@ -66,6 +66,7 @@ namespace Opm
is_spd_(is_spd)
{
}
LinearSolverAGMG::LinearSolverAGMG(const parameter::ParameterGroup& param)
: max_it_(100) ,
rtol_ (1.0e-6),
@ -76,11 +77,8 @@ namespace Opm
is_spd_ = param.getDefault("is_spd", is_spd_);
}
LinearSolverAGMG::~LinearSolverAGMG() {}
LinearSolverInterface::LinearSolverReport
LinearSolverAGMG::solve(const int size ,
const int nonzeros,

View File

@ -44,7 +44,6 @@
#include <opm/core/linalg/LinearSolverInterface.hpp>
#include <opm/core/utility/parameters/ParameterGroup.hpp>
#include <string>
namespace Opm
{
@ -63,26 +62,30 @@ namespace Opm
LinearSolverAGMG(const int max_it = 100 ,
const double rtol = 1.0e-6,
const bool is_spd = false);
/**
/**
* Constructor.
* \param[in] param ParameterGroup object contianing the fields
* max_it,rtol,is_spd as used in the constructor
*/
LinearSolverAGMG(const parameter::ParameterGroup& param);
/// Destructor.
* \param[in] param ParameterGroup object containing the fields
* max_it,rtol,is_spd as used in the constructor.
*/
LinearSolverAGMG(const parameter::ParameterGroup& param);
/**
* Destructor.
*/
virtual ~LinearSolverAGMG();
using LinearSolverInterface::solve;
/// Solve a linear system, with a matrix given in compressed
/// sparse row format.
/// \param[in] size Number of rows (and colums).
/// \param[in] nonzeros Number of (structural) non-zeros.
/// \param[in] ia Row pointers.
/// \param[in] ja Column indices.
/// \param[in] sa (structurally) non-zero elements.
/// \param[in] rhs System right-hand side.
/// \param[inout] solution System solution.
/// \param[in] size Number of rows (and columns).
/// \param[in] nonzeros Number of (structural) non-zeros.
/// \param[in] ia Row pointers.
/// \param[in] ja Column indices.
/// \param[in] sa (structurally) non-zero elements.
/// \param[in] rhs System right-hand side.
/// \param[in,out] solution System solution.
/// \return Solver meta-data concerning most recent system solve.
virtual LinearSolverInterface::LinearSolverReport
solve(const int size, const int nonzeros,

View File

@ -30,6 +30,7 @@
#if HAVE_DUNE_ISTL
#include <opm/core/linalg/LinearSolverIstl.hpp>
#endif
#if HAVE_AGMG
#include <opm/core/linalg/LinearSolverAGMG.hpp>
#endif
@ -73,12 +74,14 @@ namespace Opm
solver_.reset(new LinearSolverIstl(param));
#endif
}
else if (ls == "agmg") {
else if (ls == "agmg") {
#if HAVE_AGMG
solver_.reset(new LinearSolverAGMG(param));
#endif
}
else {
}
else {
THROW("Linear solver " << ls << " is unknown.");
}