← Back to team overview

dolfin team mailing list archive

Re: Exposing MeshMarkers in Python

 

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?

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 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. 

Johan

On Friday September 2 2011 13:58:13 Anders Logg wrote:
> Typically through the Mesh class and then they are not visible:
> 
>   subdomain0 = MySubDomain0()
>   subdomain1 = MySubDomain1()
> 
>   subdomain0.mark_facets(mesh, 0)
>   subdomain1.mark_facets(mesh, 1)
> 
> But one should also be able to use it directly, like so:
> 
>   markers = MeshMarkers("uint", mesh, mesh.topology().dim() - 1)
>   markers.set_marker(cell_index, local_entity, marker_value)
> 
>   marker = markers.get_marker(i)
> 
> where marker = (cell_index, local_entity, marker_value) or perhaps
> marker = ((cell_index, local_entity), marker_value). In C++, I
> currently use the latter so I can use std::pair and it somehow makes
> sense.
> 
> We should probably also add FacetMarkers, CellMarkers etc in the same
> was as for MeshFunction.
> 
> --
> Anders
> 
> On Fri, Sep 02, 2011 at 09:57:39AM -0700, Johan Hake wrote:
> > Could you briefly sketch some different scenarios how a user should use
> > MeshMarker in Python?
> > 
> > Johan
> > 
> > On Sep 2, 2011, at 5:20, Anders Logg <logg@xxxxxxxxx> wrote:
> > > Can someone (Mr Swig...) help me expose the class MeshMarkers in
> > > Python?
> > > 
> > > Judging from mesh_post.i, some heavy swig macros are needed. I can try
> > > to emulate what's in there for MeshFunction but I fear I will break
> > > something. :-)


Follow ups

References