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
Add TrilinosWrappers::SolverBelos #14352
Conversation
for (unsigned int i = 0; i < n_cols; ++i) | ||
(*this->vectors[i]) *= beta; | ||
|
||
for (unsigned int i = 0; i < n_cols; ++i) | ||
for (unsigned int j = 0; j < n_rows; ++j) | ||
this->vectors[i]->add(alpha * B(j, i), *A.vectors[j]); |
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.
@kronbichler All the optimized vector operations are missing here. But I believe we do not have to implement those twice and can reuse them from #14349 once that one is generalized for block vectors.
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.
Correctly, I think we can simply create these general abstractions for blessed vectors (i.e., deal.II's own vectors Vector
and LinearAlgebra::distributed::Vector
) and the block vectors building on top of these vectors.
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.
I like this interfaces, it gives access to newer solvers.
@kronbichler I have added some documentation and have worked on the solver control part. Belos only understands relative tolerance so that I need to translate the absolute one. |
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.
Good. It would be great to have an additional opinion on this PR.
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.
I've got to run to get my flight, but here are a few comments already. I'll look at the rest on occasion!
In any case, many thanks!
|
||
double relative_tolerance_to_be_achieved = | ||
solver_control.tolerance() / norm_0; | ||
const int max_steps = solver_control.max_steps(); |
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.
const int max_steps = solver_control.max_steps(); | |
const unsigned int max_steps = solver_control.max_steps(); |
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.
I have changed it. The reason for using int was that this is what Trilinos expects. I cast it now when giving the value to the parameter struct.
Teuchos::RCP<Belos::SolverManager<value_type, MV, OP>> solver = | ||
Teuchos::rcp( | ||
new Belos::BlockGmresSolMgr<value_type, MV, OP>(problem, | ||
belos_parameters_copy)); |
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.
Does this mean that right now, SolverBelos
always uses GMRES? That seems unnecessarily restrictive.
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.
True. I have made gmres a parameter.
No description provided.