← Back to team overview

dolfin team mailing list archive

Re: Python mixed spaces and dof numbering

 

On Friday August 6 2010 09:52:20 Garth N. Wells wrote:
> We have an issue with MixedFunctionSpace which makes incorrect usage
> very easy. For example, if I have
> 
>     V = VectorFunctionSpace(mesh, "CG", 2)
>     Q = FunctionSpace(mesh, "CG", 1)
>     W = V * Q
> 
> The dof maps for Q and W.sub(1) are not the same. I've seen a number of
> users using V or Q in setting boundary conditions rather than W.sub(0)
> and W.sub(1).

I have done this mistake myself :P

I guess this problem only excist in POyDOLFIN?

> When using
> 
>     W = MixedFunctionSpace([ V, Q])
> 
> could we create W and then inside the MixedFunctionSpace constructor set
> 
>    V = W.sub(0)
>    Q = W.sub(1)

No as you are then just changing the local references of V and Q inside the 
__init__ method. What you need is a method of FunctionSpace that transform it 
to a SubSpace. Not sure that is possible?

Is there a user case where V and Q are used for what they are (not subspaces), 
after a declaration of a mixed space? We will screw such a use if we turn V 
and Q into a subspaces.

If this is not a consern, we might be able to tag V and Q as beeing used to 
create a mixed space inside the __init__ of mixedfunctionspace and issue some 
kind of warning (or exception!) whenever these are used to create a Function 
or someother FunctionSpace dependent object. This can be done purely in the 
Python layer. 

Johan

> ?
> 
> Garth
> 
> 
> 
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~dolfin
> Post to     : dolfin@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dolfin
> More help   : https://help.launchpad.net/ListHelp



Follow ups

References