-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix the FormSum
!?
#3897
base: master
Are you sure you want to change the base?
Fix the FormSum
!?
#3897
Conversation
|
|
Oh dear, if this fixes the issue then that interface could do with updating! I think that the traversal method is taking advantage of the behaviour described here: #3348 (comment) This behaviour is not widely known and is quite unintuitive - it's usually considered a bug. It might be best to change this method signature (and the preorder traversal method) to use |
No. This does not fix it. I am still debugging. |
Shame it wasn't so simple! It may still be good to change the signatures to avoid that behaviour though |
I see. I gonna try |
firedrake/assemble.py
Outdated
@@ -584,7 +583,8 @@ def update_tensor(assembled_base_form, tensor): | |||
raise NotImplementedError("Cannot update tensor of type %s" % type(tensor)) | |||
|
|||
@staticmethod | |||
def base_form_postorder_traversal(expr, visitor, visited={}): | |||
def base_form_postorder_traversal(expr, visitor, visited=None): | |||
visited = visited if visited is not None else {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To have the same caching behaviour as before, without the {}
default kwarg, this should stash visited
as an attribute so it get's reused unless the user passes visited
, e.g.
visited = visited if visited is not None else self._visited
Description
No.