~njansson/dolfin/hpc

« back to all changes in this revision

Viewing changes to src/demo/pde/mixed-poisson/cpp/MixedPoisson.form

  • Committer: Johannes Ring
  • Date: 2008-03-05 22:43:06 UTC
  • Revision ID: johannr@simula.no-20080305224306-2npsdyhfdpl2esji
The BIG commit!

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2007 Anders Logg (logg@simula.no) and Marie Rognes (meg@math.uio.no)"
2
 
# Licensed under the GNU LGPL Version 2.1
3
 
#
4
 
# The bilinear form a(v, u) and linear form L(v) for
5
 
# a mixed formulation of Poisson's equation with BDM
6
 
# (Brezzi-Douglas-Marini) elements.
7
 
 
8
 
# Compile this form with FFC: ffc -l dolfin MixedPoisson.form
9
 
 
10
 
q = 1
11
 
 
12
 
BDM = FiniteElement("Brezzi-Douglas-Marini", "triangle", q)
13
 
DG  = FiniteElement("Discontinuous Lagrange", "triangle", q - 1)
14
 
 
15
 
mixed_element = BDM + DG
16
 
 
17
 
(tau, w) = TestFunctions(mixed_element)
18
 
(sigma, u) = TrialFunctions(mixed_element)
19
 
 
20
 
f = Function(DG)
21
 
 
22
 
a = (dot(tau, sigma) - div(tau)*u + w*div(sigma))*dx
23
 
L = w*f*dx