← Back to team overview

dolfin team mailing list archive

Re: Mesh topology question

 

On Sat, Oct 06, 2012 at 09:51:24PM +0100, Garth N. Wells wrote:
> What does the mesh connectivity (d, d) really mean? This is related
> to the bug
>
>     https://bugs.launchpad.net/dolfin/+bug/1063013
>
> The code
>
>     #include <dolfin.h>
>     int main()
>     {
>       // Create mesh
>       UnitSquare mesh(1, 1);
>       mesh.init(2, 2);
>       Cell cell(mesh2, 0);
>       for (CellIterator c(cell); !c.end(); ++c)
>         cout << "In cell loop" << endl;
>     }
>
> prints
>
>     In cell loop
>     In cell loop
>     In cell loop
>     In cell loop
>     In cell loop
>     In cell loop

Connectivity d --> d means sharing a vertex for d > 0 and sharing a
cell for d = 0.

In the above case, each cell will be connected to itself and the other
cell, so the loop should print only this:

  In cell loop
  In cell loop

Why do you get 6? I tried this (in Python) and get only 2.

> In what sense are entities of the same dimension 'connected'? The
> present behaviour is causing a problem when computing a BoundaryMesh
> in 1D because it picks up the end vertices, but then iterates along
> the lines of
>
>         for (VertexIterator v(vertex); !v.end(); ++v)
>         {
>
>         }
>
> which then yields the vertex that is one place in from the boundary.

The algorithm for BoundaryMesh is to iterate over all facets of the
mesh, in this case all vertices, and then check for each one if it is
connected to exactly one entity of dimension D (cells) which in this
case is edges (intervals). So something clearly goes wrong in
TopologyComputation in 1D.

I'll look at it later.

--
Anders


Follow ups

References