Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ta440 committed Apr 8, 2024
1 parent f079c06 commit e04e5ce
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
18 changes: 8 additions & 10 deletions gusto/time_discretisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,13 @@ def setup(self, equation, apply_bcs=True, *active_labels):
if self.field_name is not None and hasattr(equation, "field_names"):
if isinstance(self.field_name, list):
# Multiple fields are being solved simultaneously.
# This enables conservative transport to be implemented
# with SIQN.

# This enables conservative transport to be implemented with SIQN.

# Use the full mixed space. The field_name and residual
# are set up later.
self.fs = equation.function_space
self.idx = None
bcs = []


else:
self.idx = equation.field_names.index(self.field_name)
self.fs = equation.spaces[self.idx]
Expand All @@ -158,7 +156,7 @@ def setup(self, equation, apply_bcs=True, *active_labels):
split_form(t.form)[self.idx].form,
t.labels),
drop)

bcs = equation.bcs[self.field_name]

else:
Expand All @@ -178,8 +176,8 @@ def setup(self, equation, apply_bcs=True, *active_labels):
# Only keep active labels for prognostics in the list:
for subname in self.field_name:
field_residual = self.residual.label_map(
lambda t: t.get(prognostic) == subname,
map_if_false=drop)
lambda t: t.get(prognostic) == subname,
map_if_false=drop)

residual += field_residual.label_map(
lambda t: t.has_label(*active_labels),
Expand All @@ -190,8 +188,8 @@ def setup(self, equation, apply_bcs=True, *active_labels):
self.residual = self.residual.label_map(
lambda t: any(t.has_label(time_derivative, *active_labels)),
map_if_false=drop)
# Set field name now, if it is a list.

# Set field name and bcs for any simultaneous transport.
if isinstance(self.field_name, list):
self.field_name = equation.field_name
bcs = equation.bcs[self.field_name]
Expand Down
4 changes: 2 additions & 2 deletions gusto/timeloop.py
Original file line number Diff line number Diff line change
Expand Up @@ -745,9 +745,9 @@ def timestep(self):
message=f'transporting velocity, outer iteration {outer}')
for name, scheme in self.active_transport:
# transports a field from xstar and puts result in xp

if isinstance(name, list):
# Evolve the mixed field. This will transport any
# Evolve the mixed field. This will transport any
# terms in the list, with the others remaining unchanged
# from xstar into xp.
logger.info(f'SIQN: Transport {outer}: Simultaneous transport of {name}')
Expand Down

0 comments on commit e04e5ce

Please sign in to comment.