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

ecriture pas de temps dans un autre fichier

parent 499eba59
No related branches found
No related tags found
No related merge requests found
......@@ -141,7 +141,7 @@ 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=2.;
const double tmax=0.5;
double t=0.;
int itermax=std::numeric_limits<int>::max();
......@@ -161,14 +161,20 @@ int main(int argc, char *argv[])
// Ecriture des valeurs initiales de rho dans un fichier
const Kokkos::View<const Rd*> xj = mesh_data.xj();
std::ofstream fout("inter");
std::ofstream fout("inter", std::ios::trunc);
fout.precision(15);
fout << std::fixed << 0. << ' ' << std::fixed << t << '\n';
//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';
}
fout.close();
// Fichier temps
std::ofstream tempo("temps");
tempo.precision(5);
tempo << std::fixed << t << '\n';
tempo.close();
while((t<tmax) and (iteration<itermax)) {
// ETAPE 1 DU SPLITTING - EULER
......@@ -224,8 +230,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';
//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';
......@@ -236,8 +242,8 @@ int main(int argc, char *argv[])
std::ifstream rint("film_rho");
std::ofstream rout("inter", std::ios::trunc);
fout.precision(15);
getline(rint, ligne);
rout << ligne << '\n';
//getline(rint, ligne);
//rout << ligne << '\n';
for (size_t j = 0; j<mesh.numberOfCells(); ++j) {
getline(rint, ligne);
rout << ligne << '\n';
......@@ -245,6 +251,12 @@ int main(int argc, char *argv[])
rint.close();
rout.close();
// Fichier temps
std::ofstream tempo("temps", std::ios::app);
tempo.precision(5);
tempo << std::fixed << t << '\n';
tempo.close();
}
std::cout << "* " << rang::style::underline << "Final time" << rang::style::reset
......
......@@ -81,7 +81,7 @@ public:
m_xmax("xmax", 1)
{
double a = 0.;
double b = 10.;
double b = 1.;
m_x0[0][0] = a;
m_xmax[0][0] = b;
const double delta_x = (b-a)/connectivity.numberOfCells();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment