site-packages/dolfin/fem/formmanipulations.py correctly insists on Function but is poorly documented
When using derivative(F, u)
, Dolfin insists for u
to be a Function
. When looking at the code though, I see that the only factual requirement for u
is to provide the .function_space()
which is also the case for, e.g., TestFunction
objects and maybe some others. This is how I got bugged by this: I provided a TestFunction
and was disturbed by an error message and a "third argument" (?).
The derivative()
method would profit from using the try
-catch
logic. Also, the error message must be improved, and the third argument better explained in the documentation.
Comments (9)
-
-
-
assigned issue to
- marked as enhancement
- marked as minor
-
assigned issue to
-
reporter 1) Why would you want to pass a TestFunction? It would fail at the ufl level if dolfin allowed it.
Ah, I thought it was whatever symbol is used in
F
to indicate the argument. -- I believe I don't quite understand the interface yet. Documentation++. -
It's explained in some detail in the UFL chapter in the book, or in the new UFL paper: http://arxiv.org/abs/1211.4047
-
Could this be fixed so the Issue can be closed? Seems like an easy fix.
-
- changed milestone to 1.4
-
- changed title to site-packages/dolfin/fem/formmanipulations.py correctly insists on Function but is poorly documented
-
- changed status to resolved
At least improved in ufl commit 09586b568738546c94984279e598939fde100ec9
-
- removed milestone
Removing milestone: 1.4 (automated comment)
- Log in to comment
1) Why would you want to pass a TestFunction? It would fail at the ufl level if dolfin allowed it.
2) The "third argument" is du (see the signature), i.e. the variation: derivative(F, u, du) := d/dt F(u+t*du)|_t=0
3) The documentation is bad. I consider this a documentation bug only.