Johan Hake wrote:
> On Wednesday 19 August 2009 14:21:12 Garth N. Wells wrote:
>> Garth N. Wells wrote:
>>> Kent Andre wrote:
>>>>> Not sure what we have to do actually. I suppose I want get any clue
>>>>> from the
>>>>> demo/function/restriction
>>>>>
>>>>> demo?
>>>>> I see that Kent has modified the dolfin.FunctionSpace to reflect the
>>>>> present (broken) implementation of restriction, anything in that
>>>>> line? Should such an implementation has been done in
>>>>> FunctionSpaceBase instead of FunctionSpace? Kent?
>>>>>
>>>>> Johan
>>>> This restriction is different in the sense that the restriction is made
>>>> by the standard element on a sub mesh.
>>>> The restriction in focus now is on the complete mesh but for only
>>>> a part of the element.
>>>> Combined, these two features will be very powerful. I guess the
>>>> sub-mesh restriction stuff is broken due to the parallel mesh.
>>> I've attached an example solver. To make it work for P^k with k > 2 we
>>> need to restrict some functions to cell facets. Using FFC, we do
>>>
>>> scalar = FiniteElement("Lagrange", "triangle", 3)
>>> dscalar = FiniteElement("Discontinuous Lagrange", "triangle", 3)
>>>
>>> # This syntax restricts the space 'scalar' to cell facets.
>>> mixed = scalar["facet"] + dscalar
>>>
>>> In PyDOLFIN we could do
>>>
>>> V_dg = FunctionSpace(mesh, "DG", 3)
>>> V_cg = FunctionSpace(mesh, "CG", 3, "facet")
>>>
>>> mixed = V_cg + V_dg
>> I see now that we need to have the above option since the everything
>> (e.g. the dof map) is created and compiled inside functionspace.py.
>
> We could implement it in FunctionSpaceBase, as an operator, returning a new
> FunctionSpaceBase, with the restricted element as arguemnt.
>
> However my concerns go to a sub space of a restricted mixed space (if such
> exists) see the other email.
>
> If we go for 1, (as you have already done ;) ), we cannot create a restricted
> mixed space using the addition syntax.
>
> mixed = V1 + V2
>
Do you mean to then restrict mixed? I'm already doing
V0 = FunctionSpace(mesh, "CG", 3, "facet")
V1 = FunctionSpace(mesh, "DG", 3)
mixed = V0 + V1
and it works. This type of restriction (we'll need to sort out our
terminology) impacts the dofmap, which I why I think it needs to be
involved in the creation of the function space.
Garth
> If we want a restricted mixed space we need to use the constructor.
>
> mixed = MixedFunctionSpace((V1,V2),restriction="facet")
>
> Johan
>
>> Garth
>>
>>> or
>>>
>>> V_dg = FunctionSpace(mesh, "DG", 3)
>>> V_cg = FunctionSpace(mesh, "CG", 3)
>>>
>>> mixed = V_cg["scalar"] + V_dg
>>>
>>> Garth
>>>
>>>> Kent
>>>>
>>>> _______________________________________________
>>>> DOLFIN-dev mailing list
>>>> [email protected]
>>>> http://www.fenics.org/mailman/listinfo/dolfin-dev
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> DOLFIN-dev mailing list
>>> [email protected]
>>> http://www.fenics.org/mailman/listinfo/dolfin-dev
>> _______________________________________________
>> DOLFIN-dev mailing list
>> [email protected]
>> http://www.fenics.org/mailman/listinfo/dolfin-dev
_______________________________________________
DOLFIN-dev mailing list
[email protected]
http://www.fenics.org/mailman/listinfo/dolfin-dev