← Back to team overview

ufl team mailing list archive

[HG UFL] Implemented support for implicit sums of tensor

 

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

changeset:   495:cf4de6795ca6c369314983e26bed0aa58e783e8d
tag:         tip
user:        "Martin Sandve Alnæs <martinal@xxxxxxxxx>"
date:        Mon Jan 12 11:07:12 2009 +0100
files:       test/indices.py test/test.py ufl/indexing.py
description:
Implemented support for implicit sums of tensor
expressions in Indexed, not only scalars.
This makes v.dx(i)[i] and A[i,:][i] valid
expressions. Altough these look a bit weird,
they are perfectly valid operations that
will be documented clearly using pen-and-paper
syntax.


changeset:   494:559b56c81d00b46a55906227572dec78f06fe207
user:        "Martin Sandve Alnæs <martinal@xxxxxxxxx>"
date:        Sat Jan 10 18:22:59 2009 +0100
files:       ufl/algorithms/ad.py ufl/exproperators.py ufl/indexing.py ufl/tensors.py ufl/terminal.py
description:
Implemented index handling in f.evaluate(...),
and support for callables in argument mapping:

def N(x):
    return x[0]**2 + x[1]
f = Function(element)
a = f**2
b = a((1.0, 2.0), { f: N })

We can test a lot of things easier now.
It should also evaluate derivatives w.r.t. functions and variables.
Derivatives of (basis) functions are more tricky to do simply.


changeset:   493:2417909fd4fb81a9890f726c0f82efb942a2edb0
user:        "Martin Sandve Alnæs <martinal@xxxxxxxxx>"
date:        Sat Jan 10 17:25:39 2009 +0100
files:       ufl/algebra.py ufl/conditional.py ufl/expr.py ufl/exproperators.py ufl/geometry.py ufl/indexing.py ufl/mathfunctions.py ufl/restriction.py ufl/scalar.py ufl/tensoralgebra.py ufl/tensors.py ufl/terminal.py ufl/variable.py ufl/zero.py
description:
Implemented Expr.evaluate function, evoced by __call__  operator like this:

  x = cell.x
  f = Function(element)
  a = x[0]*f**2
  x = (1.0, 2.0)
  b = a(x, { f: 7 })

Some types are not implemented yet.
We could allow something else than scalar
values in argument mapping (the {f:7} part),
for example a callable that takes x as input.

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