diff --git a/src/engine_config.c b/src/engine_config.c index e6c68d9db540c7496dea26fcd21af7e5b514a90a..fb18cc48cb175d8eb202ea9c1bc5e3ca375654f4 100644 --- a/src/engine_config.c +++ b/src/engine_config.c @@ -37,6 +37,7 @@ /* Local headers. */ #include "fof.h" +#include "line_of_sight.h" #include "mpiuse.h" #include "part.h" #include "pressure_floor.h" @@ -792,9 +793,11 @@ void engine_config(int restart, int fof, struct engine *e, /* Find the time of the first statistics output */ engine_compute_next_statistics_time(e); - /* Find the time of the first line of sight output */ + /* Find the time of the first line of sight output + * and verify the outputs */ if (e->policy & engine_policy_line_of_sight) { engine_compute_next_los_time(e); + los_io_output_check(e); } /* Find the time of the first stf output */ diff --git a/src/line_of_sight.c b/src/line_of_sight.c index 40e71f960224c60329f68e04f206154f71c29d73..55dc0222c8eb87ccdfb221923ea929792b93c996 100644 --- a/src/line_of_sight.c +++ b/src/line_of_sight.c @@ -152,6 +152,40 @@ void los_init(const double dim[3], struct los_props *los_params, los_params->range_when_shooting_down_axis[2]); } +void los_io_output_check(const struct engine *e) { + + /* What kind of run are we working with? */ + struct swift_params *params = e->parameter_file; + const int with_cosmology = e->policy & engine_policy_cosmology; + const int with_cooling = e->policy & engine_policy_cooling; + const int with_temperature = e->policy & engine_policy_temperature; + const int with_fof = e->policy & engine_policy_fof; +#ifdef HAVE_VELOCIRAPTOR + const int with_stf = (e->policy & engine_policy_structure_finding) && + (e->s->gpart_group_data != NULL); +#else + const int with_stf = 0; +#endif + const int with_rt = e->policy & engine_policy_rt; + + int num_fields = 0; + struct io_props list[100]; + + /* Find all the gas output fields */ + io_select_hydro_fields(e->s->parts, e->s->xparts, with_cosmology, with_cooling, + with_temperature, with_fof, with_stf, with_rt, e, + &num_fields, list); + + /* Loop over each output field */ + for (int i = 0; i < num_fields; i++) { + + /* Did the user cancel this field? */ + char field[PARSER_MAX_LINE_SIZE]; + sprintf(field, "SelectOutputLOS:%.*s", FIELD_BUFFER_SIZE, list[i].name); + parser_get_opt_param_int(params, field, 1); + } +} + /** * @brief Create a #line_of_sight object from its attributes */ diff --git a/src/line_of_sight.h b/src/line_of_sight.h index 158c0fce6cb348f9dde95da0302b170d3091de79..6abf0832f1d472d117de4f15b5c1886d89d4b3c8 100644 --- a/src/line_of_sight.h +++ b/src/line_of_sight.h @@ -25,9 +25,11 @@ #include <config.h> /* Local includes. */ -#include "engine.h" #include "io_properties.h" +/* Pre-declarations */ +struct engine; + /** * @brief Maps the LOS axis geometry to the simulation axis geometry. * @@ -117,6 +119,7 @@ void print_los_info(const struct line_of_sight *Los, const int i); void do_line_of_sight(struct engine *e); void los_init(const double dim[3], struct los_props *los_params, struct swift_params *params); +void los_io_output_check(const struct engine *e); void los_struct_dump(const struct los_props *internal_los, FILE *stream); void los_struct_restore(const struct los_props *internal_los, FILE *stream); diff --git a/src/parser.h b/src/parser.h index 072bbe03b719be025d2ddf04523caa8f13ef28af..e97188b48c91e9fda329cb861101829ca7c7c1d2 100644 --- a/src/parser.h +++ b/src/parser.h @@ -32,7 +32,7 @@ /* Some constants. */ #define PARSER_MAX_LINE_SIZE 256 -#define PARSER_MAX_NO_OF_PARAMS 600 +#define PARSER_MAX_NO_OF_PARAMS 700 #define PARSER_MAX_NO_OF_SECTIONS 64 /* A parameter in the input file */