Base Initial Condition
exponax.ic.BaseRandomICGenerator
¤
Bases: Module
Source code in exponax/ic/_base_ic.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | |
gen_ic_fun
¤
gen_ic_fun(*, key: PRNGKeyArray) -> BaseIC
Generate an initial condition function.
Arguments:
key: A jax random key.
Returns:
ic: An initial condition function that can be evaluated at degree of freedom locations.
Source code in exponax/ic/_base_ic.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | |
__call__
¤
__call__(
num_points: int, *, key: PRNGKeyArray
) -> Float[Array, "1 ... N"]
Generate a random initial condition on a grid with num_points points.
Arguments:
num_points: The number of grid points in each dimension.key: A jax random key.
Returns:
u: The initial condition evaluated at the grid points.
Source code in exponax/ic/_base_ic.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | |
exponax.ic.BaseIC
¤
Bases: Module, ABC
Source code in exponax/ic/_base_ic.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | |
__call__
abstractmethod
¤
__call__(
x: Float[Array, "D ... N"]
) -> Float[Array, "1 ... N"]
Evaluate the initial condition.
Arguments:
x: The grid points.
Returns:
u: The initial condition evaluated at the grid points.
Source code in exponax/ic/_base_ic.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 | |