~njansson/dolfin/hpc

« back to all changes in this revision

Viewing changes to demo/pde/poisson1D/cpp/Poisson.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) 2007 Kristian B. Oelgaard.
 
2
# Licensed under the GNU LGPL Version 2.1.
 
3
#
 
4
# First added:  2007
 
5
# Last changed: 2007-11-23
 
6
#
 
7
# The bilinear form a(v, U) and linear form L(v) for
 
8
# Poisson's equation.
 
9
#
 
10
# Compile this form with FFC: ffc -l dolfin Poisson.form.
 
11
 
 
12
element = FiniteElement("Lagrange", "interval", 1)
 
13
 
 
14
# Test and trial functions
 
15
v = TestFunction(element)
 
16
u = TrialFunction(element)
 
17
 
 
18
f = Function(element)
 
19
g = Function(element)
 
20
 
 
21
a = dot(grad(v), grad(u))*dx
 
22
L = v*f*dx + v*g*ds
 
23