From be79cb0f0f523a915d1ccd37797be5662cdbeb4e Mon Sep 17 00:00:00 2001 From: Corentin Cadiou Date: Fri, 29 May 2020 14:58:10 +0100 Subject: [PATCH] Correct cell ordering between Fortran/C code --- yt/utilities/lib/pyoctree_raytracing.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/yt/utilities/lib/pyoctree_raytracing.py b/yt/utilities/lib/pyoctree_raytracing.py index f5fd46056b8..b20d48dac9f 100644 --- a/yt/utilities/lib/pyoctree_raytracing.py +++ b/yt/utilities/lib/pyoctree_raytracing.py @@ -63,7 +63,9 @@ def set_fields(self, fields, log_fields, no_ghost, force=False): vertex_data = np.log10(vertex_data) # Vertex_data has shape (2, 2, 2, ...) - self.data = vertex_data.reshape(8, -1) + # Note: here we have the wrong ordering within the oct (classical Fortran/C + # ordering issue) so we need to swap axis 0 and 2. + self.data = vertex_data.swapaxes(0, 2).reshape(8, -1) def cast_rays(self, vp_pos, vp_dir): """Cast the rays through the oct.