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

corrections formules derivees par stephane

parent a1d1268c
No related branches found
No related tags found
No related merge requests found
...@@ -164,6 +164,7 @@ int main(int argc, char *argv[]) ...@@ -164,6 +164,7 @@ int main(int argc, char *argv[])
// Ecriture des valeurs initiales dans un fichier // Ecriture des valeurs initiales dans un fichier
const Kokkos::View<const Rd*> xj = mesh_data.xj(); const Kokkos::View<const Rd*> xj = mesh_data.xj();
const Kokkos::View<const Rd*> xr = mesh.xr();
// rho // rho
std::ofstream fout1("inter1", std::ios::trunc); std::ofstream fout1("inter1", std::ios::trunc);
...@@ -208,32 +209,33 @@ int main(int argc, char *argv[]) ...@@ -208,32 +209,33 @@ int main(int argc, char *argv[])
// derivee de u // derivee de u
std::ofstream fout6("inter6", std::ios::trunc); std::ofstream fout6("inter6", std::ios::trunc);
fout6.precision(15); fout6.precision(15);
for (size_t j=0; j<mesh.numberOfCells()-1; ++j) { // en 1D : mesh.numberOfNodes() = mesh.numberOfCells() - 1
fout6 << std::fixed << xj[j][0] << ' ' << std::fixed << (uj[j+1][0]-uj[j][0])/(xj[j+1][0]-xj[j][0]) << '\n'; for (size_t j=0; j<mesh.numberOfNodes()-2; ++j) {
fout6 << std::fixed << xj[j][0] << ' ' << std::fixed << (uj[j+1][0]-uj[j][0])/(xr[j+2][0]-xr[j+1][0]) << '\n';
} }
fout6.close(); fout6.close();
// derivee de p // derivee de p
std::ofstream fout7("inter7", std::ios::trunc); std::ofstream fout7("inter7", std::ios::trunc);
fout7.precision(15); fout7.precision(15);
for (size_t j=0; j<mesh.numberOfCells()-1; ++j) { for (size_t j=0; j<mesh.numberOfNodes()-2; ++j) {
fout7 << std::fixed << xj[j][0] << ' ' << std::fixed << (pj[j+1]-pj[j])/(xj[j+1][0]-xj[j][0]) << '\n'; fout7 << std::fixed << xj[j][0] << ' ' << std::fixed << (pj[j+1]-pj[j])/(xr[j+2][0]-xr[j+1][0]) << '\n';
} }
fout7.close(); fout7.close();
// derivee de rho // derivee de rho
std::ofstream fout8("inter8", std::ios::trunc); std::ofstream fout8("inter8", std::ios::trunc);
fout8.precision(15); fout8.precision(15);
for (size_t j=0; j<mesh.numberOfCells()-1; ++j) { for (size_t j=0; j<mesh.numberOfNodes()-2; ++j) {
fout8 << std::fixed << xj[j][0] << ' ' << std::fixed << (rhoj[j+1]-rhoj[j])/(xj[j+1][0]-xj[j][0]) << '\n'; fout8 << std::fixed << xj[j][0] << ' ' << std::fixed << (rhoj[j+1]-rhoj[j])/(xr[j+2][0]-xr[j+1][0]) << '\n';
} }
fout8.close(); fout8.close();
// terme baroclyne // terme baroclyne
std::ofstream fout9("inter9", std::ios::trunc); std::ofstream fout9("inter9", std::ios::trunc);
fout9.precision(15); fout9.precision(15);
for (size_t j=0; j<mesh.numberOfCells()-1; ++j) { for (size_t j=0; j<mesh.numberOfNodes()-2; ++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 << std::fixed << xj[j][0] << ' ' << std::fixed << (((rhoj[j+1]-rhoj[j])/(xr[j+2][0]-xr[j+1][0]))*((pj[j+1]-pj[j])/(xr[j+2][0]-xr[j+1][0])))/(rhoj[j]*rhoj[j]) << '\n';
} }
fout9.close(); fout9.close();
...@@ -434,16 +436,16 @@ int main(int argc, char *argv[]) ...@@ -434,16 +436,16 @@ int main(int argc, char *argv[])
std::ifstream fint6("inter6"); std::ifstream fint6("inter6");
std::ofstream fout6("film_du", std::ios::trunc); std::ofstream fout6("film_du", std::ios::trunc);
fout6.precision(15); fout6.precision(15);
for (size_t j = 0; j<mesh.numberOfCells()-1; ++j) { for (size_t j = 0; j<mesh.numberOfNodes()-2; ++j) {
getline(fint6, ligne); 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'; fout6 << ligne << ' ' << std::fixed << xj[j][0] << ' ' << std::fixed << (uj[j+1][0]-uj[j][0])/(xr[j+2][0]-xr[j+1][0]) << '\n';
} }
fint6.close(); fint6.close();
fout6.close(); fout6.close();
std::ifstream rint6("film_du"); std::ifstream rint6("film_du");
std::ofstream rout6("inter6", std::ios::trunc); std::ofstream rout6("inter6", std::ios::trunc);
for (size_t j = 0; j<mesh.numberOfCells()-1; ++j) { for (size_t j = 0; j<mesh.numberOfNodes()-2; ++j) {
getline(rint6, ligne); getline(rint6, ligne);
rout6 << ligne << '\n'; rout6 << ligne << '\n';
} }
...@@ -454,16 +456,16 @@ int main(int argc, char *argv[]) ...@@ -454,16 +456,16 @@ int main(int argc, char *argv[])
std::ifstream fint7("inter7"); std::ifstream fint7("inter7");
std::ofstream fout7("film_dp", std::ios::trunc); std::ofstream fout7("film_dp", std::ios::trunc);
fout7.precision(15); fout7.precision(15);
for (size_t j = 0; j<mesh.numberOfCells()-1; ++j) { for (size_t j = 0; j<mesh.numberOfNodes()-2; ++j) {
getline(fint7, ligne); 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'; fout7 << ligne << ' ' << std::fixed << xj[j][0] << ' ' << std::fixed << (pj[j+1]-pj[j])/(xr[j+2][0]-xr[j+1][0]) << '\n';
} }
fint7.close(); fint7.close();
fout7.close(); fout7.close();
std::ifstream rint7("film_dp"); std::ifstream rint7("film_dp");
std::ofstream rout7("inter7", std::ios::trunc); std::ofstream rout7("inter7", std::ios::trunc);
for (size_t j = 0; j<mesh.numberOfCells()-1; ++j) { for (size_t j = 0; j<mesh.numberOfNodes()-2; ++j) {
getline(rint7, ligne); getline(rint7, ligne);
rout7 << ligne << '\n'; rout7 << ligne << '\n';
} }
...@@ -474,16 +476,16 @@ int main(int argc, char *argv[]) ...@@ -474,16 +476,16 @@ int main(int argc, char *argv[])
std::ifstream fint8("inter8"); std::ifstream fint8("inter8");
std::ofstream fout8("film_drho", std::ios::trunc); std::ofstream fout8("film_drho", std::ios::trunc);
fout8.precision(15); fout8.precision(15);
for (size_t j = 0; j<mesh.numberOfCells()-1; ++j) { for (size_t j = 0; j<mesh.numberOfNodes()-2; ++j) {
getline(fint8, ligne); 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'; fout8 << ligne << ' ' << std::fixed << xj[j][0] << ' ' << std::fixed << (rhoj[j+1]-rhoj[j])/(xr[j+2][0]-xr[j+1][0]) << '\n';
} }
fint8.close(); fint8.close();
fout8.close(); fout8.close();
std::ifstream rint8("film_drho"); std::ifstream rint8("film_drho");
std::ofstream rout8("inter8", std::ios::trunc); std::ofstream rout8("inter8", std::ios::trunc);
for (size_t j = 0; j<mesh.numberOfCells()-1; ++j) { for (size_t j = 0; j<mesh.numberOfNodes()-2; ++j) {
getline(rint8, ligne); getline(rint8, ligne);
rout8 << ligne << '\n'; rout8 << ligne << '\n';
} }
...@@ -494,16 +496,16 @@ int main(int argc, char *argv[]) ...@@ -494,16 +496,16 @@ int main(int argc, char *argv[])
std::ifstream fint9("inter9"); std::ifstream fint9("inter9");
std::ofstream fout9("film_baro", std::ios::trunc); std::ofstream fout9("film_baro", std::ios::trunc);
fout9.precision(15); fout9.precision(15);
for (size_t j = 0; j<mesh.numberOfCells()-1; ++j) { for (size_t j = 0; j<mesh.numberOfNodes()-2; ++j) {
getline(fint9, ligne); 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'; fout9 << ligne << ' ' << std::fixed << xj[j][0] << ' ' << std::fixed << (((rhoj[j+1]-rhoj[j])/(xr[j+2][0]-xr[j+1][0]))*((pj[j+1]-pj[j])/(xr[j+2][0]-xr[j+1][0])))/(rhoj[j]*rhoj[j])<< '\n';
} }
fint9.close(); fint9.close();
fout9.close(); fout9.close();
std::ifstream rint9("film_baro"); std::ifstream rint9("film_baro");
std::ofstream rout9("inter9", std::ios::trunc); std::ofstream rout9("inter9", std::ios::trunc);
for (size_t j = 0; j<mesh.numberOfCells()-1; ++j) { for (size_t j = 0; j<mesh.numberOfNodes()-2; ++j) {
getline(rint9, ligne); getline(rint9, ligne);
rout9 << ligne << '\n'; rout9 << ligne << '\n';
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment