Skip to content
Snippets Groups Projects
Commit 87b9cd17 authored by lhausamm's avatar lhausamm
Browse files

Write field for any bad input

parent 5699230b
No related branches found
No related tags found
1 merge request!520Select io
......@@ -888,7 +888,8 @@ void io_check_output_fields(const struct swift_params* params,
if (retParam != 0 && retParam != 1)
message("WARNING: Unexpected input for %s. "
"Received %i but expect 0 or 1", field_name, retParam);
"Received %i but expect 0 or 1. "
"We will write this field.", field_name, retParam);
continue;
}
}
......@@ -933,7 +934,7 @@ void io_write_output_field_parameter(const char* filename) {
if (num_fields == 0) continue;
fprintf(file, " # Particle Type %i\n", ptype);
fprintf(file, " # Particle Type %s\n", part_type_names[ptype]);
/* Write everything */
for (int i = 0; i < num_fields; ++i) {
fprintf(file, " %s_%s: 1\n",
......
......@@ -1268,7 +1268,7 @@ void write_output_parallel(struct engine* e, const char* baseName,
char field[PARSER_MAX_LINE_SIZE];
sprintf(field, "SelectOutput:%s_%s", list[i].name, part_type_names[ptype]);
int should_write = parser_get_opt_param_int(params, field, 1);
if (should_write)
if (should_write != 0)
writeArray(e, h_grp, fileName, partTypeGroupName, list[i], Nparticles,
N_total[ptype], mpi_rank, offset[ptype], internal_units,
snapshot_units);
......
......@@ -1012,7 +1012,7 @@ void write_output_serial(struct engine* e, const char* baseName,
char field[PARSER_MAX_LINE_SIZE];
sprintf(field, "SelectOutput:%s_%s", list[i].name, part_type_names[ptype]);
int should_write = parser_get_opt_param_int(params, field, 1);
if (should_write)
if (should_write != 0)
writeArray(e, h_grp, fileName, xmfFile, partTypeGroupName, list[i],
Nparticles, N_total[ptype], mpi_rank, offset[ptype],
internal_units, snapshot_units);
......
......@@ -831,7 +831,7 @@ void write_output_single(struct engine* e, const char* baseName,
char field[PARSER_MAX_LINE_SIZE];
sprintf(field, "SelectOutput:%s_%s", list[i].name, part_type_names[ptype]);
int should_write = parser_get_opt_param_int(params, field, 1);
if (should_write)
if (should_write != 0)
writeArray(e, h_grp, fileName, xmfFile, partTypeGroupName, list[i], N,
internal_units, snapshot_units);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment