Subject: [FFC-dev] Question

From: Ali Mesforush <[email-masked]>
Date: Thu, 30 Apr 2009 10:40:55 +0200

Hello,
I run
ffc Heat.form (See attachment please)
and I got Heat.py, but when I run
python Heat.py
I have no output.
How can I run heat equation?
Cheers
/Ali
# Copyright (C) 2005-2007 Anders Logg ([email-masked])
# 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.form

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

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

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

---

From: Johan Hake <[email-masked]>
Date: Thu, 30 Apr 2009 13:57:27 +0200

> How can I run heat equation?

Ali!

A heat equation is actually not included in the demos, but it is very easy to 
make one from the more complex advection-diffusion demo, just remove anything 
that as to do with the velocity field.

The attached file is such a rework. Please run the file as:

  python heat.py

in the demo/pde/advection-diffusion directory, as it uses the mesh and 
subdomains in that directory.

Have fun!

Johan