reading boundaries from *_physical_region.xml file

Asked by Nico Schlömer on 2013-04-05

When dealing with custom meshes with subdomains, my typical workflow is to generate a mesh in Gmsh, convert it to XML format using dolfin-convert, and then read the mesh from the two files mymesh.xml and mymesh_physical_region.xml. The second file gives me the subdomains, e.g.,

mesh = Mesh('mymesh.xml')
subdomains = MeshFunction('size_t', mesh, 'mymesh_physical_region.xml')

From there, I typically go ahead and define the volumes,

dx = Measure('dx')[subdomains]

What I'd like to do now I also define subdomain boundary "volumes", e.g.,

ds = Measure('ds')[boundaries]

How can I generate the corresponding `boundaries`?

Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Johan Hake
Solved:
2013-04-07
Last query:
2013-04-07
Last reply:
2013-04-07
Jan Blechta (blechta) said : #1

boundaries = mesh.domains().facet_domains(mesh)

Nico Schlömer (nschloe) said : #2

    boundaries = mesh.domains().facet_domains(mesh)
TypeError: (b) expected positive 'int' for argument

Best Johan Hake (johan-hake) said : #3

In trunk/master you should not need the mesh argument anymore.

Johan

On 04/07/2013 09:35 PM, Nico Schlömer wrote:
> Question #225970 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/225970
>
> Status: Answered => Open
>
> Nico Schlömer is still having a problem:
> boundaries = mesh.domains().facet_domains(mesh)
> TypeError: (b) expected positive 'int' for argument
>

Nico Schlömer (nschloe) said : #4

Confirmed. Thanks!