← Back to team overview

dolfin team mailing list archive

Re: more new mesh

 


Anders Logg wrote:
> On Tue, Oct 17, 2006 at 02:35:16PM +0200, Garth N. Wells wrote:
>> OK. It's taking me a while to get into the new structure.
> 
> It should be simple and intuitive, so if it's not I might have
> overlooked something. Any suggestions for improvements are welcome.
> 
> Maybe it's just that it's (a little) different and more general than
> the old mesh library but maybe there is room for improvement.
>

I don't think that it's a problem. It's more abstract, which demands a
little more thinking on my side. Some of the error messages are cryptic,
which can be worked on later.

>> So, for a 2D mesh, mesh.init(1, 2) computes which cells share an
>> edge
> 
> Yes.
> 
>> and mesh.init(2, 1) computes which edges belong to a cell?
> 
> Yes.
> 
> The connectivity 1 - 2 is actually computed as the transpose of 2 - 1
> so what happens when 1 - 2 is computed is that 2 - 1 is first computed
> and 1 - 2 follows from that.
> 
> This computation happens in the class TopologyComputation. For a mesh
> of topological dimension d, there are (d+1)^2 different things to
> compute and there is some logic that takes care of computing one from
> the other. By doing things in the right order, everything is O(N) and
> should be quite fast. (There are some hidden factors for local
> iterations in there as well.)
> 
>> Inside
>> mesh.init(2, 1) would therefore be the place to compute local edge ID's?
> 
> I don't think you need to modify the computation (if there is no
> bug). Everything should be available. I'm not sure what you mean by
> local edge IDs but I assume you mean the local numbering of edges
> within a cell. 

Yes.

Then you just need to do mesh.init(2, 1) for a 2D mesh
> and you have it. For any cell in that mesh, you may then do
> 
>     uint* edges = cell.connections(1);
> 
> Which gives you the global edge numbers for the three edges of the
> cell. The local numbers are 0, 1, 2.
> 
> Is that what you mean?
> 

What I would like is the other way around. For a given facet, I need to
it's local ID (0, 1 or 2) relative to the cells which is it connected
to. Basically, on the boundary, I now have the facet and the mesh cell,
but I don't know the local facet number (FFC generate output for each case).

I could use the above way and iterate over each mesh cell which has a
boundary facet, and work out which facet is on the boundary.

Garth

> /Anders
> 
> 


Follow ups

References