dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #07781
Re: Plotting MeshFunction
Nuno David Lopes skrev den 05/05-2008 følgende:
> Hi,
>
> I'm a newbie --2 months--, user trying to get in to Dolfin.
> Until know I've found the answers to my doubts in the manual, demos or in the
> mailing list archive.
> (So Sorry if I'm asking something that's not reasonable.)
>
> What kind of MeshFunctions are we able to plot with Dolfin,
> (using viper or file vtk format)?
> For instance is there a direct way to plot the subdomain markers defined in a
> MeshFunction<unsigned int>?
>
> If we are dealing with complex domains it would be a great help, so one could
> be shore that the markers are well defined.
>
>
> Thanks in advance.
Try this:
from dolfin import *
mesh = UnitSquare(5,5)
#mesh = UnitCube(5,5,5)
mf = MeshFunction("uint", mesh, mesh.topology().dim())
tmp = mf.values()
tmp[::2] = 4
plot(mf)
Ola
> --
> Nuno Lopes
> Math/Numerical-Analysis -- PhD Student FCT-UNL (Lisbon)
>
> e-mail:ndl @ ptmat .fc.ul. pt (FCUL/CMAF)
> nlopes @ dec .isel.ipl.pt (ISEL)
>
> _______________________________________________
> DOLFIN-dev mailing list
> DOLFIN-dev@xxxxxxxxxx
> http://www.fenics.org/mailman/listinfo/dolfin-dev
Follow ups
References