~ubuntu-branches/ubuntu/raring/ffc/raring

« back to all changes in this revision

Viewing changes to demo/AlgebraOperators.ufl

  • Committer: Bazaar Package Importer
  • Author(s): Johannes Ring
  • Date: 2010-07-01 19:54:32 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20100701195432-xz3gw5nprdj79jcb
Tags: 0.9.3-1
* New upstream release.
* debian/control:
  - Minor fix in Vcs fields.
  - Bump Standards-Version to 3.9.0 (no changes needed).
  - Update version for python-ufc, python-fiat, and python-ufl in
    Depends field.
* Switch to dpkg-source 3.0 (quilt) format.
* Update debian/copyright and debian/copyright_hints.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (C) 2010 Kristian B. Oelgaard (k.b.oelgaard@gmail.com)
 
2
# Licensed under the GNU GPL version 3 or any later version
 
3
#
 
4
# Test all algebra operators on Coefficients.
 
5
#
 
6
# Compile this form with FFC: ffc AlgebraOperators.ufl
 
7
 
 
8
element = FiniteElement("Lagrange", triangle, 1)
 
9
 
 
10
c0 = Coefficient(element)
 
11
c1 = Coefficient(element)
 
12
 
 
13
s0 = c0 - c1
 
14
p0 = c0*c1
 
15
f0 = c0/c1
 
16
 
 
17
integrand = 5*c0 + 5*p0 + 5*f0\
 
18
          + s0*c0 + s0*p0 + s0*f0\
 
19
          + 5/c0 + 5/p0 + 5/f0\
 
20
          + s0/c0 + s0/p0 + s0/f0\
 
21
          + s0/5 + s0/5 + s0/5\
 
22
          + c0**2 + s0**2 + p0**2 + f0**2\
 
23
          + c1**2.2 + s0**2.2 + p0**2.2 + f0**2.2\
 
24
          + c0**c1 + s0**c0 + p0**c0 + f0**c0\
 
25
          + c0**s0 + s0**p0 + p0**f0 + f0**p0\
 
26
          + abs(c0) + abs(s0) + abs(p0) + abs(f0)
 
27
 
 
28
a = integrand*dx
 
29