Use a uint cell function and then convert the values: m = UnitInterval(100) f = CellFunction('uint',m)
class Left(SubDomain): def inside(self, x, on_boundary): return x[0] < 0.5 left = Left() f.set_all(0) left.mark(f,1) fd = CellFunction('double',m) fd.values()[:] = f.values()*0.01 Johan On Monday January 24 2011 17:34:33 Chaffra wrote: > New question #142746 on DOLFIN: > https://answers.launchpad.net/dolfin/+question/142746 > > This is what I'd like to do: > > m = UnitInterval(100) > f = CellFunction('double',m) > > class Left(SubDomain): > def inside(self, x, on_boundary): > return x[0] < 0.5 > > left = Left() > left.mark(f,0.01) > > Obviously this does not work because mark only accepts MeshFunctionUInt. Is > there a simple way to do this with a MeshFunctionDouble? > > Thanks, > Chaffra _______________________________________________ Mailing list: https://launchpad.net/~dolfin Post to : dolfin@lists.launchpad.net Unsubscribe : https://launchpad.net/~dolfin More help : https://help.launchpad.net/ListHelp