Plots of mesh functions over facets look wrong

Bug #750232 reported by Marie Rognes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
DOLFIN
Fix Released
Undecided
Joachim Haga
Viper
Won't Fix
High
Joachim Haga

Bug Description

Plots of mesh functions over facets look wrong (and sometimes very wrong). A simple example is provided below.

from dolfin import *

mesh = UnitSquare(8, 8)

class Right(SubDomain):
    def inside(self, x, on_boundary):
        return x[0] < DOLFIN_EPS

right = Right()
mf = MeshFunction("uint", mesh, 1)
mf.set_all(0)
right.mark(mf, 1)

plot(mf, interactive=True)

Revision history for this message
Anders Logg (logg) wrote :

In the meantime, write to a VTK file and open in Paraview. That should work better.

Changed in fenics-viper:
status: New → Confirmed
importance: Undecided → Medium
importance: Medium → High
Revision history for this message
Garth Wells (garth-wells) wrote :

This works 'properly' via a VTK file, whereas Viper performs an interpolation which makes the output impossible to properly interpret at boundaries where the MeshFunction value changes. Since it is supported via VTK, the easiest 'fix' would be to disable plotting of MeshFunctions via Viper.

Revision history for this message
Anders Logg (logg) wrote : Re: [Bug 750232] Re: Plots of mesh functions over facets look wrong

On Tue, May 03, 2011 at 11:31:22AM -0000, Garth Wells wrote:
> This works 'properly' via a VTK file, whereas Viper performs an
> interpolation which makes the output impossible to properly interpret at
> boundaries where the MeshFunction value changes. Since it is supported
> via VTK, the easiest 'fix' would be to disable plotting of MeshFunctions
> via Viper.

I don't think that's a good fix. I would prefer if plotting
MeshFunctions on facets would issue a warning.

--
Anders

Joachim Haga (jobh)
Changed in fenics-viper:
assignee: nobody → Joachim Haga (jobh)
status: Confirmed → In Progress
Revision history for this message
Joachim Haga (jobh) wrote :

Just a heads-up. This was supposed to be fixed in dolfin with the recent plot-c++ merge, but it still looks wonky. I'll get it sorted out asap.

Changed in dolfin:
status: New → Confirmed
Changed in fenics-viper:
status: In Progress → Won't Fix
Changed in dolfin:
assignee: nobody → Joachim Haga (jobh)
Revision history for this message
Joachim Haga (jobh) wrote :

Fix is pushed to lp:~jobh/dolfin/plot-fix.

Changed in dolfin:
status: Confirmed → In Progress
Revision history for this message
Benjamin Kehlet (benjamik) wrote :

Great! Would you mind (next time) to pull from trunk before fixing. The branch has diverged so manual merging was necessary.

Changed in dolfin:
status: In Progress → Fix Committed
Changed in dolfin:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.