diff --git a/src/mesh/Mesh.hpp b/src/mesh/Mesh.hpp index a9219164d2dd3d736bac2de2595a326376288eae..7440cdc15cd916932eb23549675990fa14b3a292 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 c1a9d64710c1c4d7a245ca0544c8aeefac01b0a5..eade1009bcd074db87372da6056c5985e06b7ef3 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