diff --git a/m4/agmg.m4 b/m4/agmg.m4 index 9e09157b..0a16e9b3 100644 --- a/m4/agmg.m4 +++ b/m4/agmg.m4 @@ -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 diff --git a/m4/ax_dune_istl.m4 b/m4/ax_dune_istl.m4 index 2f0fd55b..40fa9072 100644 --- a/m4/ax_dune_istl.m4 +++ b/m4/ax_dune_istl.m4 @@ -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 \ diff --git a/opm/core/grid.c b/opm/core/grid.c index 07250ea3..9fa4cd67 100644 --- a/opm/core/grid.c +++ b/opm/core/grid.c @@ -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) ) diff --git a/opm/core/grid/cart_grid.c b/opm/core/grid/cart_grid.c index 25c04d24..989bbfe6 100644 --- a/opm/core/grid/cart_grid.c +++ b/opm/core/grid/cart_grid.c @@ -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; } diff --git a/opm/core/linalg/LinearSolverAGMG.cpp b/opm/core/linalg/LinearSolverAGMG.cpp index 5ce7dfca..086c9316 100644 --- a/opm/core/linalg/LinearSolverAGMG.cpp +++ b/opm/core/linalg/LinearSolverAGMG.cpp @@ -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, diff --git a/opm/core/linalg/LinearSolverAGMG.hpp b/opm/core/linalg/LinearSolverAGMG.hpp index f8c95ad7..9038ba75 100644 --- a/opm/core/linalg/LinearSolverAGMG.hpp +++ b/opm/core/linalg/LinearSolverAGMG.hpp @@ -44,7 +44,6 @@ #include #include -#include 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, diff --git a/opm/core/linalg/LinearSolverFactory.cpp b/opm/core/linalg/LinearSolverFactory.cpp index 98552c84..4e2f3679 100644 --- a/opm/core/linalg/LinearSolverFactory.cpp +++ b/opm/core/linalg/LinearSolverFactory.cpp @@ -30,6 +30,7 @@ #if HAVE_DUNE_ISTL #include #endif + #if HAVE_AGMG #include #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."); }