Base Initial Condition
exponax.ic.BaseRandomICGenerator
¤
Bases: Module
Source code in exponax/ic/_base_ic.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | |
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
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | |
__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
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | |
exponax.ic.BaseIC
¤
Bases: Module, ABC
Source code in exponax/ic/_base_ic.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | |
__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
36 37 38 39 40 41 42 43 44 45 46 47 48 49 | |