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
|