← Back to team overview

ufl team mailing list archive

Re: grad() w.r. to a coefficient

 



On 06/07/10 13:25, Patrick Riesen wrote:
hello,

i want to take the gradient of a coefficient with respect to some other
quantity than the spatial coordinates (i.e. some other coefficient).

i tried to construct a custom operator derived from diff() and the
SpatialCoordinate/Derivative classes in ufl but after some point beyond
my knowledge it always gets evaluated to zero by FFC then stops
compiling with FFC : division by zero!

does somebody of you experts know an approach to this?


Did you try using 'variable'?

    . . .
    v  = variable(v)
    f  = v*v
    df = diff(f, v)	

Garth

many thanks and best regards,
patrick

_______________________________________________
Mailing list: https://launchpad.net/~ufl
Post to : ufl@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~ufl
More help : https://help.launchpad.net/ListHelp




Follow ups

References