@@ -407,6 +407,7 @@ def compute_circularity(loop_polydata):
407407 npts = face .GetNumberOfPoints ()
408408 # Canonicalize face nodes to a sorted tuple so orientation/order doesn't matter
409409 key = tuple (sorted (face .GetPointId (k ) for k in range (npts )))
410+ print ("key: {} -> {}" .format (key , i ))
410411 face_to_cell [key ] = i
411412 #for i, cap in enumerate(iscap):
412413 # if not cap == 1:
@@ -422,9 +423,9 @@ def compute_circularity(loop_polydata):
422423 if not isinstance (mesh , type (None )):
423424 wall_surface .point_data ["GlobalNodeID" ] = numpy .zeros (wall_surface .n_points , dtype = numpy .int32 )
424425 wall_surface .cell_data ['GlobalElementID' ] = numpy .zeros (wall_surface .n_cells , dtype = numpy .int32 )
425- wall_surface .cell_data ['ModelFaceID' ] = numpy .ones (wall_surface .n_cells , dtype = numpy .int32 )
426+ wall_surface .cell_data ['ModelFaceID' ] = numpy .ones (wall_surface .n_cells , dtype = numpy .int32 ) * i
426427 _ , indices = global_node_tree .query (wall_surface .points )
427- wall_surface .point_data ["GlobalNodeID" ] = indices .astype (int )
428+ wall_surface .point_data ["GlobalNodeID" ] = indices .astype (numpy . int32 )
428429 # Assign Global Element IDs
429430 wall_faces = wall_surface .point_data ["GlobalNodeID" ][wall_surface .faces ]
430431 wall_faces = wall_faces .reshape (- 1 , 4 )[:, 1 :].tolist ()
@@ -465,10 +466,10 @@ def compute_circularity(loop_polydata):
465466 if not isinstance (mesh , type (None )):
466467 cap_surface .point_data ["GlobalNodeID" ] = numpy .zeros (cap_surface .n_points , dtype = numpy .int32 )
467468 cap_surface .cell_data ["GlobalElementID" ] = numpy .zeros (cap_surface .n_cells , dtype = numpy .int32 )
468- cap_surface .cell_data ["ModelFaceID" ] = numpy .ones (cap_surface .n_cells , dtype = numpy .int32 )
469+ cap_surface .cell_data ["ModelFaceID" ] = numpy .ones (cap_surface .n_cells , dtype = numpy .int32 ) * ( len ( walls ) + i )
469470 # Assign Global Node IDs
470471 _ , indices = global_node_tree .query (cap_surface .points )
471- cap_surface .point_data ["GlobalNodeID" ] = indices .astype (int )
472+ cap_surface .point_data ["GlobalNodeID" ] = indices .astype (numpy . int32 )
472473 # Assign Global Element IDs
473474 cap_faces = cap_surface .point_data ["GlobalNodeID" ][cap_surface .faces ]
474475 cap_faces = cap_faces .reshape (- 1 , 4 )[:, 1 :].tolist ()
@@ -507,10 +508,10 @@ def compute_circularity(loop_polydata):
507508 if not isinstance (mesh , type (None )):
508509 lumen_surface .point_data ["GlobalNodeID" ] = numpy .zeros (lumen_surface .n_points , dtype = int )
509510 lumen_surface .cell_data ["GlobalElementID" ] = numpy .zeros (lumen_surface .n_cells , dtype = int )
510- lumen_surface .cell_data ["ModelFaceID" ] = numpy .ones (lumen_surface .n_cells , dtype = int ) * (len (caps ) + i + 2 )
511+ lumen_surface .cell_data ["ModelFaceID" ] = numpy .ones (lumen_surface .n_cells , dtype = int ) * (len (walls ) + len ( caps ) + i )
511512 # Assign Global Node IDs
512513 _ , indices = global_node_tree .query (lumen_surface .points )
513- lumen_surface .point_data ["GlobalNodeID" ] = indices .astype (int )
514+ lumen_surface .point_data ["GlobalNodeID" ] = indices .astype (numpy . int32 )
514515 # Assign Global Element IDs
515516 lumen_faces = lumen_surface .point_data ["GlobalNodeID" ][lumen_surface .faces ]
516517 lumen_faces = lumen_faces .reshape (- 1 , 4 )[:, 1 :].tolist ()
0 commit comments