Beispiel #1
0
 def abs(self, o, df):
     f, = o.ufl_operands
     # return conditional(eq(f, 0), 0, Product(sign(f), df)) abs is
     # not complex differentiable, so we workaround the case of a
     # real F in complex mode by defensively casting to real inside
     # the sign.
     return sign(Real(f)) * df
Beispiel #2
0
 def real(self, o, df):
     return Real(df)