Spectral Operator¤
In xpektra, spectral operators are defined to perform various operations in the spectral domain. These operators are essential for implementing spectral methods for solving partial differential equations. The spectral operators are built upon the discretization schemes defined in the scheme module and the spectral spaces defined in the space module.
The SpectralOperator class serves as a unified interface for various spectral operations, including gradient, symmetric gradient, divergence, and Laplacian operations. It also provides methods for forward and inverse Fourier transforms, as well as tensor operations like double dot product, dot product, trace, and dyadic product.
xpektra.spectral_operator.SpectralOperator
¤
A spectral operator defined by spectral space, differential scheme. It provides methods to compute gradient, divergence, symmetric gradient, and also tensor operations like dot, ddot, trace, transpose, and dyadic product.
*Arguuments - space: The spectral space. - scheme: The differential scheme.
Returns - The spectral operator.
Example:
operator = SpectralOperator(space, scheme)
grad_u = operator.grad(u)
div_v = operator.div(v)
sym_grad_u = operator.sym_grad(u)
grad(u: jaxlib._jax.Array) -> jaxlib._jax.Array
¤
Applies the gradient operator to the input real-valued array u.
Arguments - u: A real-valued array of shape (N,)*dim.
Returns - The gradient of u, a real-valued array of shape (N,)*dim + (dim,).
sym_grad(u: jaxlib._jax.Array) -> jaxlib._jax.Array
¤
Applies the symmetric gradient operator to the input real-valued array u.
Arguments - u: A real-valued array of shape (N,)*dim.
Returns - The symmetric gradient of u, a real-valued array of shape (N,)*dim + (dim, dim).
div(v: jaxlib._jax.Array) -> jaxlib._jax.Array
¤
Applies the divergence operator to the input real-valued array v.
Arguments - v: A real-valued array of shape (N,)dim + (dim,). Returns - The divergence of v, a real-valued array of shape (N,)dim.
laplacian(u: jaxlib._jax.Array) -> jaxlib._jax.Array
¤
Applies the Laplacian operator to the input real-valued array u.
Arguments - u: A real-valued array of shape (N,)dim. Returns - The Laplacian of u, a real-valued array of shape (N,)dim.
forward(u: jaxlib._jax.Array) -> jaxlib._jax.Array
¤
Applies the forward transform to the input real-valued array u.
Arguments - u: A real-valued array of shape (N,)dim. Returns - The transformed array u_hat, a complex-valued array of shape (N,)dim.
inverse(u_hat: jaxlib._jax.Array) -> jaxlib._jax.Array
¤
Applies the inverse transform to the input complex-valued array u_hat.
Arguments - u_hat: A complex-valued array of shape (N,)dim. Returns - The inverse transformed array u, a real-valued array of shape (N,)dim.
ddot(A: jaxlib._jax.Array, B: jaxlib._jax.Array) -> jaxlib._jax.Array
¤
Applies the double dot product to the input arrays A and B.
Arguments - A: A real-valued array of shape (N,)dim. - B: A real-valued array of shape (N,)dim. Returns - The double dot product of A and B, a real-valued array of shape (N,)*dim.
dot(A: jaxlib._jax.Array, B: jaxlib._jax.Array) -> jaxlib._jax.Array
¤
Applies the dot product to the input arrays A and B.
Arguments - A: A real-valued array of shape (N,)dim. - B: A real-valued array of shape (N,)dim. Returns - The dot product of A and B, a real-valued array of shape (N,)*dim.
trace(A: jaxlib._jax.Array) -> jaxlib._jax.Array
¤
Applies the trace operator to the input array A.
Arguments - A: A real-valued array of shape (N,)dim. Returns* - The trace of A, a real-valued array of shape (N,).
dyad(A: jaxlib._jax.Array, B: jaxlib._jax.Array) -> jaxlib._jax.Array
¤
Applies the dyadic product to the input arrays A and B.
Arguments - A: A real-valued array of shape (N,)dim. - B: A real-valued array of shape (N,)dim. Returns - The dyadic product of A and B, a real-valued array of shape (N,)*dim.