Skip to content

Commit

Permalink
bug fix to test func / q
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbrown1995 committed Nov 1, 2023
1 parent 6daae50 commit 9191901
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions gusto/common_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
geophysical fluid dynamics."""

from firedrake import (dx, dot, grad, div, inner, outer, cross, curl, split,
TestFunctions, TrialFunction)
TestFunction, TestFunctions, TrialFunction)
from firedrake.fml import subject, drop
from gusto.configuration import TransportEquationType
from gusto.labels import (transport, transporting_velocity, diffusion,
Expand Down Expand Up @@ -222,11 +222,13 @@ def split_continuity_form(equation):
prognostic_field_name = t.get(prognostic)
if hasattr(equation, "field_names"):
idx = equation.field_names.index(prognostic_field_name)
W = equation.function_space
test = TestFunctions(W)[idx]
q = split(subj)[idx]
else:
idx = equation.field_name.index(prognostic_field_name)
W = equation.function_space
test = TestFunctions(W)[idx]
q = split(subj)[idx]
W = equation.function_space
test = TestFunction(W)
q = subj
# u is either a prognostic or prescribed field
if (hasattr(equation, "field_names")
and 'u' in equation.field_names):
Expand Down

0 comments on commit 9191901

Please sign in to comment.