Replacing derivative coefficients fail (since recently)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
UFL |
Fix Released
|
High
|
Martin Sandve Alnæs |
Bug Description
This snippet
--
from ufl import *
V = FiniteElement("CG", triangle, 1)
u = Coefficient(V)
g = Coefficient(V)
J = inner(u, u)*dx
a = derivative(J, u)
G = replace(a, {u:g})
--
gives this error
--
Applying replace with arguments among derivative coefficients is not correctly implemented.
Traceback (most recent call last):
File "foo.py", line 8, in <module>
G = replace(a, {u:g})
File "/home/
return apply_transform
File "/home/
return transform_
File "/home/
integrand = transform(
File "/home/
return transformer.
File "/home/
r = h(o)
File "/home/
error("Applying replace with arguments among derivative coefficients is not correctly implemented.")
File "/home/
raise self._exception
ufl.log.
--
This error seems to have been put in last week. The functionality is sorely missed though. Is a fix planned?
Changed in ufl: | |
status: | New → Fix Committed |
importance: | Undecided → Medium |
importance: | Medium → High |
Changed in ufl: | |
milestone: | none → 1.1.0-alpha |
assignee: | nobody → Martin Sandve Alnæs (martinal) |
Changed in ufl: | |
status: | Fix Committed → Fix Released |
I added this to protect against another bug. It may not be a problem in your case, maybe we can adjust the error check a bit.
Martin
Den 23. jan. 2012 kl. 22:38 skrev Marie Rognes <email address hidden>:
> Public bug reported: meg/local/ fenics/ lib/python2. 7/site- packages/ ufl/algorithms/ transformations .py", line 890, in replace er(e, Replacer(mapping2)) meg/local/ fenics/ lib/python2. 7/site- packages/ ufl/algorithms/ transformations .py", line 867, in apply_transformer integrands( e, _transform) meg/local/ fenics/ lib/python2. 7/site- packages/ ufl/algorithms/ transformations .py", line 842, in transform_ integrands itg.integrand( )) meg/local/ fenics/ lib/python2. 7/site- packages/ ufl/algorithms/ transformations .py", line 866, in _transform visit(expr) meg/local/ fenics/ lib/python2. 7/site- packages/ ufl/algorithms/ transformations .py", line 160, in visit meg/local/ fenics/ lib/python2. 7/site- packages/ ufl/algorithms/ transformations .py", line 284, in coefficient_ derivative meg/local/ fenics/ lib/python2. 7/site- packages/ ufl/log. py", line 148, in error _type(self. _format_ raw(*message) ) UFLException: Applying replace with arguments among derivative coefficients is not correctly implemented. /bugs.launchpad .net/bugs/ 920674 meg/local/ fenics/ lib/python2. 7/site- packages/ ufl/algorithms/ transformations .py", line 890, in replace er(e, Replacer(mapping2)) meg/local/ fenics/ lib/python2. 7/site- packages/ ufl/algorithms/ transformations .py", line 867, in apply_transformer
>
>
> This snippet
>
> --
> from ufl import *
>
> V = FiniteElement("CG", triangle, 1)
> u = Coefficient(V)
> g = Coefficient(V)
> J = inner(u, u)*dx
> a = derivative(J, u)
> G = replace(a, {u:g})
> --
>
> gives this error
>
> --
> Applying replace with arguments among derivative coefficients is not correctly implemented.
> Traceback (most recent call last):
> File "foo.py", line 8, in <module>
> G = replace(a, {u:g})
> File "/home/
> return apply_transform
> File "/home/
> return transform_
> File "/home/
> integrand = transform(
> File "/home/
> return transformer.
> File "/home/
> r = h(o)
> File "/home/
> error("Applying replace with arguments among derivative coefficients is not correctly implemented.")
> File "/home/
> raise self._exception
> ufl.log.
> --
>
> This error seems to have been put in last week. The functionality is
> sorely missed though. Is a fix planned?
>
> ** Affects: ufl
> Importance: Undecided
> Status: New
>
> --
> You received this bug notification because you are subscribed to FEniCS
> Project.
> https:/
>
> Title:
> Replacing derivative coefficients fail (since recently)
>
> Status in Unified Form Language:
> New
>
> Bug description:
>
> This snippet
>
> --
> from ufl import *
>
> V = FiniteElement("CG", triangle, 1)
> u = Coefficient(V)
> g = Coefficient(V)
> J = inner(u, u)*dx
> a = derivative(J, u)
> G = replace(a, {u:g})
> --
>
> gives this error
>
> --
> Applying replace with arguments among derivative coefficients is not correctly implemented.
> Traceback (most recent call last):
> File "foo.py", line 8, in <module>
> G = replace(a, {u:g})
> File "/home/
> return apply_transform
> File "/home/
> r...