ufl team mailing list archive
-
ufl team
-
Mailing list archive
-
Message #01251
Re: rot and curl
I've verified the curl vs wikipedia and defined rot as the z-component
of the curl of the 2D vector operand embedded in 3D. Is that right?
ez = (0, 0, 1)
u = (u0, u1)
rot(u) = ez . (nabla x (u0, u1, 0))
def curl(self, o, a):
# o = curl a = "cross(nabla, a)"
def c(i, j):
return a[j].dx(i) - a[i].dx(j)
return as_vector((c(1,2), c(2,0), c(0,1)))
def rot(self, o, a):
# o = rot a = "cross(nabla, (a0, a1, 0))[2]"
def c(i, j):
return a[j].dx(i) - a[i].dx(j)
return c(0,1)
Martin
On Fri, Apr 24, 2009 at 10:31 PM, Martin Sandve Alnæs
<martinal@xxxxxxxxx> wrote:
> No reason. I'll fix them.
>
> Martin
>
>
>
> On Fri, Apr 24, 2009 at 6:16 PM, Garth N. Wells <gnw20@xxxxxxxxx> wrote:
>> Is there any particular reason why 'rot' is not implemented,
>>
>> def rot(self, o, a):
>> raise NotImplementedError # FIXME
>>
>>
>> and 'curl' is,
>>
>> def curl(self, o, a):
>> # o = curl a = "cross(nabla, a)"
>> def c(i, j):
>> return a[j].dx(i) - a[i].dx(j)
>> return as_vector((c(1,2), c(2,0), c(0,1))) # FIXME: Verify this
>>
>>
>> Should there be a check in curl that the vector function is in R^3?
>>
>> Garth
>> _______________________________________________
>> UFL-dev mailing list
>> UFL-dev@xxxxxxxxxx
>> http://fenics.org/mailman/listinfo/ufl-dev
>>
>
Follow ups
References