From 50a0362d88375b2cd80a5d1470659dfe3b0cceaa Mon Sep 17 00:00:00 2001 From: Fanny CHOPOT <fanny.chopot.ocre@cea.fr> Date: Mon, 14 May 2018 16:54:06 +0200 Subject: [PATCH] modification formule k dans Fl --- src/mesh/Mesh.hpp | 8 ++++---- src/scheme/FiniteVolumesDiffusion.hpp | 20 +++++++++++--------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/mesh/Mesh.hpp b/src/mesh/Mesh.hpp index b7dd7da9d..ddef6dd5b 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 091870631..3f3fc0d24 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]); -- GitLab