~ubuntu-branches/ubuntu/maverick/dolfin/maverick

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Johannes Ring
  • Date: 2008-09-16 08:41:20 UTC
  • Revision ID: james.westby@ubuntu.com-20080916084120-i8k3u6lhx3mw3py3
Tags: upstream-0.9.2
ImportĀ upstreamĀ versionĀ 0.9.2

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