diff --git a/src/mesh/Mesh.hpp b/src/mesh/Mesh.hpp index b7dd7da9da1e781f3546c516201e3d0882b6761c..ddef6dd5b3ae4ddb1242b86090a909749fabc7bd 100644 --- a/src/mesh/Mesh.hpp +++ b/src/mesh/Mesh.hpp @@ -50,7 +50,7 @@ public: // pas constant - + /* Mesh(const Connectivity& connectivity) : m_connectivity(connectivity), m_xr("xr", connectivity.numberOfNodes()) @@ -60,10 +60,10 @@ public: m_xr[r][0] = r*delta_x; }); } - + */ // pas non constant - /* + Mesh(const Connectivity& connectivity) : m_connectivity(connectivity), @@ -85,7 +85,7 @@ public: } }); } - */ + ~Mesh() { diff --git a/src/scheme/FiniteVolumesDiffusion.hpp b/src/scheme/FiniteVolumesDiffusion.hpp index 091870631f89877a543a9722de8e9e6c8941b8a2..3f3fc0d24d4077f3b98e7acee34f699185573d93 100644 --- a/src/scheme/FiniteVolumesDiffusion.hpp +++ b/src/scheme/FiniteVolumesDiffusion.hpp @@ -103,8 +103,10 @@ private: int cell_here = face_cells(l,j); int local_face_number_in_cell = face_cell_local_face(l,j); sum -= tensorProduct(uj(cell_here), Cjr(cell_here, local_face_number_in_cell)); - sum2 += kj(cell_here)*Vj(cell_here); - sum3 += Vj(cell_here); + // sum2 += kj(cell_here)*Vj(cell_here); + //sum3 += Vj(cell_here); + sum2 += (1./Vj(cell_here))*kj(cell_here); + sum3 += 1./Vj(cell_here); } m_Fl(l) = ((sum2/sum3)/Vl(l))*sum; @@ -163,7 +165,7 @@ private: sum += (1./Vj(cell_here))*uj(cell_here); sum2 += 1./Vj(cell_here); } - + m_Gl(l) = (1./sum2)*Fl(l)*sum; }); @@ -352,8 +354,8 @@ public: double erreur = 0.; double exacte = 0.; for (size_t j=0; j<m_mesh.numberOfCells(); ++j) { - //exacte = std::sin(pi*xj[j][0])*std::exp(-2.*pi*pi*0.2); // solution exacte cas test k constant - exacte = std::sin(pi*xj[j][0])*std::exp(-0.2); // solution exacte cas test k non constant + exacte = std::sin(pi*xj[j][0])*std::exp(-2.*pi*pi*0.2); // solution exacte cas test k constant + //exacte = std::sin(pi*xj[j][0])*std::exp(-0.2); // solution exacte cas test k non constant erreur += (exacte - uj[j][0])*(exacte - uj[j][0])*Vj(j); } erreur = std::sqrt(erreur); @@ -370,13 +372,13 @@ public: const Kokkos::View<const Rd*> xj = m_mesh_data.xj(); double pi = 4.*std::atan(1.); - //double exacte = std::sin(pi*xj[0][0])*std::exp(-2.*pi*pi*0.2); // k constant - double exacte = std::sin(pi*xj[0][0])*std::exp(-0.2); // k non constant + double exacte = std::sin(pi*xj[0][0])*std::exp(-2.*pi*pi*0.2); // k constant + //double exacte = std::sin(pi*xj[0][0])*std::exp(-0.2); // k non constant double erreur = std::abs(exacte - uj[0][0]); for (size_t j=1; j<m_mesh.numberOfCells(); ++j) { - //exacte = std::sin(pi*xj[j][0])*std::exp(-2.*pi*pi*0.2); - exacte = std::sin(pi*xj[j][0])*std::exp(-0.2); + exacte = std::sin(pi*xj[j][0])*std::exp(-2.*pi*pi*0.2); + //exacte = std::sin(pi*xj[j][0])*std::exp(-0.2); if (std::abs(exacte - uj[j][0]) > erreur) { erreur = std::abs(exacte - uj[j][0]);