Gaussian Blob¤
exponax.ic.RandomGaussianBlobs
¤
Bases: BaseRandomICGenerator
Source code in exponax/ic/_gaussian_blob.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
|
__init__
¤
__init__(
num_spatial_dims: int,
*,
domain_extent: float = 1.0,
num_blobs: int = 1,
position_range: tuple[float, float] = (0.4, 0.6),
variance_range: tuple[float, float] = (0.005, 0.01),
one_complement: bool = False
)
A random Gaussian blob initial condition generator.
Arguments:
- num_spatial_dims
: The number of spatial dimensions.
- domain_extent
: The extent of the domain.
- num_blobs
: The number of blobs.
- position_range
: The range of the position of the blobs. This
will be scaled by the domain extent. Hence, this acts as if the
domain_extent was 1
- variance_range
: The range of the variance of the blobs. This will
be scaled by the domain extent. Hence, this acts as if the
domain_extent was 1
- one_complement
: Whether to return one minus the Gaussian blob.
Source code in exponax/ic/_gaussian_blob.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
|
__call__
¤
__call__(
num_points: int, *, key: PRNGKeyArray
) -> Float[Array, "1 ... N"]
Generate a random initial condition.
Arguments:
- num_points
: The number of grid points in each dimension.
- key
: A jax random key.
- indexing
: The indexing convention for the grid.
Returns:
- u
: The initial condition evaluated at the grid points.
Source code in exponax/ic/_base_ic.py
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 |
|
exponax.ic.GaussianBlobs
¤
Bases: BaseIC
Source code in exponax/ic/_gaussian_blob.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
|
__init__
¤
__init__(blob_list: tuple[GaussianBlob, ...])
A state described by a collection of Gaussian blobs.
Arguments:
- blob_list
: A tuple of Gaussian blobs.
Source code in exponax/ic/_gaussian_blob.py
73 74 75 76 77 78 79 80 81 82 83 |
|
__call__
¤
__call__(x: Array) -> Array
Source code in exponax/ic/_gaussian_blob.py
85 86 87 |
|