File: Heat.ufl

package info (click to toggle)
ffc 0.9.3-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 31,928 kB
  • ctags: 5,610
  • sloc: cpp: 200,834; python: 14,417; perl: 351; makefile: 21; sh: 6
file content (19 lines) | stat: -rw-r--r-- 656 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Copyright (C) 2005-2007 Anders Logg (logg@simula.no)
# Licensed under the GNU GPL version 3 or any later version
#
# The bilinear form a(v, u1) and linear form L(v) for
# one backward Euler step with the heat equation.
#
# Compile this form with FFC: ffc Heat.ufl

element = FiniteElement("Lagrange", triangle, 1)

v  = TestFunction(element)  # Test function
u1 = TrialFunction(element) # Value at t_n
u0 = Coefficient(element)      # Value at t_n-1
c  = Coefficient(element)      # Heat conductivity
f  = Coefficient(element)      # Heat source
k  = Constant(triangle)   # Time step

a = v*u1*dx + k*c*inner(grad(v), grad(u1))*dx
L = v*u0*dx + k*v*f*dx