@@ -445,11 +445,11 @@ def evaluate(cfg: DictConfig):
445
445
for i in [0 , 0.25 , 0.5 , 0.75 , 1.0 ]:
446
446
x_star , y_star , z_star = np .mgrid [- 1.0 :1.0 :100j , - 1.0 :1.0 :100j , - 1.0 :1.0 :100j ]
447
447
x_star , y_star , z_star = (
448
- x_star .reshape (- 1 , 1 ),
449
- y_star .reshape (- 1 , 1 ),
450
- z_star .reshape (- 1 , 1 ),
448
+ x_star .reshape (- 1 , 1 ). astype ( np . float32 ) ,
449
+ y_star .reshape (- 1 , 1 ). astype ( np . float32 ) ,
450
+ z_star .reshape (- 1 , 1 ). astype ( np . float32 ) ,
451
451
)
452
- t_star = i * np .ones (x_star .shape )
452
+ t_star = i * np .ones (x_star .shape , dtype = x_star . dtype )
453
453
u_star , v_star , w_star , p_star = analytic_solution_generate (
454
454
x_star , y_star , z_star , t_star
455
455
)
@@ -474,12 +474,12 @@ def evaluate(cfg: DictConfig):
474
474
475
475
## plot vorticity
476
476
grid_x , grid_y = np .mgrid [- 1.0 :1.0 :1000j , - 1.0 :1.0 :1000j ]
477
- grid_x = grid_x .reshape (- 1 , 1 )
478
- grid_y = grid_y .reshape (- 1 , 1 )
479
- grid_z = np .zeros (grid_x .shape )
477
+ grid_x = grid_x .reshape (- 1 , 1 ). astype ( np . float32 )
478
+ grid_y = grid_y .reshape (- 1 , 1 ). astype ( np . float32 )
479
+ grid_z = np .zeros (grid_x .shape ). astype ( np . float32 )
480
480
T = np .linspace (0 , 1 , 101 )
481
481
for i in T :
482
- t_star = i * np .ones (x_star .shape )
482
+ t_star = i * np .ones (x_star .shape , dtype = x_star . dtype )
483
483
u_star , v_star , w_star , p_star = analytic_solution_generate (
484
484
grid_x , grid_y , grid_z , t_star
485
485
)
@@ -533,6 +533,7 @@ def evaluate(cfg: DictConfig):
533
533
ax [2 , 0 ].set_title ("w_exact" )
534
534
ax [2 , 1 ].set_title ("w_pred" )
535
535
time = "%.3f" % i
536
+ logger .info (f"saving velocity_t={ str (time )} .png" )
536
537
fig .savefig (OUTPUT_DIR + f"/velocity_t={ str (time )} .png" )
537
538
538
539
0 commit comments