-
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
Factor the riesz map out into a separate object. #3662
base: master
Are you sure you want to change the base?
Conversation
o.dat.data[:] = c.dat.data[:] | ||
else: | ||
solve, rhs, soln = self._solver | ||
rhs.assign(value) |
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.
check whether we need to explicitly zero BCs here.
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.
Aparently we need to do that, #3498
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.
OK, so I think what that issue actually says is that solve is bugged. I think I should default the solver here to restrict=True
(because that's the nice modern way of doing it) and anything else should be fixed in a separate fix to solve.
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.
This looks good to me.
def arguments(self): | ||
return (self,) | ||
|
||
def coefficients(self): | ||
return () |
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.
These two methods are part of the BaseForm
interface. I suspect this is needed because it conveniently allows the use of arguments as if they were base forms in a few places in pyadjoint. I think this suggests that, in the long term, the right thing to do is probably to have ufl.Argument
as BaseForm
. It mathematically makes sense as arguments map V -> V
, i.e. V x V* - > R
.
|
|
1 similar comment
|
LinearVariationalProblem, Function, Cofunction) | ||
rhs = Cofunction(self._function_space.dual()) | ||
soln = Function(self._function_space) | ||
lvp = LinearVariationalProblem( |
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.
Given that the inner product form won't ever change, I think the LVP should have constant_jacobian=True
to avoid refactoring every time.
Is there enough information available at setup to cache the That way if the same riesz map is needed in different places where it would be cumbersome to share the |
lvp = LinearVariationalProblem( | ||
self._inner_product, rhs, soln, bcs=self._bcs, restrict=True, | ||
form_compiler_parameters=self._form_compiler_parameters) | ||
solver = LinearVariationalSolver( |
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.
Can we pass an optional options_prefix
through to the LVS for command line options?
Description