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

ajout variables post traitements pour films

parent 661f8bbf
No related branches found
No related tags found
No related merge requests found
...@@ -142,7 +142,7 @@ int main(int argc, char *argv[]) ...@@ -142,7 +142,7 @@ int main(int argc, char *argv[])
const Kokkos::View<const double*> Vj = mesh_data.Vj(); const Kokkos::View<const double*> Vj = mesh_data.Vj();
const Kokkos::View<const Rd**> Cjr = mesh_data.Cjr(); const Kokkos::View<const Rd**> Cjr = mesh_data.Cjr();
const double tmax=0.7; const double tmax=0.8;
double t=0.; double t=0.;
int itermax=std::numeric_limits<int>::max(); int itermax=std::numeric_limits<int>::max();
...@@ -189,6 +189,54 @@ int main(int argc, char *argv[]) ...@@ -189,6 +189,54 @@ int main(int argc, char *argv[])
} }
fout3.close(); fout3.close();
// p
std::ofstream fout4("inter4", std::ios::trunc);
fout4.precision(15);
for (size_t j=0; j<mesh.numberOfCells(); ++j) {
fout4 << std::fixed << xj[j][0] << ' ' << std::fixed << pj[j] << '\n';
}
fout4.close();
// S
std::ofstream fout5("inter5", std::ios::trunc);
fout5.precision(15);
for (size_t j=0; j<mesh.numberOfCells(); ++j) {
fout5 << std::fixed << xj[j][0] << ' ' << std::fixed << std::log(pj[j]*std::pow(rhoj[j],-gammaj[j])) << '\n';
}
fout5.close();
// derivee de u
std::ofstream fout6("inter6", std::ios::trunc);
fout6.precision(15);
for (size_t j=0; j<mesh.numberOfCells()-1; ++j) {
fout6 << std::fixed << xj[j][0] << ' ' << std::fixed << (uj[j+1][0]-uj[j][0])/(xj[j+1][0]-xj[j][0]) << '\n';
}
fout6.close();
// derivee de p
std::ofstream fout7("inter7", std::ios::trunc);
fout7.precision(15);
for (size_t j=0; j<mesh.numberOfCells()-1; ++j) {
fout7 << std::fixed << xj[j][0] << ' ' << std::fixed << (pj[j+1]-pj[j])/(xj[j+1][0]-xj[j][0]) << '\n';
}
fout7.close();
// derivee de rho
std::ofstream fout8("inter8", std::ios::trunc);
fout8.precision(15);
for (size_t j=0; j<mesh.numberOfCells()-1; ++j) {
fout8 << std::fixed << xj[j][0] << ' ' << std::fixed << (rhoj[j+1]-rhoj[j])/(xj[j+1][0]-xj[j][0]) << '\n';
}
fout8.close();
// terme baroclyne
std::ofstream fout9("inter9", std::ios::trunc);
fout9.precision(15);
for (size_t j=0; j<mesh.numberOfCells()-1; ++j) {
fout9 << std::fixed << xj[j][0] << ' ' << std::fixed << (((rhoj[j+1]-rhoj[j])/(xj[j+1][0]-xj[j][0]))*((pj[j+1]-pj[j])/(xj[j+1][0]-xj[j][0])))/(rhoj[j]*rhoj[j]) << '\n';
}
fout9.close();
// Fichier temps // Fichier temps
std::ofstream tempo("temps"); std::ofstream tempo("temps");
tempo.precision(5); tempo.precision(5);
...@@ -203,7 +251,7 @@ int main(int argc, char *argv[]) ...@@ -203,7 +251,7 @@ int main(int argc, char *argv[])
if (kj[j]>0.) { if (kj[j]>0.) {
diff << std::fixed << xj[j][0] << ' ' << std::fixed << 4. << '\n'; diff << std::fixed << xj[j][0] << ' ' << std::fixed << 4. << '\n';
} else { } else {
diff << std::fixed << xj[j][0] << ' ' << std::fixed << 0. << '\n'; diff << std::fixed << xj[j][0] << ' ' << std::fixed << -0.1 << '\n';
} }
} }
diff.close(); diff.close();
...@@ -275,15 +323,16 @@ int main(int argc, char *argv[]) ...@@ -275,15 +323,16 @@ int main(int argc, char *argv[])
++iteration; ++iteration;
std::cout << "temps t : " << t << std::endl; std::cout << "temps t : " << t << std::endl;
// ECRITURE DANS UN FICHIER // ECRITURE DANS UN FICHIER
//if ((std::fmod(t,0.001) < 0.0001) or (t == tmax)) { if ((std::fmod(t,0.001) < 0.0001) or (t == tmax)) {
std::string ligne; std::string ligne;
// rho // rho
std::ifstream fint1("inter1"); std::ifstream fint1("inter1");
std::ofstream fout1("film1", std::ios::trunc); std::ofstream fout1("film_rho", std::ios::trunc);
fout1.precision(15); fout1.precision(15);
for (size_t j = 0; j<mesh.numberOfCells(); ++j) { for (size_t j = 0; j<mesh.numberOfCells(); ++j) {
getline(fint1, ligne); getline(fint1, ligne);
...@@ -292,7 +341,7 @@ int main(int argc, char *argv[]) ...@@ -292,7 +341,7 @@ int main(int argc, char *argv[])
fint1.close(); fint1.close();
fout1.close(); fout1.close();
std::ifstream rint1("film1"); std::ifstream rint1("film_rho");
std::ofstream rout1("inter1", std::ios::trunc); std::ofstream rout1("inter1", std::ios::trunc);
for (size_t j = 0; j<mesh.numberOfCells(); ++j) { for (size_t j = 0; j<mesh.numberOfCells(); ++j) {
getline(rint1, ligne); getline(rint1, ligne);
...@@ -303,7 +352,7 @@ int main(int argc, char *argv[]) ...@@ -303,7 +352,7 @@ int main(int argc, char *argv[])
// u // u
std::ifstream fint2("inter2"); std::ifstream fint2("inter2");
std::ofstream fout2("film2", std::ios::trunc); std::ofstream fout2("film_u", std::ios::trunc);
fout2.precision(15); fout2.precision(15);
for (size_t j = 0; j<mesh.numberOfCells(); ++j) { for (size_t j = 0; j<mesh.numberOfCells(); ++j) {
getline(fint2, ligne); getline(fint2, ligne);
...@@ -312,7 +361,7 @@ int main(int argc, char *argv[]) ...@@ -312,7 +361,7 @@ int main(int argc, char *argv[])
fint2.close(); fint2.close();
fout2.close(); fout2.close();
std::ifstream rint2("film2"); std::ifstream rint2("film_u");
std::ofstream rout2("inter2", std::ios::trunc); std::ofstream rout2("inter2", std::ios::trunc);
for (size_t j = 0; j<mesh.numberOfCells(); ++j) { for (size_t j = 0; j<mesh.numberOfCells(); ++j) {
getline(rint2, ligne); getline(rint2, ligne);
...@@ -323,7 +372,7 @@ int main(int argc, char *argv[]) ...@@ -323,7 +372,7 @@ int main(int argc, char *argv[])
// e // e
std::ifstream fint3("inter3"); std::ifstream fint3("inter3");
std::ofstream fout3("film3", std::ios::trunc); std::ofstream fout3("film_e", std::ios::trunc);
fout3.precision(15); fout3.precision(15);
for (size_t j = 0; j<mesh.numberOfCells(); ++j) { for (size_t j = 0; j<mesh.numberOfCells(); ++j) {
getline(fint3, ligne); getline(fint3, ligne);
...@@ -332,7 +381,7 @@ int main(int argc, char *argv[]) ...@@ -332,7 +381,7 @@ int main(int argc, char *argv[])
fint3.close(); fint3.close();
fout3.close(); fout3.close();
std::ifstream rint3("film3"); std::ifstream rint3("film_e");
std::ofstream rout3("inter3", std::ios::trunc); std::ofstream rout3("inter3", std::ios::trunc);
for (size_t j = 0; j<mesh.numberOfCells(); ++j) { for (size_t j = 0; j<mesh.numberOfCells(); ++j) {
getline(rint3, ligne); getline(rint3, ligne);
...@@ -341,14 +390,133 @@ int main(int argc, char *argv[]) ...@@ -341,14 +390,133 @@ int main(int argc, char *argv[])
rint3.close(); rint3.close();
rout3.close(); rout3.close();
// p
std::ifstream fint4("inter4");
std::ofstream fout4("film_p", std::ios::trunc);
fout4.precision(15);
for (size_t j = 0; j<mesh.numberOfCells(); ++j) {
getline(fint4, ligne);
fout4 << ligne << ' ' << std::fixed << xj[j][0] << ' ' << std::fixed << pj[j] << '\n';
}
fint4.close();
fout4.close();
std::ifstream rint4("film_p");
std::ofstream rout4("inter4", std::ios::trunc);
for (size_t j = 0; j<mesh.numberOfCells(); ++j) {
getline(rint4, ligne);
rout4 << ligne << '\n';
}
rint4.close();
rout4.close();
// S
std::ifstream fint5("inter5");
std::ofstream fout5("film_S", std::ios::trunc);
fout5.precision(15);
for (size_t j = 0; j<mesh.numberOfCells(); ++j) {
getline(fint5, ligne);
fout5 << ligne << ' ' << std::fixed << xj[j][0] << ' ' << std::fixed << std::log(pj[j]*std::pow(rhoj[j],-gammaj[j])) << '\n';
}
fint5.close();
fout5.close();
std::ifstream rint5("film_S");
std::ofstream rout5("inter5", std::ios::trunc);
for (size_t j = 0; j<mesh.numberOfCells(); ++j) {
getline(rint5, ligne);
rout5 << ligne << '\n';
}
rint5.close();
rout5.close();
// derivee de u
std::ifstream fint6("inter6");
std::ofstream fout6("film_du", std::ios::trunc);
fout6.precision(15);
for (size_t j = 0; j<mesh.numberOfCells()-1; ++j) {
getline(fint6, ligne);
fout6 << ligne << ' ' << std::fixed << xj[j][0] << ' ' << std::fixed << (uj[j+1][0]-uj[j][0])/(xj[j+1][0]-xj[j][0]) << '\n';
}
fint6.close();
fout6.close();
std::ifstream rint6("film_du");
std::ofstream rout6("inter6", std::ios::trunc);
for (size_t j = 0; j<mesh.numberOfCells()-1; ++j) {
getline(rint6, ligne);
rout6 << ligne << '\n';
}
rint6.close();
rout6.close();
// derivee de p
std::ifstream fint7("inter7");
std::ofstream fout7("film_dp", std::ios::trunc);
fout7.precision(15);
for (size_t j = 0; j<mesh.numberOfCells()-1; ++j) {
getline(fint7, ligne);
fout7 << ligne << ' ' << std::fixed << xj[j][0] << ' ' << std::fixed << (pj[j+1]-pj[j])/(xj[j+1][0]-xj[j][0]) << '\n';
}
fint7.close();
fout7.close();
std::ifstream rint7("film_dp");
std::ofstream rout7("inter7", std::ios::trunc);
for (size_t j = 0; j<mesh.numberOfCells()-1; ++j) {
getline(rint7, ligne);
rout7 << ligne << '\n';
}
rint7.close();
rout7.close();
// derivee de rho
std::ifstream fint8("inter8");
std::ofstream fout8("film_drho", std::ios::trunc);
fout8.precision(15);
for (size_t j = 0; j<mesh.numberOfCells()-1; ++j) {
getline(fint8, ligne);
fout8 << ligne << ' ' << std::fixed << xj[j][0] << ' ' << std::fixed << (rhoj[j+1]-rhoj[j])/(xj[j+1][0]-xj[j][0]) << '\n';
}
fint8.close();
fout8.close();
std::ifstream rint8("film_drho");
std::ofstream rout8("inter8", std::ios::trunc);
for (size_t j = 0; j<mesh.numberOfCells()-1; ++j) {
getline(rint8, ligne);
rout8 << ligne << '\n';
}
rint8.close();
rout8.close();
// terme baroclyne
std::ifstream fint9("inter9");
std::ofstream fout9("film_baro", std::ios::trunc);
fout9.precision(15);
for (size_t j = 0; j<mesh.numberOfCells()-1; ++j) {
getline(fint9, ligne);
fout9 << ligne << ' ' << std::fixed << xj[j][0] << ' ' << std::fixed << (((rhoj[j+1]-rhoj[j])/(xj[j+1][0]-xj[j][0]))*((pj[j+1]-pj[j])/(xj[j+1][0]-xj[j][0])))/(rhoj[j]*rhoj[j])<< '\n';
}
fint9.close();
fout9.close();
std::ifstream rint9("film_baro");
std::ofstream rout9("inter9", std::ios::trunc);
for (size_t j = 0; j<mesh.numberOfCells()-1; ++j) {
getline(rint9, ligne);
rout9 << ligne << '\n';
}
rint9.close();
rout9.close();
// Fichier temps // Fichier temps
std::ofstream tempo("temps", std::ios::app); std::ofstream tempo("temps", std::ios::app);
tempo.precision(5); tempo.precision(5);
tempo << std::fixed << t << '\n'; tempo << std::fixed << t << '\n';
tempo.close(); tempo.close();
// k // Fichier k indicateur
std::ifstream diffint("diffinter"); std::ifstream diffint("diffinter");
std::ofstream diffout("k", std::ios::trunc); std::ofstream diffout("k", std::ios::trunc);
diffout.precision(5); diffout.precision(5);
...@@ -358,7 +526,7 @@ int main(int argc, char *argv[]) ...@@ -358,7 +526,7 @@ int main(int argc, char *argv[])
if (kj[j]>0.) { if (kj[j]>0.) {
diffout << ligne << ' ' << std::fixed << xj[j][0] << ' ' << std::fixed << 4. << '\n'; diffout << ligne << ' ' << std::fixed << xj[j][0] << ' ' << std::fixed << 4. << '\n';
} else { } else {
diffout << ligne << ' ' << std::fixed << xj[j][0] << ' ' << std::fixed << 0. << '\n'; diffout << ligne << ' ' << std::fixed << xj[j][0] << ' ' << std::fixed << -0.1 << '\n';
} }
} }
diffint.close(); diffint.close();
...@@ -373,7 +541,7 @@ int main(int argc, char *argv[]) ...@@ -373,7 +541,7 @@ int main(int argc, char *argv[])
riffint.close(); riffint.close();
riffout.close(); riffout.close();
//} }
// ENTROPY TEST // ENTROPY TEST
//finite_volumes_diffusion.entropie(unknowns); //finite_volumes_diffusion.entropie(unknowns);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment