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

« back to all changes in this revision

Viewing changes to demo/pde/advection-diffusion/cpp/AdvectionDiffusion.ufl

  • Committer: Bazaar Package Importer
  • Author(s): Johannes Ring
  • Date: 2009-10-12 14:13:18 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20091012141318-hkbxl0sq555vqv7d
Tags: 0.9.4-1
* New upstream release. This version cleans up the design of the
  function class by adding a new abstraction for user-defined
  functions called Expression. A number of minor bugfixes and
  improvements have also been made.
* debian/watch: Update for new flat directory structure.
* Update debian/copyright.
* debian/rules: Use explicit paths to PETSc 3.0.0 and SLEPc 3.0.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (C) 2006-2007 Anders Logg.
 
2
# Licensed under the GNU LGPL Version 2.1.
 
3
#
 
4
# First added:  2006-02-09
 
5
# Last changed: 2007-04-30
 
6
#
 
7
# The bilinear form a(v, u) and linear form L(v) for
 
8
# convection-diffusion using cG(1)cG(1).
 
9
#
 
10
# Compile this form with FFC: ffc -l dolfin ConvectionDiffusion.form
 
11
 
 
12
scalar = FiniteElement("Lagrange", "triangle", 1)
 
13
vector = VectorElement("Lagrange", "triangle", 2)
 
14
 
 
15
v  = TestFunction(scalar)
 
16
u1 = TrialFunction(scalar)
 
17
u0 = Function(scalar)
 
18
b  = Function(vector)
 
19
f  = Function(scalar)
 
20
 
 
21
c = 0.005
 
22
k = 0.05
 
23
 
 
24
a = v*u1*dx + 0.5*k*(v*dot(b, grad(u1))*dx + c*dot(grad(v), grad(u1))*dx)
 
25
L = v*u0*dx - 0.5*k*(v*dot(b, grad(u0))*dx + c*dot(grad(v), grad(u0))*dx) + k*v*f*dx