- marked as critical
Remove hacky type 'Data' and implement a better type for holding coefficient mapping of derivative
When doing derivative(F, u, v, coefficient_derivatives={f:g, h:q}), the dict with derivatives g,q of f,h is just wrapped in a Data object which doesn't behave as a proper ufl type.
Besides being an ugly hack, this leads to a very concrete problem. First of all it doesn't curretly have a way to compute its signature, although that could be remedied if it was the only problem.
To be able to compute the form signature before differentiation, a numbering of coefficients must be enumerated. To do this all coefficients must be extracted from a form; however the Data object hides the coefficients it references.
The solution seems to be to introduce a type instead that more explicitly represents what Data is used for, a mapping between coefficients and other symbolic expressions.
class CoefficientMapping(Operator):
def __init__(self, mapping):
self._operands = sum(((k,v) for k,v in mapping.iteritems()), ())
def operands(self):
return self._operands
def free_indices(self):
error
etc.
This could possibly be used to represent delayed evaluation of 'replace' as well, together with a type 'PartialEvaluation' or something like that.
Comments (7)
-
reporter -
reporter - marked as blocker
This is a necessary requirement to complete https://bitbucket.org/fenics-project/ufl/issue/36/
-
reporter - changed milestone to 1.5
-
reporter - changed milestone to 1.4
-
reporter In next.
-
reporter - changed status to resolved
-
reporter - removed milestone
Removing milestone: 1.4 (automated comment)
- Log in to comment