Esempio n. 1
0
    def divergence(self, x):
        # x.shape (num_dims, points.shape)
        # return shape (sub_output_shape, points.shape)
        num_dims = x.shape[0]
        if num_dims != self.num_eqns:
            raise errors.InvalidOperation("XFunction", "divergence")

        # jacobian shape (num_eqns, sub_output_shape, num_dims, points.shape)
        jacobian = self.jacobian(x)
        index = (slice(o) for o in self.sub_output_shape)
        return sum([jacobian[(i,) + index + (i,)] for i in range(num_dims)])
Esempio n. 2
0
 def __ifloordiv__(self, other):
     # self //= other
     raise errors.InvalidOperation("DGSolution", "//=")
Esempio n. 3
0
 def __imatmul__(self, other):
     # self @= other
     raise errors.InvalidOperation("DGSolution", "@=")
Esempio n. 4
0
 def __ror__(self, other):
     # other | self
     raise errors.InvalidOperation("DGSolution", "|")
Esempio n. 5
0
 def __rxor__(self, other):
     # other ^ self
     raise errors.InvalidOperation("DGSolution", "^")
Esempio n. 6
0
 def __lt__(self, other):
     raise errors.InvalidOperation("DGSolution", "<")
Esempio n. 7
0
 def __ixor__(self, other):
     # self ^= other
     raise errors.InvalidOperation("DGSolution", "^=")
Esempio n. 8
0
 def __irshift__(self, other):
     # self >>= other
     raise errors.InvalidOperation("DGSolution", ">>=")
Esempio n. 9
0
 def __rpow__(self, other):
     # other ** self
     raise errors.InvalidOperation("DGSolution", "**")
Esempio n. 10
0
 def __rdivmod(self, other):
     # divmod(other, self)
     raise errors.InvalidOperation("DGSolution", "divmod")
Esempio n. 11
0
 def __rmod__(self, other):
     # other % self
     raise errors.InvalidOperation("DGSolution", "%")
Esempio n. 12
0
 def __rfloordiv__(self, other):
     # other // self
     raise errors.InvalidOperation("DGSolution", "//")
Esempio n. 13
0
 def __rtruediv__(self, other):
     # other / self
     raise errors.InvalidOperation("DGSolution", "/")
Esempio n. 14
0
 def __rmatmul__(self, other):
     # other @ self
     raise errors.InvalidOperation("DGSolution", "@")
Esempio n. 15
0
 def __ge__(self, other):
     raise errors.InvalidOperation("DGSolution", ">=")
Esempio n. 16
0
 def __imod__(self, other):
     # self %= other
     raise errors.InvalidOperation("DGSolution", "%=")
Esempio n. 17
0
 def __ilshift__(self, other):
     # self <<= other
     raise errors.InvalidOperation("DGSolution", "<<=")
Esempio n. 18
0
 def __rlshift__(self, other):
     # other << self
     raise errors.InvalidOperation("DGSolution", "<<")
Esempio n. 19
0
 def __iand__(self, other):
     # self &= other
     raise errors.InvalidOperation("DGSolution", "&=")
Esempio n. 20
0
 def __rrshift__(self, other):
     # other >> self
     raise errors.InvalidOperation("DGSolution", ">>")
Esempio n. 21
0
 def __ior__(self, other):
     # self |= other
     raise errors.InvalidOperation("DGSolution", "|=")
Esempio n. 22
0
 def __rand__(self, other):
     # other & self
     raise errors.InvalidOperation("DGSolution", "&")