← Back to team overview

dolfin team mailing list archive

Re: Crouzeix-Raviart error

 

On Mon, Apr 28, 2008 at 03:00:26PM +0200, Marie Rognes wrote:
> 
> Error:
> 
>     Traceback (most recent call last):
>       File "test.py", line 33, in ?
>         u0.assign(w)
>       File
>     "/home/meg/src/dolfin/dolfin/local/lib/python2.4/site-packages/dolfin/dolfin.py",
>     line 3172, in assign
>         return _dolfin.cpp_Function_assign(*args)
>     RuntimeError: *** Error: Unable to find finite element in library:
>     "Mixed finite element: [Crouzeix-Raviart finite element of degree 1
>     on a triangle, Crouzeix-Raviart finite element of degree 1 on a
>     triangle]".
>     Segmentation fault
> 
> 
> Code:
> 
>     from dolfin import *
> 
>     # Geometry of the domain and mesh
>     shape = "triangle"
>     mesh = UnitSquare(16, 16)
> 
>     # Setting up the elements
>     V = VectorElement("CR", shape, 1)
> 
>     u0 = Function(V, mesh, 0.0)
> 
>     v = TestFunction(V)
>     u = TrialFunction(V)
>     a = dot(grad(u), grad(v))*dx
>     L = dot(u0, v)*dx
> 
>     pde = LinearPDE(a, L, mesh)
>     w = pde.solve()
>     u0.assign(w)
> 
>    
> Easy fix?

Probably not. The message comes from the copy constructor (in C++) of
DiscreteFunction, which looks in the list of precompiled elements and
that list does not include vector-valued CR elements.

I'll see if I can find the problem. You are doing this from Python so
it should be possible to get around this problem and not need to
create the element from precompiled code.

-- 
Anders


Follow ups

References