Argyris Elements - bug, or am I doing it wrong?

Asked by Christopher Laing on 2013-03-10

Hi guys,

Whenever I try to run any simulation with Argyris elements, I get the following error:

Traceback (most recent call last):
  File "", line 41, in <module>
    V = FunctionSpace(mesh, "ARG",5)
  File "/maybehome/claing/fenics/FEniCS/lib64/python2.7/site-packages/dolfin/functions/", line 353, in __init__
    FunctionSpaceBase.__init__(self, mesh, element)
  File "/maybehome/claing/fenics/FEniCS/lib64/python2.7/site-packages/dolfin/functions/", line 77, in __init__
    ufc_element, ufc_dofmap = jit(self._ufl_element)
  File "/maybehome/claing/fenics/FEniCS/lib64/python2.7/site-packages/dolfin/compilemodules/", line 66, in mpi_jit
    return local_jit(*args, **kwargs)
  File "/maybehome/claing/fenics/FEniCS/lib64/python2.7/site-packages/dolfin/compilemodules/", 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/", line 71, in jit
    return jit_element(ufl_object, parameters)
  File "/maybehome/claing/fenics/FEniCS/lib/python2.7/site-packages/ffc/", 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/", line 130, in jit_form
  File "/maybehome/claing/fenics/FEniCS/lib/python2.7/site-packages/ffc/", line 155, in compile_form
    ir = compute_ir(analysis, parameters, common_cell)
  File "/maybehome/claing/fenics/FEniCS/lib/python2.7/site-packages/ffc/", line 78, in compute_ir
    for (i, e) in enumerate(elements)]
  File "/maybehome/claing/fenics/FEniCS/lib/python2.7/site-packages/ffc/", line 131, in _compute_dofmap_ir
    num_dofs_per_entity = _num_dofs_per_entity(element)
  File "/maybehome/claing/fenics/FEniCS/lib/python2.7/site-packages/ffc/", line 492, in _num_dofs_per_entity
    return [len(entity_dofs[e][0]) for e in range(len(entity_dofs.keys()))]
KeyError: 0

This particular one was produced using the code with Argyris elements. The code is reproduced minimally below:

from dolfin import *

mesh = UnitSquare(32, 32)
V = FunctionSpace(mesh, "ARG",5)

def boundary(x):
    return x[0] < DOLFIN_EPS or x[0] > 1.0 - DOLFIN_EPS

u0 = Constant(0.0)
bc = DirichletBC(V, u0, boundary)

u = TrialFunction(V)
v = TestFunction(V)
f = Expression("10*exp(-(pow(x[0] - 0.5, 2) + pow(x[1] - 0.5, 2)) / 0.02)")
g = Expression("sin(5*x[0])")
a = inner(grad(u), grad(v))*dx
L = f*v*dx + g*v*ds

u = Function(V)
solve(a == L, u, bc)

Is this a bug, or do I just not understand how Argyris elements work?

Many thanks,


Question information

English Edit question
DOLFIN Edit question
No assignee Edit question
Solved by:
Marie Rognes
Last query:
Last reply:
Revision history for this message
Marie Rognes (meg-simula) said :

Argyris elements are not really supported throughout the FEniCS pipeline. This should probably be intercepted earlier however, and a more informative error message given.

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

Okay, what does this mean in a practical sense? Are they usable at all, or only in certain circumstances? I haven't been able to find anything in the documentation about it.

Revision history for this message
Best Marie Rognes (meg-simula) said :

It means that they are not really usable.

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

Ah, okay then, thanks.

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

Thanks Marie Rognes, that solved my question.