1
# Copyright (C) 2005-2007 Anders Logg (logg@simula.no)
2
# Licensed under the GNU GPL version 3 or any later version
4
# The bilinear form a(v, u) and linear form L(v) for
5
# tensor-weighted Poisson's equation.
1
# Copyright (C) 2005-2007 Anders Logg
3
# This file is part of FFC.
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.
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.
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/>.
18
# The bilinear form a(u, v) for tensor-weighted Poisson's equation.
7
20
# Compile this form with FFC: ffc TensorWeightedPoisson.ufl
9
22
P1 = FiniteElement("Lagrange", triangle, 1)
10
23
P0 = TensorElement("Discontinuous Lagrange", triangle, 0, (2, 2))
12
26
v = TestFunction(P1)
14
27
f = Coefficient(P1)
16
29
C = Coefficient(P0)
18
a = inner(grad(v), C*grad(u))*dx
31
a = inner(C*grad(u), grad(v))*dx