Dolfin mesh smoothing broken

Bug #1143977 reported by Olaf Schumann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
DOLFIN
Fix Released
Medium
Anders Logg

Bug Description

Mesh smoothin in fenics 1.1.0 does not work on my Computer. I have Ubuntu 12.04 with the Fenics Packages from http://fenicsproject.org/download/ubuntu_details.html#ubuntu-details

If I create a very simple 2D Mesh with

> mesh=UnitSquareMesh(2,2)

and an immediate smoothing

> mesh.smooth(1)

The resulting Mesh is broken

> mesh.coordinates()
array([[ 0. , 0. ],
             [ 0.5 , 0. ],
             [ 1. , 0. ],
             [ 0. , 5. ],
             [ nan, nan],
             [ 1. , 0.5 ],
             [ 0. , 1. ],
             [ 0.5 , 1. ],
             [ 1. , 1. ]])

Revision history for this message
Johannes Ring (johannr) wrote :

Confirmed for 1.1.x and trunk.

It works fine with 1.0.x.

Changed in dolfin:
status: New → Confirmed
milestone: none → 1.1.1
Revision history for this message
Anders Logg (logg) wrote :

This is broken because someone broke the connectivity computation for 0-0 connectivity. I found the following in TopologyComputation.cpp. It just sets every vertex to be connected to itself. Why was this changed?

 if (d0 == 0 && d1 == 0)
  {
    std::vector<std::vector<std::size_t> >
      connectivity00(topology.size(0), std::vector<std::size_t>(1));
    for (MeshEntityIterator v(mesh, 0); !v.end(); ++v)
      connectivity00[v->index()][0] = v->index();
    topology(0, 0).set(connectivity00);
  }

Revision history for this message
Garth Wells (garth-wells) wrote : Re: [Bug 1143977] Re: Dolfin mesh smoothing broken

On Tuesday, 19 March 2013, Anders Logg wrote:

> This is broken because someone broke the connectivity computation for
> 0-0 connectivity. I found the following in TopologyComputation.cpp. It
> just sets every vertex to be connected to itself. Why was this changed?
>
>
This was discussed on the mailing list.

It was changed because it makes a bunch of algorithms work in any
dimension. Specifically, it was changed to make the parallel code work in
1D.

Garth

> if (d0 == 0 && d1 == 0)
> {
> std::vector<std::vector<std::size_t> >
> connectivity00(topology.size(0), std::vector<std::size_t>(1));
> for (MeshEntityIterator v(mesh, 0); !v.end(); ++v)
> connectivity00[v->index()][0] = v->index();
> topology(0, 0).set(connectivity00);
> }
>
> --
> You received this bug notification because you are a member of DOLFIN
> Core Team, which is subscribed to DOLFIN.
> https://bugs.launchpad.net/bugs/1143977
>
> Title:
> Dolfin mesh smoothing broken
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/dolfin/+bug/1143977/+subscriptions
>

--
Garth N. Wells
Department of Engineering, University of Cambridge
http://www.eng.cam.ac.uk/~gnw20

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

On Tue, Mar 19, 2013 at 12:20:23AM -0000, Garth Wells wrote:
>> This is broken because someone broke the connectivity computation for
>> 0-0 connectivity. I found the following in TopologyComputation.cpp. It
>> just sets every vertex to be connected to itself. Why was this changed?
>>
>>
> This was discussed on the mailing list.
> It was changed because it makes a bunch of algorithms work in any
> dimension. Specifically, it was changed to make the parallel code work in
> 1D.

I worked around it by using vertex-edge connectivity.

--
Anders

Changed in dolfin:
assignee: nobody → Anders Logg (logg)
importance: Undecided → Medium
status: Confirmed → Fix Committed
Johannes Ring (johannr)
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

Remote bug watches

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