This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Line boundary conditions

+1 vote

Hi

I am reading in my boundaries from the xml file using
"boundaries = MeshFunction("size_t", mesh, facetfilename)"

It contains the surfaces of a 3D mesh. How do I generate a boundary condition for a line that is defined by the common boundary between two of the surfaces?

Thanks

asked Apr 1, 2015 by lee FEniCS User (1,170 points)

1 Answer

0 votes

You can define a line source within the mesh with the following syntax:

Constant(1.0) * v('+') * dS(subdomain_id=1,
                                     subdomain_data=boundaries)

This should work for a CG function space. The boundary is assumed to be labeled with 1, but this can of course be changed.

answered Apr 1, 2015 by cevito FEniCS User (5,550 points)
edited Apr 2, 2015 by cevito

Thanks cevito. I tried it and it is not working.

can I ask you what does v('+') stands for?

Also, does dol refer to the dolfin?

Sry, I read through your original posting too quickly. I just noticed that you are talking about 3d meshes, the code I outlined works for 2D.

If you want to have a line integral in 3D you would need an 'integration over topological dimension - 2', however, this concept is not yet implemented in ufl, see ufl/measure.py)
The code I have oultined above would also work in 3D if you need to take the integral over facets as this corresponds to an integration over topological dimension - 1.

...