@@ -532,15 +532,20 @@ def Evolve_1D_Display(self):
532532 while window .running :
533533 self .eta_paint ()
534534 if use_ggui :
535- canvas .circles (self .eta1D ,radius = 0.005 ,color = (0. , 150 / 255. , 255. / 255 ))
536- canvas .lines (self .bottom1D ,width = 0.01 ,indices = self .indexbottom1D ,color = (128 / 255. , 0.0 , 0. ))
535+ try :
536+ canvas .circles (self .eta1D ,radius = 0.005 ,color = (0. , 150 / 255. , 255. / 255 ))
537+ canvas .lines (self .bottom1D ,width = 0.01 ,indices = self .indexbottom1D ,color = (128 / 255. , 0.0 , 0. ))
538+ except Exception as e :
539+ print (f"Error in GGUI circles / lines rendering: { e } " )
537540 else :
538- for ii in range (self .solver .nx ):
539- window .circle (pos = [self .eta1D [ii ][0 ], self .eta1D [ii ][1 ]], radius = 1 , color = 0x00FFFF )
540- if ii >= self .solver .nx - 1 :
541- continue
542- window .line (self .bottom1D [ii ], self .bottom1D [ii + 1 ], radius = 1 , color = 0x39FF14 )
543-
541+ try :
542+ for ii in range (self .solver .nx ):
543+ window .circle (pos = [self .eta1D [ii ][0 ], self .eta1D [ii ][1 ]], radius = 1 , color = 0x00FFFF )
544+ if ii >= self .solver .nx - 1 :
545+ continue
546+ window .line (self .bottom1D [ii ], self .bottom1D [ii + 1 ], radius = 1 , color = 0x39FF14 )
547+ except Exception as e :
548+ print (f"Error in legacy GUI circle / line rendering: { e } " )
544549 self .Evolve_Steps (i )
545550
546551 if i == 1 or (i % 100 )== 0 :
@@ -685,10 +690,12 @@ def Evolve_Display( # noqa: C901, N802, D102
685690 ) # using the Taichi tensors to render the image
686691 self .Evolve_Steps (i )
687692
688- window .line (self .solver .force_sensor_begin_scaled , self .solver .force_sensor_end_scaled , radius = 1 , color = 0x39FF14 )
689- for k in range (self .solver .num_wave_gauges ):
690- window .circle (pos = [self .solver .wave_gauge_scaled [int (k ),int (0 )], self .solver .wave_gauge_scaled [int (k ),int (1 )]], radius = 2 , color = 0xFF5733 )
691-
693+ try :
694+ window .line (self .solver .force_sensor_begin_scaled , self .solver .force_sensor_end_scaled , radius = 1 , color = 0x39FF14 )
695+ for k in range (self .solver .num_wave_gauges ):
696+ window .circle (pos = [self .solver .wave_gauge_scaled [int (k ),int (0 )], self .solver .wave_gauge_scaled [int (k ),int (1 )]], radius = 2 , color = 0xFF5733 )
697+ except Exception as e : # noqa: BLE001
698+ print (f'Error in rendering sensors or wave gauges using line / circle: { e } ' ) # noqa:
692699
693700 if i == self .buffer_step :
694701 start_time = (
0 commit comments