The error checking macro makes it harder to read and harder to write, so
instead we now only check for functions that can contain errors. Bounds and
range checks are handled by PETSc and not OPM.
The previous implementation set plenty of values in the initialization list and
immediately overwrote these values with values looked up from the param group.
This patch makes it look up the parameteres from the param group argument,
making the constructor simpler.
Petsc only supports initialisation through the ParameterGroup constructor.
Calling the default, non-arg constructor is a static error, and not
implementing it makes using it break compiles.
call_petsc.c was really a thin C wrapper around the call to petsc itself and
turns out was mostly unnecessary C++ emulation. This removes the file entirely
and ports its functionality into LinearSolverPetsc.cpp.
All features from the file should now be more readable as well as properly
utilising modern C++ features.
The patch uses the CHKERRXX macro from petsc to handle errors reported by
petsc, and currently does not handle this and give the control back to OPM's
error/throw system.
The class OwnerOverlapCopyCommunication is not defined unless MPI is
avilable. Therefore, we cannot reference the type unless we know
that MPI is available in the current translation unit.
To support this the solveSystem methods of the LinearSolverInterface gets
an optional additional template parameter of type boost::any. It can hold any
copy constructable object. In our case it is used to pass the information about
the parallelization into the solvers of dune-istl without the compiler needing to know
their type. Inside of LinearSolverIstl::solveSystem we check whether the type stored inside of
boost::any is the new ParallelIstlInformation. If this is the case we extract the information
and use the parallel solvers if available, otherwise we solve serial/sequential.
The new ParallelIstlInformation is needed as the OwnerOverlapCopyCommunication is not copy
constructable. This is indeed a design flaw that should and will fixed upstream, but for the
time being we need ParallelIstlInformation to transfer the ParallelIndexSet and RemoteIndices
objects.
This patch refactors the calls to the dune-istl solvers.
The SeqScalarProduct, and SequentialInformation is now explicitly
constructed and later used to construct the smoothers
generically. Aditionally the linear operator (MatrixAdapter) is
constructed before calling the various solver dependent solve
routines.
While this does not change the behaviour of the code it is a
preparatory step to support parallel solvers. These parallel
solvers only differ in the type of the scalarproduct and
linear operator used from the sequential ones.
This patch refactors the calls to the dune-istl solvers.
The SeqScalarProduct, and SequentialInformation is now explicitly
constructed and later used to construct the smoothers
generically. Aditionally the linear operator (MatrixAdapter) is
constructed before calling the various solver dependent solve
routines.
While this does not change the behaviour of the code it is a
preparatory step to support parallel solvers. These parallel
solvers only differ in the type of the scalarproduct and
linear operator used from the sequential ones.
This fixes further occurences of DUNE_HAS_FASTAMG that were
missed in pull request #530.
Previously we relied on the define DUNE_HAS_FAST_AMG to detect
whether these preconditioners are available. This define is only
available in the 2.2 release with cmake support. Therfore we now
addtionally test whether we are using dune-istl 2.3 or newer.
Previously we relied on the define DUNE_HAS_FAST_AMG to detect
whether these preconditioners are available. This define is only
available in the 2.2 release with cmake support. Therfore we now
addtionally test whether we are using dune-isl 2.3 or newer.
To avoid deprecation warnings the number of smoothing steps was passed
through the Criterion instead of directly to the constructor in commit
a7f32b934b.
However, due to an insufficient test matrix this was not tested using
the fast AMG variant of DUNE so it breaks the builds if
`-DHAS_DUNE_FAST_AMG` is defined.
This change should apply the same type of change to this branch as for
the others. The number of smoothing steps is put into a constant to
avoid the magic number 1 to appear in too many places (although I am
not sure the number for pre- and post-smoothing always should be the
same).
for some of these files this is needed to make to keep it compiling
after the next patch because the new ErrorMacros.hpp file will no
longer implicitly includes <iostream>. for the remaining files it is
just good style.
While at it, the includes for most of these files have been ordered in
order of decreasing abstraction level.
SuiteSparse may or may not be installed in a suitesparse/ directory.
FindSuiteSparse will look in a suitesparse/ subdirectory when trying
to locate umfpack.h, but it will add the full directory to the compiler
command-line (e.g. `-I/usr/include/suitesparse`) and not that of the
parent. Since the parent is usually included too, it is not noticed
that it is advertedly using another include paths than its own.
However, if we have SuiteSparse installed in a non-system location,
using the subdirectory in the `#include` statement may now cause an
error, even though configuration actually found SuiteSparse!
AGMG is now under a closed-source license, meaning that results
obtained with this solver is not freely reproducible by others.
Its use is therefore discouraged.
As of version 2.3, the DUNE AMG parts are competitive, so there
is a free and open alternative.
our policy is that we only use boost if necessary, i.e., if the oldest
supported compiler does not support a given feature but boost
does. since we recently switched to GCC 4.4 or newer, std::shared_ptr
is available unconditionally.
The <have_boost_redef.hpp> header was introduced (commit 82369f9) as
a work-around for a particular interaction in the Autotools-based
setup of OPM-Core and the Dune core modules. Notably, Dune's
"Enable" trick for Boost failed on some older Autoconf systems. Now
that we're using CMake, however, that kluge is no longer needed
because we (OPM-Core) always
#define HAVE_BOOST 1
i.e., as an explict true/false value.
Therefore, we need no longer include <have_boost_redef.hpp> . The
header will be removed at a later time.
After this patch one can set the prolongation factor for all
AMG calls and the number of smoothing steps for all except
of FastAMG that currently only supports on step.
In DUNE 2.2 FieldVector::size changed from being a member to being a
method. A compatibility warning is issued if you include the relevant
headers.
This warning can be silenced for DUNE modules by using passing the
option --enable-fieldvector-size-is-method to ./configure. This patch
effectively does the same, but through a macro definition.
Existing mark-up (/** ... */) would erroneously apply the documentation
of one field to the one below. Using /**< ... */ avoids this problem.
Found by reading the Doxygen manual more carefully...