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
Using TrilinosWrappers::SolverCG in inverse_operator() #12754
Comments
I think that this is an error with your code (due to our current lack of documentation), and that you need to change |
Thank you so much for the clarification. |
Perhaps you can give either of those (or both) modifications, and let us know if that fixes the issue :-) |
@jppelteret
It seems that this does not work (with the same error message). So basically I should set up dealii/examples/step-70/step-70.cc Lines 1561 to 1562 in 54c0f16
Any suggenstions? |
I think this issue is present in your example (and not in step 70), because in step-70 we use deal.II solvers, and not Trilinos ones. When using a deal.II solver, the preconditioner and the linear operators do not initialize the inverse Payload, since trilinos does not know how to interpret our solver as an EpetraOperator.
I agree that this is very opaque, and we should fix it in the documentation.
In particular, I think this is a bug: this approach
auto K = linear_operator<LA::MPI::Vector>(system_matrix);
auto preconK = linear_operator<LA::MPI::Vector>(K, preconditioner);
ought to give the same result as this:
auto K = linear_operator<LA::MPI::Vector>(system_matrix);
auto preconK = linear_operator<LA::MPI::Vector>(system_matrix, preconditioner);
while in the first case we don’t propagate the Payload correctly. JP, any idea on how this could be fixed?
… On 12 Sep 2021, at 6:53, Jean-Paul Pelteret ***@***.***> wrote:
I think that this is an error with your code (due to our current lack of documentation), and that you need to change auto preconK = linear_operator(K, preconditioner); to auto preconK = linear_operator<LA::MPI::Vector>(system_matrix, preconditioner); or maybe just put the preconditioner directly into the inverse_operator. I'll see if I can dig up a concrete example of the former approach in the test suite, but you can see #12466 for comments that I made that will be transcribed into the documentation.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I guess that why step-70 works is that the Ok, having looked through some of the code I now agree that this must be a bug and that it's a code path that hasn't been tested yet. It looks to me that we have everything in place with the expectation that this should work (we permit |
Actually, I think that I have some idea what the problem is could be. The methods that set up the
None of those are specialised for a type
then you see some different behaviour? |
Well. I got the same error message.
Here is a test based on step-40: step-40.cc.zip |
Thanks for the test. I managed to simplify it further, mimicking what was done in the other step-40 based tests in the test suite. I've also opened a PR that fixes this issue. |
Hi,
I am trying to solve the linear system in step-60 but using distributed triangulations. Following the routine
solve()
in step-60, I define an inverse operator for the stiffness matrix using the CG solver fromTrilinosWrappers::SolverCG
. The code compiles successfully but a dealii exception is thrown out at the evaluation of the inverse operator with the following additional information:The above can be recovered by modifying
solve()
in step-40 when usingTrilinos
: replace the followingdealii/examples/step-40/step-40.cc
Lines 489 to 492 in 54c0f16
with
and add the headers
Then I get the following error message:
The above issue can be avoided using the native CG solver, i.e.
dealii::SolverCG<LA::MPI::Vector>
.Should this be a bug? or somewhere I did incorrectly?
FYI @luca-heltai
The text was updated successfully, but these errors were encountered: