How to define boundary of a complex domain

Asked by Martin Vymazal

Hello,

 is there a way of marking the boundary of a general domain in 3D with a tag (integer, string ...)? I would like to use gmsh for mesh generation. Gmsh can save the surface triangles in the mesh file and tag them with an integer ("physical tag") to distinguish different parts of the boundary. I'm wondering if dolfin can treat the boundaries in a similar manner. All tutorials use space coordinates-based expressions to detect which nodes are on boundary (e.g. x[0] > 10.0 - DOLFIN_EPS and similar). This becomes very complicated/impossible for a generic 3D domain. Could you please provide an example of how to deal with this on a complex domain in 3D?

Thank you very much.

 Martin Vymazal

Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Jan Blechta
Solved:
Last query:
Last reply:
Revision history for this message
Garth Wells (garth-wells) said :
#1

Using strings to mark domains is on the near-term TODO agenda.

Revision history for this message
Marie Rognes (meg-simula) said :
#2

For an example of how to use integer markers for boundaries and boundary conditions , take a look at

  demo/undocumented/stokes-taylor-hood

Revision history for this message
Martin Vymazal (martin-vymazal-gmail) said :
#3

Hello Garth & Marie,

 thank you for your reply. I don't explicitly need the tag to be string - integers will do just fine. I looked at the demo that Marie mentioned. One last question: how do I generate my own 'subdomains.xml.gz' ?

 Thank you very much.

 Best regards,

   Martin Vymazal

Revision history for this message
Best Jan Blechta (blechta) said :
#4

Hi Martin,
you can convert gmsh (and other formats) to xml by dolfin-convert script (to be called from command-line) or by convert2xml() method (called from python). By brief inspection it seems that dolfin 1.1.0 supports conversion of cell markers and facet markes for gmsh format. But in case of need it is relatively easy to tweak source http://bazaar.launchpad.net/~dolfin-core/dolfin/1.1.x/view/head:/site-packages/dolfin_utils/meshconvert/meshconvert.py for your needs.

Jan

Revision history for this message
Martin Vymazal (martin-vymazal-gmail) said :
#5

Hi Jan,

 thanks for the hint. That's what I was looking for.

 Best regards,

   Martin

Revision history for this message
Martin Vymazal (martin-vymazal-gmail) said :
#6

Thanks Jan Blechta, that solved my question.