← Back to team overview

ufl team mailing list archive

Re: Element problems

 



Andy Ray Terrel wrote:
Hello,

I'm still getting a hang of this but I was trying to do some things
with mixed elements and derivatives.  I'm not sure if I have the bug
or if ufl has a bug but the following doesn't pass ufl-analyse.


sElem = TensorElement("DG", triangle, 1)
vElem = VectorElement("CG", triangle, 2)

mElem = sElem + vElem

phi, v = TestFunctions(mElem)
sigma, u = TrialFunctions(mElem)


The above is the problem. You need to use 'split'. Look at the cahn-hilliard demo for an example of how to do it.

Garth

sF = Function(sElem)

f = inner(sF, dot(u, grad(sF)))*dx
F = derivative(f, sF, phi)
J = derivative(F, sF, sigma)


It seems that the TestFunctions function doesn't return a proper
TestFunction but a list of things. I can do the following but then I
loose the mixed element, which I don't know if ffc could handle.


sElem = TensorElement("DG", triangle, 1)
vElem = VectorElement("CG", triangle, 2)

mElem = sElem + vElem

phi = TestFunction(sElem)
v = TestFunction(vElem)
sigma = TrialFunction(sElem)
u = TrialFunction(vElem)

sF = Function(sElem)

f = inner(sF, dot(u, grad(sF)))*dx
F = derivative(f, sF, phi)
J = derivative(F, sF, sigma)


Any thoughts on either my bug or ufl please let me know.

-- Andy
_______________________________________________
UFL-dev mailing list
UFL-dev@xxxxxxxxxx
http://fenics.org/mailman/listinfo/ufl-dev



Follow ups

References