From 891b3bf15de5611e3b682fe8a486f630deb5a1a8 Mon Sep 17 00:00:00 2001 From: Fanny CHOPOT <fanny.chopot.ocre@cea.fr> Date: Wed, 20 Jun 2018 08:39:13 +0200 Subject: [PATCH] test pertinent ou non pour k regulier et tube de choc de Sod --- src/main.cpp | 14 +++++++------- src/scheme/FiniteVolumesEulerUnknowns.hpp | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 185991619..28d36d13b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -160,12 +160,12 @@ int main(int argc, char *argv[]) double c = 0.; c = finite_volumes_diffusion.conservatif(unknowns); - /* + // Ecriture des valeurs initiales dans un fichier const Kokkos::View<const Rd*> xj = mesh_data.xj(); const Kokkos::View<const Rd*> xr = mesh.xr(); - + /* // rho std::ofstream fout1("inter1", std::ios::trunc); fout1.precision(15); @@ -244,20 +244,20 @@ int main(int argc, char *argv[]) tempo.precision(5); tempo << std::fixed << t << '\n'; tempo.close(); - + */ // Fichier k indicateur std::ofstream diff("diffinter"); diff.precision(5); for (size_t j=0; j<mesh.numberOfCells(); ++j) { - //diff << std::fixed << xj[j][0] << ' ' << std::fixed << kj[j] << '\n'; - if (kj[j]>0.) { + diff << std::fixed << xj[j][0] << ' ' << std::fixed << kj[j] << '\n'; + /*if (kj[j]>0.) { diff << std::fixed << xj[j][0] << ' ' << std::fixed << 4. << '\n'; } else { diff << std::fixed << xj[j][0] << ' ' << std::fixed << -0.1 << '\n'; - } + }*/ } diff.close(); - */ + while((t<tmax) and (iteration<itermax)) { diff --git a/src/scheme/FiniteVolumesEulerUnknowns.hpp b/src/scheme/FiniteVolumesEulerUnknowns.hpp index ce20a9948..29445d094 100644 --- a/src/scheme/FiniteVolumesEulerUnknowns.hpp +++ b/src/scheme/FiniteVolumesEulerUnknowns.hpp @@ -312,7 +312,7 @@ public: */ // k regulier - int n = 1.; + int n = 10.; m_kj[j] = std::exp(1.)*std::exp(-1./(1.-( (xj[j][0]-(0.7+0.1/n)) / (0.1/n) )*( (xj[j][0]-(0.7+0.1/n)) / (0.1/n) ))) * (xj[j][0]>0.7)*(xj[j][0]<0.7+0.1/n) + std::exp(1.)*std::exp(-1./(1.-( (xj[j][0]-(0.9-0.1/n)) / (0.1/n) )*( (xj[j][0]-(0.9-0.1/n)) / (0.1/n) ))) * (xj[j][0]>0.9-0.1/n)*(xj[j][0]<0.9) + (xj[j][0]>0.7+0.1/n)*(xj[j][0]<0.9-0.1/n); m_kj[j] = 0.014*m_kj[j]; -- GitLab