← Back to team overview

ufl team mailing list archive

[HG UFL] Implemented index handling in f.evaluate(...),

 

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

changeset:   494:559b56c81d00b46a55906227572dec78f06fe207
tag:         tip
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.


changeset:   492:982082a9d9df0fad6ceab20e57f7a734d7aae9ea
user:        "Martin Sandve Alnæs <martinal@xxxxxxxxx>"
date:        Sat Jan 10 15:14:29 2009 +0100
files:       ufl/algorithms/ufl2latex.py ufl/classes.py ufl/differentiation.py ufl/exproperators.py ufl/indexing.py ufl/tensors.py
description:
Removed AxisType, simplifying MultiIndex and related code a bit.
Indexing with an axis is now represented differently:

  A = <rank 2 tensor expression>
  b = A[i,:] # rank 1 expression with one free index

is the same as

  b = as_tensor(A[i,j], (j,))

or

  b = A[i,j](j)

using the previously checked in experimental syntax.

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