-
Notifications
You must be signed in to change notification settings - Fork 160
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
BUG: linear solver fails if fields are initialised in a different order #4001
Comments
I think the following reproduces the issue. So far I observed that it happens when:
Example:
Output:
|
Thanks @ksagiyam, that's a much simpler example! |
Maybe this is due to the fact that |
|
This fails without lhs
|
The issue also goes away if the
|
By inspecting @ksagiyam's MFE, with There is no mechanism to know that the unsplit mass term
vs the failing case with
This suggests that we should zero-simplify more eagerly. I'm not entirely sure whether the gusto test can be fixed in this way. |
That could work around the issue, but I think the code should work whether or not we zero-simplify. |
I agree. I also just want to point out that it could be that the zero-simplification that has been added so far is just exposing bugs that were not triggered by the rather complicated expressions that we previously allowed. |
Yes, I know. |
@tommbendall Can you see if #4003 fixes your issue? |
This should fix about half of the failing Gusto tests -- and it does fix almost all of those. However our |
Can you show me the error message? |
The brief part is this:
But I've attached the whole log in case that it also useful |
If I install gusto and run
Is this expected? You might want to fix these first. |
See this PR for fixes firedrakeproject/gusto#610
Sent from Outlook for iOS<https://aka.ms/o0ukef>
________________________________
From: ksagiyam ***@***.***>
Sent: Friday, January 31, 2025 10:09:56 PM
To: firedrakeproject/firedrake ***@***.***>
Cc: Subscribed ***@***.***>
Subject: Re: [firedrakeproject/firedrake] BUG: linear solver fails if fields are initialised in a different order (Issue #4001)
CAUTION: This email originated from outside of the organisation. Do not click links or open attachments unless you recognise the sender and know the content is safe.
If I install gusto and run ../gusto/examples/shallow_water/test_shallow_water_examples.py::test_moist_thermal_eqiuvb_gw, I get:
self = <firedrake.assemble.OneFormAssembler object at 0x7e04cf70f4a0>
tensor = Coefficient(WithGeometry(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7e04d4ada840>, FiniteElement('Discontinuous Lagrange', triangle, 0), name=None), Mesh(VectorElement(FiniteElement('Lagrange', triangle, 2), dim=3), 4)), 432)
def _check_tensor(self, tensor):
if tensor.function_space() != self._form.arguments()[0].function_space().dual():
raise ValueError("Form's argument does not match provided result tensor")
E ValueError: Form's argument does not match provided result tensor
Is this expected? You might want to fix these first.
—
Reply to this email directly, view it on GitHub<#4001 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABUOTSVVSOKKX3FKDDE4FHL2NPYDJAVCNFSM6AAAAABWDNZU3OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMRYGQ4DGNBSGI>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
I do not see issues running
|
Describe the bug
Changing the order of declaration of a field leads to a solver failure. This is a Gusto-independent version of one of the several different errors currently breaking Gusto tests that most likely originated with Firedrake PR #3947
For the Gusto errors, see for instance: https://github.com/firedrakeproject/gusto/actions/runs/12864886794/job/36134821475?pr=610
Steps to Reproduce
Steps to reproduce the behavior:
Here is a failing example. Sorry that it's not more minimal, I couldn't find a smaller example that would fail!
This is clearly very odd. I can also make the test pass by making any number of other trivial changes, but changing the point at which the field
N
in the example below is declared seems to be enough. Otherwise the code below is a Gusto-independent version of the thermal shallow water solver which is currently exhibiting these failures.Expected behavior
I expect this to complete independent of the point at which the cell normal field
N
is first set.Error message
A short back trace for the error is here:
I will also attach the full backtrace, which prints out nearly 2000 lines of loopy code.
Environment:
firedrake-status
:Additional Info
Unfortunately this is only one of several different errors currently afflicting Gusto since we picked up the changes from #3947
The text was updated successfully, but these errors were encountered: