Debian Codegraph @

demo/BiharmonicRegge.ufl

raw
1 # Copyright (C) 2016 Lizao Li
2 #
3 # This file is part of FFC.
4 #
5 # FFC is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU Lesser General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # FFC is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU Lesser General Public License for more details.
14 #
15 # You should have received a copy of the GNU Lesser General Public License
16 # along with FFC. If not, see <http://www.gnu.org/licenses/>.
17 #
18 # The bilinear form a(u, v) and linear form L(v) for
19 # Biharmonic equation in Regge formulation.
20 #
21 # Compile this form with FFC: ffc -l dolfin BiharmonicRegge.ufl
22
23 REG = FiniteElement('Regge', tetrahedron, 1)
24 CG = FiniteElement('Lagrange', tetrahedron, 2)
25 mixed_element = REG * CG
26
27 (sigma, u) = TrialFunctions(mixed_element)
28 (tau, v) = TestFunctions(mixed_element)
29 f = Coefficient(CG)
30
31 def S(mu):
32 return mu - Identity(3) * tr(mu)
33
34 def b(mu, v):
35 n = FacetNormal(tetrahedron)
36 return inner(S(mu), grad(grad(v))) * dx \
37 - dot(dot(S(mu('+')), n('+')), n('+')) * jump(grad(v), n) * dS \
38 - dot(dot(S(mu), n), n) * dot(grad(v), n) * ds
39
40 a = inner(S(sigma), S(tau)) * dx - b(tau, u) + b(sigma, v)
41 L = f * v * dx