@@ -54,20 +54,23 @@ def _ncores(
5454 nnpb -= 1
5555 cpu = lambda icy : icy * nns [0 ] # noqa: E731
5656 if twod is None or "Y" in twod :
57- while (
58- nnpb > 1
59- and meshes [cpu (nns [1 ])]["Y" ][0 , 0 , 0 ]
60- == meshes [ cpu ( nns [ 1 ] - 1 )][ "Y" ][ 0 , - 1 , 0 ]
57+ while nnpb > 1 and np . isclose (
58+ meshes [ cpu ( nns [ 1 ])][ "Y" ][ 0 , 0 , 0 ],
59+ meshes [cpu (nns [1 ] - 1 )]["Y" ][0 , - 1 , 0 ],
60+ rtol = 1e-10 ,
6161 ):
6262 nns [1 ] += 1
6363 nnpb -= nns [0 ]
6464 cpu = lambda icz : icz * nns [0 ] * nns [1 ] # noqa: E731
65- while (
66- nnpb > 1
67- and meshes [cpu (nns [2 ])]["Z" ][0 , 0 , 0 ] == meshes [cpu (nns [2 ] - 1 )]["Z" ][0 , 0 , - 1 ]
65+ while nnpb > 1 and np .isclose (
66+ meshes [cpu (nns [2 ])]["Z" ][0 , 0 , 0 ],
67+ meshes [cpu (nns [2 ] - 1 )]["Z" ][0 , 0 , - 1 ],
68+ rtol = 1e-10 ,
6869 ):
6970 nns [2 ] += 1
7071 nnpb -= nns [0 ] * nns [1 ]
72+ assert nnpb == 1
73+ assert len (meshes ) == np .prod (nns )
7174 return np .array (nns )
7275
7376
@@ -231,6 +234,7 @@ def read_geom(xdmf: FieldXmf, snapshot: int) -> dict[str, Any]:
231234 header : dict [str , Any ] = {}
232235
233236 entry = xdmf [snapshot ]
237+ print (entry )
234238 header ["ti_ad" ] = entry .time
235239 header ["mo_lambda" ] = entry .mo_lambda
236240 header ["mo_thick_sol" ] = entry .mo_thick_sol
0 commit comments