|
4 | 4 |
|
5 | 5 | from numpy.typing import NDArray |
6 | 6 |
|
7 | | -from gpgi._typing import FloatT |
| 7 | +from gpgi._typing import F |
8 | 8 |
|
9 | 9 | BoundaryRecipeT = Callable[ |
10 | 10 | [ |
11 | | - NDArray[FloatT], |
12 | | - NDArray[FloatT], |
13 | | - NDArray[FloatT], |
14 | | - NDArray[FloatT], |
15 | | - NDArray[FloatT], |
16 | | - NDArray[FloatT], |
17 | | - NDArray[FloatT], |
18 | | - NDArray[FloatT], |
| 11 | + NDArray[F], |
| 12 | + NDArray[F], |
| 13 | + NDArray[F], |
| 14 | + NDArray[F], |
| 15 | + NDArray[F], |
| 16 | + NDArray[F], |
| 17 | + NDArray[F], |
| 18 | + NDArray[F], |
19 | 19 | Literal["left", "right"], |
20 | 20 | dict[str, Any], |
21 | 21 | ], |
22 | | - NDArray[FloatT], |
| 22 | + NDArray[F], |
23 | 23 | ] |
24 | 24 |
|
25 | 25 |
|
@@ -125,64 +125,64 @@ def __contains__(self, key: str) -> bool: |
125 | 125 |
|
126 | 126 | # basic recipes |
127 | 127 | def open_boundary( |
128 | | - same_side_active_layer: NDArray[FloatT], |
129 | | - same_side_ghost_layer: NDArray[FloatT], |
130 | | - opposite_side_active_layer: NDArray[FloatT], |
131 | | - opposite_side_ghost_layer: NDArray[FloatT], |
132 | | - weight_same_side_active_layer: NDArray[FloatT], |
133 | | - weight_same_side_ghost_layer: NDArray[FloatT], |
134 | | - weight_opposite_side_active_layer: NDArray[FloatT], |
135 | | - weight_opposite_side_ghost_layer: NDArray[FloatT], |
| 128 | + same_side_active_layer: NDArray[F], |
| 129 | + same_side_ghost_layer: NDArray[F], |
| 130 | + opposite_side_active_layer: NDArray[F], |
| 131 | + opposite_side_ghost_layer: NDArray[F], |
| 132 | + weight_same_side_active_layer: NDArray[F], |
| 133 | + weight_same_side_ghost_layer: NDArray[F], |
| 134 | + weight_opposite_side_active_layer: NDArray[F], |
| 135 | + weight_opposite_side_ghost_layer: NDArray[F], |
136 | 136 | side: Literal["left", "right"], |
137 | 137 | metadata: dict[str, Any], |
138 | | -) -> NDArray[FloatT]: |
| 138 | +) -> NDArray[F]: |
139 | 139 | # return the active layer unchanged |
140 | 140 | return same_side_active_layer |
141 | 141 |
|
142 | 142 |
|
143 | 143 | def wall_boundary( |
144 | | - same_side_active_layer: NDArray[FloatT], |
145 | | - same_side_ghost_layer: NDArray[FloatT], |
146 | | - opposite_side_active_layer: NDArray[FloatT], |
147 | | - opposite_side_ghost_layer: NDArray[FloatT], |
148 | | - weight_same_side_active_layer: NDArray[FloatT], |
149 | | - weight_same_side_ghost_layer: NDArray[FloatT], |
150 | | - weight_opposite_side_active_layer: NDArray[FloatT], |
151 | | - weight_opposite_side_ghost_layer: NDArray[FloatT], |
| 144 | + same_side_active_layer: NDArray[F], |
| 145 | + same_side_ghost_layer: NDArray[F], |
| 146 | + opposite_side_active_layer: NDArray[F], |
| 147 | + opposite_side_ghost_layer: NDArray[F], |
| 148 | + weight_same_side_active_layer: NDArray[F], |
| 149 | + weight_same_side_ghost_layer: NDArray[F], |
| 150 | + weight_opposite_side_active_layer: NDArray[F], |
| 151 | + weight_opposite_side_ghost_layer: NDArray[F], |
152 | 152 | side: Literal["left", "right"], |
153 | 153 | metadata: dict[str, Any], |
154 | | -) -> NDArray[FloatT]: |
155 | | - return cast("NDArray[FloatT]", same_side_active_layer + same_side_ghost_layer) |
| 154 | +) -> NDArray[F]: |
| 155 | + return cast("NDArray[F]", same_side_active_layer + same_side_ghost_layer) |
156 | 156 |
|
157 | 157 |
|
158 | 158 | def antisymmetric_boundary( |
159 | | - same_side_active_layer: NDArray[FloatT], |
160 | | - same_side_ghost_layer: NDArray[FloatT], |
161 | | - opposite_side_active_layer: NDArray[FloatT], |
162 | | - opposite_side_ghost_layer: NDArray[FloatT], |
163 | | - weight_same_side_active_layer: NDArray[FloatT], |
164 | | - weight_same_side_ghost_layer: NDArray[FloatT], |
165 | | - weight_opposite_side_active_layer: NDArray[FloatT], |
166 | | - weight_opposite_side_ghost_layer: NDArray[FloatT], |
| 159 | + same_side_active_layer: NDArray[F], |
| 160 | + same_side_ghost_layer: NDArray[F], |
| 161 | + opposite_side_active_layer: NDArray[F], |
| 162 | + opposite_side_ghost_layer: NDArray[F], |
| 163 | + weight_same_side_active_layer: NDArray[F], |
| 164 | + weight_same_side_ghost_layer: NDArray[F], |
| 165 | + weight_opposite_side_active_layer: NDArray[F], |
| 166 | + weight_opposite_side_ghost_layer: NDArray[F], |
167 | 167 | side: Literal["left", "right"], |
168 | 168 | metadata: dict[str, Any], |
169 | | -) -> NDArray[FloatT]: |
170 | | - return cast("NDArray[FloatT]", same_side_active_layer - same_side_ghost_layer) |
| 169 | +) -> NDArray[F]: |
| 170 | + return cast("NDArray[F]", same_side_active_layer - same_side_ghost_layer) |
171 | 171 |
|
172 | 172 |
|
173 | 173 | def periodic_boundary( |
174 | | - same_side_active_layer: NDArray[FloatT], |
175 | | - same_side_ghost_layer: NDArray[FloatT], |
176 | | - opposite_side_active_layer: NDArray[FloatT], |
177 | | - opposite_side_ghost_layer: NDArray[FloatT], |
178 | | - weight_same_side_active_layer: NDArray[FloatT], |
179 | | - weight_same_side_ghost_layer: NDArray[FloatT], |
180 | | - weight_opposite_side_active_layer: NDArray[FloatT], |
181 | | - weight_opposite_side_ghost_layer: NDArray[FloatT], |
| 174 | + same_side_active_layer: NDArray[F], |
| 175 | + same_side_ghost_layer: NDArray[F], |
| 176 | + opposite_side_active_layer: NDArray[F], |
| 177 | + opposite_side_ghost_layer: NDArray[F], |
| 178 | + weight_same_side_active_layer: NDArray[F], |
| 179 | + weight_same_side_ghost_layer: NDArray[F], |
| 180 | + weight_opposite_side_active_layer: NDArray[F], |
| 181 | + weight_opposite_side_ghost_layer: NDArray[F], |
182 | 182 | side: Literal["left", "right"], |
183 | 183 | metadata: dict[str, Any], |
184 | | -) -> NDArray[FloatT]: |
185 | | - return cast("NDArray[FloatT]", same_side_active_layer + opposite_side_ghost_layer) |
| 184 | +) -> NDArray[F]: |
| 185 | + return cast("NDArray[F]", same_side_active_layer + opposite_side_ghost_layer) |
186 | 186 |
|
187 | 187 |
|
188 | 188 | _base_registry: dict[str, BoundaryRecipeT] = { |
|
0 commit comments