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

adaptive solver with an error: Order "1" invalid for "Real" finite element

+1 vote

Hi,
I'm dealing with the solution of the forward facing step flow and I'm using mixed element and function spaces for the velocity, pressure and the lagrange multiplier(for the pressure). When I use the adaptive solver it fails with the error:

Order "1" invalid for "Real" finite element.
I found a question posted but it doesn't solve my problem either.
auto adaptive solver for ...

The elements and spaces that I generate are given below:

V_element = VectorElement('CG', triangle, 2)
Q_element = FiniteElement('CG', triangle, 1)
R_element = FiniteElement('R', triangle, 0)
W_element = MixedElement([V_element,Q_element,R_element])
W = FunctionSpace(mesh, W_element)

v, q, d = TestFunctions(W)
w = Function(W)
u, p, c = split(w)

F = ...
J = derivative(F,w)
pde = NonlinearVariationalProblem(F,w,bcs,J)
M = inner(w,w)*dx
solver = AdaptiveNonlinearVariationalSolver(pde,M)
solver.solve(tol)

Thanks in advance,
Cansu.

asked May 22, 2017 by cevcin FEniCS Novice (130 points)

Hi, the problem you see is the same as discussed in the thread you linked. This is a bug in FEniCS which apparently wasn't resolved properly. Therefor consider (re)opening the issue on bitbucket.

Thanks for your advice,
I reported it.
Hopefully, it can be solved soon.

Have you tried using DG elements instead? AFAIK the 'R' element is used for global constants (that's how I've been using them), so I would declare them as

R_element = FiniteElement('R', triangle, 0, 5)

where 5 would be the number of global coefficients. Best regards.

...