Question concerning Other()

Hi guys,

in the context of DG methods, I want to be able to compute the average (or mean) of the product of trial and test function. For example, as follows:

V = VectorL2(mesh,order=2)
u = V.TrialFunction()
v = V.TestFunction()
uv = InnerProduct(u,v)
avg_uv = 0.5*( uv + uv.Other() )

This does not work. The exception suggests to use the Other()-operator on sub-trees.
Is the following meant with that?

avg_uv = 0.5*( InnerProduct(u,v) + InnerProduct(u.Other(),v.Other()) )

Because this does not lead to an error :wink:

Thanks for your help!
Best, Philipp

Hi Philipp,

Other() is only implemented for ProxyFunctions (test or trialfunctions). The product/InnerProduct of both is not a ProxyFunction anymore but a general CoefficientFunction. That why the first version does not work, but the second.



you can use the Other also to Coefficients,
or to Coefficient-trees, as long as they don’t contain a proxy.

Sorry for this limitation, the fix requires some effort.
Now an exception is thrown if we violate this constraint.


Thank you very much! I just wanted to make sure I understood the exception :slight_smile: