Commit Graph
100 Commits
Author SHA1 Message Date
Markus Blatt a270994ad0 Support compiling Cpr without any MPI support.
There is a problem compiling upstream
Hierarchy::recalculateGalerkin() without MPI. Therefore we
reimplement that method in our AMG version. Fixes will travel
upstream.

Apart from that we made sure that all types have a meaning even
if there is no MPI found and that we at least have redistribute method
to call even if using SequentialInformation. In that case the method
does nothing but prevents compilation errors complaining about missing
parallel functionality.
2019-04-11 18:43:07 +02:00
Markus Blatt 26e1a9a94d Support DUNE 2.4 with CPR.
This version does not support the DirectsolverSelector struct and we
therefore implemented a fallback.
2019-04-11 14:15:04 +02:00
Markus Blatt 9f49e3fc26 Also pass the parseContext and errorGuard to Opm::checkDeck()
This is now mandated since the checkDeck interface was changed recently.
Otherwise compilation errors out.
2019-04-10 15:01:52 +02:00
Markus Blatt 81b7af1d8a Support DUNE 2.5 with CPR reusing hierarchy 2019-04-10 15:01:35 +02:00
Markus Blatt 29e893dc8e Make sure the the OwnerOverlopCommunication object stays alive.
As the AMG hierarchy is kept and uses the initial OwnerOverlopCommunication object
we need to make sure that this object lives as long as the hierarchy. We assure
this by storing a shared_ptr to it in ISTLSolverEbosCpr and reuse it to construct
the WellModelMatrixAdapter.
2019-04-10 14:40:46 +02:00
Markus Blatt 8057c2ba83 Use a shared pointer to the OwnerOverlapCommunication in WellModelMatrixAdapter.
Previously the OwnerOverlapCommunication object was owned by the adapter as a
unique_ptr was used. The change to shared_ptr makes it possible to to extract
it and reuse even if OwnerOverlapCommunication is thrown away.
2019-04-10 14:40:46 +02:00
Markus Blatt 6538b59d9e Added parallel CPR that reuses the matrix hierarchy.
Currently this just compiles but still segfaults in parallel.
2019-04-10 14:40:46 +02:00
Markus Blatt 831f41c0e3 Cater for empty fipnum vectors in output code.
Due to loadbalancing this vector might be empty under some circumstances.
Hence the old code would dereference the end iterator which is a bug.
2019-03-22 15:14:08 +01:00
Markus Blatt 2575cf715c Merge pull request #1724 from blattms/strip-milu-debug-out
Remove bogus debug output printing in MILU.
2019-02-07 16:34:41 +01:00
Markus Blatt 29464cd832 Remove bogus debug output printing in MILU.
Somehow some standard output when running MILU () is still there and
it really clutters the output and and makes it unusable. This commit
removes it from flow.
2019-02-06 10:37:35 +01:00
Markus Blatt 3b8ef5f004 one line per variable as requested. 2019-01-16 13:16:45 +01:00
Markus Blatt d87c5764b9 Use doxygen style suggested by reviewer. 2019-01-16 13:16:45 +01:00
Markus Blatt ace49a2c22 Adhere to CamelCase for types, functions, and variables.
This seems to be covered for types and functions by our coding style
with room for interpretation. For variables the coding styles asks for
underlines though, but nevermind.
2019-01-16 13:16:45 +01:00
Markus Blatt fb0f04d814 [bugfix] Cater for multiple EDITNNC entry for same cell pair. 2019-01-16 13:16:45 +01:00
Markus Blatt 64326dad53 [bugfix] Prevent accessing elements beyond end of NNC entries. 2019-01-16 13:16:45 +01:00
Markus Blatt 362476a494 [bugfix] Prevent double scaling of NNC with EDITNNC resembled trans
The former order resulted of first apply NCC to the grid
transmissibilities and then applying EDITNNC resulted in NNCs being
scaled twices. The reason is that applyNNCToGridTrans_ scales the NNC
with EDITNNC. With the patch the order of the function calls is
reversed to prevent double scaling.
2019-01-16 13:16:45 +01:00
Markus Blatt 5e83a26908 Process values from NNC keyword for those connection resembled by grid.
This is includes neighboring connection and NNCs due to faults. In both
cases the transmissibilities of specified via NNC are added to the set or
computed ones.

This is the first step for supporting NNC in flow.
2019-01-16 13:16:45 +01:00
Markus Blatt 2dd0b62eff [bugfix] Added missing ) to make code compile 2019-01-16 12:03:01 +01:00
Markus Blatt 4f4f5cbca3 [bugfix] Only strip ".DATA" or "." extensions.
As there might models named MODEL.01.DATA for which a call
"flow MODEL.01" would have stripped the extension.
2019-01-16 12:03:01 +01:00
Markus Blatt 20d12f5b53 [bugfix] Use file not filename to remove files not in current directory.
Passing just the filename to remove only will remove files in the
current directory. When --output-dir the files would not have been
removed.
2019-01-16 12:01:46 +01:00
Markus Blatt 0c2edcfe47 Remove debugging output 2019-01-16 11:56:47 +01:00
Markus Blatt 89ec35e0d2 Make BlackoilWellModel::hasTHPConstraints() work correctly in parallel.
Previously, this method did not take parallelism into account but just
checked the local wells for the constraints. Depending on the load balancing
of the wells this sometimes led to different return values of the function on different
processors. As the output is used to limit the time step size, different processors
were sometimes using different time steps in their local computations. This screwed
up convergence checks int the nonlinear operator such that only some processor thought
convergence was already achieved while others wanted to do more iterations.

With this commit the method now returns whether there is any well on any processor
with the constraint being true.
2019-01-14 22:14:01 +01:00
Markus Blatt 4b6144bb65 Only warn and show parallel logging fallout on demand.
This commit adds an option that allows to enable detecting parallel
logging fallout (option --enable-logging-fallout-warning). It is now
false by default (previous behavior was as if the option was true).

If option is true a warning will be printed for any process with nonzero
rank that does try to log to *.PRT or *.DBG and the logged output will be appended
to these files at the end.
2019-01-14 13:06:21 +01:00
Markus Blatt 52270e7ac7 Use uppercase basename for *DBG and *PRT files for any extension.
Previously runs of flow started with 'flow base.' Would result in base..DBG
files; note the double dot and the case sensitivity. Now the file will be
BASE.DBG in this case. Note that any extension will be stipped (not only
.DATA as before).
2019-01-14 13:03:03 +01:00
Markus Blatt 84acf3965f Do not log messages during getWriteRestartFile query on all procs.
Previously all processes reported
Warning: Fast restart using SAVE is not supported. Standard restart file is written instead.
Now this is done only on the master process where logging is activated.
2018-12-07 15:56:45 +01:00
Markus Blatt d7d9a3ecd8 bugfix: Fallback to SeqILUn in tracer code for DUNE < 2.6
In that versions SeqILU was not there.
2018-12-07 12:08:03 +01:00
Markus Blatt a2be89d586 bugfix: Use a typedef that is actually defined.
Fixes `error: ‘LinearSolverScalar’ was not declared in this scope`.
2018-12-07 12:06:29 +01:00
Markus Blatt 7c2f6d9275 Refactored loop which applies the EDITNCC. 2018-12-05 10:15:42 +01:00
Markus Blatt 7a4b817010 Add spaces where requested by coding standard 2018-12-03 16:46:03 +01:00
Markus Blatt cfac47ddbc Apply multiplicators from EDITNNC from the Deck. 2018-11-20 14:00:45 +01:00
Markus Blatt 8cafb0e92a Make MPI calls in gatherConvergenceReport with void* instead of const void*
Fixes compilation of PR #1612 with open-mpi 1.6.5.
Compiler complained about not being able to transform const void* to void*
as needed by MPI.
2018-11-15 09:30:51 +00:00
Markus Blatt 9f2f6705bc Merge pull request #1564 from dr-robertk/PR/fix-compile-dune-master
[bugfix][ISTLSolverEbos] make compile with current dune master.
2018-09-24 07:25:30 +02:00
Markus Blatt 5aa07fca69 Remove more dead code from the ISTLSolver.hpp fork for ebos.
These functions are also not used.
2018-09-21 16:15:32 +02:00
Markus Blatt abddcb74d3 Merge branch 'fix_build' into fix-issue-1574-and-more
It removes some dead code that appeared during the fork of
ISTLSolver.hpp for ebos.
2018-09-21 15:49:39 +02:00
Markus Blatt 2dd5a3d15c Fix compilation issue of flow_legacy without UMFPack.
The problem was only present if UMFPack was not found and therefore
FLOW_SUPPORT_AMG was defined to true. In that case we experienced compile
errors in a source branch that would never be executed. Therefore we remove
the code there and throw an exception.
2018-09-21 15:07:54 +02:00
Markus Blatt 8455c0457b ParallelFileMerger: Remove old local regex and fileWaringRegex_ instead 2018-09-05 16:42:13 +02:00
Markus Blatt 5aab0dfb7b Really only warn about CASENAME.[0-9]+.[A-Z]+.
Previously we did warn about files not starting with CASENAME.
2018-09-05 16:06:36 +02:00
Markus Blatt 07bc4396ab Let ParallelFileMerger only warn about CASENAME.[0-9]*.EXT files.
Previously the regex issued warning for all files containing ".[0-9]*." in the name
in the output directory. That was too general and created more warnings than we wanted.
2018-09-05 16:06:36 +02:00
Markus Blatt 0863f665aa [bugfix] Make parallel file merge work again for any --output-dir.
This fixes fallout from the merge of PR #1512. Since then the
ParallelFileMerger was always given the current directory even if
another output directory was requested. This resulted in
CASENAME.<procid>.<ext> files in that directory never being merged and removed.
Now the ParallelFileMerger gets the output directory path again.
2018-09-05 14:03:00 +02:00
Markus Blatt 9a692b2d09 Improvements to MILU help strings 2018-08-30 18:22:17 +02:00
Markus Blatt 324cb70d3e Renamed MIluVariant to MiluVariant to correct --m-ilu-variant parameter.
It should be --milu-variant and is it now. Maybe the parameter system
could be a bit smart and detect consecutive upper case letters and treat
them correctly.
2018-08-30 18:02:24 +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 41e5779ae3 Extended test for the reordering 2018-07-20 14:43:40 +02:00
Markus Blatt 190272e21d Added two alternatives for reordering based on colors 2018-07-20 14:43:40 +02:00
Markus Blatt 3953b20215 Also return the number of vertices for each color from Welsh-Powell-Algorithm. 2018-07-20 14:43:40 +02:00
Markus Blatt a1650a58f4 Added Welsh Powell graph coloring 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 59b99d9ef9 Fixed unused variable warnings in test_milu 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 397fc78405 Add additional MILU test. 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 5333a2430f Be verbose only when compiled with -DDEBUG 2018-07-20 14:42:46 +02:00
Markus Blatt e1e289dc1e Added MILU0 decomposition 2018-07-20 14:42:46 +02:00
Markus Blatt 1bd735428f Deactivate selection of CPR via eclipse keyword
as this preconditioner is still considered experimental
and fails miserably for some models. Users can select
CPR using the command line.
2018-06-15 15:34:01 +02:00
Markus Blatt e27fa72aee Use extended sparsity pattern also of we add well contributions to the preconditioner. 2018-03-07 13:54:21 +01:00
Markus Blatt 01b25f27ed Allow to add well contributions to both matrix and preconditioner matrix.
matrix_add_well_contributions=true will add to both the preconditioner matrix
and the matrix of the linear operator. preconditioner_add_well_contributions=true
will only add the contributions to the preconditioner matrix.
2018-03-05 16:48:10 +01:00
Markus Blatt dc86d972d2 Removed hack to access StandardWell::addWellContributions. 2018-03-05 16:48:03 +01:00
Markus Blatt 12d2114bd7 Add well contribution to preconditioner matrix and always use old operator approach for wells.
It turned out that applying the well part of the full matrix has to be
done after the application of the non-well interactions. Otherwise we
screw up the ordering so much that convergence suffers a lot.

Kudos got Atgeirr for inspiration based on his testing.
2018-03-02 20:57:43 +01:00
Markus Blatt f07874cf42 Cleanup code.
Removed unused boolean switch in WellModelMatrixAdapter and removed commented code.
2018-03-02 20:57:10 +01:00
Markus Blatt af3c45dd6a Do not add additional entries to matrix when not adding well contributions. 2018-03-02 20:55:58 +01:00
Markus Blatt 44d31f9dcc Removed unused variable warning in addWellContributions. 2018-02-26 16:23:13 +01:00
Markus Blatt 8aa0973cfc Removed unsused friend declaration.
This seemed to be a leftover from the approach taken
before the refactoring of the well code.
2018-02-26 16:20:41 +01:00
Markus Blatt 247241c037 Added test for multMatrixTransposed. 2018-02-26 16:11:53 +01:00
Markus Blatt 3be954fe98 Move multMatrixTransposed for better testability.
Otherwise we need to deal with the property system of ewoms.
2018-02-26 15:49:59 +01:00
Markus Blatt e53374b8ec Check which each well whether to call apply for well contributions.
This allows for different implementations of wells in well_container
when adding well contributions to the matrix.
2018-02-26 15:47:25 +01:00
Markus Blatt 455cf79d8d Fixed comments in StandardWell 2018-02-26 15:16:07 +01:00
Markus Blatt 5ec804d362 Prevent unused variable warning 2018-02-26 15:16:07 +01:00
Markus Blatt 3f0d6f7dca Space 2018-02-26 15:16:07 +01:00
Markus Blatt 96a636f25b Let WellModel decide whether to apply well contributions.
It queries the Well whether the jacobian also contains well contributions.
If not then it applies them in the operator in addition. Thus the
well knows whether that is needed or not.
2018-02-26 15:16:07 +01:00
Markus Blatt afb806bc3e Remove effectless typedef in version check.
The typedef is the same and has no effect since we
switched to Dune::FMatrixHelp::invertMatrix.
2018-02-26 15:16:07 +01:00
Markus Blatt 8e78f02230 Use Dune::FMatrixHelp::invertMatrix for inversion
Thus we always take advantage of the specializations in ISTLSolver.hpp
and do need to take care about the type of the matrix block.
2018-02-26 15:12:14 +01:00
Markus Blatt b5d55b9fb2 Fix indentation and whitespace. 2018-02-26 14:35:04 +01:00
Markus Blatt 2e7313ac08 Cater for move of CpGrid header 2018-02-26 14:35:04 +01:00
Markus Blatt 9221bc958b Added missing header includes 2018-02-26 14:35:04 +01:00
Markus Blatt 01b90bce05 Improve well matrix products 2018-02-26 14:35:04 +01:00
Markus Blatt 22dfa6f135 Setup auxiliary module only once with all possible well completions.
Clearing the auxiliary modules will result in the sparsity pattern being
recomputed. Previously we did this before each nonlinear solve. But for the
master branch the sparsity pattern was only computed once for the whole
simulation.

To get the same behaviour (one sparsity pattern computation) we change the
auxiliary module to include all well perforations that might become active
during the simulation and do this once up front of a simulator run.

Please note that the new matrix entries might also improve convergence for
the ILU if the well is not active.
2018-02-26 14:35:04 +01:00
Markus Blatt 07f61c2a2b Add auxiliary module in BlackoilModelEbos constructor.
Previously, we did this during assemble. Unfortunately, this resulted
in the sparsity pattern being recomputed every time instead of just
once for a non-linear solve.
2018-02-26 14:35:04 +01:00
Markus Blatt 799cbb4b62 Add influences by well perforations to matrix.
This is only done upon request and uses the auxiliary module approach
provided by ewoms.

In the case of adding the influences we do not execute applyWellModelScaleAdd
or applyWellModel in the operator
2018-02-26 14:35:04 +01:00
Markus Blatt d0fcd1a8e9 Add non neighboring connections induced by well perforations to matrix sparsity pattern
This is only done upon request and uses the auxiliary module approach
provided by ewoms.
2018-02-26 14:32:50 +01:00
Markus Blatt 8456a84ec9 Prevent unused variable warning when compiling test_blackoil_amg 2018-02-07 16:58:51 +01:00
Markus Blatt e5de96e5f4 Make test_blackoil_amg compile.
There was typo in the last fix.
2018-02-07 16:58:09 +01: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 f381336dff Remove unused function parameters and default arguments for AMG construction.
It turned out that they are not needed and used.
2018-02-07 16:32:00 +01:00
Markus Blatt bf3132e9cf Fixes unused variable warning 2018-02-06 19:48:26 +01:00
Markus Blatt cda0c22d0f Avoid negation in if clause 2018-02-06 15:36:23 +01:00
Markus Blatt 034b1840ae Fixed comment about smoother arguments needed for construction 2018-02-06 15:34:13 +01:00
Markus Blatt 4c590c17d6 Moved definition of CPRParameter to top of header as needed for constructor call. 2018-02-06 15:32:35 +01:00
Markus Blatt fc9acf963e Spelling fixes in BlackoilAmg.hpp 2018-02-06 15:31:50 +01:00
Markus Blatt 14cde5bafc Made use of range based for for graph traversal. 2018-02-06 15:30:24 +01:00
Markus Blatt a8dde44afc Removed dead code und commented code. 2018-02-06 15:28:10 +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 ffda4f96d5 Adjust test to changed constructor. 2018-02-06 12:44:21 +01:00
Markus Blatt cfa311e055 recover compilation support for dune versions <2.6 2018-02-05 22:09:37 +00:00
Markus Blatt cf1cdbd375 Improved documentation 2018-02-05 22:37:01 +01:00