dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #22593
[Question #152662]: diff() converts a constant to a zero
New question #152662 on DOLFIN:
https://answers.launchpad.net/dolfin/+question/152662
if I want to use an expression or its derivative
V=VectorFunctionSpace(...)
v=Function(V)
z=variable(v)
a=det(grad(v))
Da=diff(a,z)
form = v[i]*Da[i]*dx
it is fine, but if the expresion is a constant
b=10.0
Db=diff(b,z)
form = v[i]*Db[i]*dx
the diff() returns a Zero and thus raise an error
TypeError: unsupported operand type(s) for +: 'set' and 'tuple'
How should I define the constant expression that it differentiates as a list with three zeros?
--
You received this question notification because you are a member of
DOLFIN Team, which is an answer contact for DOLFIN.
Follow ups