← Back to team overview

ufl team mailing list archive

Re: Element problems

 

>
>
> Johan Hake wrote:
>>>
>>> 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)
>>
>> I might be totaly of here but does not TestFunctions and TrialFunctions
>> return a properly splitted FooFunction?
>>
>> What I mean is:
>>
>>   dk, dc = TestFunctions(ME)
>>
>> should be the same as:
>>
>>   du = TestFunction(ME)
>>   dk, dc = split(du)
>>
>> Please correct me if I am wrong.
>>
>
> Yes, but former approach doesn't provide access to the 'mother' function
> du, and it's with respect to du that you want to compute the derivative.

Ahh, forgot the derivative.

Good to know I was not totally of ;)

Johan

> Garth
>
>
>> Isn't the problem the sF Function, which is defined using an element
>> which
>> is not 'properly mixed'?
>>
>>>> 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 think the list you refere to is the somewhat unreadable representation
>> of the view of the TestFunctions, which should be the correct one.
>>
>> Johan
>>
>>> 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
>>> _______________________________________________
>>> UFL-dev mailing list
>>> UFL-dev@xxxxxxxxxx
>>> http://fenics.org/mailman/listinfo/ufl-dev
>>>
>>
>>
>
>




References