← Back to team overview

dolfin team mailing list archive

Re: [Question #147504]: Subfunction does not work any more

 

Question #147504 on DOLFIN changed:
https://answers.launchpad.net/dolfin/+question/147504

Johan Hake proposed the following answer:
On Wednesday March 2 2011 16:31:48 Marijke Habermann wrote:
> Question #147504 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/147504
> 
> Marijke Habermann requested for more information:
> I have a related question: How can I create the same function p =
> Function(V2) when I can only access W directly? Do I need to use the
> 'collapse_sub_spaces' method, and if so, what are the necessary arguments?

We have discussed this extensively in:

  https://bugs.launchpad.net/dolfin/+bug/681415

but we did never conclude...

A hack that might work for you can be:

  spaces = [V1, V2]
  W = MixedFunctionSpace(spaces)
  W.spaces = spaces

...

  u0 = Function(W.spaces[0])

This will only work in the Python interface.

Johan

-- 
You received this question notification because you are a member of
DOLFIN Team, which is an answer contact for DOLFIN.