@@ -256,13 +256,11 @@ def construct_islands(self):
256256 self .n_stack [i_b ] = 0
257257 self .stack [self .n_stack [i_b ], i_b ] = i_v
258258 self .n_stack [i_b ] = self .n_stack [i_b ] + 1
259+ self .entity_island [i_v , i_b ] = self .n_islands [i_b ]
259260
260261 while self .n_stack [i_b ] > 0 :
261262 self .n_stack [i_b ] = self .n_stack [i_b ] - 1
262263 v = self .stack [self .n_stack [i_b ], i_b ]
263- if self .entity_island [v , i_b ] != - 1 :
264- continue
265- self .entity_island [v , i_b ] = self .n_islands [i_b ]
266264
267265 for i_edge in range (self .entity_edge [v , i_b ].n ):
268266 _id = self .entity_edge [v , i_b ].start + i_edge # half-edge index
@@ -271,9 +269,10 @@ def construct_islands(self):
271269 if next_v == v :
272270 next_v = self .ci_edges [edge , 1 , i_b ]
273271
274- if self .solver .entities_info .n_dofs [next_v ] > 0 and next_v != v : # 2nd condition must not happen ?
272+ if self .solver .entities_info .n_dofs [next_v ] > 0 and next_v != v and self . entity_island [ next_v , i_b ] == - 1 : # 2nd condition must not happen ?
275273 self .stack [self .n_stack [i_b ], i_b ] = next_v
276274 self .n_stack [i_b ] = self .n_stack [i_b ] + 1
275+ self .entity_island [next_v , i_b ] = self .n_islands [i_b ]
277276
278277 self .n_islands [i_b ] = self .n_islands [i_b ] + 1
279278
0 commit comments