This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

CellAvg causes KeyError: 'FE0_C0_D10_AC'

0 votes

Hi,

I attempted to use the CellAvg class from ufl.restriction and got the KeyError stated in the headline. A (hopefully) minimal example that generates the error is given below:

import dolfin as dlf

from ufl.restriction import CellAvg

# Generate mesh                                                                                                                                                                                                   
mesh = dlf.UnitSquareMesh(4, 4)

# Function Space                                                                                                                                                                                                  
vecFuncSpace = dlf.VectorFunctionSpace(mesh, 'CG', 1)

# Functions                                                                                                                                                                                                       
u = dlf.Function(vecFuncSpace)
v = dlf.TestFunction(vecFuncSpace)

# Kinematics                                                                                                                                                                                                      
I = dlf.Identity(u.geometric_dimension())
F = I + dlf.grad(u)
J = dlf.det(F)

kappa = dlf.Constant(1e3)
p = kappa*(J - 1.0)

form = CellAvg(p) * dlf.div(v) * dlf.dx
b = dlf.assemble(form) # Error

This code gave me the error:

KeyError: 'FE0_C0_D10_AC'

I am using

In [17]: dlf.__version__
Out[17]: '1.6.0'

I came across this in an attempt to formulate static condensation for an incompressible hyper-elastic material, which I realize has been submitted as an issue here. I also found this, but don't see a way to download the file uploaded by "Kent-Andre Mardal (kent-and)".

asked Jul 28, 2016 by miguelr FEniCS Novice (420 points)
...