dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #10990
Re: [HG DOLFIN] Added support for f.split()
On Sat, Dec 06, 2008 at 03:34:40PM +0100, Johan Hake wrote:
> On Saturday 06 December 2008 14:56:59 Anders Logg wrote:
> > On Sat, Dec 06, 2008 at 12:05:41PM +0100, DOLFIN wrote:
> > > One or more new changesets pushed to the primary dolfin repository.
> > > A short summary of the last three changesets is included below.
> > >
> > > changeset: 5262:0e349fbe09ce4179252652fe5c1d58725951bc3f
> > > tag: tip
> > > user: "Johan Hake <hake@xxxxxxxxx>"
> > > date: Sat Dec 06 12:05:42 2008 +0100
> > > files: demo/pde/stokes/taylor-hood/python/demo.py
> > > dolfin/function/SpecialFunctions.h dolfin/swig/dolfin_function_pre.i
> > > site-packages/dolfin/function.py description:
> > > Added support for f.split()
> > > - Renamed operator[] to f._sub instead of f.sub
> > > - f.sub(i) now returns an instantiated sub function
> > > - f.split() uses f.sub() to return a tuple of all sub functions
> > > - stoke/taylor-hood demo now runs.
> >
> > Excellent!
> >
> > It runs now but the solution looks completely crazy. The problem is
> > that the boundary conditions are not set correctly since we use V and
> > Q to set the boundary conditions for the sub systems and they don't
> > know the offsets (DofMap::offset()).
>
> The problem here is that these spaces need to be SubSpaces?
Yes.
> If that is the case, we could extract the subspaces after a MixedFunctionSpace
> is created and then store these in the spaces attribute, either as pure
> cpp.SubSpaces or add another python class, SubSpace, which is a cpp.SubSpace
> and stores the original ffc.element too, or something?
I was thinking something like this:
W = VectorFunctionSpace(mesh, "triangle", 2) + FunctionSpace(mesh, "triangle", 1)
V, Q = W.split()
The split function needs to both create SubSpaces (which will lead to
DofMaps with correct offsets) and set the element correctly, which can
be done by looking at the spaces attribute in MixedFunctionSpace.
It's a bit weird since what we really do is
V = VectorFunctionSpace(mesh, "triangle", 2)
Q = FunctionSpace(mesh, "triangle", 1)
W = V + Q
V, Q = W.split()
First, we put V and Q together to create a mixed function space. Then
we split W again into V and Q. After the split V and Q know that they
are part of the bigger space (at least they know the offset into the
bigger space).
The other option would be to let + have a side effect on V and Q but
that does not seem to be a good solution.
--
Anders
Attachment:
signature.asc
Description: Digital signature
Follow ups
References