Assembling Matrices fails in 3D with high order Nedelec Curl Conforming Elements

Issue #469 resolved
Johann Heller created an issue

When assembling matrices with "N1curl" in 3D, the assembly fails for orders higher than 2. The problem is, that while the Stiffness Matrix (S) can be assembled in no time, the mass matrix (T) can not be assembled an the code is simply doing nothing and does not finish.

The folowing minimal code shows the problem:

from dolfin import*

mesh = UnitCubeMesh(2,2,2)

V =  FunctionSpace(mesh,"N1curl", 3)

u = TestFunction(V)
v = TrialFunction(V)

s = dot(curl(u),curl(v))*dx
t = dot(u, v)*dx

S = PETScMatrix()
T = PETScMatrix()

t_s = time()
assemble(s, tensor=S)
print time()-t_s

t_t = time()
assemble(t, tensor=T)
print time()-t_t

i have tried to change some parameters like the quadrature degree or some optimization parameters but nothing seems to work. I further tried to set the log level extremely low and it really looks like the code is doing exactly nothing.

The same code works fine for a 2D mesh with orders of >2. I also tried imported meshes and its the same here.

I also let the code run, for roughly one hour on a relatively powerful computer but the code still does not finish.

Kind regards

Johann

Comments (4)

  1. Johann Heller reporter

    It seems that after more than one hour, the code finishes. Still an odd behaviour, especially because for dot(curl(u),curl(v))dx he takes roughly no time, even though it seems more complicated than dot(u, v)dx. I believe that the time is spent in the compiler, because once the script has run through (in more than one hour), the execution takes under 1 second.

  2. Prof Garth Wells

    Your test code runs pretty fast for me. JIT of the curl-curl part takes a while (36s), but is faster when adding

    parameters["form_compiler"]["representation"] = "quadrature"
    

    Make sure you have the latest FFC and DOLFIN. Make sure you don't have FErari installed (FErari has been removed from the latest FFC).

  3. Johann Heller reporter

    You are correct i had Ferari installed, this fixes it. Thank you for the fast reply !

  4. Log in to comment