plot cells of mesh

Asked by Chaffra Affouda

Is there are way to plot a group of cells from a mesh, maybe using there indices?

I'd like to do

mesh = UnitSquare(10,10)

c = Cell(mesh,0)
plot(c)

cs = [Cell(mesh,0), Cell(mesh,1)]

plot(cs)

Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Johan Hake
Solved:
Last query:
Last reply:
Revision history for this message
Best Johan Hake (johan-hake) said :
#1

from dolfin import *
mesh = UnitSquare(10,10)
cf = CellFunction("uint", mesh, 0)
cf.array()[0] = 1
plot(SubMesh(mesh, cf, 1), interactive=True)

On 10/19/2012 06:21 PM, Chaffra Affouda wrote:
> New question #211693 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/211693
>
> Is there are way to plot a group of cells from a mesh, maybe using there indices?
>
> I'd like to do
>
> mesh = UnitSquare(10,10)
>
> c = Cell(mesh,0)
> plot(c)
>
> cs = [Cell(mesh,0), Cell(mesh,1)]
>
> plot(cs)
>
>
>
>

Revision history for this message
Chaffra Affouda (chaffra) said :
#2

Thanks Johan Hake, that solved my question.