← Back to team overview

dolfin team mailing list archive

Re: Exposing MeshMarkers in Python

 

On Sun, Sep 04, 2011 at 11:23:04PM -0700, Johan Hake wrote:
> On Friday September 2 2011 23:19:22 Anders Logg wrote:
> > On Fri, Sep 02, 2011 at 02:35:57PM -0700, Johan Hake wrote:
> > > What is the different between a MeshMarker and a MeshFunction? Is
> > > MeshMarker a MeshFunction but instead of storing the values in line with
> > > its global entity index it stores it wrt the global cell entity index
> > > together with its local entity index?
> >
> > Yes, that and values don't need to be stored on the entire mesh, only
> > for a subset, so you can mark just 3 facets without needing to store
> > markers for a million facets.
>
> ok, I will see what I can do.

Thanks!

> > Copy paste from the MeshMarker docstring:
> >
> >   /// The MeshMarkers class can be used to store data associated with
> >   /// a subset of the entities of a mesh of a given topological
> >   /// dimension. It differs from the MeshFunction class in two ways.
> >   /// First, data does not need to be associated with all entities
> >   /// (only a subset). Second, data is associated with entities
> >   /// through the corresponding cell index and local entity number
> >   /// (relative to the cell), not by global entity index, which means
> >   /// that data may be stored robustly to file.
> >
> > > Also, will this take over for the way we use MeshFunctions in the
> > > assembler, or will a MeshFunction be generated by a MeshMarker before
> > > assemble gets called?
> >
> > I think we will do that as a first step (convert from MeshMarker to
> > MeshFunction) since then we don't need to touch the assembler. Then
> > later we can think about using MeshMarkers directly.
>
> Ok.
>
> > > I think I also get confused with the naming here. If my explaination of
> > > what MeshMarker is doing is correct, a MeshMarker and a MeshFunction are
> > > essentially doing the same thing. What differs is the way the data is
> > > stored. This is not reflected in the naming of the classes
> >
> > It was the best I could come up with. Feel free to suggest something
> > else. SubsetMeshFunction would also be confusing since it's not really
> > a MeshFunction.
> >
> > Either way, I expect the MeshMarkers class to be used mostly
> > internally by the MeshDomains class.
>
> Ok.
>
> Not sure these are better, but they might reflect the difference between this
> guy and a MeshFunction in a slightly more intuitive way.
>
>   MeshEntityFunction, LocalMeshEntityFunction, LocalMeshFunction,
>   SubMeshFunction

I'm not sure those are much better, and I don't think it would be
correct to call them something containing "Function" since they are
not really functions. With a MeshFunction, one can input x (a mesh
entity) and get y = f(x) (the value of the MeshFunction at that
entity). That's not possible with MeshMarkers; they are just a
collection of markers, not really a function since the value is only
defined on a subset and one would need to loop through the list of
values to get the value at any entity where the value is actually
defined.

So MeshMarkers may not be that bad. I'm starting to get used to
it... :-)

--
Anders


Follow ups

References