Skip to content
Snippets Groups Projects
Commit 7143feb8 authored by Fanny CHOPOT's avatar Fanny CHOPOT
Browse files

creation fichier pour tracer h en fonction de x pour le maillage aleatoire

parent 9936fa37
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment