📄 ne_glbp.c
字号:
exerrval = status; sprintf(errmsg, "Error: failed to get status for \"%s\" from file ID %d", VAR_EXT_N_STAT, neid); ex_err(func_name, errmsg, exerrval); return (EX_FATAL); } if (nmstat == 1) { if (ne_get_idx(neid, VAR_NODE_MAP_EXT_IDX, varidx, processor) == -1) { exerrval = status; sprintf(errmsg, "Error: failed to find index variable, \"%s\", in file ID %d", VAR_NODE_MAP_EXT_IDX, neid); ex_err(func_name, errmsg, exerrval); return (EX_FATAL); } /* check if I need to get the dimension of the external node map */ if (varidx[1] == -1) { /* Get the dimension ID for the number of external nodes */ if ((status = nc_inq_dimid(neid, DIM_NUM_EXT_NODES, &dimid)) != NC_NOERR) { exerrval = status; sprintf(errmsg, "Error: failed to find dimension ID for \"%s\" in file ID %d", DIM_NUM_EXT_NODES, neid); ex_err(func_name, errmsg, exerrval); return (EX_FATAL); } /* * Get the value of the dimension representing the number of external * FEM nodes. */ if ((status = nc_inq_dimlen(neid, dimid, <empsv)) != NC_NOERR) { exerrval = status; sprintf(errmsg, "Error: failed to find length of dimension \"%s\" in file ID %d", DIM_NUM_EXT_NODES, neid); ex_err(func_name, errmsg, exerrval); return (EX_FATAL); } /* set the end value for the node map */ varidx[1] = ltempsv; } /* End "if (varidx[1] == -1)" */ /* now get the number of nodes */ *num_ext_nodes = varidx[1] - varidx[0]; } else { /* if (nmstat != 1) */ *num_ext_nodes = 0; } /* End "if (nmstat == 1)" */ /* Get the status for this element map */ if ((status = nc_inq_varid(neid, VAR_INT_E_STAT, &varid)) != NC_NOERR) { exerrval = status; sprintf(errmsg, "Error: failed to find variable ID for \"%s\" from file ID %d", VAR_INT_E_STAT, neid); ex_err(func_name, errmsg, exerrval); return (EX_FATAL); } if (ftype[0] == 's') start[0] = processor; else start[0] = 0; if ((status = nc_get_var1_int(neid, varid, start, &nmstat)) != NC_NOERR) { exerrval = status; sprintf(errmsg, "Error: failed to get status for \"%s\" from file ID %d", VAR_INT_E_STAT, neid); ex_err(func_name, errmsg, exerrval); return (EX_FATAL); } if (nmstat == 1) { if (ne_get_idx(neid, VAR_ELEM_MAP_INT_IDX, varidx, processor) == -1) { exerrval = status; sprintf(errmsg, "Error: failed to find index variable, \"%s\", in file ID %d", VAR_ELEM_MAP_INT_IDX, neid); ex_err(func_name, errmsg, exerrval); return (EX_FATAL); } /* check if I need to get the dimension of the internal element map */ if (varidx[1] == -1) { /* Get the dimension ID for the number of internal elements */ if ((status = nc_inq_dimid(neid, DIM_NUM_INT_ELEMS, &dimid)) != NC_NOERR) { exerrval = status; sprintf(errmsg, "Error: failed to find dimension ID for \"%s\" from file ID %d", DIM_NUM_INT_ELEMS, neid); ex_err(func_name, errmsg, exerrval); return (EX_FATAL); } /* * Get the value of the dimension representing the number of internal * FEM elements. */ if ((status = nc_inq_dimlen(neid, dimid, <empsv)) != NC_NOERR) { exerrval = status; sprintf(errmsg, "Error: failed to find length of dimesion \"%s\" in file ID %d", DIM_NUM_INT_ELEMS, neid); ex_err(func_name, errmsg, exerrval); return (EX_FATAL); } /* set the end value for the node map */ varidx[1] = ltempsv; } /* End "if (varidx[1] == -1)" */ /* now get the number of elements */ *num_int_elems = varidx[1] - varidx[0]; } else { /* if (nmstat != 1) */ *num_int_elems = 0; } /* End "if (nmstat == 1)" */ /* Get the status for this element map */ if ((status = nc_inq_varid(neid, VAR_BOR_E_STAT, &varid)) != NC_NOERR) { exerrval = status; sprintf(errmsg, "Error: failed to find variable ID for \"%s\" from file ID %d", VAR_BOR_E_STAT, neid); ex_err(func_name, errmsg, exerrval); return (EX_FATAL); } if (ftype[0] == 's') start[0] = processor; else start[0] = 0; if ((status = nc_get_var1_int(neid, varid, start, &nmstat)) != NC_NOERR) { exerrval = status; sprintf(errmsg, "Error: failed to get status for \"%s\" from file ID %d", VAR_BOR_E_STAT, neid); ex_err(func_name, errmsg, exerrval); return (EX_FATAL); } if (nmstat == 1) { if (ne_get_idx(neid, VAR_ELEM_MAP_BOR_IDX, varidx, processor) == -1) { exerrval = status; sprintf(errmsg, "Error: failed to find index variable, \"%s\", in file ID %d", VAR_ELEM_MAP_BOR_IDX, neid); ex_err(func_name, errmsg, exerrval); return (EX_FATAL); } /* check if I need to get the dimension of the border element map */ if (varidx[1] == -1) { /* Get the dimension ID for the number of border elements */ if ((status = nc_inq_dimid(neid, DIM_NUM_BOR_ELEMS, &dimid)) != NC_NOERR) { exerrval = status; sprintf(errmsg, "Error: failed to find dimension ID for \"%s\" from file ID %d", DIM_NUM_BOR_ELEMS, neid); ex_err(func_name, errmsg, exerrval); return (EX_FATAL); } /* * Get the value of the dimension representing the number of internal * FEM elements. */ if ((status = nc_inq_dimlen(neid, dimid, <empsv)) != NC_NOERR) { exerrval = status; sprintf(errmsg, "Error: failed to find length of dimesion \"%s\" in file ID %d", DIM_NUM_BOR_ELEMS, neid); ex_err(func_name, errmsg, exerrval); return (EX_FATAL); } /* set the end value for the node map */ varidx[1] = ltempsv; } /* End "if (varidx[1] == -1)" */ /* now get the number of nodes */ *num_bor_elems = varidx[1] - varidx[0]; } else { /* if (nmstat != 1) */ *num_bor_elems = 0; } /* End "if (nmstat == 1)" */ if (ne_get_idx(neid, VAR_N_COMM_INFO_IDX, varidx, processor) == -1) { exerrval = status; sprintf(errmsg, "Error: failed to find index variable, \"%s\", in file ID %d", VAR_N_COMM_INFO_IDX, neid); ex_err(func_name, errmsg, exerrval); return (EX_FATAL); } /* check if I need to get the dimension of the nodal comm map */ if (varidx[1] == -1) { /* Get the nodal comm map information */ if ((status = nc_inq_dimid(neid, DIM_NUM_N_CMAPS, &dimid)) != NC_NOERR) varidx[1] = 0; else { if ((status = nc_inq_dimlen(neid, dimid, <empsv2)) != NC_NOERR) { exerrval = status; sprintf(errmsg, "Error: failed to find length of dimension \"%s\" in file ID %d", DIM_NUM_N_CMAPS, neid); ex_err(func_name, errmsg, exerrval); return (EX_FATAL); } /* set the end value for the node map */ varidx[1] = ltempsv2; } } /* End "if (varidx[1] == -1)" */ *num_node_cmaps = varidx[1] - varidx[0]; if (ne_get_idx(neid, VAR_E_COMM_INFO_IDX, varidx, processor) == -1) { exerrval = status; sprintf(errmsg, "Error: failed to find index variable, \"%s\", in file ID %d", VAR_E_COMM_INFO_IDX, neid); ex_err(func_name, errmsg, exerrval); return (EX_FATAL); } /* check if I need to get the dimension of the elemental comm map */ if (varidx[1] == -1) { /* Get the elemental comm map information */ if ((status = nc_inq_dimid(neid, DIM_NUM_E_CMAPS, &dimid)) != NC_NOERR) varidx[1] = 0; else { if ((status = nc_inq_dimlen(neid, dimid, <empsv2)) != NC_NOERR) { exerrval = status; sprintf(errmsg, "Error: failed to find length of dimension \"%s\" in file ID %d", DIM_NUM_E_CMAPS, neid); ex_err(func_name, errmsg, exerrval); return (EX_FATAL); } /* set the end value for the node map */ varidx[1] = ltempsv2; } } /* End "if (varidx[1] == -1)" */ *num_elem_cmaps = varidx[1] - varidx[0]; return (EX_NOERR);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -