Skip to content

Zero Nonlinear Function¤

Use for linear time steppers.

exponax.nonlin_fun.ZeroNonlinearFun ¤

Bases: BaseNonlinearFun

Source code in exponax/nonlin_fun/_zero.py
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
class ZeroNonlinearFun(BaseNonlinearFun):
    def __init__(
        self,
        num_spatial_dims: int,
        num_points: int,
    ):
        """
        A zero nonlinear function to be used for linear problems. It's nonlinear
        function is just

        ```
            𝒩(u) = 0
        ```

        **Arguments:**

        - `num_spatial_dims`: The number of spatial dimensions `d`.
        - `num_points`: The number of points `N` used to discretize the domain.
            This **includes** the left boundary point and **excludes** the right
            boundary point. In higher dimensions; the number of points in each
            dimension is the same.
        """
        super().__init__(
            num_spatial_dims,
            num_points,
        )

    def __call__(
        self,
        u_hat: Complex[Array, "C ... (N//2)+1"],
    ) -> Complex[Array, "C ... (N//2)+1"]:
        return jnp.zeros_like(u_hat)
__init__ ¤
__init__(num_spatial_dims: int, num_points: int)

A zero nonlinear function to be used for linear problems. It's nonlinear function is just

    𝒩(u) = 0

Arguments:

  • num_spatial_dims: The number of spatial dimensions d.
  • num_points: The number of points N used to discretize the domain. This includes the left boundary point and excludes the right boundary point. In higher dimensions; the number of points in each dimension is the same.
Source code in exponax/nonlin_fun/_zero.py
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
def __init__(
    self,
    num_spatial_dims: int,
    num_points: int,
):
    """
    A zero nonlinear function to be used for linear problems. It's nonlinear
    function is just

    ```
        𝒩(u) = 0
    ```

    **Arguments:**

    - `num_spatial_dims`: The number of spatial dimensions `d`.
    - `num_points`: The number of points `N` used to discretize the domain.
        This **includes** the left boundary point and **excludes** the right
        boundary point. In higher dimensions; the number of points in each
        dimension is the same.
    """
    super().__init__(
        num_spatial_dims,
        num_points,
    )
__call__ ¤
__call__(
    u_hat: Complex[Array, "C ... (N//2)+1"]
) -> Complex[Array, "C ... (N//2)+1"]
Source code in exponax/nonlin_fun/_zero.py
34
35
36
37
38
def __call__(
    self,
    u_hat: Complex[Array, "C ... (N//2)+1"],
) -> Complex[Array, "C ... (N//2)+1"]:
    return jnp.zeros_like(u_hat)