From 9dfa6abb4e08cdca6f525a9b4484c6c61a29bf31 Mon Sep 17 00:00:00 2001
From: Fanny CHOPOT <fanny.chopot.ocre@cea.fr>
Date: Wed, 25 Apr 2018 09:12:50 +0200
Subject: [PATCH] =?UTF-8?q?bugs=20r=C3=A9gl=C3=A9s?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/main.cpp                          | 11 ++++++++---
 src/scheme/FiniteVolumesDiffusion.hpp |  4 ++--
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/main.cpp b/src/main.cpp
index 6abce8dce..5e6325e1b 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -131,6 +131,7 @@ int main(int argc, char *argv[])
     unknowns.initializeSod();
 
     AcousticSolver<MeshDataType> acoustic_solver(mesh_data, unknowns);
+    FiniteVolumesDiffusion<MeshDataType> finite_volumes_diffusion(mesh_data, unknowns);
 
     typedef TinyVector<MeshType::dimension> Rd;
 
@@ -148,17 +149,21 @@ int main(int argc, char *argv[])
     Kokkos::View<double*> pj = unknowns.pj();
     Kokkos::View<double*> gammaj = unknowns.gammaj();
     Kokkos::View<double*> cj = unknowns.cj();
+    Kokkos::View<double*> kj = unknowns.kj();
 
     BlockPerfectGas block_eos(rhoj, ej, pj, gammaj, cj);
 
     while((t<tmax) and (iteration<itermax)) {
-      double dt = 0.4*acoustic_solver.acoustic_dt(Vj, cj);
+      //double dt = 0.4*acoustic_solver.acoustic_dt(Vj, cj);
+      double dt = 0.4*finite_volumes_diffusion.diffusion_dt(rhoj, kj);
+
       if (t+dt>tmax) {
 	dt=tmax-t;
       }
 
-      acoustic_solver.computeNextStep(t,dt, unknowns);
-
+      //acoustic_solver.computeNextStep(t,dt, unknowns);
+      finite_volumes_diffusion.computeNextStep(t, dt, unknowns);
+      
       block_eos.updatePandCFromRhoE();    
     
       t += dt;
diff --git a/src/scheme/FiniteVolumesDiffusion.hpp b/src/scheme/FiniteVolumesDiffusion.hpp
index 99ab626e3..1afd942e1 100644
--- a/src/scheme/FiniteVolumesDiffusion.hpp
+++ b/src/scheme/FiniteVolumesDiffusion.hpp
@@ -100,7 +100,7 @@ private:
 
     Kokkos::parallel_for(m_mesh.numberOfCells(), KOKKOS_LAMBDA(const int& j) {
 	for (int r=0; r<cell_nb_nodes[j]; ++r) {
-	  m_Gjr(j,r) = 0.5*(uj(cell_nodes(j,r)) + uj(cell_nodes(j,r)-1))*Fjr(j,r);
+	  m_Gjr(j,r) = 0.5*((uj(cell_nodes(j,r)) + uj(cell_nodes(j,r)-1)),Fjr(j,r));
 	}
       });
 
@@ -195,7 +195,7 @@ public:
     const Kokkos::View<const Rd**> Cjr = m_mesh_data.Cjr();
 
     // Calcule les flux
-    computeExplicitFluxes(xj, rhoj, uj, Cjr, kj);
+    computeExplicitFluxes(uj, Cjr, kj);
 
     const Kokkos::View<const Rd**> Fjr = m_Fjr;
     const Kokkos::View<const double**> Gjr = m_Gjr;
-- 
GitLab