From 7143feb86e0d1bfdce5316fb9c9965664bb3a9b1 Mon Sep 17 00:00:00 2001 From: Fanny CHOPOT <fanny.chopot.ocre@cea.fr> Date: Thu, 2 Aug 2018 11:26:54 +0200 Subject: [PATCH] creation fichier pour tracer h en fonction de x pour le maillage aleatoire --- src/mesh/Mesh.hpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/mesh/Mesh.hpp b/src/mesh/Mesh.hpp index 3aaa5061a..176beae12 100644 --- a/src/mesh/Mesh.hpp +++ b/src/mesh/Mesh.hpp @@ -5,6 +5,7 @@ #include <TinyVector.hpp> #include <random> #include <iostream> +#include <fstream> template <typename ConnectivityType> class Mesh @@ -144,12 +145,19 @@ public: std::random_device rd; std::mt19937 mt(rd()); std::uniform_real_distribution<double> dist(-h/2.1,h/2.1); + + // creation fichier pour tracer h en fonction de x + std::ofstream fout("alea"); + for (int r=1; r<connectivity.numberOfNodes()-1; ++r){ const double delta_xr = dist(mt); - // m_xr[r][0] = m_xr[r-1][0] + std::abs(delta_xr); m_xr[r][0] = r*h + delta_xr; - std::cout << m_xr[r][0] << std::endl; + fout << m_xr[r][0] << ' ' << m_xr[r][0]-m_xr[r-1][0] << '\n'; + //std::cout << m_xr[r][0] << std::endl; } + + fout.close(); + std::exit(0); } -- GitLab