Exemplo 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)])
Exemplo n.º 2
0
 def __ifloordiv__(self, other):
     # self //= other
     raise errors.InvalidOperation("DGSolution", "//=")
Exemplo n.º 3
0
 def __imatmul__(self, other):
     # self @= other
     raise errors.InvalidOperation("DGSolution", "@=")
Exemplo n.º 4
0
 def __ror__(self, other):
     # other | self
     raise errors.InvalidOperation("DGSolution", "|")
Exemplo n.º 5
0
 def __rxor__(self, other):
     # other ^ self
     raise errors.InvalidOperation("DGSolution", "^")
Exemplo n.º 6
0
 def __lt__(self, other):
     raise errors.InvalidOperation("DGSolution", "<")
Exemplo n.º 7
0
 def __ixor__(self, other):
     # self ^= other
     raise errors.InvalidOperation("DGSolution", "^=")
Exemplo n.º 8
0
 def __irshift__(self, other):
     # self >>= other
     raise errors.InvalidOperation("DGSolution", ">>=")
Exemplo n.º 9
0
 def __rpow__(self, other):
     # other ** self
     raise errors.InvalidOperation("DGSolution", "**")
Exemplo n.º 10
0
 def __rdivmod(self, other):
     # divmod(other, self)
     raise errors.InvalidOperation("DGSolution", "divmod")
Exemplo n.º 11
0
 def __rmod__(self, other):
     # other % self
     raise errors.InvalidOperation("DGSolution", "%")
Exemplo n.º 12
0
 def __rfloordiv__(self, other):
     # other // self
     raise errors.InvalidOperation("DGSolution", "//")
Exemplo n.º 13
0
 def __rtruediv__(self, other):
     # other / self
     raise errors.InvalidOperation("DGSolution", "/")
Exemplo n.º 14
0
 def __rmatmul__(self, other):
     # other @ self
     raise errors.InvalidOperation("DGSolution", "@")
Exemplo n.º 15
0
 def __ge__(self, other):
     raise errors.InvalidOperation("DGSolution", ">=")
Exemplo n.º 16
0
 def __imod__(self, other):
     # self %= other
     raise errors.InvalidOperation("DGSolution", "%=")
Exemplo n.º 17
0
 def __ilshift__(self, other):
     # self <<= other
     raise errors.InvalidOperation("DGSolution", "<<=")
Exemplo n.º 18
0
 def __rlshift__(self, other):
     # other << self
     raise errors.InvalidOperation("DGSolution", "<<")
Exemplo n.º 19
0
 def __iand__(self, other):
     # self &= other
     raise errors.InvalidOperation("DGSolution", "&=")
Exemplo n.º 20
0
 def __rrshift__(self, other):
     # other >> self
     raise errors.InvalidOperation("DGSolution", ">>")
Exemplo n.º 21
0
 def __ior__(self, other):
     # self |= other
     raise errors.InvalidOperation("DGSolution", "|=")
Exemplo n.º 22
0
 def __rand__(self, other):
     # other & self
     raise errors.InvalidOperation("DGSolution", "&")