From 4aeb8bb3c5f754257a887bea69eef98e93bb74ae Mon Sep 17 00:00:00 2001
From: Jean-Matthieu Etancelin <jean-matthieu.etancelin@univ-pau.fr>
Date: Wed, 20 Jun 2018 08:23:06 +0200
Subject: [PATCH] fix poisson_rotationnel projection

---
 hysop/backend/host/fortran/operator/poisson_rotational.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/hysop/backend/host/fortran/operator/poisson_rotational.py b/hysop/backend/host/fortran/operator/poisson_rotational.py
index fa54c554b..231376678 100644
--- a/hysop/backend/host/fortran/operator/poisson_rotational.py
+++ b/hysop/backend/host/fortran/operator/poisson_rotational.py
@@ -161,8 +161,10 @@ class PoissonRotationalFFTW(FortranFFTWOperator):
         """
         assert self.dim==3
         ghosts_w = self.output_fields[self.vorticity].ghosts
+        changeLayout, dv, dw = self._initialize_mem_layout()
+        # Vectors are given in ZYX layout to Fortran
         self.dvorticity.data =\
-            fftw2py.projection_om_3d(self.dvorticity.data[0],
-                                     self.dvorticity.data[1],
-                                     self.dvorticity.data[2], ghosts_w)
+            fftw2py.projection_om_3d(dw[2], dw[1], dw[0], ghosts_w)
+        if changeLayout:
+            self._finalize_mem_layout(dv)
         self.dvorticity.exchange_ghosts()
-- 
GitLab