Skip to content

Commit

Permalink
style
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrubeck committed Jan 7, 2025
1 parent ed58467 commit 2a0c03b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion firedrake/bcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ def reconstruct(self, field=None, V=None, subu=None, u=None, row_field=None, col
rank = len(self.f.arguments())
splitter = ExtractSubBlock()
form = splitter.split(self.f, argument_indices=(row_field, col_field)[:rank])
if form == 0:
if isinstance(form, ufl.ZeroBaseForm) or form.empty():
# form is empty, do nothing
return
if u is not None:
Expand Down
2 changes: 1 addition & 1 deletion firedrake/formmanipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ def split(self, form, argument_indices):
assert (len(idx) == 1 for idx in self.blocks.values())
assert (idx[0] == 0 for idx in self.blocks.values())
return form
f = map_integrand_dags(self, form)
# TODO find a way to distinguish empty Forms avoiding expand_derivatives
f = map_integrand_dags(self, form)
if expand_derivatives(f).empty():
# Get ZeroBaseForm with the right shape
f = ZeroBaseForm(tuple(Argument(subspace(arg.function_space(),
Expand Down
1 change: 0 additions & 1 deletion tests/firedrake/equation_bcs/test_equation_bcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ def linear_poisson_mixed(solver_parameters, mesh_num, porder):

solve(a == L, w, bcs=[bc2, bc3, bc4], solver_parameters=solver_parameters)


f = cos(2 * pi * x + pi / 3) * cos(2 * pi * y)
g = as_vector([-2 * pi * sin(2 * pi * x + pi / 3) * cos(2 * pi * y), -2 * pi * cos(2 * pi * x + pi / 3) * sin(2 * pi * y)])

Expand Down

0 comments on commit 2a0c03b

Please sign in to comment.