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

How to apply several nondirichlet boundary condition with dolfin 1.2.0?

+1 vote

Hello there.
I use FEniCS via C++ interface and it seems since version 1.2.0 there are major changes to those interface:

http://fenicsproject.org/documentation/dolfin/1.1.0/cpp/programmers-reference/fem/assemble.html
http://fenicsproject.org/documentation/dolfin/1.2.0/cpp/programmers-reference/fem/assemble.html

as a result i can't figure out how to tell to .ufl file which boundary use when integer on ds(0), ds(1) and so on. For example there is a part of my .ufl for time-dependent problem:

#Neumann boundary conditions at ds(0) 
#and Robin boundary conditions at ds(2)
#bi-linear form:
a = (u*v + dt * inner (grad(u), grad(v))) * dx + u * v * ds(2)
#linear form: 
L = (u0 + dt * f) * v * dx + gn * v * ds(0) - gr * v * ds(2) 

In short i need C++ analog of

ds = Measure("ds")[boundary_parts]

or

A = assemble(a, exterior_facet_domains=boundary_parts)
b = assemble(L, exterior_facet_domains=boundary_parts)

which would work with dolfin 1.2.0.

Thanks for helping!
Temuri.

asked Jul 2, 2013 by mgrviper FEniCS Novice (370 points)

1 Answer

+2 votes
 
Best answer

See http://fenicsproject.org/documentation/dolfin/1.2.0/cpp/programmers-reference/fem/Assembler.html. Try

a.ds = boundary_parts;
L.ds = boundary_parts;

// now assemble
answered Jul 2, 2013 by Jan Blechta FEniCS Expert (51,420 points)
selected Jul 3, 2013 by mgrviper

This is it!
Thanks a lot.

...