Boundaries are marked only partially

Asked by andrés León Baldelli

Hi everyone,
I'd like to use a MeshFunction to hold markers for the vertical boundaries of a domain. Inspecting the marked MeshFunction (with plot() and outputting it in vtk format), it seems that the vertical boundary gets marked only partially. It happens regardless of the size, number of elements, geometry (Rectangle, UnitSquare), side...
I've reproduced the issue on two machines with the code that follows.
Any suggestion about what is going wrong?

Cheers,

Andrés León Baldelli

ps: I'm using the stable version of FEniCS built with dorsal on a Darwin10.8 machine.

_____Begin Python Snippet______

from dolfin import *
import numpy as np
l = 1. # width of the cell
nx = 12 # n of elts in x[0] direction
mesh = UnitSquare(nx, nx)

class Left(SubDomain):
 def inside(self, x, on_boundary):
  return abs(x[0] - 1.) < DOLFIN_EPS and on_boundary

boundaries = MeshFunction("uint", mesh, mesh.topology().dim()-1)
boundaries.set_all(0)

G_Left = Left()

G_Left.mark(boundaries, 1)
plot(boundaries, interactive=True)

_____End Python Snippet______

Question information

Language:
English Edit question
Status:
Answered
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Marie Rognes (meg-simula) said :
#1

Hi,

The viper-based plotting of mesh functions defined over facets is rather broken,
cf this bug report:

  https://bugs.launchpad.net/fenics-viper/+bug/750232

However, storing to .pvd should work fine. Doing that, and looking
at the result in paraview works fine here.

Also note that you can inspect the values of the mesh function by for instance

  print boundaries.array()

Can you help with this problem?

Provide an answer of your own, or ask andrés León Baldelli for more information if necessary.

To post a message you must log in.