← Back to team overview

dolfin team mailing list archive

[HG DOLFIN] A clean up in assemble.py

 

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

changeset:   4382:d4298f265081fa56f328adc582f9487308cd91d0
tag:         tip
user:        "Johan Hake <hake@xxxxxxxxx>"
date:        Thu Jul 03 20:57:05 2008 +0200
files:       site-packages/dolfin/assemble.py
description:
A clean up in assemble.py
  - Putted code for extracting coeffisients in own function
  - Added the parameter "form compiler", which can be set by, e.g.,
    dolfin_set("form compiler","ffc")
  - Dolfin assume that the form compiler implements the jit function, which takes
    a form as first argument and an optional option parameter as second argument.
  - The options parameter is optional. If provided it must be a dict that is
    handed directly to the registered form compilers jit function.
  - Added a private function _jit(form, options) which uses the jit compiler
    that is provided by the module, registered in dolfin_get("form compiler").
  - This commit requires that also ffc is updated to newest version, as the jit
    interface needed to be updated.


changeset:   4381:6506b99339a4096cde9e8ad0290071c8c42f881c
user:        "Martin Sandve Alnæs <martinal@xxxxxxxxx>"
date:        Mon Jul 07 19:14:23 2008 +0200
files:       dolfin/swig/dolfin_la_post.i
description:
Implemented x.array() and A.array() for GenericVector and GenericMatrix in PyDOLFIN,
both returning a numpy array with a copy of the data. (NB! dense matrix!).

Try f.ex.:

In [7]: A = assemble(u*v*dx, mesh)

In [8]: B = A.array()

In [12]: import scipy.linalg

In [13]: scipy.linalg.eigvals(B)
Out[13]:
array([ 0.08803702+0.j,  0.05652695+0.j,  0.05015566+0.j,  0.06728417+0.j,
        0.01369043+0.j,  0.01388889+0.j,  0.00755545+0.j,  0.02386164+0.j,
        0.02406092+0.j,  0.02966277+0.j,  0.01663435+0.j,  0.00759757+0.j,
        0.03219184+0.j,  0.02969543+0.j,  0.02255606+0.j,  0.01660086+0.j])


changeset:   4380:1d6869e94def00a759eb52388443f606781d108c
user:        "Martin Sandve Alnæs <martinal@xxxxxxxxx>"
date:        Mon Jul 07 11:12:16 2008 +0200
files:       dolfin/function/ConstantFunction.cpp dolfin/function/ConstantFunction.h dolfin/function/Function.cpp dolfin/function/Function.h dolfin/swig/dolfin_common_post.i dolfin/swig/dolfin_function_pre.i site-packages/dolfin/__init__.py
description:
Changed syntax of constant vector and tensor functions to use Array.
The following are equivalent and generalizes in the obvious way:

Function(mesh, 2, 0.0);

Array<real> values(0.0, 0.0);
Function(mesh, values);

Array<uint> shape(2);
Array<real> values(0.0, 0.0);
Function(mesh, shape, values);

In Python, the typemaps doesn't seem to pick up lists,
so the corresponding syntax there is currently:

f = Function(mesh, 2, 0.0)

f = Function(mesh, ArrayDouble(0.0, 0.0))

f = Function(mesh, ArrayUInt(2), ArrayDouble(0.0, 0.0))

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