integration of a function over the boundary or parts of the boundary

Created by Lutz Gross
Keywords:
integration boundary

How can I integrate a function over the boundary or parts of the boundary?

To integrate a function f over the boundary use

   integrate(f,where=FunctionOnBoundary(f.getDomain()))

Be aware that f must be defined on the boundary or must be interpolatable to the boundary (WARNING: In the case of finley, the boundary is defined by the face elements!!) .

If you want to integrate over parts of the boundary you can use masks: For instance to integrate over the portion of the boundary where x_0==0 use

    integrate(f*whereZero(FunctionOnBoundary(f.getDomain()).getX()[0])))