← Back to team overview

dolfin team mailing list archive

Re: more new mesh

 

On Tue, Oct 17, 2006 at 06:47:46PM +0200, Garth N. Wells wrote:> 
> 
> Anders Logg wrote:
> > On Tue, Oct 17, 2006 at 06:30:09PM +0200, Anders Logg wrote:
> >> On Tue, Oct 17, 2006 at 03:09:50PM +0200, Garth N. Wells wrote:
> >>
> >>>> 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.
> >> ok, now I remember. I forgot we had this before by localID().
> >>
> >> Is this needed only for the boundary? If so, we could add it as
> >> another MeshFunction that gets computed when the boundary is
> >> generated. In that case, we compute this in BoundaryComputation.
> >>
> >> Or do we need something more general, so for any given pair of
> >> entities (e0, e1), e0 can ask e1: Who am I to you?
> >>
> >> /Anders
> > 
> > Looks like we need the more general information when we start doing
> > discontinuous Galerkin (which is soon)?
> >
> 
> Yes, we will need the general case. For now, I'm computing the local
> index in FEM.cpp.

Looks like a very cheap computation (in particular since the iterators
should be very fast) so maybe we don't need to throw this into the
topology computation, at least not now. What we probably should do is
to add a utility function somewhere for this computation. It could be
something in MeshEntity:

  /// Return local index of given connected entity
  uint MeshEntity::index(const MeshEntity& entity) const;

Then e0.index(e1) would give the local index of e1 as seen from e0.

/Anders


References