Numbering of DG0 Elements in 1.0.0 vs 1.1.0
Hallo,
when I did the upgrade on 1.1.0 I had to realize that one of my code isn't working anymore. It seems that the numbering of the DG0 Elements has changed. Is this a known issue and if yes, what is the idea to do instead, since this method is proposed in a similar way in the fenics book on page 69.
I added a commented minimum running example.
Thanks for your reply in advance,
Thomas
-------
from dolfin import *
# Create a small mesh, if we stay here everything goes fine.
mesh = UnitSquare(4,4)
# We are doing some Refinement to produce the failure.
V = FunctionSpace(mesh, "CG", 1)
while V.dim() < 150:
dummy_markers = MeshFunction(
for c in cells(mesh):
mesh = refine(mesh, dummy_markers)
V = FunctionSpace(mesh, "CG", 1)
# We creat a simple marker. It is a small 2x2 chessboard.
f = Expression(
LocalSpace = FunctionSpace(mesh, "DG", 0)
w = TestFunction(
form_estimator = f*w*dx
estimator = assemble(
# Create a meshfunction and set it to false
markers = MeshFunction(
for c in cells(mesh):
markers[c] = False
# Try to mark regions with positive values of the estimator,
# this was fine with version 1.0.0, but not with version 1.1.0.
for c in cells(mesh):
if (estimator[
markers[c] = True
# Here we can see the difference.
# Normally four square regions should be marked.
# But with version 1.1.0 everything seems to get mixed up.
plot(markers)
interactive()
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Thomas Fraunholz
- Solved:
- Last query:
- Last reply: