commit 2e0b73bd98b3f12ec3fcf815fc9dab9ec6201efb
parent 8f54ec9a02b24171abf006ac2c723542a96bc1f4
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date: Fri, 20 Oct 2023 16:52:16 +0200
Improve geometry dump
Diffstat:
9 files changed, 160 insertions(+), 61 deletions(-)
diff --git a/doc/stardis.1.txt.in b/doc/stardis.1.txt.in
@@ -29,7 +29,7 @@ SYNOPSIS
*stardis* *-M* <__file__> [_option_]
DESCRIPTION
-*stardis* solves coupled thermal systems: conductive, convective and
+*stardis* solves coupled thermal systems: conductive, convective and
radiative transfers are solved together. The physical model used for
conduction is the local unstationary heat conduction equation.
Convection fluxes are assumed to be linear with temperature, and radiation
@@ -167,7 +167,7 @@ EXCLUSIVE OPTIONS
**file=**_output_file_;;
File name to use to write the infrared image to. If no file name is
provided, the result is written to _standard output_.
-
+
**fmt=**_image_file_format_;;
Format of the image file in output. Can be *VTK*, or *HT* (see
htrdr-image(5) and htpp(1)). Default _image_file_format_ is
@@ -207,15 +207,17 @@ EXCLUSIVE OPTIONS
OTHER OPTIONS
-------------
-*-d*::
- Write the geometry to _standard output_ in VTK format along with various
- properties, including possible errors. If this option is used, no
- computation occurs.
+*-d* _file_base_name_::
+ Write the geometry to a file in VTK format along with various properties,
+ including possible errors. Also possibly write some problematic parts of the
+ geometry (if any) in OBJ format. Possible parts are overlapping triangles,
+ triangles with property conflicts, and triangles with merge errors. The
+ various file are all named after the provided base name. If this option is
+ used, no computation occurs.
+
Using this option in conjunction with an option that
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_ (-g, -h, -R, -v).
+region in the VTK output.
*-D* _type,files_name_prefix_::
Write sampled heat paths of the given *type* to files in VTK format, one
diff --git a/src/stardis-app.c b/src/stardis-app.c
@@ -13,6 +13,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#include <star/sg3d.h>
#ifdef STARDIS_ENABLE_MPI
#define _POSIX_C_SOURCE 200112L
#endif
@@ -37,6 +38,7 @@
#include <rsys/logger.h>
#include <rsys/double2.h>
#include <rsys/double3.h>
+#include <rsys/dynamic_array_double.h>
#include <string.h>
@@ -222,7 +224,8 @@ stardis_init
res_T tmp_res, res = RES_OK;
struct sg3d_sdisXd_scene_create_context create_context;
struct htable_intface htable_interfaces;
- struct str str;
+ struct str str, name;
+ FILE* f = NULL;
unsigned i, vcount, tcount, ocount, count;
int is_for_compute;
struct sdis_device_create_args dev_args = SDIS_DEVICE_CREATE_ARGS_DEFAULT;
@@ -230,6 +233,7 @@ stardis_init
ASSERT(args && logger && allocator && stardis);
str_init(allocator, &str);
+ str_init(allocator, &name);
/* Init everything that cannot fail */
stardis->dummies = DUMMIES_NULL;
stardis->logger = logger;
@@ -245,6 +249,7 @@ stardis_init
stardis->counts = COUNTS_NULL;
init_camera(stardis->allocator, &stardis->camera);
str_init(stardis->allocator, &stardis->solve_name);
+ str_init(stardis->allocator, &stardis->dump_model_filename);
str_init(stardis->allocator, &stardis->paths_filename);
str_init(stardis->allocator, &stardis->bin_green_filename);
str_init(stardis->allocator, &stardis->end_paths_filename);
@@ -276,7 +281,7 @@ stardis_init
/* If a dump is expected, we won't process any computation */
is_for_compute =
- (stardis->mode & COMPUTE_MODES) && !(stardis->mode & MODE_DUMP_VTK);
+ (stardis->mode & COMPUTE_MODES) && !(stardis->mode & MODE_DUMP_MODEL);
dev_args.logger = stardis->logger;
dev_args.allocator = stardis->allocator;
@@ -303,6 +308,10 @@ stardis_init
&stardis->geometry));
stardis->geometry_initialized = 1;
+ if(args->dump_model_filename) {
+ ERR(str_set(&stardis->dump_model_filename, args->dump_model_filename));
+ }
+
if(args->mode & MODE_IR_COMPUTE) {
ERR(parse_camera(stardis->logger, args->camera, stardis));
}
@@ -334,6 +343,20 @@ stardis_init
ERR(sg3d_geometry_get_unique_triangles_with_properties_conflict_count(
stardis->geometry.sg3d, &count));
if(count) {
+ if(!str_is_empty(&stardis->dump_model_filename)) {
+ ERR(str_copy(&name, &stardis->dump_model_filename));
+ ERR(str_append(&name, "_property_conflits.obj"));
+ f = fopen(str_cget(&name), "w");
+ if(!f) {
+ logger_print(stardis->logger, LOG_ERROR,
+ "cannot open file '%s' for writing.\n", str_cget(&name));
+ res = RES_IO_ERR;
+ goto error;
+ }
+ ERR(sg3d_geometry_dump_as_obj(stardis->geometry.sg3d, f,
+ SG3D_OBJ_DUMP_PROPERTY_CONFLICTS));
+ fclose(f); f = NULL;
+ }
logger_print(stardis->logger, (is_for_compute ? LOG_ERROR : LOG_WARNING),
"Property conflicts found in the model (%u triangles).\n", count);
if(is_for_compute) {
@@ -376,6 +399,32 @@ stardis_init
}
ERR(senc3d_scene_get_overlapping_triangles_count(stardis->senc3d_scn, &ocount));
if(ocount) {
+ if(!str_is_empty(&stardis->dump_model_filename)) {
+ ERR(str_copy(&name, &stardis->dump_model_filename));
+ ERR(str_append(&name, "_overlapping_triangles.obj"));
+ f = fopen(str_cget(&name), "w");
+ if(!f) {
+ logger_print(stardis->logger, LOG_ERROR,
+ "cannot open file '%s' for writing.\n", str_cget(&name));
+ res = RES_IO_ERR;
+ goto error;
+ }
+ /* Dump vertices */
+ for(i = 0; i < vcount; i++) {
+ double coord[3];
+ ERR(senc3d_scene_get_vertex(stardis->senc3d_scn, i, coord));
+ fprintf(f, "v %.16g %.16g %.16g\n", SPLIT3(coord));
+ }
+ /* Dump triangles */
+ for(i = 0; i < ocount; i++) {
+ unsigned id, trg[3];
+ ERR(senc3d_scene_get_overlapping_triangle(stardis->senc3d_scn, i, &id));
+ ERR(senc3d_scene_get_triangle(stardis->senc3d_scn, id, trg));
+ fprintf(f, "f %u %u %u\n",
+ 1 + trg[0], 1 + trg[1], 1 + trg[2]); /* OBJ indexing starts at 1 */
+ }
+ fclose(f); f = NULL;
+ }
logger_print(stardis->logger, (is_for_compute ? LOG_ERROR : LOG_WARNING),
"Scene contains %u overlapping triangles.\n",
ocount);
@@ -465,7 +514,9 @@ stardis_init
}
exit:
+ if(f) fclose(f);
str_release(&str);
+ str_release(&name);
htable_intface_release(&htable_interfaces);
return res;
error:
@@ -485,6 +536,7 @@ stardis_release
if(stardis->sdis_scn) SDIS(scene_ref_put(stardis->sdis_scn));
if(stardis->senc3d_scn) SENC3D(scene_ref_put(stardis->senc3d_scn));
str_release(&stardis->solve_name);
+ str_release(&stardis->dump_model_filename);
str_release(&stardis->paths_filename);
str_release(&stardis->bin_green_filename);
str_release(&stardis->end_paths_filename);
diff --git a/src/stardis-app.h b/src/stardis-app.h
@@ -213,6 +213,7 @@ struct stardis {
struct compute_surface compute_surface; /* 2D compute region when mode is
[FLUX_]BOUNDARY_COMPUTE
or MAP_COMPUTE */
+ struct str dump_model_filename;
struct str paths_filename;
struct str bin_green_filename;
struct str end_paths_filename;
diff --git a/src/stardis-args.c b/src/stardis-args.c
@@ -29,7 +29,6 @@
#include <getopt.h>
#include <stdlib.h>
#include <stdio.h>
-#include <ctype.h>
#include <string.h>
#ifdef COMPILER_GCC
@@ -109,7 +108,7 @@ mode_option
int found = 0;
char res = '?';
if(m & MODE_DUMP_C_CHUNKS) { found++; res = 'c'; }
- if(m & MODE_DUMP_VTK) { found++; res = 'd'; }
+ if(m & MODE_DUMP_MODEL) { found++; res = 'd'; }
if(m & MODE_DUMP_PATHS) { found++; res = 'D'; }
if(m & MODE_EXTENDED_RESULTS) { found++; res = 'e'; }
if(m & MODE_FLUX_BOUNDARY_COMPUTE) { found++; res = 'F'; }
@@ -284,8 +283,12 @@ short_help
fprintf(stream, "\n -c NAMES_PREFIX\n");
fprintf(stream, " Dump the geometry and property ids to stdout as C chunks.\n");
- fprintf(stream, "\n -d\n");
- fprintf(stream, " Dump the geometry to stdout in VTK format along with various properties.\n");
+ fprintf(stream, "\n -d FILE_NAME_PREFIX\n");
+ fprintf(stream, " Dump the geometry to file <FILE_NAME_PREFIX>.vtk in VTK format along with various properties.\n");
+ fprintf(stream, " If merge errors where detected, the corresponding part of the geometry is dumped to file\n"
+ " <FILE_NAME_PREFIX>_merge_conflicts.obj in OBJ format.\n");
+ fprintf(stream, " If property errors where detected, the corresponding part of the geometry is dumped to file\n"
+ " <FILE_NAME_PREFIX>_property_conflicts.obj in OBJ format.\n");
fprintf(stream, "\n -D TYPE,FILE_NAMES_PREFIX\n");
fprintf(stream, " Write thermal paths of the given TYPE in VTK format.\n");
@@ -385,7 +388,7 @@ parse_args
{
int opt = 0, n_used = 0, o_used = 0;
size_t len = 0;
- const char option_list[] = "c:dD:eF:gG:hm:M:n:o:p:P:R:s:S:t:vV:x:X:";
+ const char option_list[] = "c:d:D:eF:gG:hm:M:n:o:p:P:R:s:S:t:vV:x:X:";
char buf[128];
struct str keep;
char** line = NULL;
@@ -426,15 +429,8 @@ parse_args
break;
case 'd':
- if(args->mode & USE_STDOUT_MODES) {
- res = RES_BAD_ARG;
- print_multiple_modes(buf, sizeof(buf), USE_STDOUT_MODES, MODE_DUMP_VTK);
- logger_print(args->logger, LOG_ERROR,
- "Option -%c cannot be used in conjunction with other dump options (%s).\n",
- (char)opt, buf);
- goto error;
- }
- args->mode |= MODE_DUMP_VTK;
+ args->dump_model_filename = optarg;
+ args->mode |= MODE_DUMP_MODEL;
break;
case 'D': {
diff --git a/src/stardis-args.h b/src/stardis-args.h
@@ -31,7 +31,7 @@ enum stardis_mode {
UNDEF_MODE = 0,
MODE_DUMP_C_CHUNKS = BIT(0), /* -c */
MODE_DUMP_PATHS = BIT(1), /* -D */
- MODE_DUMP_VTK = BIT(2), /* -d */
+ MODE_DUMP_MODEL = BIT(2), /* -d */
MODE_EXTENDED_RESULTS = BIT(3), /* -e */
MODE_FLUX_BOUNDARY_COMPUTE = BIT(4), /* -F */
MODE_BIN_GREEN = BIT(5), /* -G */
@@ -65,15 +65,15 @@ enum stardis_mode {
SHORT_EXIT_MODES = MODE_DUMP_HELP | MODE_DUMP_VERSION,
USE_STDOUT_MODES
- = MODE_DUMP_C_CHUNKS | MODE_DUMP_VTK | MODE_DUMP_HELP | MODE_DUMP_VERSION
- | MODE_IR_COMPUTE | MODE_GREEN,
+ = MODE_DUMP_C_CHUNKS | MODE_DUMP_HELP | MODE_DUMP_VERSION | MODE_IR_COMPUTE
+ | MODE_GREEN,
RANDOM_RW_MODES
= MODE_PROBE_COMPUTE | MODE_PROBE_COMPUTE_ON_INTERFACE | MODE_MEDIUM_COMPUTE
| MODE_BOUNDARY_COMPUTE | MODE_FLUX_BOUNDARY_COMPUTE
};
-STATIC_ASSERT(GREEN_COMPATIBLE_MODES == (COMPUTE_MODES & GREEN_COMPATIBLE_MODES),
+STATIC_ASSERT(GREEN_COMPATIBLE_MODES == (COMPUTE_MODES & GREEN_COMPATIBLE_MODES),
Cannot_have_a_GREEN_COMPATIBLE_MODE_that_is_not_a_COMPUTE_MODE);
enum dump_path_type {
@@ -91,6 +91,7 @@ struct args {
char* solve_filename;
char* bin_green_filename;
char* end_paths_filename;
+ char* dump_model_filename;
char* paths_filename;
char* rndgen_state_in_filename;
char* rndgen_state_out_filename;
@@ -100,7 +101,7 @@ struct args {
double pos_and_time[5];
unsigned nthreads;
unsigned picard_order;
- enum stardis_mode mode;
+ int mode;
enum dump_path_type dump_paths;
int verbose;
};
@@ -133,7 +134,7 @@ parse_args
res_T
parse_camera
- (struct logger* logger,
+ (struct logger* logger,
char* cam_param,
struct stardis* stardis);
diff --git a/src/stardis-compute.c b/src/stardis-compute.c
@@ -510,7 +510,8 @@ compute_probe(struct stardis* stardis, struct time* start)
stream_g = fopen(str_cget(&stardis->bin_green_filename), "wb");
if(!stream_g) {
logger_print(stardis->logger, LOG_ERROR,
- "cannot open file '%s'\n", str_cget(&stardis->bin_green_filename));
+ "cannot open file '%s' for binary writing.\n",
+ str_cget(&stardis->bin_green_filename));
res = RES_IO_ERR;
goto error;
}
@@ -520,7 +521,8 @@ compute_probe(struct stardis* stardis, struct time* start)
stream_p = fopen(str_cget(&stardis->end_paths_filename), "w");
if(!stream_p) {
logger_print(stardis->logger, LOG_ERROR,
- "cannot open file '%s'\n", str_cget(&stardis->end_paths_filename));
+ "cannot open file '%s' for writing.\n",
+ str_cget(&stardis->end_paths_filename));
res = RES_IO_ERR;
goto error;
}
@@ -769,7 +771,8 @@ compute_probe_on_interface(struct stardis* stardis, struct time* start)
stream_g = fopen(str_cget(&stardis->bin_green_filename), "wb");
if(!stream_g) {
logger_print(stardis->logger, LOG_ERROR,
- "cannot open file '%s'\n", str_cget(&stardis->bin_green_filename));
+ "cannot open file '%s' for binary writing.\n",
+ str_cget(&stardis->bin_green_filename));
res = RES_IO_ERR;
goto error;
}
@@ -779,7 +782,8 @@ compute_probe_on_interface(struct stardis* stardis, struct time* start)
stream_p = fopen(str_cget(&stardis->end_paths_filename), "w");
if(!stream_p) {
logger_print(stardis->logger, LOG_ERROR,
- "cannot open file '%s'\n", str_cget(&stardis->end_paths_filename));
+ "cannot open file '%s' for writing.\n",
+ str_cget(&stardis->end_paths_filename));
res = RES_IO_ERR;
goto error;
}
@@ -817,7 +821,7 @@ compute_probe_on_interface(struct stardis* stardis, struct time* start)
ERR(print_computation_time(estimator, stardis,
start, &compute_start, &compute_end, NULL));
tmp_res1 = print_single_MC_result(estimator, stardis, stdout);
-
+
/* Dump recorded paths according to user settings */
dump_ctx.stardis = stardis;
dump_ctx.rank = 0;
@@ -980,6 +984,9 @@ compute_camera(struct stardis* stardis, struct time* start)
else {
stream = fopen(str_cget(&stardis->camera.file_name), "w");
if(!stream) {
+ logger_print(stardis->logger, LOG_ERROR,
+ "cannot open file '%s' for writing.\n",
+ str_cget(&stardis->camera.file_name));
res = RES_IO_ERR;
goto error;
}
@@ -1059,7 +1066,8 @@ compute_medium(struct stardis* stardis, struct time* start)
stream_g = fopen(str_cget(&stardis->bin_green_filename), "wb");
if(!stream_g) {
logger_print(stardis->logger, LOG_ERROR,
- "cannot open file '%s'\n", str_cget(&stardis->bin_green_filename));
+ "cannot open file '%s' for binary writing.\n",
+ str_cget(&stardis->bin_green_filename));
res = RES_IO_ERR;
goto error;
}
@@ -1069,7 +1077,8 @@ compute_medium(struct stardis* stardis, struct time* start)
stream_p = fopen(str_cget(&stardis->end_paths_filename), "w");
if(!stream_p) {
logger_print(stardis->logger, LOG_ERROR,
- "cannot open file '%s'\n", str_cget(&stardis->end_paths_filename));
+ "cannot open file '%s' for writing.\n",
+ str_cget(&stardis->end_paths_filename));
res = RES_IO_ERR;
goto error;
}
@@ -1215,7 +1224,8 @@ compute_boundary(struct stardis* stardis, struct time* start)
stream_g = fopen(str_cget(&stardis->bin_green_filename), "wb");
if(!stream_g) {
logger_print(stardis->logger, LOG_ERROR,
- "cannot open file '%s'\n", str_cget(&stardis->bin_green_filename));
+ "cannot open file '%s' for binary writing.\n",
+ str_cget(&stardis->bin_green_filename));
res = RES_IO_ERR;
goto error;
}
@@ -1225,7 +1235,8 @@ compute_boundary(struct stardis* stardis, struct time* start)
stream_p = fopen(str_cget(&stardis->end_paths_filename), "w");
if(!stream_p) {
logger_print(stardis->logger, LOG_ERROR,
- "cannot open file '%s'\n", str_cget(&stardis->end_paths_filename));
+ "cannot open file '%s' for writing.\n",
+ str_cget(&stardis->end_paths_filename));
res = RES_IO_ERR;
goto error;
}
diff --git a/src/stardis-main.c b/src/stardis-main.c
@@ -24,6 +24,7 @@
#include <rsys/logger.h>
#include <rsys/clock_time.h>
+#include <rsys/str.h>
#include <stdlib.h>
#include <stdio.h>
@@ -39,12 +40,14 @@ main
struct args* args = NULL;
struct stardis stardis;
int logger_initialized = 0, allocator_initialized = 0,
- args_initialized = 0, stardis_initialized = 0;
+ args_initialized = 0, stardis_initialized = 0, name_initialized = 0;
int err = EXIT_SUCCESS;
struct mem_allocator allocator;
struct logger logger;
int mode = 0;
struct time start;
+ FILE* f = NULL;
+ struct str name;
res_T res = RES_OK;
time_current(&start);
@@ -58,6 +61,8 @@ main
ERR(logger_init(&allocator, &logger));
logger_initialized = 1;
+ str_init(&allocator, &name);
+ name_initialized = 1;
/* Active loggin for args parsing */
logger_set_stream(&logger, LOG_ERROR, log_err_fn, NULL);
logger_set_stream(&logger, LOG_WARNING, log_warn_fn, NULL);
@@ -90,17 +95,28 @@ main
release_args(args);
args_initialized = 0;
- if(mode & MODE_DUMP_VTK) {
+ if(mode & MODE_DUMP_MODEL) {
+ ERR(str_copy(&name, &stardis.dump_model_filename));
+ ERR(str_append(&name, ".vtk"));
+ f = fopen(str_cget(&name), "w");
+ if(!f) {
+ logger_print(stardis.logger, LOG_ERROR,
+ "cannot open file '%s' for writing.\n", str_cget(&name));
+ res = RES_IO_ERR;
+ goto error;
+ }
+
/* Dump all the app-independent information */
- ERR(sg3d_geometry_dump_as_vtk(stardis.geometry.sg3d, stdout));
+ ERR(sg3d_geometry_dump_as_vtk(stardis.geometry.sg3d, f));
/* Dump boundaries
* Should we dump connections too? */
- ERR(dump_boundaries_at_the_end_of_vtk(&stardis, stdout));
+ ERR(dump_boundaries_at_the_end_of_vtk(&stardis, f));
/* Dump the compute region if any */
if(mode & REGION_COMPUTE_MODES) {
- ERR(dump_compute_region_at_the_end_of_vtk(&stardis, stdout));
+ ERR(dump_compute_region_at_the_end_of_vtk(&stardis, f));
}
- ERR(dump_enclosure_related_stuff_at_the_end_of_vtk(&stardis, stdout));
+ ERR(dump_enclosure_related_stuff_at_the_end_of_vtk(&stardis, f));
+ fclose(f); f = NULL;
/* If dump, exit after dump done */
goto exit;
@@ -115,6 +131,8 @@ main
ERR(stardis_compute(&stardis, &start));
exit:
+ if(name_initialized) str_release(&name);
+ if(f) fclose(f);
if(args_initialized) release_args(args);
if(stardis_initialized) stardis_release(&stardis);
if(logger_initialized) logger_release(&logger);
diff --git a/src/stardis-output.c b/src/stardis-output.c
@@ -274,7 +274,7 @@ dump_path
stream = fopen(name, "w");
if(!stream) {
logger_print(dump_ctx->stardis->logger, LOG_ERROR,
- "cannot open file '%s'\n", name);
+ "cannot open file '%s' for writing.\n", name);
res = RES_IO_ERR;
goto error;
}
diff --git a/src/stardis-parsing.c b/src/stardis-parsing.c
@@ -45,10 +45,10 @@
#include <rsys/text_reader.h>
#include <rsys/library.h>
+#include <star/sg3d.h>
#include <wordexp.h>
#include <stdlib.h>
#include <stdio.h>
-#include <ctype.h>
#include <string.h>
#ifdef COMPILER_GCC
#include <strings.h> /* strcasecmp */
@@ -102,12 +102,14 @@ read_sides_and_files
unsigned current_merge_errors;
struct sg3d_geometry_add_callbacks callbacks = SG3D_ADD_CALLBACKS_NULL__;
struct darray_uint degenerated;
- struct str str;
+ struct str str, name;
+ FILE* f = NULL;
res_T res = RES_OK;
ASSERT(stardis && pwordexp && idx);
darray_uint_init(stardis->allocator, °enerated);
+ str_init(stardis->allocator, &name);
str_init(stardis->allocator, &str);
callbacks.get_indices = add_geom_ctx_indices;
callbacks.get_properties = add_geom_ctx_properties;
@@ -217,7 +219,21 @@ read_sides_and_files
stardis->geometry.sg3d, &merge_errors));
if(current_merge_errors != merge_errors) {
int is_for_compute =
- (stardis->mode & COMPUTE_MODES) && !(stardis->mode & MODE_DUMP_VTK);
+ (stardis->mode & COMPUTE_MODES) && !(stardis->mode & MODE_DUMP_MODEL);
+ if(!str_is_empty(&stardis->dump_model_filename)) {
+ ERR(str_copy(&name, &stardis->dump_model_filename));
+ ERR(str_append(&name, "_merge_conflits.obj"));
+ f = fopen(str_cget(&name), "w");
+ if(!f) {
+ logger_print(stardis->logger, LOG_ERROR,
+ "cannot open file '%s' for writing.\n", str_cget(&name));
+ res = RES_IO_ERR;
+ goto error;
+ }
+ ERR(sg3d_geometry_dump_as_obj(stardis->geometry.sg3d, f,
+ SG3D_OBJ_DUMP_MERGE_CONFLICTS));
+ fclose(f); f = NULL;
+ }
logger_print(stardis->logger, (is_for_compute ? LOG_ERROR : LOG_WARNING),
"Merge conflicts found reading file '%s' (%u triangles).\n",
arg, merge_errors - current_merge_errors);
@@ -230,6 +246,8 @@ read_sides_and_files
}
end:
+ if(f) fclose(f);
+ str_release(&name);
darray_uint_release(°enerated);
str_release(&str);
if(sstl) SSTL(ref_put(sstl));
@@ -729,7 +747,7 @@ process_program
ERR(init_program(stardis->allocator, &desc->d.program));
program = desc->d.program;
desc->type = DESC_PROGRAM;
-
+
CHK_ARG(idx, "program name");
ERR(description_set_name(stardis, &program->name, arg));
if(find_description_by_name(stardis, &program->name, desc)) {
@@ -855,7 +873,7 @@ process_h_prog
ERR(init_h_boundary_prog(stardis->allocator, &desc->d.h_boundary_prog));
h_boundary_prog = desc->d.h_boundary_prog;
desc->type = type;
-
+
CHK_ARG(idx, "programmed h boundary name");
ERR(description_set_name(stardis, &h_boundary_prog->name, arg));
if(find_description_by_name(stardis, &h_boundary_prog->name, desc)) {
@@ -951,7 +969,7 @@ process_hf_prog
ERR(init_hf_boundary_prog(stardis->allocator, &desc->d.hf_boundary_prog));
hf_boundary_prog = desc->d.hf_boundary_prog;
desc->type = type;
-
+
CHK_ARG(idx, "programmed hf boundary name");
ERR(description_set_name(stardis, &hf_boundary_prog->name, arg));
if(find_description_by_name(stardis, &hf_boundary_prog->name, desc)) {
@@ -1036,7 +1054,7 @@ process_t
ERR(get_dummy_fluid_id(stardis, &t_boundary->mat_id));
-
+
CHK_ARG(idx, "temperature boundary name");
ERR(description_set_name(stardis, &t_boundary->name, arg));
if(find_description_by_name(stardis, &t_boundary->name, desc)) {
@@ -1094,7 +1112,7 @@ process_t_prog
desc->type = DESC_BOUND_T_FOR_SOLID_PROG;
ERR(get_dummy_fluid_id(stardis, &t_boundary_prog->mat_id));
-
+
CHK_ARG(idx, "programmed t boundary name");
ERR(description_set_name(stardis, &t_boundary_prog->name, arg));
if(find_description_by_name(stardis, &t_boundary_prog->name, desc)) {
@@ -1221,7 +1239,7 @@ process_flx_prog
desc->type = DESC_BOUND_F_FOR_SOLID_PROG;
ERR(get_dummy_fluid_id(stardis, &f_boundary_prog->mat_id));
-
+
CHK_ARG(idx, "programmed t boundary name");
ERR(description_set_name(stardis, &f_boundary_prog->name, arg));
if(find_description_by_name(stardis, &f_boundary_prog->name, desc)) {
@@ -1603,7 +1621,7 @@ read_delta
goto error;
}
} else {
- /* Could be 'auto' */
+ /* Could be 'auto' */
if(0 == strcasecmp(arg, "AUTO")) {
/* Set to DELTA_AUTO until actual value is substituted */
*delta = DELTA_AUTO;
@@ -1647,7 +1665,7 @@ process_solid
solid->is_outside = 0;
ASSERT(sz <= UINT_MAX);
solid->desc_id = (unsigned)sz;
-
+
CHK_ARG(idx, "solid name");
ERR(description_set_name(stardis, &solid->name, arg));
if(find_description_by_name(stardis, &solid->name, desc)) {
@@ -1766,7 +1784,7 @@ process_solid_prog
solid_prog->solid_id = allocate_stardis_medium_id(stardis);
ASSERT(sz <= UINT_MAX);
solid_prog->desc_id = (unsigned)sz;
-
+
CHK_ARG(idx, "programmed solid name");
ERR(description_set_name(stardis, &solid_prog->name, arg));
if(find_description_by_name(stardis, &solid_prog->name, desc)) {
@@ -1837,7 +1855,7 @@ process_fluid
fluid->is_green = stardis->mode & (MODE_BIN_GREEN | MODE_GREEN);
ASSERT(sz <= UINT_MAX);
fluid->desc_id = (unsigned)sz;
-
+
CHK_ARG(idx, "fluid name");
ERR(description_set_name(stardis, &fluid->name, arg));
if(find_description_by_name(stardis, &fluid->name, desc)) {
@@ -1930,7 +1948,7 @@ process_fluid_prog
fluid_prog->fluid_id = allocate_stardis_medium_id(stardis);
ASSERT(sz <= UINT_MAX);
fluid_prog->desc_id = (unsigned)sz;
-
+
CHK_ARG(idx, "programmed fluid name");
ERR(description_set_name(stardis, &fluid_prog->name, arg));
if(find_description_by_name(stardis, &fluid_prog->name, desc)) {
@@ -2090,7 +2108,7 @@ process_model_line
ASSERT(file_name && line && pwordexp && stardis);
CHK_ARG(idx, "model line type");
-
+
if(0 == strcasecmp(arg, "H_BOUNDARY_FOR_SOLID"))
ERR(process_h(stardis, DESC_BOUND_H_FOR_SOLID, pwordexp));
else if(0 == strcasecmp(arg, "H_BOUNDARY_FOR_SOLID_PROG"))