From d6141b903aec07d925bcd7bf70e0e0f729c3bb6d Mon Sep 17 00:00:00 2001
From: Fanny CHOPOT <fanny.chopot.ocre@cea.fr>
Date: Fri, 27 Apr 2018 14:20:53 +0200
Subject: [PATCH] test xr avec pas non constant, OK

---
 src/mesh/Mesh.hpp                     | 27 +++++++++++++++++++++++----
 src/scheme/FiniteVolumesDiffusion.hpp |  4 ++--
 2 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/src/mesh/Mesh.hpp b/src/mesh/Mesh.hpp
index 04f018e34..238a2adb4 100644
--- a/src/mesh/Mesh.hpp
+++ b/src/mesh/Mesh.hpp
@@ -48,16 +48,35 @@ public:
     return m_xr;
   }
 
-  Mesh(const Connectivity& connectivity)
-    : m_connectivity(connectivity),
-      m_xr("xr", connectivity.numberOfNodes())
+  // pas constant
+
+   Mesh(const Connectivity& connectivity)
+     : m_connectivity(connectivity),
+       m_xr("xr", connectivity.numberOfNodes())
   {
     const double delta_x = 1./connectivity.numberOfCells();
     Kokkos::parallel_for(connectivity.numberOfNodes(), KOKKOS_LAMBDA(const int& r){
-	m_xr[r][0] = r*delta_x;
+  	m_xr[r][0] = r*delta_x;
       });
   }
 
+  // pas non constant
+
+  //Mesh(const Connectivity& connectivity)
+  //  : m_connectivity(connectivity),
+  //   m_xr("xr", connectivity.numberOfNodes())
+  //{
+  // const double delta_x = 1./connectivity.numberOfCells();
+  // Kokkos::parallel_for(connectivity.numberOfNodes(), KOKKOS_LAMBDA(const int& r){
+  //	if (r%2 == 0) {
+  //	  m_xr[r][0] = r*delta_x;
+  //	}
+  //	else {
+  //	  m_xr[r][0] = (r*2+1)*0.5*delta_x;
+  //	}
+  //  });
+  //}
+
   ~Mesh()
   {
     ;
diff --git a/src/scheme/FiniteVolumesDiffusion.hpp b/src/scheme/FiniteVolumesDiffusion.hpp
index a9215d594..1af81019e 100644
--- a/src/scheme/FiniteVolumesDiffusion.hpp
+++ b/src/scheme/FiniteVolumesDiffusion.hpp
@@ -206,8 +206,8 @@ public:
 	for (int ll=0; ll<cell_nb_faces(j); ++ll) {
 	  minVl = std::min(minVl, Vl(cell_faces(j, ll)));
 	}
-	// k=1 => (kj(j+1) + 2*kj(j) + kj(j-1)) = 4
-       	dt_j[j]= 0.5*rhoj(j)*Vj(j)*(2./4.)*minVl;
+	// k=2 => (kj(j+1) + 2*kj(j) + kj(j-1)) = 8
+       	dt_j[j]= 0.5*rhoj(j)*Vj(j)*(2./8.)*minVl;
       });
     
     // for (int j=0; j<m_mesh.numberOfCells(); ++j) {
-- 
GitLab