Commit Graph

34 Commits

Author SHA1 Message Date
Atgeirr Flø Rasmussen
48db4062b5 Count lower/upper entries simpler and faster. 2018-11-23 21:38:22 +01:00
Atgeirr Flø Rasmussen
8a038401ce Avoid in-loop allocation in convertToCRS().
This is done by counting entries first.
2018-11-23 21:38:22 +01:00
Andreas Lauser
ab94700f9a ParallelOverlappingILU0: fix warning emitted by newish compilers 2018-10-22 10:37:16 +02:00
Markus Blatt
8482b435eb Added clarifying comment on definedness of const_cast 2018-08-01 18:06:45 +02:00
Markus Blatt
f850f04c93 Prevent unnecessary copies of vectors using references. 2018-08-01 15:22:07 +02:00
Markus Blatt
458cd8768f Rely less on implicit includes of header files 2018-08-01 15:20:45 +02:00
Markus Blatt
019835b123 Added support for red-black ordering to ILUn. 2018-07-20 14:43:40 +02:00
Markus Blatt
865a690243 Allow usage of red-black ILU0.
We introduced two runtime parameters for this: ilu_redblack and
ilu_reorder_spheres. If the last one is false, we try to preserve
the ordering within in the colors. Otherwise we try to achieve a D2
(alternative diagonal) ordering.
2018-07-20 14:43:40 +02:00
Markus Blatt
43c1714478 Added various other variants of MILU.
These versions are inspired by the ones used in SuperLU and the enums
to choose them have simuilar names, but without leading S (MILU_1-MILU_3).

The following variants are supported (chosen by the enum MILU_VARIANT):
ILU: plain ILU
MILU_1:  lump diagonal with dropped row entries.
MILU_2:  lump diagonal with the sum of the absolute values of the dropped row
         entries.
MILU_3: if diagonal is positive add sum of dropped row entrires. Otherwise substract them.
MILU_4: if diagonal is positive add sum of dropped row entrires. Otherwise do nothing
2018-07-20 14:43:40 +02:00
Markus Blatt
63058559bc Added various other variants of MILU.
These versions are inspired by the ones used in SuperLU and the enums
to choose them have simuilar names, but without leading S (MILU_1-MILU_3).

The following variants are supported (chosen by the enum MILU_VARIANT):
ILU: plain ILU
MILU_1:  lump diagonal with dropped row entries.
MILU_2:  lump diagonal with the sum of the absolute values of the dropped row
         entries.
MILU_3: if diagonal is positive add sum of dropped row entrires. Otherwise substract them.
MILU_4: if diagonal is positive add sum of dropped row entrires. Otherwise do nothing
2018-07-20 14:42:46 +02:00
Markus Blatt
e0a138e23c [MILU] Add dropped elements only to diagonal.
We did add the dropped matrix blocks to the diagonal blocks,
but this is not MILU where oone only modifies the diagonal.
With this patch we fix this behaviour and now only modify the
diagonal of the diagonal block.
2018-07-20 14:42:46 +02:00
Markus Blatt
0bae240a42 Allow user to choose modified ILU0 decomposition.
Using the parameter ilu_milu=true|false (default=false) the user can now choose
to use the modified ILU0 decomposition. If selected values will
not be dropped for nonzero entries but added to the diagonal of U.
This approach will result in A*e = L*U*e for vector e with all entries
beging 1.
2018-07-20 14:42:46 +02:00
Markus Blatt
e1e289dc1e Added MILU0 decomposition 2018-07-20 14:42:46 +02:00
Atgeirr Flø Rasmussen
f9c1fbcbe6 Make sure we (re-)throw MatrixBlockError also in the serial case. 2018-04-24 14:32:43 +02:00
Markus Blatt
a82598abe7 include ErrorMacros.hpp to safely make use of OPM_THROW (and not abort) 2018-02-07 16:56:12 +01:00
Markus Blatt
6bcfce1733 Prevent problems to due oversight in parallel AMG.
Currently we run into issues with the parallel AMG if
redistribution happened on the coarsest level. That is
not detected by AMG and it will construct smoothers on
all processors present before the redistribution. Some of
them will get OwnerOverlapCommunication objects that have
an invalid MPI communicator in them (MPI_COMM_NULL) and an
MPI_ERROR will be raised as we communicate in the constructor.

With this patch we detect this situaton and set the pointer to
OwnerOverlapCommunication to null to prevent communication. A
sanity check that the matrix has zero rows has been added.
2018-02-06 13:19:59 +01:00
Markus Blatt
28e566ba02 [bugfix] Prevent indexing an array of zero size for matrices with zero rows. 2018-02-06 12:45:13 +01:00
Markus Blatt
6d21214fa7 Switch to ParallelOverlappingILU0 for CPRPreconditioner.
This seems to have been forgotten previously. Now the code int CPRPreconditioner.hpp
uses ParallelOverlappingILU0 instead of SeqILU[0n]/BlockPreconditioner which
makes the code more slim.
2018-02-05 22:37:01 +01:00
Arne Morten Kvarving
4315665b64 changed: expose category as member for dune 2.6
the enum can only be used with a define, and that would
just be a temporary solution in any case
2018-01-22 17:23:22 +01:00
Andreas Lauser
6e7189b518 fix a few Dune 2.5 deprecation warnings 2017-10-27 17:48:26 +02:00
Arne Morten Kvarving
167147acc4 use std::remove_const instead of Dune::remove_const 2017-10-05 12:02:10 +02:00
Markus Blatt
542f181f7e Narrow down the possible Matrix types for ParallelOverlappingILU0
It now has to be a BCRSMatrix, but the block type is flexible and
needs to this way. flow_legacy uses MatrixBlock, and flow_ebos uses
FieldMatrix.
2017-07-03 13:50:21 +02:00
Markus Blatt
1bb0968283 Work around unstable matrix inversion in DUNE 2.[34]
The versions are missing the specialized code for inverting
a 3x3 matrix that makes the algorithms quite a bit more stable.
With this patch we fall back to using our own MatrixBlock that does
not suffer from this deficiency.
2017-07-03 10:20:23 +02:00
Markus Blatt
c2129185ae Store columns of ParallelOverlappingILU0::upper in descending order
This is the order used by ILU in dune-istl
2017-06-14 10:06:33 +00:00
Robert Kloefkorn
0b90b7863b [cleanup[ use Dune::Amg::SequentialInformation instead of int. 2017-06-13 15:48:01 +02:00
Robert Kloefkorn
38300a4c9b [cleanup] avoid over aggressive memory allocation in ILU. 2017-06-13 15:48:01 +02:00
Robert Kloefkorn
1fa04096c3 [bugfix] circumvent bug in dune-istl when matrix was assembled in
row_wise mode. Also cleanup of output.
2017-06-13 15:48:01 +02:00
Robert Kloefkorn
a774128fb7 [feature] Make ILU use CRS for storing lower and upper triangular matrices.
Then the backwards in memory iteration for the upper triangular can be
avoided by storing the matrix blocks in the correct order.
2017-06-13 15:48:01 +02:00
Markus Blatt
cb9d566ec2 Added braces to one-line for loop. 2015-12-02 11:29:38 +01:00
Markus Blatt
99c1b988a7 Fixed typo "consistent consistent" -> consistent. 2015-12-01 15:13:22 +01:00
Markus Blatt
4adf8487ea Uses more speaking names for template parameter and adds more documentation. 2015-12-01 14:49:07 +01:00
Markus Blatt
e05e3fa478 Removes code that was commented out. 2015-12-01 14:48:35 +01:00
Markus Blatt
0fdd27267b Adds empty lines around namespaces and comment about the end of a namespace. 2015-12-01 14:47:28 +01:00
Markus Blatt
dc1d7c526f Moved ParallelOverlappingILU0 to its own file. 2015-12-01 14:41:06 +01:00