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

problem with Fenics 1.4.0

–2 votes

Hi i'm having problems with Fenics 1.4.0, my code was working with the previous version. I have this error and I have no idea what is the problem, can you help? Here is the error. Thank you.

Traceback (most recent call last):
File "robin.py", line 594, in
LV = assemble(L)
File "/usr/site-local/FEniCS-1.4.0/lib64/python2.7/site-packages/dolfin/fem/assembling.py", line 230, in assemble
cell_domains, exterior_facet_domains, interior_facet_domains)
File "/usr/site-local/FEniCS-1.4.0/lib64/python2.7/site-packages/dolfin/fem/assembling.py", line 80, in _create_dolfin_form
mesh=mesh)
File "/usr/site-local/FEniCS-1.4.0/lib64/python2.7/site-packages/dolfin/fem/form.py", line 98, in init
= jit(form, form_compiler_parameters)
File "/usr/site-local/FEniCS-1.4.0/lib64/python2.7/site-packages/dolfin/compilemodules/jit.py", line 62, in mpi_jit
return local_jit(*args, **kwargs)
File "/usr/site-local/FEniCS-1.4.0/lib64/python2.7/site-packages/dolfin/compilemodules/jit.py", line 126, in jit
return jit_compile(form, parameters=p)
File "/usr/site-local/FEniCS-1.4.0/lib64/python2.7/site-packages/ffc/jitcompiler.py", line 77, in jit
return jit_form(ufl_object, parameters)
File "/usr/site-local/FEniCS-1.4.0/lib64/python2.7/site-packages/ffc/jitcompiler.py", line 103, in jit_form
form_data = form.compute_form_data()
File "/usr/site-local/FEniCS-1.4.0/lib/python2.7/site-packages/ufl/form.py", line 169, in compute_form_data
self._form_data = preprocess(self, object_names=object_names)
File "/usr/site-local/FEniCS-1.4.0/lib/python2.7/site-packages/ufl/algorithms/preprocess.py", line 149, in preprocess
form_data.subdomain_data = join_subdomain_data(form.integrals(), form.domains())
File "/usr/site-local/FEniCS-1.4.0/lib/python2.7/site-packages/ufl/algorithms/preprocess.py", line 98, in join_subdomain_data
l = l2l[None]
KeyError: None

asked Jul 1, 2014 by Antoine FEniCS Novice (810 points)

Please provide the form for L.

Please edit your question and include a complete but minimal example that reproduces the problem.

Thank you, actually I found a solution to the problem but I can not explain what was the problem exactly. The form L is too complicated to reproduce here but I will try to explain in a simple way what I did to solve the problem, maybe you have an explanation.

So I have a domain Omega, let's say a square with a rectangle mesh.

mesh = RectangleMesh(0, 0, 1, 1, N, N)

The associated measure is called:

dtotal = Measure("dx")

Then this domain is splitted in two domains Omega0 and Omega1, marked 0 and 1, respectively, and I define the associated measures:

dx = Measure("dx")[domains]

Then I am defining a form L using a sum, for instance to make it simple:

for k  in range(0,10):
    L +=  u[k]**2 * dtotal + u[k] * dx(0)

but I need to initialize L, so I add before that

L     = 0 * psi * dx(0)

where psi is some appropriate test function.

This initialization of L was actually creating the mistake. I changed it to

L     = 0 * psi * dtotal

so in other words, using the measure of the larger domain and now it is fine. In the previous version of Fenics there was no problem with this.

cheers

...