@@ -79,8 +79,6 @@ def flip_edge(mesh_analysis, n1: Node, n2: Node) -> True:
7979
8080 after_check = check_mesh (mesh_analysis , mesh_before )
8181 if not after_check :
82- plot_mesh (mesh_before )
83- plot_mesh (mesh_analysis .mesh )
8482 raise ValueError ("Some checks are missing" )
8583
8684 return valid_action , topo , geo
@@ -242,23 +240,21 @@ def collapse_edge(mesh_analysis, n1: Node, n2: Node) -> True:
242240 ds = ds11 .get_beta (2 )
243241 if i > 30 :
244242 i = 0
245- plot_mesh (mesh_analysis .mesh )
246243 raise ValueError ("Potential infinite loop in action collapse" )
247244 else :
248245 ds = d2s .get_beta (1 )
249246 ds .set_node (n1 )
250247 ds1 = ds .get_beta (1 )
251248 if i > 30 :
252249 i = 0
253- plot_mesh (mesh_analysis .mesh )
254250 raise ValueError ("Potential infinite loop in action collapse" )
255251
256252 found , new_x , new_y = mesh_analysis .find_star_vertex (n1 )
257253 if found :
258254 n1 .set_xy (new_x , new_y )
259255 else :
260- plot_mesh (mesh_before )
261- plot_mesh (mesh_analysis .mesh )
256+ # plot_mesh(mesh_before)
257+ # plot_mesh(mesh_analysis.mesh)
262258 mesh_analysis .find_star_vertex (n1 , plot = True )
263259 raise ValueError ("No star vertex found" )
264260
@@ -301,7 +297,7 @@ def collapse_edge(mesh_analysis, n1: Node, n2: Node) -> True:
301297
302298 after_check = check_mesh (mesh_analysis , mesh_before )
303299 if not after_check :
304- mesh_analysis .is_star_vertex (n1 , np .array ([n1 .x (), n1 .y ()]), True )
300+ # mesh_analysis.is_star_vertex(n1, np.array([n1.x(), n1.y()]), True)
305301 raise ValueError ("Some checks are missing" )
306302 return True , topo , geo
307303
@@ -352,54 +348,54 @@ def check_mesh(mesh_analysis, m=None) -> bool:
352348 return False
353349 return True
354350
355-
356- def check_mesh_debug (mesh_analysis , mesh_before = None )-> True :
357- for dart_info in mesh_analysis .mesh .active_darts ():
358- #Check beta2 relation
359- d = dart_info [0 ]
360- d2 = dart_info [2 ]
361- # if associated twin dart no longer exist
362- if d2 >= 0 and mesh_analysis .mesh .dart_info [d2 , 0 ] < 0 :
363- plot_mesh (mesh_analysis .mesh )
364- if mesh_before is not None :
365- plot_mesh (mesh_before )
366- raise ValueError ("error beta2" )
367- # if beta2 relation is not symetrical
368- elif d2 >= 0 and mesh_analysis .mesh .dart_info [d2 , 2 ] != d :
369- plot_mesh (mesh_analysis .mesh )
370- if mesh_before is not None :
371- plot_mesh (mesh_before )
372- raise ValueError ("error beta2" )
373- # null dart
374- elif d2 >= 0 and mesh_analysis .mesh .dart_info [d2 , 3 ] == mesh_analysis .mesh .dart_info [d , 3 ]:
375- plot_mesh (mesh_analysis .mesh )
376- if mesh_before is not None :
377- plot_mesh (mesh_before )
378- raise ValueError ("same node for twin darts" )
379- #if adjacent face is the same
380- elif d2 >= 0 and mesh_analysis .mesh .dart_info [d2 , 4 ] == mesh_analysis .mesh .dart_info [d , 4 ]:
381- plot_mesh (mesh_analysis .mesh )
382- if mesh_before is not None :
383- plot_mesh (mesh_before )
384- raise ValueError ("same adjacent face" )
385-
386-
387- d1 = mesh_analysis .mesh .dart_info [d ,1 ]
388- d11 = mesh_analysis .mesh .dart_info [d1 ,1 ]
389-
390- #Check beta1
391- if mesh_analysis .mesh .dart_info [d11 ,1 ]!= d :
392- plot_mesh (mesh_analysis .mesh )
393- if mesh_before is not None :
394- plot_mesh (mesh_before )
395- raise ValueError ("error beta1" )
396-
397- if d2 >= 0 :
398- d = Dart (mesh_analysis .mesh , d )
399- d2 , d1 , d11 , d21 , d211 , n1 , n2 , n3 , n4 = mesh_analysis .mesh .active_triangles (d )
400-
401- if len (set ([n1 .id , n2 .id , n3 .id , n4 .id ])) < 4 :
402- plot_mesh (mesh_analysis .mesh )
403- if mesh_before is not None :
404- plot_mesh (mesh_before )
405- raise ValueError ("same traingle for two faces" )
351+ #
352+ # def check_mesh_debug(mesh_analysis, mesh_before=None)->True:
353+ # for dart_info in mesh_analysis.mesh.active_darts():
354+ # #Check beta2 relation
355+ # d = dart_info[0]
356+ # d2 = dart_info[2]
357+ # # if associated twin dart no longer exist
358+ # if d2 >= 0 and mesh_analysis.mesh.dart_info[d2, 0] < 0:
359+ # plot_mesh(mesh_analysis.mesh)
360+ # if mesh_before is not None:
361+ # plot_mesh(mesh_before)
362+ # raise ValueError("error beta2")
363+ # # if beta2 relation is not symetrical
364+ # elif d2 >= 0 and mesh_analysis.mesh.dart_info[d2, 2] != d:
365+ # plot_mesh(mesh_analysis.mesh)
366+ # if mesh_before is not None:
367+ # plot_mesh(mesh_before)
368+ # raise ValueError("error beta2")
369+ # # null dart
370+ # elif d2>=0 and mesh_analysis.mesh.dart_info[d2, 3] == mesh_analysis.mesh.dart_info[d, 3]:
371+ # plot_mesh(mesh_analysis.mesh)
372+ # if mesh_before is not None:
373+ # plot_mesh(mesh_before)
374+ # raise ValueError("same node for twin darts")
375+ # #if adjacent face is the same
376+ # elif d2>=0 and mesh_analysis.mesh.dart_info[d2, 4] == mesh_analysis.mesh.dart_info[d, 4]:
377+ # plot_mesh(mesh_analysis.mesh)
378+ # if mesh_before is not None:
379+ # plot_mesh(mesh_before)
380+ # raise ValueError("same adjacent face")
381+ #
382+ #
383+ # d1 = mesh_analysis.mesh.dart_info[d,1]
384+ # d11 = mesh_analysis.mesh.dart_info[d1,1]
385+ #
386+ # #Check beta1
387+ # if mesh_analysis.mesh.dart_info[d11,1]!=d :
388+ # plot_mesh(mesh_analysis.mesh)
389+ # if mesh_before is not None:
390+ # plot_mesh(mesh_before)
391+ # raise ValueError("error beta1")
392+ #
393+ # if d2 >= 0 :
394+ # d = Dart(mesh_analysis.mesh, d)
395+ # d2, d1, d11, d21, d211, n1, n2, n3, n4 = mesh_analysis.mesh.active_triangles(d)
396+ #
397+ # if len(set([n1.id, n2.id, n3.id, n4.id])) < 4:
398+ # plot_mesh(mesh_analysis.mesh)
399+ # if mesh_before is not None:
400+ # plot_mesh(mesh_before)
401+ # raise ValueError("same traingle for two faces")
0 commit comments