# MixedFunctionSpace with Space on the boundary

**URL:** https://fenicsproject.discourse.group/t/mixedfunctionspace-with-space-on-the-boundary/3462
**Category:** variational formulation
**Created:** [June 7, 2020, 7:57pm UTC](https://fenicsproject.discourse.group/t/mixedfunctionspace-with-space-on-the-boundary/3462 "2020-06-07T19:57:17Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![joh\_annes](https://avatars.discourse-cdn.com/v4/letter/j/ecd19e/32.png) [@joh\_annes](https://fenicsproject.discourse.group/u/joh_annes)
#### Post date: [June 7, 2020, 7:57pm UTC](https://fenicsproject.discourse.group/t/mixedfunctionspace-with-space-on-the-boundary/3462/1 "2020-06-07T19:57:17Z")

</div>

Hello,  
I want to create a mixed Function Space where one space is only defined on a part of the boundary (in order to include boundary conditions weakly). For example, I want to do something like this:

from dolfin import \*

mesh = UnitSquareMesh(2,2)  
Mesh0 = BoundaryMesh(mesh, ‘exterior’)  
class Top(SubDomain):  
def inside(self,x,on\_boundary):  
return near(x[0], 0.0)  
top = Top()  
submesh = SubMesh(Mesh0,top)

Y1\_elem = FiniteElement(‘P’,mesh.ufl\_cell(),1)  
Y2\_elem = FiniteElement(‘DG’,submesh.ufl\_cell(),1)  
Y = FunctionSpace(mesh,[Y1\_elem,Y2\_elem])

Is there a possibility to circumvent these difficulties?  
Kind regards, Johannes

---

<div class="post-metadata">

### Author: ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)
#### Post date: [June 7, 2020, 8:47pm UTC](https://fenicsproject.discourse.group/t/mixedfunctionspace-with-space-on-the-boundary/3462/2 "2020-06-07T20:47:36Z")

</div>

See @cdaversin Mixed dimensional Finite element method ([link to paper](https://arxiv.org/pdf/1911.01166.pdf)). There are many examples on this forum of usage, as well as on [Zenodo](https://zenodo.org/record/3525001#.Xt1SVcBHklQ)
