Construct Test/TrialFunction from Coefficient (using its element)
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 (rather non-intuitive):
u = TrialFunction(
v = TestFunction(
Implementation is easy: check type of the 1st parameter to Argument constructor, if it is a Coefficient, extract its element, proceed as usual. As a side effect this would allow any Argument to be constructed from a Coefficient (not taking into account the Coefficient's count). If that is not wanted, this case distinction could be made in the Test/TrialFunction constructors instead.
Blueprint information
- Status:
- Complete
- Approver:
- None
- Priority:
- Not
- Drafter:
- None
- Direction:
- Needs approval
- Assignee:
- None
- Definition:
- Obsolete
- Series goal:
- None
- Implementation:
- Unknown
- Milestone target:
- None
- Started by
- Completed by
- Martin Sandve Alnæs
Related branches
Sprints
Whiteboard
I disagree. The argument lives in a finite element space, that is what it takes in its constructor, and v TrialFunction(