diff --git a/README b/README index 9ef773cd85b408ff822b3652c3fd5507e6d95d01..0d658c333f1328b423851031c5b5d202f43df3c2 100644 --- a/README +++ b/README @@ -28,6 +28,7 @@ Valid options are: -G Run with self-gravity -n {int} Execute a fixed number of time steps. When unset use the time_end parameter to stop. -s Run with SPH + -S Run with stars -t {int} The number of threads to use on each MPI rank. Defaults to 1 if not specified. -v [12] Increase the level of verbosity 1: MPI-rank 0 writes diff --git a/examples/main.c b/examples/main.c index 6b8d0a009be68a7f86f1a81b216e581a505f6542..a2df9554247a88913bfbf81658be1deb96342d38 100644 --- a/examples/main.c +++ b/examples/main.c @@ -83,6 +83,7 @@ void print_help_message() { "Execute a fixed number of time steps. When unset use the time_end " "parameter to stop."); printf(" %2s %8s %s\n", "-s", "", "Run with SPH"); + printf(" %2s %8s %s\n", "-S", "", "Run with stars"); printf(" %2s %8s %s\n", "-t", "{int}", "The number of threads to use on each MPI rank. Defaults to 1 if not " "specified."); @@ -156,6 +157,7 @@ int main(int argc, char *argv[]) { int with_cooling = 0; int with_self_gravity = 0; int with_hydro = 0; + int with_stars = 0; int with_fp_exceptions = 0; int with_drift_all = 0; int verbose = 0; @@ -165,7 +167,7 @@ int main(int argc, char *argv[]) { /* Parse the parameters */ int c; - while ((c = getopt(argc, argv, "acCdDef:FgGhn:st:v:y:")) != -1) switch (c) { + while ((c = getopt(argc, argv, "acCdDef:FgGhn:sSt:v:y:")) != -1) switch (c) { case 'a': with_aff = 1; break; @@ -213,6 +215,9 @@ int main(int argc, char *argv[]) { case 's': with_hydro = 1; break; + case 'S': + with_stars = 1; + break; case 't': if (sscanf(optarg, "%d", &nr_threads) != 1) { if (myrank == 0) @@ -406,11 +411,17 @@ int main(int argc, char *argv[]) { for (size_t k = 0; k < Nspart; ++k) sparts[k].gpart = NULL; Ngpart = 0; } + if (!with_stars) { + free(sparts); + sparts = NULL; + for (size_t k = 0; k < Nspart; ++k) + if (gparts[k].type == swift_type_star) error("Linking problem"); + } if (!with_hydro) { free(parts); parts = NULL; for (size_t k = 0; k < Ngpart; ++k) - if (gparts[k].id_or_neg_offset < 0) error("Linking problem"); + if (gparts[k].type == swift_type_gas) error("Linking problem"); Ngas = 0; } @@ -536,8 +547,6 @@ int main(int argc, char *argv[]) { return 0; } - engine_dump_snapshot(&e); - #ifdef WITH_MPI /* Split the space. */ engine_split(&e, &initial_partition);