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

Boundary conditions with Raviart-Thomas elements

+1 vote

I am trying to understand how boundary conditions are applied to Raviart-Thomas elements.

That is, when I define DirichletBC on Raviart-Thomas elements what is exactly done in the background? Are the facet values integrated? Or the facet values are interpolated?

Can anybody clarify this to me?

Thank you.

asked Dec 4, 2013 by artur.palha FEniCS Novice (160 points)

1 Answer

+2 votes
 
Best answer
RT = FunctionSpace(mesh, 'RT', q)
bc = DirichletBC(RT, g, ...)

is to be applied (algebraically) to facet DOFs by evaluating g at those DOFs. (In fact something like g.restrict(..., RT.element(), cell, ...) is used to do this where cell is adjacent to respective facet.)

answered Dec 5, 2013 by Jan Blechta FEniCS Expert (51,420 points)
selected Dec 5, 2013 by artur.palha

Thank you Jan.

But the degrees of freedom of RT elements are moments. What is being done here is interpolation, right? How correct is this?

Yes. Moments are expanded into basis and expressed using values at distinct nodes on facets. So the actual DOFs are these values at facet nodes and few interior moments (for higher-order RT elements). DirichletBC is to be applied to these facet DOFs only iff a facet is marked for application of BC. See FEniCS book.

If you want a projection then do

# Pick g's function space
try:
    g_space = g.function_space()
except AttributeError:
    g_space = None

# Project g to RT if necessary
if g_space != RT:
    g = project(g, RT)

bc = DirichletBC(RT, g, ...)

Yes, indeed! That is the way to do it, I agree.

Thanks a lot for your help.

If V is a function space, like V = FunctionSpace(...), then
bc = DirichletBC(V, Constant(0.0), ...) means u = 0.0 for all u in V, right?
How about this?

...