How to make a hole in a uniform mesh

Asked by Øystein Sørensen

I am trying to make a uniform mesh, something like
mesh = Rectangle(0,0,4,1,nx,ny)
and then make two holes inside the mesh. The holes are supposed to represent a source and a sink, with inner boundary condition du/dn=f on the boundary of the holes.
I am aware that this is pretty straightforward to do in some external preprocessor, but I wonder if it is possible to implement this straight into Dolfin.
Ideally, the holes should be small (e.g. [0.01,0.01] squares).
Any idea?
Or may I alternatively define some inner boundary and implement the boundary condition on this?

Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Anders Logg
Solved:
Last query:
Last reply:
Revision history for this message
Best Anders Logg (logg) said :
#1

On Thu, Aug 26, 2010 at 03:05:00PM -0000, Øystein Sørensen wrote:
> New question #122849 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/122849
>
> I am trying to make a uniform mesh, something like
> mesh = Rectangle(0,0,4,1,nx,ny)
> and then make two holes inside the mesh. The holes are supposed to represent a source and a sink, with inner boundary condition du/dn=f on the boundary of the holes.
> I am aware that this is pretty straightforward to do in some external preprocessor, but I wonder if it is possible to implement this straight into Dolfin.
> Ideally, the holes should be small (e.g. [0.01,0.01] squares).
> Any idea?
> Or may I alternatively define some inner boundary and implement the boundary condition on this?

This is easy to do in DOLFIN.

Take a look at this demo:

  demo/mesh/smoothing/python/demo.py

--
Anders

Revision history for this message
Øystein Sørensen (oystein-sorensen) said :
#2

Thanks Anders Logg, that solved my question.