Commit Graph

83 Commits

Author SHA1 Message Date
Jørgen Kvalsvik
b3ebe04e14 Adds missing preconditoner destruction. 2014-12-10 18:09:13 +01:00
Jørgen Kvalsvik
8fbbdad722 Renamed variables to match Ax = b 2014-12-10 18:09:01 +01:00
Jørgen Kvalsvik
37a47711e5 Vector construction is now value oriented.
No longer initialised and constructed in two places.
2014-12-10 18:07:45 +01:00
Jørgen Kvalsvik
6c70d2938d Removes unecessary whitespace. 2014-12-10 18:06:28 +01:00
Jørgen Kvalsvik
43d82a232c Fixes performance bug in matrix construction.
At the same time changes the construction to be value-oriented, not
constructing it in OEM_DATA, but rather in to_petsc_mat
2014-12-10 18:05:04 +01:00
Jørgen Kvalsvik
e69d92cca3 Moved KSPCreate to the Data constructor
This is where it was always intended to be called, so this fixes a mistake in
earlier development.
2014-11-12 20:41:21 +01:00
Jørgen Kvalsvik
7c78afa13d Reduces CHKERRXX usage to where necessary.
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.
2014-10-14 14:43:42 +02:00
Jørgen Kvalsvik
93a8430339 Petsc constructor now uses intialiser list.
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.
2014-10-14 14:43:42 +02:00
Jørgen Kvalsvik
ce3981a55e Makes using wrong constructor a compile-time error
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.
2014-10-14 14:43:42 +02:00
Jørgen Kvalsvik
ade7aa658e Removes call_petsc.c and calls the lib from C++
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.
2014-10-14 14:43:42 +02:00
Liu Ming
28b354c625 Add HAVE_PETSC macro. 2014-07-08 10:58:39 +08:00
Liu Ming
8a118f45fe rename the private member. 2014-05-23 11:10:22 +08:00
Liu Ming
9d985f7421 use unordered_map for "string-enum" translations. 2014-05-23 11:09:04 +08:00
Liu Ming
6f2d28d08a Throw information for Petsc. 2014-05-16 15:02:49 +08:00
Liu Ming
ccb83a8503 Initialize Petsc from constructor.
Remove private members for initializing Petsc.
2014-05-16 14:53:49 +08:00
Liu Ming
4491eb7a6a Add Petsc to OPM. 2014-05-16 14:41:51 +08:00
Atgeirr Flø Rasmussen
be5af2378a Change option name and generated header names. 2014-04-15 20:21:10 +02:00
Atgeirr Flø Rasmussen
bd4eef5a86 Merge remote-tracking branch 'akva2/quell_dune_warnings' into suppress-external-warnings 2014-04-15 14:35:01 +02:00
Atgeirr Flø Rasmussen
798ef0d070 Comment or add (void) usage of unused arguments. 2014-04-15 13:39:03 +02:00
Bård Skaflestad
99d7f61822 Don't reference OwnerOverlap* unless MPI is available
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.
2014-04-07 20:01:18 +02:00
Markus Blatt
7fd5b65691 Merge remote-tracking branch 'upstream/master' into parallel-solver-support
Removed conflicts in:
	opm/core/linalg/LinearSolverIstl.cpp
2014-04-04 20:38:52 +02:00
Markus Blatt
8653ffe327 [bugfix] Use the size of the vector for the copying.
The last patch did not compile as there was no size member
in scope. Therefore this patch resorts to using the size of
the vector.
2014-03-27 11:53:13 +01:00
Markus Blatt
23f19584cb Throw an error when using a sequential solver in parallel 2014-03-27 11:49:41 +01:00
Markus Blatt
7495bfa6c4 [bugfix] Use the size of the vector for the copying.
The last patch did not compile as there was no size member
in scope. Therefore this patch resorts to using the size of
the vector.
2014-03-26 10:23:11 +01:00
Markus Blatt
3115b7868f Moved ISTL right and left hand side construction for ISTL to solveSystem
cherry-picked from add-scalarproduct and ported.
2014-03-25 09:58:07 +01:00
Markus Blatt
909d3c9019 Moved ISTL right and left hand side construction for ISTL to solveSystem 2014-03-25 09:37:41 +01:00
Markus Blatt
bdc4573e2a Added support for the parallel solvers of dune-istl.
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.
2014-03-20 21:59:29 +01:00
Markus Blatt
cec51280e7 Explicitly construct the ScalarProduct, and SequentialInformation.
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.
2014-03-20 12:09:24 +01:00
Markus Blatt
e1d0995104 Explicitly construct the ScalarProduct, and SequentialInformation.
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.
2014-03-20 10:39:48 +01:00
Markus Blatt
8f60175d04 Include fastamg.hh for dune-istl 2.3
For the inofficial 2.2 release this was included automatically with amg.hh.
2014-03-19 19:51:17 +01:00
Markus Blatt
d333f413d1 Complete cf7f07b PR #530 to support FastAMG with dune-istl 2.3
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.
2014-03-19 17:40:02 +01:00
Markus Blatt
8c8bb67aa0 Makes KAMG and FastAMG solver available with dune-istl 2.3
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.
2014-03-19 11:19:25 +01:00
Arne Morten Kvarving
bb1e21d764 add option to quell dune(-istl) warnings 2014-03-05 09:27:47 +01:00
Atgeirr Flø Rasmussen
cb99938c62 Fix initialisation warning. 2014-02-05 13:05:33 +01:00
Roland Kaufmann
88a38a8e3f Fix LinearSolverIstl cleanup also for fast AMG branch
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).
2013-09-20 10:00:21 +02:00
Roland Kaufmann
5f00467f02 Set linear solver steps in criterion instead of ctor
The constructor that takes the number of steps is deprecated; this
generates needless warnings.
2013-09-19 10:32:49 +02:00
Andreas Lauser
cb76a0fd7f convert THROW to OPM_THROW 2013-09-05 13:04:37 +02:00
Andreas Lauser
408d3389c3 include iostream in the files which use std::cerr or std::cout
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.
2013-09-05 13:04:37 +02:00
Roland Kaufmann
440c7721ae Remove subdirectory from SuiteSparse include
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!
2013-08-25 09:35:51 +02:00
Roland Kaufmann
76f3863780 Remove bindings to AGMG from library
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.
2013-08-13 23:25:04 +02:00
Andreas Lauser
5cd622fbf7 use std::shared_ptr instead of boost::shared_ptr
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.
2013-08-08 13:25:58 +02:00
Júlio Hoffimann
c077912466 Remove trailing whitespaces 2013-07-28 08:34:13 -03:00
Roland Kaufmann
baa9bf12e0 Zero-initialize structure to avoid returning undefined
The compiler will otherwise complain that we are returning undefined
data. There is no way for the client code to know whether this was
the case.
2013-07-05 10:59:52 +02:00
Bård Skaflestad
f99377ceec Merge pull request #274 from blattms/non-tr1
Changed std::tr1 occurences to boost.
2013-07-04 12:01:51 -07:00
Markus Blatt
b5db3e0713 Changed std::tr1 occurences to boost.
std::tr1 might not be supported by all compilers and will eventually
be dropped by others. Using boost instead makes this more
portable.
2013-07-04 16:04:35 +02:00
Atgeirr Flø Rasmussen
fb77fffdc8 Merge pull request #263 from bska/remove-redef-kluge
Disable build kluge that is no longer pertinent
2013-06-24 06:02:10 -07:00
Markus Blatt
eaf8e780c7 Fixed unused parameters and whitespace issues. 2013-06-21 12:49:35 +02:00
Bård Skaflestad
85a9a41264 Disable build kluge that is no longer pertinent
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.
2013-06-20 23:14:39 +02:00
Markus Blatt
9b0b60c3f8 Fixed spelling 2013-06-20 17:01:35 +02:00
Markus Blatt
2db889cd2b Unifies the way how AMG is called.
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.
2013-06-20 16:55:07 +02:00