-
Notifications
You must be signed in to change notification settings - Fork 129
Restricted Additive Schwarz with multiple layers of overlap #2369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,7 +24,6 @@ | |
| #include <opm/simulators/linalg/MatrixBlock.hpp> | ||
| #include <opm/simulators/linalg/BlackoilAmg.hpp> | ||
| #include <opm/simulators/linalg/CPRPreconditioner.hpp> | ||
| #include <opm/simulators/linalg/ParallelRestrictedAdditiveSchwarz.hpp> | ||
| #include <opm/simulators/linalg/ParallelOverlappingILU0.hpp> | ||
| #include <opm/simulators/linalg/ExtractParallelGridInformationToISTL.hpp> | ||
| #include <opm/simulators/linalg/findOverlapRowsAndColumns.hpp> | ||
|
|
@@ -257,6 +256,8 @@ class WellModelMatrixAdapter : public Dune::AssembledLinearOperator<M,X,Y> | |
| const auto wellsForConn = simulator_.vanguard().schedule().getWellsatEnd(); | ||
| const bool useWellConn = EWOMS_GET_PARAM(TypeTag, bool, MatrixAddWellContributions); | ||
|
|
||
| overlapLayers_ = EWOMS_GET_PARAM(TypeTag, int, OverlapLayers); | ||
|
|
||
| detail::setWellConnections(gridForConn, wellsForConn, useWellConn, wellConnectionsGraph_); | ||
| detail::findOverlapAndInterior(gridForConn, overlapRows_, interiorRows_); | ||
| if (gridForConn.comm().size() > 1) { | ||
|
|
@@ -391,6 +392,11 @@ class WellModelMatrixAdapter : public Dune::AssembledLinearOperator<M,X,Y> | |
| // Construct scalar product. | ||
| auto sp = Dune::createScalarProduct<Vector,POrComm>(parallelInformation_arg, category); | ||
|
|
||
| // If overlapLayers_ > 1 we are using Restricted Additive Schwarz and therefore need | ||
| // the residual at overlap DoFs. | ||
| if (overlapLayers_ > 1) | ||
| parallelInformation_arg.copyOwnerToAll(istlb, istlb); | ||
|
|
||
| #if FLOW_SUPPORT_AMG // activate AMG if either flow_ebos is used or UMFPack is not available | ||
| if( parameters_.linear_solver_use_amg_ || parameters_.use_cpr_) | ||
| { | ||
|
|
@@ -688,7 +694,7 @@ class WellModelMatrixAdapter : public Dune::AssembledLinearOperator<M,X,Y> | |
| pattern[idx].insert(*wc); | ||
|
|
||
| // Add just a single element to ghost rows | ||
| if (elem.partitionType() != Dune::InteriorEntity) | ||
| if (elem.partitionType() == Dune::GhostEntity) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is totally unrelated to this PR but it just struck me when reading the diff: Should we move the for-loop over the wellConnectionsGraph_ to else branch and explicitly use |
||
| { | ||
| noGhostMat_->setrowsize(idx, pattern[idx].size()); | ||
| } | ||
|
|
@@ -949,6 +955,7 @@ class WellModelMatrixAdapter : public Dune::AssembledLinearOperator<M,X,Y> | |
| std::vector<int> overlapRows_; | ||
| std::vector<int> interiorRows_; | ||
| std::vector<std::set<int>> wellConnectionsGraph_; | ||
| int overlapLayers_; | ||
| FlowLinearSolverParameters parameters_; | ||
| Vector weights_; | ||
| bool scale_variables_; | ||
|
|
||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please explain why this is only needed for more than one overlap layers. Shouldn't the right hand side always be consistent (all procs have the same values?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The right hand side is normally unique, which is correct with only one overlap since this will give Dirichlet condition for the copy (?). I think the problem is that of some reason the residual is only calculated for the owner cells since this is the only needed for the original solvers. With this copying and the additional setting of zero for the copy attribute (i.e. "useless overlap") the right hand side is correct. The correct thing is to assemble for all owner and overlap (I would have prefered all) and then set it to zero (at the same time as the matrix elements is fixed to get correct Dirichlet condition). If amg solver is used I think a change in the redistribution function is needed to get correct behavoir if the coarse scale communicator has overlap attributes.