Exception while trying to build an enriched Function Space (MINI-Element)


212
views
0
9 months ago by

Dear Community,

I get an exception in the following code snipped, where I try to build a MINI Element for solving the stokes equation.

from dolfin import *
mesh = UnitSquareMesh(32, 32)
#plot(mesh)
V = VectorElement("P", mesh.ufl_cell(), 1)
B = VectorElement("B", mesh.ufl_cell(), 3)
Q = FiniteElement("P", mesh.ufl_cell(), 1)
FunctionSpace(mesh, (V+B)*Q)

I compiled fenics from source using the current release branch. Therefore my fenics version is 2017.2.0. (I also tried the master branch but I get the same error)

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/dolfin/compilemodules/jit.py", line 142, in jit
    result = ffc.jit(ufl_object, parameters=p)
  File "/usr/lib/python3.6/site-packages/ffc/jitcompiler.py", line 218, in jit
    module = jit_build(ufl_object, module_name, parameters)
  File "/usr/lib/python3.6/site-packages/ffc/jitcompiler.py", line 134, in jit_build
    generate=jit_generate)
  File "/usr/lib/python3.6/site-packages/dijitso/jit.py", line 167, in jit
    header, source, dependencies = generate(jitable, name, signature, params["generator"])
  File "/usr/lib/python3.6/site-packages/ffc/jitcompiler.py", line 67, in jit_generate
    prefix=module_name, parameters=parameters, jit=True)
  File "/usr/lib/python3.6/site-packages/ffc/compiler.py", line 150, in compile_element
    prefix, parameters, jit)
  File "/usr/lib/python3.6/site-packages/ffc/compiler.py", line 190, in compile_ufl_objects
    ir = compute_ir(analysis, prefix, parameters, jit)
  File "/usr/lib/python3.6/site-packages/ffc/representation.py", line 171, in compute_ir
    for e in elements]
  File "/usr/lib/python3.6/site-packages/ffc/representation.py", line 171, in <listcomp>
    for e in elements]
  File "/usr/lib/python3.6/site-packages/ffc/representation.py", line 203, in _compute_element_ir
    fiat_element = create_element(ufl_element)
  File "/usr/lib/python3.6/site-packages/ffc/fiatinterface.py", line 103, in create_element
    elements = _extract_elements(ufl_element)
  File "/usr/lib/python3.6/site-packages/ffc/fiatinterface.py", line 301, in _extract_elements
    elements += _extract_elements(sub_element, restriction_domain)
  File "/usr/lib/python3.6/site-packages/ffc/fiatinterface.py", line 313, in _extract_elements
    elements += [create_element(ufl_element)]
  File "/usr/lib/python3.6/site-packages/ffc/fiatinterface.py", line 109, in create_element
    element = EnrichedElement(*elements)
  File "/usr/lib/python3.6/site-packages/FIAT/enriched.py", line 54, in __init__
    order = max(e.get_order() for e in elements)
TypeError: '>' not supported between instances of 'NoneType' and 'NoneType'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "Code_Snipped.py", line 6, in <module>
    FunctionSpace(mesh, (V+B)*Q)
  File "/usr/local/lib/python3.6/site-packages/dolfin/functions/functionspace.py", line 197, in __init__
    self._init_from_ufl(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/dolfin/functions/functionspace.py", line 218, in _init_from_ufl
    dolfin_element, dolfin_dofmap = _compile_dolfin_element(element, mesh, constrained_domain=constrained_domain)
  File "/usr/local/lib/python3.6/site-packages/dolfin/functions/functionspace.py", line 82, in _compile_dolfin_element
    ufc_element, ufc_dofmap = jit(element, mpi_comm=mesh.mpi_comm())
  File "/usr/local/lib/python3.6/site-packages/dolfin/compilemodules/jit.py", line 70, in mpi_jit
    return local_jit(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/dolfin/compilemodules/jit.py", line 147, in jit
    "ffc.jit failed with message:\n%s" % (tb_text,))
  File "/usr/local/lib/python3.6/site-packages/dolfin/cpp/common.py", line 2739, in dolfin_error
    return _common.dolfin_error(location, task, reason)
RuntimeError: 

*** -------------------------------------------------------------------------
*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at
***
***     fenics-support@googlegroups.com
***
*** Remember to include the error message listed below and, if possible,
*** include a *minimal* running example to reproduce the error.
***
*** -------------------------------------------------------------------------
*** Error:   Unable to perform just-in-time compilation of form.
*** Reason:  ffc.jit failed with message:
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/dolfin/compilemodules/jit.py", line 142, in jit
    result = ffc.jit(ufl_object, parameters=p)
  File "/usr/lib/python3.6/site-packages/ffc/jitcompiler.py", line 218, in jit
    module = jit_build(ufl_object, module_name, parameters)
  File "/usr/lib/python3.6/site-packages/ffc/jitcompiler.py", line 134, in jit_build
    generate=jit_generate)
  File "/usr/lib/python3.6/site-packages/dijitso/jit.py", line 167, in jit
    header, source, dependencies = generate(jitable, name, signature, params["generator"])
  File "/usr/lib/python3.6/site-packages/ffc/jitcompiler.py", line 67, in jit_generate
    prefix=module_name, parameters=parameters, jit=True)
  File "/usr/lib/python3.6/site-packages/ffc/compiler.py", line 150, in compile_element
    prefix, parameters, jit)
  File "/usr/lib/python3.6/site-packages/ffc/compiler.py", line 190, in compile_ufl_objects
    ir = compute_ir(analysis, prefix, parameters, jit)
  File "/usr/lib/python3.6/site-packages/ffc/representation.py", line 171, in compute_ir
    for e in elements]
  File "/usr/lib/python3.6/site-packages/ffc/representation.py", line 171, in <listcomp>
    for e in elements]
  File "/usr/lib/python3.6/site-packages/ffc/representation.py", line 203, in _compute_element_ir
    fiat_element = create_element(ufl_element)
  File "/usr/lib/python3.6/site-packages/ffc/fiatinterface.py", line 103, in create_element
    elements = _extract_elements(ufl_element)
  File "/usr/lib/python3.6/site-packages/ffc/fiatinterface.py", line 301, in _extract_elements
    elements += _extract_elements(sub_element, restriction_domain)
  File "/usr/lib/python3.6/site-packages/ffc/fiatinterface.py", line 313, in _extract_elements
    elements += [create_element(ufl_element)]
  File "/usr/lib/python3.6/site-packages/ffc/fiatinterface.py", line 109, in create_element
    element = EnrichedElement(*elements)
  File "/usr/lib/python3.6/site-packages/FIAT/enriched.py", line 54, in __init__
    order = max(e.get_order() for e in elements)
TypeError: '>' not supported between instances of 'NoneType' and 'NoneType'
.
*** Where:   This error was encountered inside jit.py.
*** Process: 0
*** 
*** DOLFIN version: 2017.2.0
*** Git changeset:  f0a95e4026c2d5807e36ba567edcc6ab46737489
*** -------------------------------------------------------------------------


Thanks in advance
Börge

Community: FEniCS Project

1 Answer


5
9 months ago by
from dolfin import *

mesh = UnitSquareMesh(32, 32)
P1 = FiniteElement("P", mesh.ufl_cell(), 1)
B3 = FiniteElement("B", mesh.ufl_cell(), 3)
FunctionSpace(mesh, ((P1+B3)*(P1+B3))*P1)


See Stokes MINI demo in the DOLFIN tree.

Thanks a lot! Sorry that I havn't found that
written 9 months ago by Börge Strümpfel  
Don't be sorry, the error message does not look helpful.
written 9 months ago by Jan Blechta  
Please login to add an answer/comment or follow this question.

Similar posts:
Search »