Source code for qewton.backends.grad
from abc import abstractmethod
from typing import Any
from qewton.backends.base import Backend, TensorType
[docs]
class GradBackend(Backend[TensorType]):
"""A Backend that implements all differential operators."""
[docs]
@staticmethod
@abstractmethod
def gradient_tracking(inp: Any) -> TensorType:
pass
[docs]
@staticmethod
@abstractmethod
def gradient(u: Any, x: Any) -> TensorType:
pass
[docs]
@staticmethod
@abstractmethod
def laplacian(u: Any, x: Any) -> TensorType:
pass
[docs]
@staticmethod
@abstractmethod
def normal_derivative(u: Any, normals: Any, x: Any) -> TensorType:
pass
[docs]
@staticmethod
@abstractmethod
def divergence(u: Any, x: Any) -> TensorType:
pass
[docs]
@staticmethod
@abstractmethod
def jacobian(u: Any, x: Any) -> TensorType:
pass
[docs]
@staticmethod
@abstractmethod
def partial(u: Any, x: Any) -> TensorType:
pass
[docs]
@staticmethod
@abstractmethod
def hessian(u: Any, x: Any) -> TensorType:
pass
[docs]
@staticmethod
@abstractmethod
def matrix_divergence(u: Any, x: Any) -> TensorType:
pass
[docs]
@staticmethod
@abstractmethod
def rotation(u: Any, x: Any) -> TensorType:
pass
[docs]
@staticmethod
@abstractmethod
def symmetric_gradient(u: Any, x: Any) -> TensorType:
pass