Bubble enriched stabilization - problem with imported mesh

Hi,

I have a question regarding Bubble enriched stabilization. Namely, I have tried to implement it to a simple advection-diffusion equation example in 2D. The code works well if I use built-in mesh or mesh generated by mshr. However, if I import the mesh generated by pygmsh, the program crashes with the following error:

NotImplementedError: This element combination is not implemented

What could be a reason for this error? MWE is given bellow, while the mesh can be found here:

from dolfin import *
from mshr import *

Pe = Constant(1e10)
t_end = 10
dt = 0.1

# mesh = RectangleMesh(Point(0, 0), Point(1, 1), 10, 10, 'crossed')  # with this mesh, program works fine
mesh = Mesh('mesh.xml')		# importing externally generated mesh causes the error

CGE = FiniteElement("CG", mesh.ufl_cell(),1)
BE = FiniteElement("Bubble", mesh.ufl_cell(),3)
NEE = NodalEnrichedElement(CGE, BE)
V = FunctionSpace(mesh, NEE)

ic = Expression("((pow(x[0]-0.3, 2)+pow(x[1]-0.3, 2)) < 0.2*0.2)?(1.0):(0.0)", degree=1, domain=mesh)
b = Expression(("-(x[1]-0.5)", "(x[0]-0.5)"), degree=1, domain=mesh)
bc = DirichletBC(V, Constant(0.0), DomainBoundary())

v = TestFunction(V)
u = TrialFunction(V)
u0 = Function(V)
u0 = interpolate(ic, V )

F = (u - u0)/dt*v*dx + (1.0/Pe)*inner(grad(u), grad(v))*dx + inner(b, grad(u))* v *dx

file = File('output/u.pvd')

u = Function(V)
problem = LinearVariationalProblem(lhs(F), rhs(F), u, [bc])
solver  = LinearVariationalSolver(problem)

u.assign(u0)

t = 0.0
file << u

while t < t_end:
	solver.solve()
	file << u
	u0.assign(u)
	t += dt

So my first guess is that you didn’t prune the z-coordinate from your mesh, see: Converting simple 2D mesh from gmsh to dolfin I would also suggest to use XDMF, and not VTK to save your mesh, see: Transitioning from mesh.xml to mesh.xdmf, from dolfin-convert to meshio for usecases and syntax

You are right, I didn’t prune the z-coordinate. Thank you for the answer and a suggestion.