Skip to content

Commit

Permalink
more changes to test functions for multiple wrappers
Browse files Browse the repository at this point in the history
  • Loading branch information
ta440 committed Jan 11, 2024
1 parent 793768e commit 5f05367
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions gusto/time_discretisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,14 @@ def setup(self, equation, apply_bcs=True, *active_labels):
# Update the function space to that needed by the wrapper
self.wrapper.wrapper_spaces[field_idx] = self.wrapper.subwrappers[field].function_space

# Replace with new test function
# STILL TO SORT OUT.
#new_test = TestFunction(self.wrapper.subwrappers[field].test_space)

#self.residual = self.residual.label_map(
# all_terms,
# map_if_true=replace_test_function(new_test, old_idx=field_idx))

# Replace the test function space
# This currently won't work: supg test
# is a function, not a space
if self.wrapper.suboptions[field].name == "supg":
self.wrapper.test_spaces[field_idx] = self.wrapper.subwrappers[field].test
else:
self.wrapper.test_spaces[field_idx] = self.wrapper.subwrappers[field].test_space

self.wrapper.setup()

Expand All @@ -244,7 +244,7 @@ def setup(self, equation, apply_bcs=True, *active_labels):

# Only call this if with SUPG, so should put this into the
# previous section
self.residual = self.wrapper.label_terms(self.residual)
# self.residual = self.wrapper.label_terms(self.residual)


else:
Expand Down
4 changes: 2 additions & 2 deletions gusto/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ def __init__(self, equation, suboptions):

#self.wrapper_spaces = equation.space_names
self.wrapper_spaces = equation.spaces
self.test_spaces = equation.spaces
print(len(equation.spaces))

#self.x_in = Function(equation.function_space)
Expand Down Expand Up @@ -475,8 +476,7 @@ def setup(self):
self.function_space = MixedFunctionSpace(self.wrapper_spaces)
self.x_in = Function(self.function_space)
self.x_out = Function(self.function_space)
self.test_space = self.function_space
#pass
self.test_space = MixedFunctionSpace(self.test_spaces)

def pre_apply(self, x_in):
"""
Expand Down

0 comments on commit 5f05367

Please sign in to comment.