@@ -75,7 +75,7 @@ def warp_implementation(self, rho, u, vel):
75
75
u = grid .create_field (cardinality = velocity_set .d , dtype = wp .float32 )
76
76
f0 = grid .create_field (cardinality = velocity_set .q , dtype = wp .float32 )
77
77
f1 = grid .create_field (cardinality = velocity_set .q , dtype = wp .float32 )
78
- bc_id = grid .create_field (cardinality = 1 , dtype = wp .uint8 )
78
+ bc_mask = grid .create_field (cardinality = 1 , dtype = wp .uint8 )
79
79
missing_mask = grid .create_field (cardinality = velocity_set .q , dtype = wp .bool )
80
80
81
81
# Make operators
@@ -154,19 +154,19 @@ def warp_implementation(self, rho, u, vel):
154
154
indices = wp .from_numpy (indices , dtype = wp .int32 )
155
155
156
156
# Set boundary conditions on the indices
157
- bc_id , missing_mask = indices_boundary_masker (indices , half_way_bc .id , bc_id , missing_mask , (0 , 0 , 0 ))
157
+ bc_mask , missing_mask = indices_boundary_masker (indices , half_way_bc .id , bc_mask , missing_mask , (0 , 0 , 0 ))
158
158
159
159
# Set inlet bc
160
160
lower_bound = (0 , 0 , 0 )
161
161
upper_bound = (0 , nr , nr )
162
162
direction = (1 , 0 , 0 )
163
- bc_id , missing_mask = planar_boundary_masker (lower_bound , upper_bound , direction , equilibrium_bc .id , bc_id , missing_mask , (0 , 0 , 0 ))
163
+ bc_mask , missing_mask = planar_boundary_masker (lower_bound , upper_bound , direction , equilibrium_bc .id , bc_mask , missing_mask , (0 , 0 , 0 ))
164
164
165
165
# Set outlet bc
166
166
lower_bound = (nr - 1 , 0 , 0 )
167
167
upper_bound = (nr - 1 , nr , nr )
168
168
direction = (- 1 , 0 , 0 )
169
- bc_id , missing_mask = planar_boundary_masker (lower_bound , upper_bound , direction , do_nothing_bc .id , bc_id , missing_mask , (0 , 0 , 0 ))
169
+ bc_mask , missing_mask = planar_boundary_masker (lower_bound , upper_bound , direction , do_nothing_bc .id , bc_mask , missing_mask , (0 , 0 , 0 ))
170
170
171
171
# Set initial conditions
172
172
rho , u = initializer (rho , u , vel )
@@ -181,7 +181,7 @@ def warp_implementation(self, rho, u, vel):
181
181
num_steps = 1024 * 8
182
182
start = time .time ()
183
183
for _ in tqdm (range (num_steps )):
184
- f1 = stepper (f0 , f1 , bc_id , missing_mask , _ )
184
+ f1 = stepper (f0 , f1 , bc_mask , missing_mask , _ )
185
185
f1 , f0 = f0 , f1
186
186
if (_ % plot_freq == 0 ) and (not compute_mlup ):
187
187
rho , u = macroscopic (f0 , rho , u )
@@ -191,7 +191,7 @@ def warp_implementation(self, rho, u, vel):
191
191
plt .imshow (u [0 , :, nr // 2 , :].numpy ())
192
192
plt .colorbar ()
193
193
plt .subplot (1 , 2 , 2 )
194
- plt .imshow (bc_id [0 , :, nr // 2 , :].numpy ())
194
+ plt .imshow (bc_mask [0 , :, nr // 2 , :].numpy ())
195
195
plt .colorbar ()
196
196
plt .savefig (f"{ save_dir } /{ str (_ ).zfill (6 )} .png" )
197
197
plt .close ()
0 commit comments