Too many spaces for MixedFunctionSpace to handle?

Asked by Christopher Laing

Hello everyone,

I am trying to solve a problem in which I need to fix only one element of a vector function. I cannot find a way to use DirichletBC to do this, so I am having to use many Lagrange multipliers instead.

The following code compiles and solves just fine:

from dolfin import *

mesh = Mesh('mesh_lc=0.100000.xml')

V = VectorFunctionSpace(mesh, "CG", 2, dim=3)
R = FunctionSpace(mesh, "R", 0)
W = MixedFunctionSpace([V,R,R,R,R,R,R])

However, when I add another lagrange multiplier, like so:
W = MixedFunctionSpace([V,R,R,R,R,R,R,R])

I get the following error:

Traceback (most recent call last):
  File "mfstest.py", line 7, in <module>
    W = MixedFunctionSpace([V,R,R,R,R,R,R,R])
  File "/maybehome/claing/fenics/FEniCS/lib64/python2.7/site-packages/dolfin/functions/functionspace.py", line 453, in __init__
    FunctionSpaceBase.__init__(self, spaces[0].mesh(), element)
  File "/maybehome/claing/fenics/FEniCS/lib64/python2.7/site-packages/dolfin/functions/functionspace.py", line 77, in __init__
    ufc_element, ufc_dofmap = jit(self._ufl_element)
  File "/maybehome/claing/fenics/FEniCS/lib64/python2.7/site-packages/dolfin/compilemodules/jit.py", line 66, in mpi_jit
    return local_jit(*args, **kwargs)
  File "/maybehome/claing/fenics/FEniCS/lib64/python2.7/site-packages/dolfin/compilemodules/jit.py", line 154, in jit
    return jit_compile(form, parameters=p, common_cell=common_cell)
  File "/maybehome/claing/fenics/FEniCS/lib/python2.7/site-packages/ffc/jitcompiler.py", line 71, in jit
    return jit_element(ufl_object, parameters)
  File "/maybehome/claing/fenics/FEniCS/lib/python2.7/site-packages/ffc/jitcompiler.py", line 178, in jit_element
    compiled_form, module, form_data, prefix = jit_form(form, parameters)
  File "/maybehome/claing/fenics/FEniCS/lib/python2.7/site-packages/ffc/jitcompiler.py", line 106, in jit_form
    compiled_form = _extract_form(module, prefix)
  File "/maybehome/claing/fenics/FEniCS/lib/python2.7/site-packages/ffc/jitcompiler.py", line 207, in _extract_form
    return getattr(module, prefix + "_form_0")()
AttributeError: 'module' object has no attribute 'ffc_form_5aeaa2517dce1c71f4efd396b95ac54760a86102_form_0'

Any help is appreciated.

NB: I am also posting a separate question regarding the use of Dirichlet conditions on only one element of a vector function.

Cheers,

Christopher

Question information

Language:
English Edit question
Status:
Solved
For:
FEniCS Project Edit question
Assignee:
No assignee Edit question
Solved by:
Kent-Andre Mardal
Solved:
Last query:
Last reply:
Revision history for this message
Best Kent-Andre Mardal (kent-and) said :
#1

Strange. Could you do 'instant-clean' to clear the cache and try again? It
works perfect here.

Kent

On 31 July 2012 03:56, Christopher Laing <
<email address hidden>> wrote:

> New question #204619 on FEniCS Project:
> https://answers.launchpad.net/fenics/+question/204619
>
> Hello everyone,
>
> I am trying to solve a problem in which I need to fix only one element of
> a vector function. I cannot find a way to use DirichletBC to do this, so I
> am having to use many Lagrange multipliers instead.
>
> The following code compiles and solves just fine:
>
> from dolfin import *
>
> mesh = Mesh('mesh_lc=0.100000.xml')
>
> V = VectorFunctionSpace(mesh, "CG", 2, dim=3)
> R = FunctionSpace(mesh, "R", 0)
> W = MixedFunctionSpace([V,R,R,R,R,R,R])
>
> However, when I add another lagrange multiplier, like so:
> W = MixedFunctionSpace([V,R,R,R,R,R,R,R])
>
> I get the following error:
>
> Traceback (most recent call last):
> File "mfstest.py", line 7, in <module>
> W = MixedFunctionSpace([V,R,R,R,R,R,R,R])
> File
> "/maybehome/claing/fenics/FEniCS/lib64/python2.7/site-packages/dolfin/functions/functionspace.py",
> line 453, in __init__
> FunctionSpaceBase.__init__(self, spaces[0].mesh(), element)
> File
> "/maybehome/claing/fenics/FEniCS/lib64/python2.7/site-packages/dolfin/functions/functionspace.py",
> line 77, in __init__
> ufc_element, ufc_dofmap = jit(self._ufl_element)
> File
> "/maybehome/claing/fenics/FEniCS/lib64/python2.7/site-packages/dolfin/compilemodules/jit.py",
> line 66, in mpi_jit
> return local_jit(*args, **kwargs)
> File
> "/maybehome/claing/fenics/FEniCS/lib64/python2.7/site-packages/dolfin/compilemodules/jit.py",
> line 154, in jit
> return jit_compile(form, parameters=p, common_cell=common_cell)
> File
> "/maybehome/claing/fenics/FEniCS/lib/python2.7/site-packages/ffc/jitcompiler.py",
> line 71, in jit
> return jit_element(ufl_object, parameters)
> File
> "/maybehome/claing/fenics/FEniCS/lib/python2.7/site-packages/ffc/jitcompiler.py",
> line 178, in jit_element
> compiled_form, module, form_data, prefix = jit_form(form, parameters)
> File
> "/maybehome/claing/fenics/FEniCS/lib/python2.7/site-packages/ffc/jitcompiler.py",
> line 106, in jit_form
> compiled_form = _extract_form(module, prefix)
> File
> "/maybehome/claing/fenics/FEniCS/lib/python2.7/site-packages/ffc/jitcompiler.py",
> line 207, in _extract_form
> return getattr(module, prefix + "_form_0")()
> AttributeError: 'module' object has no attribute
> 'ffc_form_5aeaa2517dce1c71f4efd396b95ac54760a86102_form_0'
>
> Any help is appreciated.
>
> NB: I am also posting a separate question regarding the use of Dirichlet
> conditions on only one element of a vector function.
>
> Cheers,
>
> Christopher
>
>
> --
> You received this question notification because you are a member of
> FEniCS Team, which is an answer contact for FEniCS Project.
>

Revision history for this message
Christopher Laing (9e9o1k-chris) said :
#2

Hi Kent,

That cured it. Thank you very much!

Christopher

Revision history for this message
Christopher Laing (9e9o1k-chris) said :
#3

Thanks Kent-Andre Mardal, that solved my question.