← Back to team overview

ufl team mailing list archive

Re: Enriching mixed element

 

On 16. juni 2010 14:55, Mehdi wrote:
> Hello,
>
> Assume the enriched element defined inside Mini.ufl,
>
> P1 = VectorElement("Lagrange", triangle, 1)
> B = VectorElement("Bubble", triangle, 3)
> Q = FiniteElement("CG", triangle, 1)
>
> Mini = (P1 + B)*Q
>
> We Have defined Function Space V on this element and a function u on V,
>
>   Function U(V);
>
> One can access to the sub functions of this mixed space by using
>
>   Function& u = U[0];
>   Function& p = U[1];
>
> However, we can't have access to the sub components of u. The problem is
> when we define enriched element for the vector elements, ufl assumes
> that
>
>   P1 + B = (P1_x*P1_y) + (B_x*B_y)
>
> Isn't this more natural and consistent, if we interpret this as,
>
>   P1 + B = (P1_x + B_x)*(P1_y + B_y)
>
> If we do so, we can access to the sub functions of u easily.
>   


It makes perfect sense to me that an enriched mixed element is an
enriched element.
Correspondingly a mixed enriched element is a mixed element, cf:

    # Create enriched mixed element
    P1 = VectorElement("Lagrange", triangle, 1)
    B = VectorElement("Bubble", triangle, 3)
    element = P1 + B

    # Create mixed enriched element
    P1 = FiniteElement("Lagrange", triangle, 1)
    B = FiniteElement("Bubble", triangle, 3)
    element = (P1 + B)*(P1 + B)


Maybe the second version is what you want?

--
Marie







References