tswap order of file pointers and simulation structs for consistency - granular … | |
git clone git://src.adamsgaard.dk/granular | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit a5fe1ca3497c9c3d6fae8e77e481045888da84ab | |
parent 8dfae9aca575a8c56aa37df2a7ef43d798cf1d97 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Tue, 15 Jun 2021 07:37:53 +0200 | |
swap order of file pointers and simulation structs for consistency | |
tthanks 20h! | |
Diffstat: | |
M granular.c | 2 +- | |
M granular2vtu.c | 2 +- | |
M granularenergy.c | 2 +- | |
M granularpacking.c | 2 +- | |
M simulation.c | 8 ++++---- | |
M simulation.h | 6 +++--- | |
6 files changed, 11 insertions(+), 11 deletions(-) | |
--- | |
diff --git a/granular.c b/granular.c | |
t@@ -68,7 +68,7 @@ main(int argc, char *argv[]) | |
sim_set_timestep(&sim); | |
if (sim.t < sim.t_end) | |
sim_run_time_loop(&sim); | |
- sim_print_grains(stdout, &sim); | |
+ sim_print_grains(&sim, stdout); | |
sim_free(&sim); | |
return 0; | |
diff --git a/granular2vtu.c b/granular2vtu.c | |
t@@ -14,7 +14,7 @@ main(void) | |
#endif | |
sim_read_grains(&sim, stdin); | |
- sim_print_grains_vtk(stdout, &sim); | |
+ sim_print_grains_vtk(&sim, stdout); | |
sim_free(&sim); | |
return 0; | |
diff --git a/granularenergy.c b/granularenergy.c | |
t@@ -14,7 +14,7 @@ main(void) | |
#endif | |
sim_read_grains(&sim, stdin); | |
- sim_print_grains_energy(stdout, &sim); | |
+ sim_print_grains_energy(&sim, stdout); | |
sim_free(&sim); | |
return 0; | |
diff --git a/granularpacking.c b/granularpacking.c | |
t@@ -92,7 +92,7 @@ main(int argc, char *argv[]) | |
errx(1, "unknown packing mode"); | |
} | |
- sim_print_grains(stdout, &sim); | |
+ sim_print_grains(&sim, stdout); | |
sim_free(&sim); | |
return 0; | |
diff --git a/simulation.c b/simulation.c | |
t@@ -80,19 +80,19 @@ sim_read_grains(struct simulation *sim, FILE *stream) | |
} | |
void | |
-sim_print_grains(FILE *stream, const struct simulation *sim) | |
+sim_print_grains(const struct simulation *sim, FILE *stream) | |
{ | |
grains_print(stream, sim->grains, sim->ng); | |
} | |
void | |
-sim_print_grains_vtk(FILE *stream, const struct simulation *sim) | |
+sim_print_grains_vtk(const struct simulation *sim, FILE *stream) | |
{ | |
grains_print_vtk(stream, sim->grains, sim->ng); | |
} | |
void | |
-sim_print_grains_energy(FILE *stream, const struct simulation *sim) | |
+sim_print_grains_energy(const struct simulation *sim, FILE *stream) | |
{ | |
grains_print_energy(stream, sim->grains, sim->ng); | |
} | |
t@@ -109,7 +109,7 @@ sim_write_output_files(struct simulation *sim) | |
if (ret < 0 || (size_t)ret >= sizeof(outfile)) | |
errx(1, "%s: could not write grains filename", __func__); | |
if ((fp = fopen(outfile, "w")) != NULL) { | |
- sim_print_grains(fp, sim); | |
+ sim_print_grains(sim, fp); | |
fclose(fp); | |
} else | |
err(1, "%s: fopen: %s", __func__, outfile); | |
diff --git a/simulation.h b/simulation.h | |
t@@ -38,9 +38,9 @@ void sim_free(struct simulation *sim); | |
void sim_add_grain(struct simulation *sim, struct grain *g); | |
void sim_read_grains(struct simulation *sim, FILE *stream); | |
-void sim_print_grains(FILE *stream, const struct simulation *sim); | |
-void sim_print_grains_vtk(FILE *stream, const struct simulation *sim); | |
-void sim_print_grains_energy(FILE *stream, const struct simulation *sim); | |
+void sim_print_grains(const struct simulation *sim, FILE *stream); | |
+void sim_print_grains_vtk(const struct simulation *sim, FILE *stream); | |
+void sim_print_grains_energy(const struct simulation *sim, FILE *stream); | |
void sim_write_output_files(struct simulation *sim); | |
void sim_force_reset(struct simulation *sim); |