dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #01130
Re: Re: [DOLFIN-dev] Dimension d in elasticity module
Quoting Anders Logg <logg@xxxxxxxxx>:
> On Fri, Oct 07, 2005 at 04:58:10PM +0200, Garth N. Wells wrote:
>
> > Knowing the tensor rank and dimension of each field of a mixed formulation
> would
> > be useful for extracting "subfunctions".
>
> You can access the list of elements that compose a mixed element
> through the member variable elements:
>
> e0 = FiniteElement(...)
> e1 = FiniteElement(...)
>
> element = e0 + e1
>
> rank_0 = element.elements[0].rank()
> rank_1 = element.elements[1].rank()
>
> But maybe you mean that you need this is information to be included in
> the generated code so it can be accessed in DOLFIN? We could do that,
> and it would make it possible to implement some more advanced
> functionality for the Function class in DOLFIN, like slicing out
> subfunctions:
>
> Function w(...);
> Function u(w, 0, 2); // Components 0-1
> Function p(w, 2); // Component 2
>
This is exactly what I was thinking. It's now possible to take slices out of
vectors (without making a copy), so I now need to know how many components an
element has, etc. Also, it would be good to extract the relevant trial
functions. For example,
BilinearForm a;
FiniteElement element0 = a.trial(0);
FiniteElement element1 = a.trial(1);
Garth
> /Anders
>
> _______________________________________________
> FFC-dev mailing list
> FFC-dev@xxxxxxxxxx
> http://www.fenics.org/cgi-bin/mailman/listinfo/ffc-dev
>
Follow ups
References