Possibility to use different function space for Test and Trial function

Hello everyone,

I’m interesting in finding the possibility to define the TestFunction and TrialFunction with different spaces. More specifically, I’m particular interested in using DG to represent a fundamental 1D FVM discretization, to do so, i need to define the TestFunction as constant 1. I tested it in FEniCS but failed.

Is there anyone know if it is possbile to do so in the current FEniCS? If possible, what is the right way to implement?

Thanks a lot!

Unless I’m missing something, the basis of a DG0 space is the constant 1 defined on each element of the mesh… There’s no need to “mix spaces”. It would be helpful if you post a minimal working example.

I’m not quite sure what you’re trying to do, but if you have any hope of solving your discrete system, you’ll need the same number of TestFunctions as TrialFunctions. So for each TrialFunction, there is an associated test function. Suppose for any given TrialFunction u, then the associated test function is w = Pu, where P is some operator (e.g. w = u’). Then you can simply write a non-symmetric weak form. That is, instead of a(w,u), you might have a(Pw,u). Then use Galerkin, and you’ve got what you want.