Access imported boundaries

Asked by Niklas

Hello Community,

I created a mesh using Netgen (Diffpack format export) and dolfin-convert. I can import the mesh and access the domains via mesh.domains().cell_domains().

The dolfin-convert also creates *_marker_# files which contain the boundaries recognized by NETGEN. Is there a comfortable way to access those boundaries and apply the boundary conditions on them, rather than using a mathematical description of the boundary coordinates?

Question information

Language:
English Edit question
Status:
Answered
For:
FEniCS Project Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jan Blechta (blechta) said :
#1

On Mon, 22 Apr 2013 06:21:29 -0000
Niklas <email address hidden> wrote:
> New question #227200 on FEniCS Project:
> https://answers.launchpad.net/fenics/+question/227200
>
> Hello Community,
>
> I created a mesh using Netgen (Diffpack format export) and
> dolfin-convert. I can import the mesh and access the domains via
> mesh.domains().cell_domains().
>
> The dolfin-convert also creates *_marker_# files which contain the
> boundaries recognized by NETGEN. Is there a comfortable way to access
> those boundaries and apply the boundary conditions on them, rather
> than using a mathematical description of the boundary coordinates?
>

Try:
facet_domains = MeshFunction('size_t', mesh, filename)
or
facet_domains = FacetFunction('size_t', mesh, filename)

Applying DirichletBC via facet functions is clearly explained in
DirichletBC docstring.

Natural boundary conditions are applied adding exterior facet
integrals to forms. Example:

ds = Measure('ds')[facet_domains]

u, v = TrialFunction(V), TestFunction(V)
a = inner(grad(u), grad(v))*dx
L = g*v*ds(3)

for applying Neumann condition du/dn = g on facet_domain 3 for Laplace
problem.

Jan

Can you help with this problem?

Provide an answer of your own, or ask Niklas for more information if necessary.

To post a message you must log in.