Skip to content

Commit

Permalink
EXODUS: Fix output of map with zero entries
Browse files Browse the repository at this point in the history
  • Loading branch information
gdsjaar committed Jun 18, 2024
1 parent 2a9a856 commit 49d63a8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/seacas/libraries/exodus/src/ex_put_partial_num_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,11 @@ int ex_put_partial_num_map(int exoid, ex_entity_type map_type, ex_entity_id map_
}

/* Check input parameters for a valid range of numbers */
if (ent_start <= 0 || ent_start > num_mobj) {
if (ent_count == 0) {
ent_start = 0;
}

if (ent_start < 0 || ent_start > num_mobj) {
snprintf(errmsg, MAX_ERR_LENGTH, "ERROR: start count is invalid in file id %d", exoid);
ex_err_fn(exoid, __func__, errmsg, EX_BADPARAM);
EX_FUNC_LEAVE(EX_FATAL);
Expand All @@ -169,7 +173,7 @@ int ex_put_partial_num_map(int exoid, ex_entity_type map_type, ex_entity_id map_
ex_err_fn(exoid, __func__, errmsg, EX_BADPARAM);
EX_FUNC_LEAVE(EX_FATAL);
}
if (ent_start + ent_count - 1 > num_mobj) {
if (ent_count > 0 && (ent_start + ent_count - 1 > num_mobj)) {
snprintf(errmsg, MAX_ERR_LENGTH,
"ERROR: start+count-1 is larger than mesh object count in file id %d", exoid);
ex_err_fn(exoid, __func__, errmsg, EX_BADPARAM);
Expand Down

0 comments on commit 49d63a8

Please sign in to comment.