tComment out diagnostic info, include fluid pressure in output files - cngf-pf … | |
git clone git://src.adamsgaard.dk/cngf-pf | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit f7d86023d0088369e36a6f887dd04e0ca096616c | |
parent a8d3c51683cd130ccfbaa614ffef059c60d673fb | |
Author: Anders Damsgaard <[email protected]> | |
Date: Tue, 16 Apr 2019 12:58:34 +0200 | |
Comment out diagnostic info, include fluid pressure in output files | |
Diffstat: | |
M fluid.c | 8 ++++---- | |
M main.c | 13 ++++++------- | |
M simulation.c | 10 +++++++++- | |
3 files changed, 19 insertions(+), 12 deletions(-) | |
--- | |
diff --git a/fluid.c b/fluid.c | |
t@@ -104,7 +104,7 @@ int darcy_solver_1d( | |
set_bc_dirichlet(sim->p_f_ghost, sim->nz, +1, p_f_top); | |
sim->p_f_ghost[idx1g(sim->nz-1)] = p_f_top; /* Include top node in BC … | |
set_bc_neumann(sim->p_f_ghost, sim->nz, -1); | |
- puts(".. p_f_ghost after BC:"); print_array(sim->p_f_ghost, sim->nz+2); | |
+ /* puts(".. p_f_ghost after BC:"); print_array(sim->p_f_ghost, sim->nz… | |
/* for (int i=0; i<sim->nz; ++i) */ | |
for (int i=0; i<sim->nz-1; ++i) | |
t@@ -133,10 +133,10 @@ int darcy_solver_1d( | |
} | |
r_norm_max = max(r_norm, sim->nz); | |
- puts(".. p_f_ghost_out:"); print_array(p_f_ghost_out, sim->nz+2); | |
+ /* puts(".. p_f_ghost_out:"); print_array(p_f_ghost_out, sim->nz+2); */ | |
copy_values(p_f_ghost_out, sim->p_f_ghost, sim->nz+2); | |
- puts(".. p_f_ghost after update:"); print_array(sim->p_f_ghost, sim->n… | |
+ /* puts(".. p_f_ghost after update:"); print_array(sim->p_f_ghost, sim… | |
if (r_norm_max <= rel_tol) { | |
set_bc_dirichlet(sim->p_f_ghost, sim->nz, +1, p_f_top); | |
t@@ -146,7 +146,7 @@ int darcy_solver_1d( | |
free(dp_f_impl); | |
free(p_f_ghost_out); | |
free(r_norm); | |
- printf(".. Solution converged after %d iterations\n", iter); | |
+ /* printf(".. Solution converged after %d iterations\n", iter); */ | |
return 0; | |
} | |
} | |
diff --git a/main.c b/main.c | |
t@@ -224,11 +224,10 @@ int main(int argc, char* argv[]) | |
if (sim.fluid) | |
hydrostatic_fluid_pressure_distribution(&sim); | |
- puts(".. p_f_ghost before iterations:"); print_array(sim.p_f_ghost, sim.nz… | |
- puts(""); | |
- | |
- puts(".. normal stress before iterations:"); print_array(sim.sigma_n, sim.… | |
- puts(""); | |
+ /* puts(".. p_f_ghost before iterations:"); print_array(sim.p_f_ghost, sim… | |
+ /* puts(""); */ | |
+ /* puts(".. normal stress before iterations:"); print_array(sim.sigma_n, s… | |
+ /* puts(""); */ | |
double filetimeclock = 0.0; | |
while (sim.t <= sim.t_end) { | |
t@@ -236,8 +235,8 @@ int main(int argc, char* argv[]) | |
if (sim.fluid) { | |
if (darcy_solver_1d(&sim, 10000, 1e-5)) | |
exit(1); | |
- puts(".. p_f_ghost:"); print_array(sim.p_f_ghost, sim.nz+2); | |
- puts(""); | |
+ /* puts(".. p_f_ghost:"); print_array(sim.p_f_ghost, sim.nz+2); */ | |
+ /* puts(""); */ | |
} | |
compute_effective_stress(&sim); | |
diff --git a/simulation.c b/simulation.c | |
t@@ -400,7 +400,15 @@ void write_output_file(struct simulation* sim) | |
sprintf(outfile, "%s.output%05d.txt", sim->name, sim->n_file++); | |
fp = fopen(outfile, "w"); | |
- fprint_three_arrays(fp, sim->z, sim->v_x, sim->sigma_n_eff, sim->nz); | |
+ if (sim->fluid) | |
+ for (int i=0; i<sim->nz; ++i) | |
+ fprintf(fp, "%.17g\t%.17g\t%.17g\t%.17g\n", | |
+ sim->z[i], | |
+ sim->v_x[i], | |
+ sim->sigma_n_eff[i], | |
+ sim->p_f_ghost[idx1g(i)]); | |
+ else | |
+ fprint_three_arrays(fp, sim->z, sim->v_x, sim->sigma_n_eff, sim->nz); | |
fclose(fp); | |
} |