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

Clarification of resumeFill requirements for Tpetra::CrsMatrix #3070

Closed
keitat opened this issue Jul 6, 2018 · 3 comments
Closed

Clarification of resumeFill requirements for Tpetra::CrsMatrix #3070

keitat opened this issue Jul 6, 2018 · 3 comments

Comments

@keitat
Copy link
Contributor

keitat commented Jul 6, 2018

Tpetra::CrsMatrix requires resumeFill() when changing its sparsity pattern. However, I have observed that there are several set...() methods requiring resumeFill() even though no changes happen in the sparsity pattern. Could you clarify the following?

  • setAllToScalar() (I got runtime error when resumeFill() is not called.)
  • add( A ) (If the input matrix A had different sparsity pattern, do I have to call resumeFill() before the call? )
  • Also, Tpetra does not support operations like A+ cI (c is a scalar and I is identity). What do you recommend for implementing this?
@mhoemmen
Copy link
Contributor

mhoemmen commented Jul 6, 2018

You must call resumeFill whenever you change the CrsMatrix's values.

@keitat wrote:

Tpetra::CrsMatrix requires resumeFill() when changing its sparsity pattern.

Generally you're not allowed to change a CrsMatrix's sparsity pattern after first fillComplete. If fillComplete has never been called on the CrsMatrix, and if the CrsMatrix was not created with a const CrsGraph, then you may change the CrsMatrix's structure until first fillComplete.

@mhoemmen
Copy link
Contributor

mhoemmen commented Jul 6, 2018

@keitat wrote:

Also, Tpetra does not support operations like A+ cI (c is a scalar and I is identity). What do you recommend for implementing this?

CrsMatrix has a method for getting the diagonal offsets. You could start with that.

MueLu has a specialized "Jacobi" kernel that does something like (A + omega D) * B, where omega is a constant and D is a diagonal matrix.

@mhoemmen
Copy link
Contributor

I'm closing this issue for now. Please feel free to reopen or open a new issue if needed. Thanks!

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

No branches or pull requests

2 participants