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

ajout fichier k indicateur zone k non nul

parent 39342952
Branches
No related tags found
No related merge requests found
...@@ -195,6 +195,19 @@ int main(int argc, char *argv[]) ...@@ -195,6 +195,19 @@ int main(int argc, char *argv[])
tempo << std::fixed << t << '\n'; tempo << std::fixed << t << '\n';
tempo.close(); tempo.close();
// Fichier k indicateur
std::ofstream diff("diffinter");
diff.precision(5);
for (size_t j=0; j<mesh.numberOfCells(); ++j) {
//diff << std::fixed << xj[j][0] << ' ' << std::fixed << kj[j] << '\n';
if (kj[j]>0.) {
diff << std::fixed << xj[j][0] << ' ' << std::fixed << 4. << '\n';
} else {
diff << std::fixed << xj[j][0] << ' ' << std::fixed << 0. << '\n';
}
}
diff.close();
while((t<tmax) and (iteration<itermax)) { while((t<tmax) and (iteration<itermax)) {
...@@ -264,7 +277,7 @@ int main(int argc, char *argv[]) ...@@ -264,7 +277,7 @@ int main(int argc, char *argv[])
// 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;
...@@ -334,7 +347,33 @@ int main(int argc, char *argv[]) ...@@ -334,7 +347,33 @@ int main(int argc, char *argv[])
tempo << std::fixed << t << '\n'; tempo << std::fixed << t << '\n';
tempo.close(); tempo.close();
// k
std::ifstream diffint("diffinter");
std::ofstream diffout("k", std::ios::trunc);
diffout.precision(5);
for (size_t j = 0; j<mesh.numberOfCells(); ++j) {
getline(diffint, ligne);
//diffout << ligne << ' ' << std::fixed << xj[j][0] << ' ' << std::fixed << kj[j] << '\n';
if (kj[j]>0.) {
diffout << ligne << ' ' << std::fixed << xj[j][0] << ' ' << std::fixed << 4. << '\n';
} else {
diffout << ligne << ' ' << std::fixed << xj[j][0] << ' ' << std::fixed << 0. << '\n';
}
}
diffint.close();
diffout.close();
std::ifstream riffint("k");
std::ofstream riffout("diffinter", std::ios::trunc);
for (size_t j = 0; j<mesh.numberOfCells(); ++j) {
getline(riffint, ligne);
riffout << ligne << '\n';
} }
riffint.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