Merge pull request #12 from bska/master
Coding Style and Diagnostics Clean-up.
This commit is contained in:
commit
d89395f486
10
m4/agmg.m4
10
m4/agmg.m4
@ -11,10 +11,14 @@ AC_DEFUN([OPM_AGMG],dnl
|
|||||||
[AS_IF([test -f "$with_agmg/dagmg.f90"],dnl
|
[AS_IF([test -f "$with_agmg/dagmg.f90"],dnl
|
||||||
[AC_SUBST([AGMG_SRCDIR], [$with_agmg])[]dnl
|
[AC_SUBST([AGMG_SRCDIR], [$with_agmg])[]dnl
|
||||||
AC_DEFINE([HAVE_AGMG], [1],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="yes"],dnl
|
||||||
[build_agmg="no"])],dnl
|
[AC_DEFINE([HAVE_AGMG], [0],dnl
|
||||||
[build_agmg="no"])[]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
|
AS_IF([test x"$build_agmg" = x"yes"],dnl
|
||||||
[AC_PROG_FC_C_O[]dnl
|
[AC_PROG_FC_C_O[]dnl
|
||||||
|
@ -31,7 +31,9 @@ AC_DEFUN([AX_DUNE_ISTL],
|
|||||||
"x$ax_cv_dune_common_available" = "xyes"],dnl
|
"x$ax_cv_dune_common_available" = "xyes"],dnl
|
||||||
[AC_DEFINE([HAVE_DUNE_ISTL], [1],dnl
|
[AC_DEFINE([HAVE_DUNE_ISTL], [1],dnl
|
||||||
[Define to 1 if `dune-istl' is available])
|
[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],
|
AM_CONDITIONAL([DUNE_ISTL],
|
||||||
[test "x$ax_cv_dune_istl_available" = "xyes" -a \
|
[test "x$ax_cv_dune_istl_available" = "xyes" -a \
|
||||||
|
@ -104,7 +104,7 @@ allocate_grid(size_t ndims ,
|
|||||||
nel = ncellfaces;
|
nel = ncellfaces;
|
||||||
G->cell_faces = malloc(nel * sizeof *G->cell_faces);
|
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;
|
nel = ncells + 1;
|
||||||
G->cell_facepos = malloc(nel * sizeof *G->cell_facepos);
|
G->cell_facepos = malloc(nel * sizeof *G->cell_facepos);
|
||||||
@ -123,7 +123,7 @@ allocate_grid(size_t ndims ,
|
|||||||
(G->face_normals == NULL) ||
|
(G->face_normals == NULL) ||
|
||||||
(G->face_areas == NULL) ||
|
(G->face_areas == NULL) ||
|
||||||
(G->cell_faces == NULL) ||
|
(G->cell_faces == NULL) ||
|
||||||
(G->cell_facetag == NULL) ||
|
(G->cell_facetag == NULL) ||
|
||||||
(G->cell_facepos == NULL) ||
|
(G->cell_facepos == NULL) ||
|
||||||
(G->cell_centroids == NULL) ||
|
(G->cell_centroids == NULL) ||
|
||||||
(G->cell_volumes == NULL) )
|
(G->cell_volumes == NULL) )
|
||||||
|
@ -262,15 +262,13 @@ fill_cart_topology_3d(struct UnstructuredGrid *G)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (k=0; k< nx*ny*nz;++k){
|
for (k = 0; k < nx * ny * nz; ++k) {
|
||||||
for (i=0; i < 6; ++i){
|
for (i = 0; i < 6; ++i) {
|
||||||
G->cell_facetag[k*6+i]=i;
|
G->cell_facetag[k*6 + i] = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
fnodes = G->face_nodes;
|
fnodes = G->face_nodes;
|
||||||
fnodepos = G->face_nodepos;
|
fnodepos = G->face_nodepos;
|
||||||
fcells = G->face_cells;
|
fcells = G->face_cells;
|
||||||
@ -572,11 +570,11 @@ fill_cart_topology_2d(struct UnstructuredGrid *G)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (j=0; j< nx*ny;++j){
|
for (j = 0; j < nx * ny; ++j) {
|
||||||
G->cell_facetag[j*4+0]=0;
|
G->cell_facetag[j*4 + 0] = 0;
|
||||||
G->cell_facetag[j*4+1]=2;
|
G->cell_facetag[j*4 + 1] = 2;
|
||||||
G->cell_facetag[j*4+2]=1;
|
G->cell_facetag[j*4 + 2] = 1;
|
||||||
G->cell_facetag[j*4+3]=3;
|
G->cell_facetag[j*4 + 3] = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -66,6 +66,7 @@ namespace Opm
|
|||||||
is_spd_(is_spd)
|
is_spd_(is_spd)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
LinearSolverAGMG::LinearSolverAGMG(const parameter::ParameterGroup& param)
|
LinearSolverAGMG::LinearSolverAGMG(const parameter::ParameterGroup& param)
|
||||||
: max_it_(100) ,
|
: max_it_(100) ,
|
||||||
rtol_ (1.0e-6),
|
rtol_ (1.0e-6),
|
||||||
@ -76,11 +77,8 @@ namespace Opm
|
|||||||
is_spd_ = param.getDefault("is_spd", is_spd_);
|
is_spd_ = param.getDefault("is_spd", is_spd_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
LinearSolverAGMG::~LinearSolverAGMG() {}
|
LinearSolverAGMG::~LinearSolverAGMG() {}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
LinearSolverInterface::LinearSolverReport
|
LinearSolverInterface::LinearSolverReport
|
||||||
LinearSolverAGMG::solve(const int size ,
|
LinearSolverAGMG::solve(const int size ,
|
||||||
const int nonzeros,
|
const int nonzeros,
|
||||||
|
@ -44,7 +44,6 @@
|
|||||||
|
|
||||||
#include <opm/core/linalg/LinearSolverInterface.hpp>
|
#include <opm/core/linalg/LinearSolverInterface.hpp>
|
||||||
#include <opm/core/utility/parameters/ParameterGroup.hpp>
|
#include <opm/core/utility/parameters/ParameterGroup.hpp>
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace Opm
|
namespace Opm
|
||||||
{
|
{
|
||||||
@ -63,26 +62,30 @@ namespace Opm
|
|||||||
LinearSolverAGMG(const int max_it = 100 ,
|
LinearSolverAGMG(const int max_it = 100 ,
|
||||||
const double rtol = 1.0e-6,
|
const double rtol = 1.0e-6,
|
||||||
const bool is_spd = false);
|
const bool is_spd = false);
|
||||||
/**
|
|
||||||
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
* \param[in] param ParameterGroup object contianing the fields
|
* \param[in] param ParameterGroup object containing the fields
|
||||||
* max_it,rtol,is_spd as used in the constructor
|
* max_it,rtol,is_spd as used in the constructor.
|
||||||
*/
|
*/
|
||||||
LinearSolverAGMG(const parameter::ParameterGroup& param);
|
LinearSolverAGMG(const parameter::ParameterGroup& param);
|
||||||
/// Destructor.
|
|
||||||
|
/**
|
||||||
|
* Destructor.
|
||||||
|
*/
|
||||||
virtual ~LinearSolverAGMG();
|
virtual ~LinearSolverAGMG();
|
||||||
|
|
||||||
using LinearSolverInterface::solve;
|
using LinearSolverInterface::solve;
|
||||||
|
|
||||||
/// Solve a linear system, with a matrix given in compressed
|
/// Solve a linear system, with a matrix given in compressed
|
||||||
/// sparse row format.
|
/// sparse row format.
|
||||||
/// \param[in] size Number of rows (and colums).
|
/// \param[in] size Number of rows (and columns).
|
||||||
/// \param[in] nonzeros Number of (structural) non-zeros.
|
/// \param[in] nonzeros Number of (structural) non-zeros.
|
||||||
/// \param[in] ia Row pointers.
|
/// \param[in] ia Row pointers.
|
||||||
/// \param[in] ja Column indices.
|
/// \param[in] ja Column indices.
|
||||||
/// \param[in] sa (structurally) non-zero elements.
|
/// \param[in] sa (structurally) non-zero elements.
|
||||||
/// \param[in] rhs System right-hand side.
|
/// \param[in] rhs System right-hand side.
|
||||||
/// \param[inout] solution System solution.
|
/// \param[in,out] solution System solution.
|
||||||
/// \return Solver meta-data concerning most recent system solve.
|
/// \return Solver meta-data concerning most recent system solve.
|
||||||
virtual LinearSolverInterface::LinearSolverReport
|
virtual LinearSolverInterface::LinearSolverReport
|
||||||
solve(const int size, const int nonzeros,
|
solve(const int size, const int nonzeros,
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
#if HAVE_DUNE_ISTL
|
#if HAVE_DUNE_ISTL
|
||||||
#include <opm/core/linalg/LinearSolverIstl.hpp>
|
#include <opm/core/linalg/LinearSolverIstl.hpp>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_AGMG
|
#if HAVE_AGMG
|
||||||
#include <opm/core/linalg/LinearSolverAGMG.hpp>
|
#include <opm/core/linalg/LinearSolverAGMG.hpp>
|
||||||
#endif
|
#endif
|
||||||
@ -73,12 +74,14 @@ namespace Opm
|
|||||||
solver_.reset(new LinearSolverIstl(param));
|
solver_.reset(new LinearSolverIstl(param));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else if (ls == "agmg") {
|
|
||||||
|
else if (ls == "agmg") {
|
||||||
#if HAVE_AGMG
|
#if HAVE_AGMG
|
||||||
solver_.reset(new LinearSolverAGMG(param));
|
solver_.reset(new LinearSolverAGMG(param));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
|
else {
|
||||||
THROW("Linear solver " << ls << " is unknown.");
|
THROW("Linear solver " << ls << " is unknown.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user