From 499eba596b9008cc2983b961cb5ffc758d74e8fa Mon Sep 17 00:00:00 2001 From: Fanny CHOPOT <fanny.chopot.ocre@cea.fr> Date: Thu, 31 May 2018 09:09:02 +0200 Subject: [PATCH] ajout pas de temps dans fichier sortie --- src/main.cpp | 13 ++++++++----- src/mesh/Mesh.hpp | 4 ++-- src/scheme/FiniteVolumesEulerUnknowns.hpp | 6 +++--- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 84adbade6..97bc4e94c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -141,8 +141,8 @@ int main(int argc, char *argv[]) const Kokkos::View<const double*> Vj = mesh_data.Vj(); const Kokkos::View<const Rd**> Cjr = mesh_data.Cjr(); - const double tmax=0.5; - double t=0; + const double tmax=2.; + double t=0.; int itermax=std::numeric_limits<int>::max(); int iteration=0; @@ -163,6 +163,7 @@ int main(int argc, char *argv[]) const Kokkos::View<const Rd*> xj = mesh_data.xj(); std::ofstream fout("inter"); fout.precision(15); + fout << std::fixed << 0. << ' ' << std::fixed << t << '\n'; for (size_t j=0; j<mesh.numberOfCells(); ++j) { fout << std::fixed << xj[j][0] << ' ' << std::fixed << rhoj[j] << '\n'; } @@ -223,6 +224,8 @@ int main(int argc, char *argv[]) //fout.clear(); //fout.seekp(0, std::ios::beg); std::string ligne; + getline(fint, ligne); + fout << ligne << ' ' << std::fixed << t << '\n'; for (size_t j = 0; j<mesh.numberOfCells(); ++j) { getline(fint, ligne); fout << ligne << ' ' << std::fixed << rhoj[j] << '\n'; @@ -233,8 +236,8 @@ int main(int argc, char *argv[]) std::ifstream rint("film_rho"); std::ofstream rout("inter", std::ios::trunc); fout.precision(15); - //fout.clear(); - //fout.seekp(0, std::ios::beg); + getline(rint, ligne); + rout << ligne << '\n'; for (size_t j = 0; j<mesh.numberOfCells(); ++j) { getline(rint, ligne); rout << ligne << '\n'; @@ -290,7 +293,7 @@ int main(int argc, char *argv[]) const Kokkos::View<const Rd*> xj = mesh_data.xj(); const Kokkos::View<const double*> rhoj = unknowns.rhoj(); //double h = std::sqrt(1. - (tmax*tmax)/(50./9.)); - std::ofstream fout("rho1.5"); + std::ofstream fout("rho"); fout.precision(15); for (size_t j=0; j<mesh.numberOfCells(); ++j) { fout << xj[j][0] << ' ' << rhoj[j] << '\n'; diff --git a/src/mesh/Mesh.hpp b/src/mesh/Mesh.hpp index ef3176a03..667f1877d 100644 --- a/src/mesh/Mesh.hpp +++ b/src/mesh/Mesh.hpp @@ -80,8 +80,8 @@ public: m_x0("x0", 1), m_xmax("xmax", 1) { - double a = 0.1; - double b = 1.; + double a = 0.; + double b = 10.; m_x0[0][0] = a; m_xmax[0][0] = b; const double delta_x = (b-a)/connectivity.numberOfCells(); diff --git a/src/scheme/FiniteVolumesEulerUnknowns.hpp b/src/scheme/FiniteVolumesEulerUnknowns.hpp index 0d8a75c7c..34e9e84a8 100644 --- a/src/scheme/FiniteVolumesEulerUnknowns.hpp +++ b/src/scheme/FiniteVolumesEulerUnknowns.hpp @@ -241,7 +241,7 @@ public: if (xj[j][0]<0.7) { m_kj[j]=0.; } else { - if (xj[j][0]<0.85){ + if (xj[j][0]<0.9){ m_kj[j]=0.5; } else { m_kj[j]=0.; @@ -253,8 +253,8 @@ public: m_uL[0] = zero; m_uR[0] = zero; - m_kL[0] = 0.01; - m_kR[0] = 0.5; + m_kL[0] = 0.; + m_kR[0] = 0.; } -- GitLab