Gaussian Random Field¤
exponax.ic.GaussianRandomField
¤
Bases: BaseRandomICGenerator
Source code in exponax/ic/_gaussian_random_field.py
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 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 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 100 101 |
|
__init__
¤
__init__(
num_spatial_dims: int,
*,
domain_extent: float = 1.0,
powerlaw_exponent: float = 3.0,
zero_mean: bool = True,
std_one: bool = False,
max_one: bool = False
)
Random generator for initial states following a power-law spectrum in Fourier space, i.e., it decays polynomially with the wavenumber.
Arguments:
num_spatial_dims
: The number of spatial dimensions.domain_extent
: The extent of the domain in each spatial direction.powerlaw_exponent
: The exponent of the power-law spectrum.zero_mean
: Whether the field should have zero mean.std_one
: Whether to normalize the state to have a standard deviation of one. Defaults toFalse
. Only works if the offset is zero.max_one
: Whether to normalize the state to have the maximum absolute value of one. Defaults toFalse
. Only one ofstd_one
andmax_one
can beTrue
.
Source code in exponax/ic/_gaussian_random_field.py
22 23 24 25 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 |
|
__call__
¤
__call__(
num_points: int, *, key: PRNGKeyArray
) -> Float[Array, "1 ... N"]
Source code in exponax/ic/_gaussian_random_field.py
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 100 101 |
|