Skip to content
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

Merged
merged 3 commits into from Nov 5, 2022
Merged

Conversation

peterrum
Copy link
Member

No description provided.

Comment on lines +890 to +895
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]);
Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member

@kronbichler kronbichler left a 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.

@peterrum peterrum changed the title [WIP] Add TrilinosWrappers::SolverBelos Add TrilinosWrappers::SolverBelos Oct 19, 2022
@peterrum
Copy link
Member Author

@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.

Copy link
Member

@kronbichler kronbichler left a 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.

Copy link
Member

@bangerth bangerth left a 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!

include/deal.II/lac/trilinos_solver.h Show resolved Hide resolved
include/deal.II/lac/trilinos_solver.h Show resolved Hide resolved
include/deal.II/lac/trilinos_solver.h Outdated Show resolved Hide resolved
include/deal.II/lac/trilinos_solver.h Outdated Show resolved Hide resolved
include/deal.II/lac/trilinos_solver.h Show resolved Hide resolved
include/deal.II/lac/trilinos_solver.h Outdated Show resolved Hide resolved
include/deal.II/lac/trilinos_solver.h Outdated Show resolved Hide resolved
include/deal.II/lac/trilinos_solver.h Outdated Show resolved Hide resolved

double relative_tolerance_to_be_achieved =
solver_control.tolerance() / norm_0;
const int max_steps = solver_control.max_steps();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const int max_steps = solver_control.max_steps();
const unsigned int max_steps = solver_control.max_steps();

Copy link
Member Author

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.

Comment on lines 1380 to 1383
Teuchos::RCP<Belos::SolverManager<value_type, MV, OP>> solver =
Teuchos::rcp(
new Belos::BlockGmresSolMgr<value_type, MV, OP>(problem,
belos_parameters_copy));
Copy link
Member

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.

Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants