-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Transform global derivatives of Jacobian to reference derivatives in preprocessed_form
#63
Conversation
ufl/algorithms/apply_derivatives.py
Outdated
@@ -593,6 +591,25 @@ def _grad(self, o): | |||
# 1) n = count number of Grads, get f | |||
# 2) if not f.has_derivatives(n): return zero(...) | |||
|
|||
def _grad_to_reference_grad(self, o, K): |
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.
Nitpick, this function doesn't need self
I think, so could it just be a free function?
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.
Sure! I put it there because it is only used by the GradRuleset
class, but I'm happy to move it
Override for specific types if other behaviour is needed.""" | ||
if is_cellwise_constant(o): | ||
return self.independent_terminal(o) | ||
else: | ||
# TODO: Which types does this involve? I don't think the | ||
# form compilers will handle this. | ||
return Grad(o) |
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.
I think you can also remove the TODO
comment?
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.
Thanks! Modulo minor comments I think this looks right.
This PR fixes #62 and FEniCS/ffcx#373.