~njansson/dolfin/hpc

« back to all changes in this revision

Viewing changes to src/demo/pde/nonlinear-poisson/cpp/NonlinearPoisson.py

  • 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
 
from ffc import *
2
 
 
3
 
# Reserved variables for forms
4
 
(a, L, M) = (None, None, None)
5
 
 
6
 
# Reserved variable for element
7
 
element = None
8
 
 
9
 
# Copyright (C) 2005 Garth N. Wells.
10
 
# Licensed under the GNU LGPL Version 2.1.
11
 
#
12
 
# The linearised bilinear form a(v, U) and linear form L(v) for
13
 
# the nonlinear equation - div (1+u^2) grad u = f
14
 
#
15
 
# Compile this form with FFC: ffc NonlinearPoisson.form.
16
 
 
17
 
element = FiniteElement("Lagrange", "triangle", 1)
18
 
 
19
 
v = TestFunction(element)
20
 
U = TrialFunction(element)
21
 
U0= Function(element)
22
 
f = Function(element)
23
 
 
24
 
a = v.dx(i)*(1+U0*U0)*U.dx(i)*dx + v.dx(i)*2*U0*U*U0.dx(i)*dx
25
 
L = v*f*dx - v.dx(i)*(1+U0*U0)*U0.dx(i)*dx
26
 
 
27
 
compile([a, L, M, element], "NonlinearPoisson", "tensor", "dolfin", {'quadrature_points=': False, 'blas': False, 'precision=': '15', 'optimize': False})