← Back to team overview

dolfin team mailing list archive

[HG DOLFIN] Small fix to get Python working with new sub function logic.

 

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

changeset:   6834:b4eadde9a0349bde276dbd2e9b06e441a342e368
tag:         tip
user:        "Garth N. Wells <gnw20@xxxxxxxxx>"
date:        Sat Aug 22 19:54:54 2009 +0100
files:       dolfin/function/SpecialFunctions.h
description:
Small fix to get Python working with new sub function logic.


changeset:   6833:30ddf63b8a1e25a6234703f1d47736ab90602376
user:        "Garth N. Wells <gnw20@xxxxxxxxx>"
date:        Sat Aug 22 12:03:42 2009 +0100
files:       dolfin/fem/VariationalProblem.cpp dolfin/function/Function.cpp dolfin/function/Function.h dolfin/function/SpecialFunctions.h dolfin/function/SubFunctionData.h dolfin/function/dolfin_function.h dolfin/swig/dolfin_docstrings.i dolfin/swig/dolfin_headers.i
description:
Work on new sub Function logic.

The new logic is more consistent with conventions. Function::operator[](uint i) now returns a reference to the sub Function. A Function keeps track of its sub Functions. Therefore,

    Function& u0 = u[0];

and

   plot(u[0]);

do not involve copying a vector. u and u0 share the same vector. If a DofMap is renumbered after construction, the Function can make sure that all its sub Functions are modified accordingly. Likewise if the mesh is refined.

Assignment makes a deep copy, i.e. you will get a new copy of everything. Therefore with

  Function u0 = u[0];

a new vector will be created and u0 will not change when u changes.

What remains to be done is reseting the dof map for the reduced dimension of the subfunction and extracting vector components upon assignment. Eventually, for

  Function u0 = u[0];
  GenericVector& x = u0.vector();

the vector x will only contains components related to the sub function u0.


changeset:   6832:887eaeeb4e81b30cf5e2031c77bd2d77f1faed18
user:        "Garth N. Wells <gnw20@xxxxxxxxx>"
date:        Fri Aug 21 18:00:56 2009 +0100
files:       dolfin/fem/DofMap.cpp
description:
Comment out duplicated code in DofMap.

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