- Thank you received: 0
Question concerning Other()
6 years 9 months ago - 6 years 9 months ago #357
by pschroe
Question concerning Other() was created by pschroe
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:
This does not work. The exception suggests to use the Other()-operator on sub-trees.
Is the following meant with that?
Because this does not lead to an error
Thanks for your help!
Best, Philipp
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:
Code:
V = VectorL2(mesh,order=2)
u = V.TrialFunction()
v = V.TestFunction()
uv = InnerProduct(u,v)
avg_uv = 0.5*( uv + uv.Other() )
Is the following meant with that?
Code:
avg_uv = 0.5*( InnerProduct(u,v) + InnerProduct(u.Other(),v.Other()) )
Thanks for your help!
Best, Philipp
Last edit: 6 years 9 months ago by pschroe.
6 years 9 months ago #358
by schruste
Replied by schruste on topic Question concerning Other()
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.
Best,
Christoph
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.
Best,
Christoph
6 years 9 months ago #359
by joachim
Replied by joachim on topic Question concerning Other()
Hi,
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.
Joachim
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.
Joachim
Time to create page: 0.099 seconds