diff --git a/packages/seacas/libraries/exodus/src/ex_utils.c b/packages/seacas/libraries/exodus/src/ex_utils.c index 50f5ce4a5a..183f2d2bdb 100644 --- a/packages/seacas/libraries/exodus/src/ex_utils.c +++ b/packages/seacas/libraries/exodus/src/ex_utils.c @@ -2321,6 +2321,30 @@ int ex__get_varid(int exoid, ex_entity_type obj_type, ex_entity_id id) return varid; } + if (obj_type == EX_ASSEMBLY) { + int varid = 0; + if ((status = nc_inq_varid(exoid, VAR_ENTITY_ASSEMBLY(id), &varid)) != NC_NOERR) { + snprintf(errmsg, MAX_ERR_LENGTH, + "ERROR: failed to locate %s id %" PRId64 " in id array in file id %d", + ex_name_of_object(obj_type), id, exoid); + ex_err_fn(exoid, __func__, errmsg, status); + return EX_FATAL; + } + return varid; + } + + if (obj_type == EX_BLOB) { + int varid = 0; + if ((status = nc_inq_varid(exoid, VAR_ENTITY_BLOB(id), &varid)) != NC_NOERR) { + snprintf(errmsg, MAX_ERR_LENGTH, + "ERROR: failed to locate %s id %" PRId64 " in id array in file id %d", + ex_name_of_object(obj_type), id, exoid); + ex_err_fn(exoid, __func__, errmsg, status); + return EX_FATAL; + } + return varid; + } + /* Everything else ... */ /* First, locate index of this objects id `obj_type` id array */ /* First, locate index of this objects id `obj_type` id array */ @@ -2341,8 +2365,6 @@ int ex__get_varid(int exoid, ex_entity_type obj_type, ex_entity_id id) const char *entryptr = NULL; switch (obj_type) { - case EX_ASSEMBLY: entryptr = VAR_ENTITY_ASSEMBLY(id_ndx); break; - case EX_BLOB: entryptr = VAR_ENTITY_BLOB(id_ndx); break; case EX_NODE_SET: entryptr = VAR_NODE_NS(id_ndx); break; case EX_EDGE_SET: entryptr = VAR_EDGE_ES(id_ndx); break; case EX_FACE_SET: entryptr = VAR_FACE_FS(id_ndx); break;