This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Can I use FunctionSpace defined on the edges and that on the elements at the same time?

+1 vote

Hi,

Can I implement a weak form that uses both FunctionSpace defined on the edges and that on the elements? In "hybridized" methods (such as the hybridized Raviart-Thomas method, these spaces are important.

More concretely, let $\lambda$ be a trial DG function defined on the edges, and let $\mathbf{v}$ be the test DG function defined on the elements. Can I assemble a form as follows
$$\sum_{K \in \mathcal{T}_h} \int_{\partial K} \lambda (\mathbf{v}\cdot n)~ds,$$
where $ \mathcal{T}_h$ is the set of elements of the mesh and $n$ is the outward unit normal vector of each element $K$. The form is equal to a integral over all facets
$$\sum_{F \in \mathcal{F}_h} \int_{F} \lambda (\mathbf{v}^+\cdot n^+ + \mathbf{v}^-\cdot n^-)~ds.$$

If there is a demo, please point me to it. Much thanks.

asked Nov 24, 2015 by civar77 FEniCS Novice (170 points)
edited Nov 25, 2015 by civar77

Did you have a look at the mixed Poisson demo?

Yes, it use Raviard-Thomas element and DG element to implement the mixed method.

But I want to use the hybridization to implement it, which means replacing the RT element by DG element and introducing a Lagrangian multiplier to impose the continuity of RT. The weak formulation is as follows, finding $p_h \in DRT_{k}$, $u_h\in DG_{k}$, $\lambda_h \in M_k$, such that
$$ \int_{\Omega} p_h q~dx + \int_{\Omega} u_h \mathrm{div} q ~dx + \sum_{K\in \mathcal{T}_h} \int_{\partial K} \lambda_h q ~ds =0,$$
$$\int_{\Omega} v \mathrm{div} p_h ~dx = \langle f, v\rangle,$$
$$ \sum_{K\in \mathcal{T}_h} \int_{\partial K} \mu p_h ~ds =0 ,$$
for any $q \in DRT_{k}$, $v\in DG_{k}$, $\mu \in M_k$. Here $M_k$ denotes the Lagrangian multiplier space, namely
$$M_k= \{\lambda \in L^{2}(\mathcal{E}_h)~|~ \lambda|_{e} \in P_{k}(e)~\forall e \in \mathcal{E}_h \}.$$
$\mathcal{T}_h$ is the set of all elements and $\mathcal{E}_h$ is the set of all edges.

Can I use the function space $M_k$ and the function space defined on element at the same time?

1 Answer

+1 vote
 
Best answer

Something like this?

cell = triangle

V = FiniteElement("DRT",cell,1)
P = FiniteElement("DG",cell,0)
L = FiniteElement("RT",cell,1)
W = MixedElement([V,P,L])

(u,p,la) = TrialFunctions(W)
(v,q,mu) = TestFunctions(W)

n = FacetNormal(cell)
a_1 = (inner(u,v) - p*div(v) - q*div(u))*dx    
a_2 = inner(avg(la),jump(n))*(inner(v("+"),n("+"))+inner(v("-"),n("-")))*dS
a_3 = inner(avg(mu),jump(n))*(inner(u("+"),n("+"))+inner(u("-"),n("-")))*dS
a = a_1 + a_2 + a_3
answered Jan 26, 2016 by szampini FEniCS Novice (510 points)
selected May 23, 2016 by civar77

Thank you very much. That's exactly what I want.

...