commit 0db7951db0bae88d2c361809a8c3a70981c85d67
parent 856a3036ba1c70e5a9e9de0f36618745de20482a
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date: Wed, 22 Apr 2020 13:44:24 +0200
Add a file name prefix to -D option (instead of writing to stdout)
Diffstat:
8 files changed, 203 insertions(+), 109 deletions(-)
diff --git a/doc/stardis.1.txt.in b/doc/stardis.1.txt.in
@@ -40,11 +40,11 @@ relative to the characteristic time of the system.
*stardis* can compute a thermal observable, like temperature or flux, at a
probe point and date or the mean value of an observable over a given surface
or volume, and time period. In addition, *stardis* gives access to the
-evaluation of the propagator (aka the *Green function*).
+evaluation of the propagator (a.k.a the *Green function*).
The propagator is of great value for thermicist engineers as it gives some
crucial information to analyse heat transfers in the system. It helps engineers
-answer questions like "Where from does the heat come at this location?".
+answer questions like _"Where from does the heat come at this location?"_.
Propagators seamlessly agregate all the provided geometrical and physical
information on the system in an unbiased and very-fast statistical model.
@@ -150,8 +150,8 @@ EXCLUSIVE OPTIONS
**pos=**_x_**,**_y_**,**_z_;;
Position of the camera. By default it is set to
{@STARDIS_ARGS_DEFAULT_RENDERING_POS@} or it is automatically computed to
- ensure that the whole scene is visible, whether *tgt* is set or not,
- respectively.
+ ensure that the whole scene is visible, whether *tgt* is set or not,
+ respectively.
**spp=**_samples-count_;;
Number of samples per pixel.
@@ -183,19 +183,19 @@ OTHER OPTIONS
computation occurs.
+
Using this option in conjunction with an option that
-specifies a compute region (-s, -S, -F) has the effect to include the
+specifies a compute region (-F, -S, -s) has the effect to include the
region in the output. This option cannot be used in conjunction with other
-options that write to _standard output_ (-R, -g, -D, -h, -v).
-
-*-D* _type_::
- Write heat paths of the given *type* to _standard output_ in VTK format.
- Possible values are *error* (write paths ending in error), *success*
- (write successful paths), and *all* (write all paths).
+options that write to _standard output_ (-g, -h, -R, -v).
+
+*-D* _type,file_name_prefix_::
+ Write sampled heat paths of the given *type* to files in VTK format, one
+ file per path. Possible values for *type* are *error* (write paths ending
+ in error), *success* (write successful paths), and *all* (write all paths).
+ Actual file names are produced by appending *file_name_prefix* and the path
+ rank: prefix00000000.vtk, prefix00000001.vtk, ...
+
-This option can only be used in conjuction with options that compute a simple
-Monte-Carlo result (-p, -P, -m, -s, -S, -F) and cannot be used in conjunction
-with some other options that write additional information to _standard output_
-(-R, -d, -g, -h, -v).
+This option can only be used in conjuction with options that compute a
+result (-F, -m, -P, -p, -R, -S, -s).
**-f** _factor_::
Rescale the geometry by the given *factor* before sending it to the solver,
@@ -226,25 +226,21 @@ ignored.
cores.
*-V* _level_::
- Set the verbosity level. Possible values are:
- * *0*: (write no message to _standard error_),
- * *1*: (write error messages only to _standard error_),
- * *2*: (write error and warning messages to _standard error_),
- * *3*: (write error, warning and informative messages to _standard error_).
-+
-Default verbosity *level* is @STARDIS_ARGS_DEFAULT_VERBOSE_LEVEL@.
+ Set the verbosity level. Possible values are *0* (no message), *1* (error
+ messages only), *2* (error and warning messages), and *3* (error, warning
+ and informative messages). All the messages are written to _standard error_.
+ Default verbosity *level* is @STARDIS_ARGS_DEFAULT_VERBOSE_LEVEL@.
*-v*::
Output version information and exit.
EXAMPLES
--------
-Preprocess the system as described in *scene.txt* when intending to compute
+Preprocess the system as described in *scene 5.txt* when intending to compute
the mean flux on the triangles from the file *edge.stl*, and write its geometry
in the file *scene.vtk*. Verbosity level is set to *3*:
- $ stardis -M scene.txt -F edge.stl -d -V 3 > scene.vtk
-
+ $ stardis -M "scene 5.txt" -F edge.stl -d -V 3 > scene.vtk
Compute the temperature at the probe point *0, 0.5, 0* at steady state. The
system is read from the 2 files *media.txt* and *bounds.txt* and the number of
@@ -257,6 +253,11 @@ read from the 2 files *media.txt* and *bounds.txt*:
$ stardis -M media.txt -M bounds.txt -m med05,100
+Supposing that the computation above encountered erroneous paths, redo it and dump
+these paths to VTK files named _error_path_NNNNNNNN.vtk_.
+
+ $ stardis -M media.txt -M bounds.txt -m med05,100 -D error,error_path_
+
Render the system as described in *scene.txt* with default settings:
$ stardis -M scene.txt -R :
@@ -277,4 +278,4 @@ permitted by law.
SEE ALSO
--------
*stardis-input*(5),
-*stardis-output*(5)
+*stardis-output*(5)
+\ No newline at end of file
diff --git a/src/stardis-app.c b/src/stardis-app.c
@@ -233,7 +233,7 @@ validate_properties
*properties_conflict_status = SFCONNECT_BETWEEN_2_FLUIDS;
else if(solid_count + fluid_count == 1)
*properties_conflict_status = SFCONNECT_USED_AS_BOUNDARY;
- else if (solid_count + fluid_count == 0)
+ else if(solid_count + fluid_count == 0)
*properties_conflict_status = SFCONNECT_BETWEEN_2_UNDEFS;
else FATAL("error:" STR(__FILE__) ":" STR(__LINE__)"\n");
goto end;
@@ -456,6 +456,7 @@ stardis_init
stardis->counts = COUNTS_NULL;
init_camera(&stardis->camera);
str_init(stardis->allocator, &stardis->solve_name);
+ str_init(stardis->allocator, &stardis->out_filename);
darray_size_t_init(stardis->allocator, &stardis->compute_surface.primitives);
darray_sides_init(stardis->allocator, &stardis->compute_surface.sides);
darray_uint_init(stardis->allocator, &stardis->compute_surface.err_triangles);
@@ -475,6 +476,7 @@ stardis_init
/* If a dump is expected, we won't process any computation */
is_for_compute =
(stardis->mode & COMPUTE_MODES) && !(stardis->mode & DUMP_VTK);
+
ERR(init_geometry(stardis->logger, stardis->allocator, stardis->verbose,
&stardis->geometry));
@@ -528,6 +530,8 @@ stardis_init
for(i = 0; i < tcount; ++i) {
ERR(create_intface(stardis, i, &htable_interfaces));
}
+ if(args->out_filename)
+ ERR(str_set(&stardis->out_filename, args->out_filename));
}
/* If computation is on a compute surface, read it */
@@ -608,6 +612,7 @@ stardis_release(struct stardis* stardis)
if(stardis->dev) SDIS(device_ref_put(stardis->dev));
if(stardis->sdis_scn) SDIS(scene_ref_put(stardis->sdis_scn));
str_release(&stardis->solve_name);
+ str_release(&stardis->out_filename);
darray_descriptions_release(&stardis->descriptions);
release_geometry(&stardis->geometry);
darray_size_t_release(&stardis->compute_surface.primitives);
diff --git a/src/stardis-app.h b/src/stardis-app.h
@@ -761,6 +761,7 @@ struct stardis {
struct compute_surface compute_surface; /* 2D compute region when mode is
[FLUX_]BOUNDARY_COMPUTE
or MAP_COMPUTE */
+ struct str out_filename;
int mode;
size_t samples;
unsigned nthreads;
diff --git a/src/stardis-compute.c b/src/stardis-compute.c
@@ -163,6 +163,7 @@ compute_probe(struct stardis* stardis)
size_t iprim = SIZE_MAX;
struct sdis_green_function* green = NULL;
struct sdis_estimator* estimator = NULL;
+ struct dump_path_context dump_ctx;
ASSERT(stardis && (stardis->mode & PROBE_COMPUTE));
@@ -193,6 +194,12 @@ compute_probe(struct stardis* stardis)
&estimator));
ERR(print_single_MC_result(estimator, stardis, stdout));
}
+
+ /* Dump paths recorded according to user settings */
+ dump_ctx.stardis = stardis;
+ dump_ctx.rank = 0;
+ ERR(sdis_estimator_for_each_path(estimator, dump_path, &dump_ctx));
+
end:
if(estimator) SDIS(estimator_ref_put(estimator));
if(green) SDIS(green_function_ref_put(green));
@@ -209,6 +216,7 @@ compute_probe_on_interface(struct stardis* stardis)
size_t iprim = SIZE_MAX;
struct sdis_estimator* estimator = NULL;
struct sdis_green_function* green = NULL;
+ struct dump_path_context dump_ctx;
ASSERT(stardis && (stardis->mode & PROBE_COMPUTE_ON_INTERFACE));
d3_set(pos, stardis->probe);
@@ -242,6 +250,12 @@ compute_probe_on_interface(struct stardis* stardis)
&estimator));
ERR(print_single_MC_result(estimator, stardis, stdout));
}
+
+ /* Dump paths recorded according to user settings */
+ dump_ctx.stardis = stardis;
+ dump_ctx.rank = 0;
+ ERR(sdis_estimator_for_each_path(estimator, dump_path, &dump_ctx));
+
end:
if(estimator) SDIS(estimator_ref_put(estimator));
if(green) SDIS(green_function_ref_put(green));
@@ -336,6 +350,9 @@ compute_camera(struct stardis* stardis)
size_t width, height;
struct sdis_estimator_buffer* buf = NULL;
struct sdis_camera* cam = NULL;
+ struct dump_path_context dump_ctx;
+ size_t definition[2];
+ size_t ix, iy;
ASSERT(stardis
&& !(stardis->mode & GREEN_MODE) && (stardis->mode & IR_COMPUTE));
@@ -370,12 +387,24 @@ compute_camera(struct stardis* stardis)
width,
height,
(size_t)stardis->camera.spp,
- 0,
+ stardis->dump_paths,
&buf));
/* Write the image */
ERR(dump_image(buf, stdout));
+ /* Dump paths recorded according to user settings */
+ dump_ctx.stardis = stardis;
+ dump_ctx.rank = 0;
+ ERR(sdis_estimator_buffer_get_definition(buf, definition));
+ FOR_EACH(iy, 0, definition[1]) {
+ FOR_EACH(ix, 0, definition[0]) {
+ const struct sdis_estimator* estimator;
+ ERR(sdis_estimator_buffer_at(buf, ix, iy, &estimator));
+ ERR(sdis_estimator_for_each_path(estimator, dump_path, &dump_ctx));
+ }
+ }
+
end:
if(cam) SDIS(camera_ref_put(cam));
if(buf) SDIS(estimator_buffer_ref_put(buf));
@@ -392,6 +421,7 @@ compute_medium(struct stardis* stardis)
struct sdis_medium* medium = NULL;
struct sdis_estimator* estimator = NULL;
struct sdis_green_function* green = NULL;
+ struct dump_path_context dump_ctx;
ASSERT(stardis && (stardis->mode & MEDIUM_COMPUTE));
@@ -428,6 +458,12 @@ compute_medium(struct stardis* stardis)
&estimator));
ERR(print_single_MC_result(estimator, stardis, stdout));
}
+
+ /* Dump paths recorded according to user settings */
+ dump_ctx.stardis = stardis;
+ dump_ctx.rank = 0;
+ ERR(sdis_estimator_for_each_path(estimator, dump_path, &dump_ctx));
+
end:
if(estimator) SDIS(estimator_ref_put(estimator));
if(green) SDIS(green_function_ref_put(green));
@@ -490,7 +526,8 @@ compute_boundary(struct stardis* stardis)
res_T res = RES_OK;
double time[2], pos[3];
struct sdis_green_function* green = NULL;
- struct sdis_estimator* estimator = NULL;
+ struct sdis_estimator* estimator = NULL;
+ struct dump_path_context dump_ctx;
ASSERT(stardis && (stardis->mode & BOUNDARY_COMPUTE));
@@ -522,6 +559,12 @@ compute_boundary(struct stardis* stardis)
&estimator));
ERR(print_single_MC_result(estimator, stardis, stdout));
}
+
+ /* Dump paths recorded according to user settings */
+ dump_ctx.stardis = stardis;
+ dump_ctx.rank = 0;
+ ERR(sdis_estimator_for_each_path(estimator, dump_path, &dump_ctx));
+
end:
if(estimator) SDIS(estimator_ref_put(estimator));
if(green) SDIS(green_function_ref_put(green));
@@ -537,6 +580,7 @@ compute_flux_boundary(struct stardis* stardis)
double time[2], pos[3];
struct sdis_green_function* green = NULL;
struct sdis_estimator* estimator = NULL;
+ struct dump_path_context dump_ctx;
ASSERT(stardis && (stardis->mode & FLUX_BOUNDARY_COMPUTE));
@@ -552,6 +596,12 @@ compute_flux_boundary(struct stardis* stardis)
stardis->ref_temp,
&estimator));
ERR(print_single_MC_result(estimator, stardis, stdout));
+
+ /* Dump paths recorded according to user settings */
+ dump_ctx.stardis = stardis;
+ dump_ctx.rank = 0;
+ ERR(sdis_estimator_for_each_path(estimator, dump_path, &dump_ctx));
+
end:
if(estimator) SDIS(estimator_ref_put(estimator));
if(green) SDIS(green_function_ref_put(green));
diff --git a/src/stardis-output.c b/src/stardis-output.c
@@ -30,7 +30,9 @@
#include <rsys/dynamic_array_uint.h>
#include <rsys/hash_table.h>
#include <rsys/logger.h>
+#include <rsys/str.h>
+#include <limits.h>
#include <stdio.h>
#define HTABLE_NAME weigth
@@ -45,6 +47,16 @@ struct w_ctx {
};
/*******************************************************************************
+ * Local Type; for documentation purpose
+ * These values are used in dumps
+ ******************************************************************************/
+enum enclosure_errors_t {
+ NO_ENCLOSURE_ERROR = BIT(0),
+ INTERNAL_ENCLOSURE_WITH_N_MEDIA = BIT(1),
+ INTERNAL_ENCLOSURE_WITH_UNDEF_MEDIUM = BIT(2)
+};
+
+/*******************************************************************************
* Local Functions
******************************************************************************/
@@ -122,20 +134,43 @@ error:
goto end;
}
-static res_T
+/*******************************************************************************
+ * Public Functions
+ ******************************************************************************/
+
+res_T
dump_path
(const struct sdis_heat_path* path,
void* context)
{
res_T res = RES_OK;
- FILE* stream = context;
+ struct dump_path_context* dump_ctx = context;
+ FILE* stream = NULL;
+ char* name = NULL;
enum sdis_heat_path_flag status = SDIS_HEAT_PATH_NONE;
- size_t i, vcount;
+ size_t i, vcount, name_sz;
+ ASSERT(path && dump_ctx
+ && dump_ctx->stardis
+ && !str_is_empty(&dump_ctx->stardis->out_filename));
+
+ name_sz = 16 + str_len(&dump_ctx->stardis->out_filename);
+ name = MEM_CALLOC(dump_ctx->stardis->allocator, name_sz, sizeof(*name));
+ if(!name) {
+ res = RES_MEM_ERR;
+ goto error;
+ }
+ snprintf(name, name_sz, "%s%08zu.vtk",
+ str_cget(&dump_ctx->stardis->out_filename), dump_ctx->rank++);
+
+ stream = fopen(name, "w");
+ if(!stream) {
+ res = RES_IO_ERR;
+ goto error;
+ }
/* Header */
- fprintf(stream, "---\n");
fprintf(stream, "# vtk DataFile Version 2.0\n");
- fprintf(stream, "Heat paths\n");
+ fprintf(stream, "Heat path\n");
fprintf(stream, "ASCII\n");
fprintf(stream, "DATASET POLYDATA\n");
/* Write path positions */
@@ -153,22 +188,24 @@ dump_path
fprintf(stream, "\n");
fprintf(stream, "POINT_DATA %zu\n", vcount);
/* Write the type of the random walk vertices */
- fprintf(stream, "SCALARS Vertex_Type float 1\n");
- fprintf(stream, "LOOKUP_TABLE vertex_type\n");
+ fprintf(stream, "SCALARS Vertex_Type unsigned_char 1\n");
+ fprintf(stream, "LOOKUP_TABLE default\n");
FOR_EACH(i, 0, vcount) {
struct sdis_heat_vertex vtx;
ERR(sdis_heat_path_get_vertex(path, i, &vtx));
- switch (vtx.type) {
- case SDIS_HEAT_VERTEX_CONDUCTION: fprintf(stream, "0.0\n"); break;
- case SDIS_HEAT_VERTEX_CONVECTION: fprintf(stream, "0.5\n"); break;
- case SDIS_HEAT_VERTEX_RADIATIVE: fprintf(stream, "1.0\n"); break;
- default: FATAL("Unreachable code.\n"); break;
- }
+ ASSERT((size_t)vtx.type <= UCHAR_MAX);
+ fprintf(stream, "%d\n", vtx.type);
+ }
+ /* Write path type */
+ fprintf(stream, "CELL_DATA %d\n", 1);
+ fprintf(stream, "SCALARS Path_Type unsigned_char 1\n");
+ fprintf(stream, "LOOKUP_TABLE default\n");
+ ERR(sdis_heat_path_get_status(path, &status));
+ switch (status) {
+ case SDIS_HEAT_PATH_SUCCESS: fprintf(stream, "0\n"); break;
+ case SDIS_HEAT_PATH_FAILURE: fprintf(stream, "1\n"); break;
+ default: FATAL("Unreachable code.\n"); break;
}
- fprintf(stream, "LOOKUP_TABLE vertex_type 3\n");
- fprintf(stream, "0.0 1.0 1.0 1.0\n"); /* 0.0 = Magenta: conduction */
- fprintf(stream, "1.0 1.0 0.0 1.0\n"); /* 0.5 = Yellow: convection */
- fprintf(stream, "1.0 0.0 1.0 1.0\n"); /* 1.0 = Purple: radiative */
/* Write the weights of the random walk vertices */
fprintf(stream, "SCALARS Weight double 1\n");
fprintf(stream, "LOOKUP_TABLE default\n");
@@ -177,38 +214,28 @@ dump_path
ERR(sdis_heat_path_get_vertex(path, i, &vtx));
fprintf(stream, "%g\n", vtx.weight);
}
- /* Write the time of the random walk vertices */
- fprintf(stream, "SCALARS Time double 1\n");
- fprintf(stream, "LOOKUP_TABLE default\n");
+ /* If computation time is not INF for every vertex,
+ * write the time of the random walk vertices */
FOR_EACH(i, 0, vcount) {
struct sdis_heat_vertex vtx;
ERR(sdis_heat_path_get_vertex(path, i, &vtx));
- fprintf(stream, "%g\n", IS_INF(vtx.time) ? FLT_MAX : vtx.time);
- }
- /* Write path type */
- fprintf(stream, "CELL_DATA %d\n", 1);
- fprintf(stream, "SCALARS Path_Type float 1\n");
- fprintf(stream, "LOOKUP_TABLE path_type\n");
- ERR(sdis_heat_path_get_status(path, &status));
- switch (status) {
- case SDIS_HEAT_PATH_SUCCESS: fprintf(stream, "0.0\n"); break;
- case SDIS_HEAT_PATH_FAILURE: fprintf(stream, "1.0\n"); break;
- default: FATAL("Unreachable code.\n"); break;
+ if(i == 0) {
+ if(IS_INF(vtx.time)) break;
+ fprintf(stream, "SCALARS Time double 1\n");
+ fprintf(stream, "LOOKUP_TABLE default\n");
+ }
+ ASSERT(!IS_INF(vtx.time));
+ fprintf(stream, "%g\n", vtx.time);
}
- fprintf(stream, "LOOKUP_TABLE path_type 2\n");
- fprintf(stream, "0.0 0.0 1.0 1.0\n"); /* 0.0 = Blue: success */
- fprintf(stream, "1.0 0.0 0.0 1.0\n"); /* 1.0 = Red: failure */
end:
+ if(name) MEM_RM(dump_ctx->stardis->allocator, name);
+ if(stream) fclose(stream);
return res;
error:
goto end;
}
-/*******************************************************************************
- * Public Functions
- ******************************************************************************/
-
res_T
print_sample
(struct sdis_green_path* path,
@@ -706,8 +733,6 @@ print_single_MC_result
logger_print(stardis->logger, LOG_ERROR,
"#failures: %zu/%zu\n", nfailures, stardis->samples);
- /* Dump paths according to user settings */
- ERR(sdis_estimator_for_each_path(estimator, dump_path, stdout));
end:
return res;
error:
@@ -866,10 +891,10 @@ dump_compute_region_at_the_end_of_vtk
}
}
- fprintf(stream, "SCALARS Compute_region int\n");
+ fprintf(stream, "SCALARS Compute_region unsigned_int 1\n");
fprintf(stream, "LOOKUP_TABLE default\n");
FOR_EACH(i, 0, tsz)
- fprintf(stream, "%d\n", v[i] == UCHAR_MAX ? INT_MAX : v[i]);
+ fprintf(stream, "%u\n", v[i] == UCHAR_MAX ? UINT_MAX : v[i]);
exit:
if(v) MEM_RM(stardis->allocator, v);
diff --git a/src/stardis-output.h b/src/stardis-output.h
@@ -32,6 +32,16 @@ struct geometry;
struct vertex;
struct darray_estimators;
+struct dump_path_context {
+ size_t rank;
+ struct stardis* stardis;
+};
+
+extern res_T
+dump_path
+ (const struct sdis_heat_path* path,
+ void* context);
+
extern res_T
print_sample
(struct sdis_green_path* path,
diff --git a/src/stardis-parsing.c b/src/stardis-parsing.c
@@ -509,24 +509,26 @@ parse_args
args->mode |= DUMP_VTK;
break;
- case 'D':
- if(args->mode & USE_STDOUT_MODES) {
- res = RES_BAD_ARG;
- print_multiple_modes(buf, sizeof(buf), USE_STDOUT_MODES, DUMP_PATHS);
- logger_print(args->logger, LOG_ERROR,
- "Option -%c cannot be used in conjunction with other dump options (%s).\n",
- (char)opt, buf);
- goto error;
- }
- if(0 == strcmp(optarg, "all")) {
- args->dump_paths = DUMP_ALL;
+ case 'D': {
+ char* ptr = strrchr(optarg, ',');
+ if(!ptr || ptr != strchr(optarg, ','))
+ res = RES_BAD_ARG; /* Single ',' expected */
+ else {
+ args->out_filename = ptr + 1;
+ *ptr = '\0';
}
- else if(0 == strcmp(optarg, "error")) {
- args->dump_paths = DUMP_ERROR;
+ if(res == RES_OK) {
+ if(0 == strcmp(optarg, "all")) {
+ args->dump_paths = DUMP_ALL;
+ }
+ else if(0 == strcmp(optarg, "error")) {
+ args->dump_paths = DUMP_ERROR;
+ }
+ else if(0 == strcmp(optarg, "success")) {
+ args->dump_paths = DUMP_SUCCESS;
+ }
}
- else if(0 == strcmp(optarg, "success")) {
- args->dump_paths = DUMP_SUCCESS;
- } else {
+ if(res != RES_OK) {
res = RES_BAD_ARG;
logger_print(args->logger, LOG_ERROR,
"Invalid argument for option -%c: %s\n",
@@ -535,6 +537,7 @@ parse_args
}
args->mode |= DUMP_PATHS;
break;
+ }
case 'f':
res = cstr_to_double(optarg, &args->scale_factor);
@@ -803,14 +806,11 @@ parse_args
goto error;
}
- if(args->mode & GREEN_MODE
- && (args->mode != (args->mode & (GREEN_MODE | GREEN_COMPATIBLE_MODES))))
- {
+ if(args->mode & GREEN_MODE && !(args->mode & GREEN_COMPATIBLE_MODES)) {
print_multiple_modes(buf, sizeof(buf), GREEN_COMPATIBLE_MODES, 0);
logger_print(args->logger, LOG_ERROR,
"Option -g can only be used in conjunction with: %s\n",
buf);
- logger_print(args->logger, LOG_ERROR, "\n");
res = RES_BAD_ARG;
goto error;
}
@@ -824,11 +824,12 @@ parse_args
}
if(args->mode & DUMP_PATHS) {
- if(!(args->mode & SINGLE_RESULT_MODES)) {
+ if(!(args->mode & COMPUTE_MODES)) {
res = RES_BAD_ARG;
- print_multiple_modes(buf, sizeof(buf), SINGLE_RESULT_MODES, 0);
+ print_multiple_modes(buf, sizeof(buf), COMPUTE_MODES, 0);
logger_print(args->logger, LOG_ERROR,
- "Option -%c can only be used in conjunction with option producing a single result (%s).\n",
+ "Option -%c can only be used in conjunction with an option"
+ " that samples heat paths (%s).\n",
mode_option(DUMP_PATHS), buf);
goto error;
}
diff --git a/src/stardis-parsing.h b/src/stardis-parsing.h
@@ -41,19 +41,20 @@ struct stardis;
#endif
enum stardis_mode {
+ /* Ordered so that print_multiple_modes() prints in alphabetical order */
UNDEF_MODE = 0,
- PROBE_COMPUTE = BIT(0),
- PROBE_COMPUTE_ON_INTERFACE = BIT(1),
- MEDIUM_COMPUTE = BIT(2),
- BOUNDARY_COMPUTE = BIT(3),
- IR_COMPUTE = BIT(4),
- MAP_COMPUTE = BIT(5),
- DUMP_VTK = BIT(6),
- GREEN_MODE = BIT(7),
- FLUX_BOUNDARY_COMPUTE = BIT(8),
- DUMP_PATHS = BIT(9),
- DUMP_HELP = BIT(10),
- DUMP_VERSION = BIT(11),
+ DUMP_PATHS = BIT(0), /* -D */
+ DUMP_VTK = BIT(1), /* -d */
+ FLUX_BOUNDARY_COMPUTE = BIT(2), /* -F */
+ GREEN_MODE = BIT(3), /* -g */
+ DUMP_HELP = BIT(4), /* -h */
+ MEDIUM_COMPUTE = BIT(5), /* -m */
+ PROBE_COMPUTE_ON_INTERFACE = BIT(6), /* -P */
+ PROBE_COMPUTE = BIT(7), /* -p */
+ IR_COMPUTE = BIT(8), /* -R */
+ MAP_COMPUTE = BIT(9), /* -S */
+ BOUNDARY_COMPUTE = BIT(10), /* -s */
+ DUMP_VERSION = BIT(11), /* -v */
GREEN_COMPATIBLE_MODES
= PROBE_COMPUTE | PROBE_COMPUTE_ON_INTERFACE | MEDIUM_COMPUTE | BOUNDARY_COMPUTE,
@@ -63,8 +64,6 @@ enum stardis_mode {
REGION_COMPUTE_MODES = SURFACE_COMPUTE_MODES | MEDIUM_COMPUTE,
- SINGLE_RESULT_MODES = GREEN_COMPATIBLE_MODES | SURFACE_COMPUTE_MODES,
-
COMPUTE_MODES = GREEN_COMPATIBLE_MODES | IR_COMPUTE | SURFACE_COMPUTE_MODES,
EXCLUSIVE_MODES = COMPUTE_MODES,
@@ -72,7 +71,7 @@ enum stardis_mode {
SHORT_EXIT_MODES = DUMP_HELP | DUMP_VERSION,
USE_STDOUT_MODES
- = DUMP_VTK | DUMP_PATHS | DUMP_HELP | DUMP_VERSION | IR_COMPUTE | GREEN_MODE
+ = DUMP_VTK | DUMP_HELP | DUMP_VERSION | IR_COMPUTE | GREEN_MODE
};
STATIC_ASSERT(GREEN_COMPATIBLE_MODES == (COMPUTE_MODES & GREEN_COMPATIBLE_MODES),
@@ -91,6 +90,7 @@ struct args {
struct darray_str model_files;
char* medium_name;
char* solve_filename;
+ char* out_filename;
size_t samples;
unsigned nthreads;
double probe[4];