gmarkall / manycore_form_compiler

MCFC is deprecated. See https://code.launchpad.net/~grm08/ffc/pyop2
https://code.launchpad.net/~grm08/ffc/pyop2
GNU General Public License v3.0
3 stars 1 forks source link

Convenience constructor for test/trial function from coefficient #29

Closed kynan closed 13 years ago

kynan commented 13 years ago

Overload UFL TestFunction and TrialFunction in MCFC and introduce a convenience constructor which allows construction of a test/trial function from a Coefficient.

This is a convenience shorthand notation allowing the following:

# c is a Coefficient (i.e. a field over some element) we got from an external source
u = TrialFunction(c)
v = TestFunction(c)

which would construct test and trial functions living on the same element / function space as the Coefficient c.

Currently one needs to write (more cumbersome):

u = TrialFunction(c.element())
v = TestFunction(c.element())

Note: this was proposed as a UFL blueprint but declined. Hence we should at the feature to MCFC.