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

Non-scalar Matrix Field bugs #1983

Open
dennisYatunin opened this issue Sep 11, 2024 · 0 comments
Open

Non-scalar Matrix Field bugs #1983

dennisYatunin opened this issue Sep 11, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@dennisYatunin
Copy link
Member

dennisYatunin commented Sep 11, 2024

Describe the bug

In the process of working the RosSSP timestepper, @Sbozzolo has uncovered 4 bugs in the Field/FieldMatrix broadcasting machinery:

  • Division (not multiplication) of a Field of BandMatrixRows of non-scalars by a scalar throws an error [fixed in Remove unnecessary method specializations for Numbers #2014]
  • Multiplciation/division of a FieldMatrix by a scalar throws an error
  • Base.one of a FieldMatrix with non-scalar subblocks generates a FieldMatrix with scalar subblocks, which then throws an error when combined with a FieldMatrix similar to the original
  • LinearAlgebra.ldiv! generates NaNs when using a FieldMatrix with a single UniformScaling block.

Steps to Reproduce

Using W to denote the ImplicitEquationJacobian used in ClimaAtmos, the bugs can be reproduced as follows:

  • For the first bug, running W.matrix[@name(f.u₃), @name(f.u₃)] ./ 2 reproduces the error
  • For the second bug, running W.matrix .* 2 reproduces the error
  • For the third bug, running one(W.matrix) generates the incorrect result, and running W.matrix .+ one(W.matrix) reproduces the error
  • For the fourth bug, ldiv!(x, W.matrix, b) with a matrix that contains a single UniformScaling block and a FieldVector x that is full of ones generates the incorrect result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant