← Back to team overview

ffc team mailing list archive

[HG FFC] Enable multiplication of vector expressions with numeric constants

 

One or more new changesets pushed to the primary ffc repository.
A short summary of the last three changesets is included below.

changeset:   1037:467fda41f02d0d17ebba336b5c4665bb91a32bcc
tag:         tip
user:        "Anders Logg <logg@xxxxxxxxx>"
date:        Sat Dec 29 00:12:11 2007 +0100
files:       ChangeLog src/ffc/compiler/language/algebra.py
description:
Enable multiplication of vector expressions with numeric constants
(expression must no longer be scalar). Simplifies expressions like
u = 0.5*(u0 + u1) when u0 and u1 are vectors.


changeset:   1036:552b9dcf9b4d9284801a055185ffa4ec5600d3ed
user:        "Anders Logg <logg@xxxxxxxxx>"
date:        Fri Dec 21 16:12:02 2007 +0100
files:       ChangeLog TODO
description:
Update TODO list (need to write about lhs and rhs in manual)


changeset:   1035:58408592ef41fcd301bddf270dcd101d50530cf9
user:        "Anders Logg <logg@xxxxxxxxx>"
date:        Fri Dec 21 16:10:04 2007 +0100
files:       src/demo/Equation.form src/ffc/compiler/language/operators.py src/test/regression/reference/Equation.h
description:
Add new operators lhs() and rhs() for simple extraction of
left- and right-hand sides for nontrivial forms (no need to
manually shuffle terms to the right-hand side).

Example: cG(1) time-stepping for the heat equation

Instead of writing

  a = v*u*dx + 0.5*k*dot(grad(v), grad(u))*dx
  L = v*u0*dx - 0.5*k*dot(grad(v), grad(u0))*dx

one may write

  F = v*(u - u0)*dx + k*dot(grad(v), grad(0.5*(u0 + u)))*dx

and then

  a = lhs(F)
  L = rhs(F)

----------------------------------------------------------------------
For more details, visit http://www.fenics.org/hg/ffc