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

'+' and '-' in interior facets

+3 votes

As far as I understand, when integrating over interior facets *dS, each expression has to be either avg(...) or jump(...) -- which is clearly defined on the facets -- or some variable v('+/-'). However, I cannot seen how this is evaluated; if I have a quantity v defined to be somehow on a cell X and differently on a neighbor cell Y, how does FEniCS choose whether v('+') is X or Y on the facet $X\cap Y$? I'm sorry if I'm missing something elementary..
Peter

asked Oct 31, 2013 by franp9am FEniCS Novice (590 points)

1 Answer

+5 votes
 
Best answer

FEniCS just picks one side of the facet to be the '+' side and one side to be the '-' side, e.g. X is the '+' and Y is the '-' side.

answered Oct 31, 2013 by Garth N. Wells FEniCS Expert (35,930 points)
selected Nov 1, 2013 by Jan Blechta

How does it choose, randomly? In fact, what I maybe don't understand, is this: does *dS mean
(a) The sum of all boundary integrals $\int_{\partial K}$ over all mesh elements K, or
(b) The sum of all integrals over interior facets, or
(c) something else.
In the (a) case, v('+') would have a clear meaning in each summand, but it seems to me that the answer to this question indicates (b). However, in the (b) case, I cannot see the meaning of n('+')...
Any hint?

*dS is the sum of all integrals over all interior facets. An interior facet is connected to two cells, hence the + and - designation for cells from either side. In case (a), having + and - sides would not make sense.

Thanks for your answer Garth, I appreciate it but I still cannot understand it. In case (a), "+" could refer to the "interior side" in each of the summands; however, in case (b), I cannot see how does it choose which side is the "+" one. I suppose, it doesn't choose randomly, because the FEniCS computations are deterministic...?

The facet -> cell connectivity has two connections (0 and 1) for an interior facet. Think of 0 being +, and 1 being -.

Consider a square ABCD and a mesh ABD, BCD (lower left and upper right triangle), and n=FacetNormal(mesh). What does the expression n('+')*dS mean? Is it a vector in the upper right direction, or a vector in the lower left direction?

n('+') is the outward unit normal vector from the cell on the + side. It's not possible to say just from a picture of a mesh which direction this will be. What is sure is that n('+') = -n('-').

Ok, so is it some hidden algorithm in the interior of FEniCS / Dolfin that the user doesn't need to understand? In other words, should I always use uniquely defined expression such as avg or jump when integrating over dS?

Yes. The + and - signs depend on the mesh initialisation. The avg and jump functions are just shortcuts for (v('+') + v('-'))/2 and v('+') - v('-'), respectively.

Ok, now I partially understand. I thought that jump(v) is a shortcat to v('+')n('+')+v('-')n('-') which is independent on the choice of + and -. The expression v('+') - v('-') is still determined only up to sign. But I think I got the main idea. Thanks a lot for the explanation.

...