Skip to content

Commit

Permalink
suggestion from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrubeck committed Dec 13, 2024
1 parent 0b0296d commit 0d70a66
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions firedrake/assemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,7 @@ def get_assembler(form, *args, **kwargs):
"""
is_base_form_preprocessed = kwargs.pop('is_base_form_preprocessed', False)
bcs = kwargs.get('bcs', None)
fc_params = kwargs.get('form_compiler_parameters', None)
fc_params = kwargs.pop('form_compiler_parameters', None)
if isinstance(form, ufl.form.BaseForm) and not is_base_form_preprocessed:
mat_type = kwargs.get('mat_type', None)
# Preprocess the DAG and restructure the DAG
Expand All @@ -155,8 +154,8 @@ def get_assembler(form, *args, **kwargs):
if len(form.arguments()) == 0:
return ZeroFormAssembler(form, form_compiler_parameters=fc_params)
elif len(form.arguments()) == 1 or diagonal:
return OneFormAssembler(form, *args, bcs=bcs, form_compiler_parameters=fc_params, needs_zeroing=kwargs.get('needs_zeroing', True),
zero_bc_nodes=kwargs.get('zero_bc_nodes', True), diagonal=diagonal)
return OneFormAssembler(form, *args, form_compiler_parameters=fc_params,
diagonal=diagonal, **kwargs)
elif len(form.arguments()) == 2:
return TwoFormAssembler(form, *args, **kwargs)
else:
Expand Down Expand Up @@ -1149,13 +1148,13 @@ class OneFormAssembler(ParloopFormAssembler):

@classmethod
def _cache_key(cls, form, bcs=None, form_compiler_parameters=None, needs_zeroing=True,
zero_bc_nodes=False, diagonal=False, weight=1.0):
zero_bc_nodes=True, diagonal=False, weight=1.0):
bcs = solving._extract_bcs(bcs)
return tuple(bcs), tuplify(form_compiler_parameters), needs_zeroing, zero_bc_nodes, diagonal
return tuple(bcs), tuplify(form_compiler_parameters), needs_zeroing, zero_bc_nodes, diagonal, weight

@FormAssembler._skip_if_initialised
def __init__(self, form, bcs=None, form_compiler_parameters=None, needs_zeroing=True,
zero_bc_nodes=False, diagonal=False, weight=1.0):
zero_bc_nodes=True, diagonal=False, weight=1.0):
super().__init__(form, bcs=bcs, form_compiler_parameters=form_compiler_parameters, needs_zeroing=needs_zeroing)
self._weight = weight
self._diagonal = diagonal
Expand Down

0 comments on commit 0d70a66

Please sign in to comment.