From ce1d2343a18fd212b2ddc96f91c74da1dd2340e4 Mon Sep 17 00:00:00 2001 From: Fanny CHOPOT <fanny.chopot.ocre@cea.fr> Date: Tue, 11 Sep 2018 11:43:07 +0200 Subject: [PATCH] tentative avec ur solveur de Riemann dans d_x u, SIGFPE --- src/mesh/Mesh.hpp | 8 ++++---- src/scheme/NoSplitting.hpp | 18 +++++++++++++++--- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/mesh/Mesh.hpp b/src/mesh/Mesh.hpp index a9219164d..7440cdc15 100644 --- a/src/mesh/Mesh.hpp +++ b/src/mesh/Mesh.hpp @@ -73,7 +73,7 @@ public: return m_xmax; } - /* + // pas constant Mesh(const Connectivity& connectivity) @@ -91,7 +91,7 @@ public: m_xr[r][0] = a + r*delta_x; }); } - */ + // pas non constant /* @@ -125,7 +125,7 @@ public: // pas aleatoire - + /* Mesh(const Connectivity& connectivity) : m_connectivity(connectivity), m_xr("xr", connectivity.numberOfNodes()), @@ -160,7 +160,7 @@ public: //std::exit(0); } - + */ ~Mesh() diff --git a/src/scheme/NoSplitting.hpp b/src/scheme/NoSplitting.hpp index c1a9d6471..eade1009b 100644 --- a/src/scheme/NoSplitting.hpp +++ b/src/scheme/NoSplitting.hpp @@ -393,7 +393,7 @@ public: PTj(j) = pj(j) - kj(j)*2.*sum/sum1; } */ - + /* // Calcul de PT (2eme essai, symetrisation) const Kokkos::View<const unsigned int**>& face_cells = m_connectivity.faceCells(); const Kokkos::View<const unsigned short*> face_nb_cells @@ -422,11 +422,23 @@ public: PTj(j) = pj(j) + kj(j)*(t/((50./9.)-t*t)); //PTj(j) = pj(j) - kj(j)*(uR[0][0]-uj[j][0])/Vl(m_mesh.numberOfFaces()-1); } else { - //PTj(j) = pj(j) - kj(j)*(stock[1]-stock[0])/Vj(j); PTj(j) = pj(j) - kj(j)*(stock[1]-stock[0])/Vj(j); } + */ + + // Calcul de PT (3eme essai, avec uR du solveur de Riemann) + Kokkos::parallel_for(m_mesh.numberOfCells(), KOKKOS_LAMBDA(const int& j) { + + if (j == 0) { + //PTj(j) = pj(j) - kj(j)*(uj[j][0]-uL[0][0])/Vl(0); + PTj(j) = pj(j) + kj(j)*(t/((50./9.)-t*t)); + } else if (j == m_mesh.numberOfCells()-1) { + PTj(j) = pj(j) + kj(j)*(t/((50./9.)-t*t)); + //PTj(j) = pj(j) - kj(j)*(uR[0][0]-uj[j][0])/Vl(m_mesh.numberOfFaces()-1); + } else { + PTj(j) = pj(j) - kj(j)*(ur[cell_nodes(j,1)][0]-ur[cell_nodes(j,0)][0])/Vj(j); + } - }); // Mise a jour de k -- GitLab