mixed function space of more than 2 subspaces

Asked by Nansi Xue

Hi,

I have a system of 3 coupled equations that I am trying to solve using FEniCS. I tried to create mixed function space with 3 subspaces, i.e.

V = FunctionSpace(mesh, "CG", 1)
ME = V*V*V

The multiplication sign seems to work only once and it can only create a mixed function space of 2 subspaces. How would one go about creating a mixed function space with more subspaces?

Thank you.

Nansi

Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Johan Hake
Solved:
Last query:
Last reply:
Revision history for this message
Best Johan Hake (johan-hake) said :
#1

On Friday July 8 2011 22:01:13 Nansi Xue wrote:
> New question #164237 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/164237
>
> Hi,
>
> I have a system of 3 coupled equations that I am trying to solve using
> FEniCS. I tried to create mixed function space with 3 subspaces, i.e.
>
> V = FunctionSpace(mesh, "CG", 1)
> ME = V*V*V

This reads:

  ME = (V*V)*V

So it will create a MixedFunctionSpace of one MixedFunctionSpace (V*V) and one
FunctionSpace (V).

From the doc string of MixedFunctionSpace:

   P1 = FunctionSpace(mesh, "CG", 1)
   P2v = VectorFunctionSpace(mesh, "Lagrange", 2)
   ME = MixedFunctionSpace([P2v, P1, P1, P1])

So in your case:

  ME = MixedFunctionSpace([V,V,V])

Johan

> The multiplication sign seems to work only once and it can only create a
> mixed function space of 2 subspaces. How would one go about creating a
> mixed function space with more subspaces?
>
> Thank you.
>
> Nansi

Revision history for this message
Nansi Xue (xue-nansi) said :
#2

Thanks Johan Hake, that solved my question.