31 static void do_logging(
int loglv,
int msgno,
int add_location,
const char *fmt,
40 if (strlen(msg) > 0) s =
": ";
52 static void set_err(
int msgno,
const char *fmt, ...) {
60 static void set_err_token(
int token,
int msgno,
const char *fmt, ...) {
78 static int read_input(
int msgno_invalid_token) {
84 set_err_token(token, msgno_invalid_token,
"'=' required after INPUT");
89 set_err_token(token, msgno_invalid_token,
"Invalid filename for INPUT");
102 strcpy(include_filename, p);
111 sprintf(include_filename,
"%s%s%s", dname,
separator, p);
118 static int read_amp_head(
void) {
137 static int read_amp_param_name(
char *name) {
149 "NAME must begin with a letter or '_'");
166 static int read_amp_param_type(
int *type) {
183 static int read_amp_param_definition(
int *definition) {
200 static int read_amp_param_time(
int *time) {
217 static int read_amp_param_value(
int *value) {
237 static int read_amp_data(
char *name,
int type,
int definition,
int time,
290 if (token ==
',' && i == NITEM) {
304 static int read_amplitude(
void) {
312 int flag_definition = 0;
320 ST_HEADER_LINE_PARAM,
326 state = ST_HEADER_LINE;
327 while (state != ST_FINISHED) {
328 if (state == ST_HEADER_LINE) {
329 if (read_amp_head())
return -1;
330 state = ST_HEADER_LINE_PARAM;
331 }
else if (state == ST_HEADER_LINE_PARAM) {
335 if (read_amp_param_name(name))
return -1;
339 if (read_amp_param_type(&type))
return -1;
343 if (read_amp_param_definition(&definition))
return -1;
347 if (read_amp_param_time(&time))
return -1;
351 if (read_amp_param_value(&value))
return -1;
370 state = flag_input ? ST_DATA_INCLUDE : ST_DATA_LINE;
371 }
else if (token ==
',') {
377 }
else if (state == ST_DATA_INCLUDE) {
382 state = ST_DATA_LINE;
383 }
else if (state == ST_DATA_LINE) {
385 if (read_amp_data(name, type, definition, time, value))
return -1;
403 static int read_contact_or_insert_pair_head(
int *last_token,
int *type) {
420 "',' or NL required after !CONTACT");
428 static int read_contact_pair_param_name(
char *name) {
440 "NAME must begin with a letter or '_'");
457 static int read_contact_pair_param_type(
int *type) {
479 static int read_contact_pair_data(
char *name,
int type) {
481 char *slave_grp, *master_grp;
496 if (slave_grp ==
NULL) {
530 if (master_grp ==
NULL) {
556 static int read_contact_pair(
void) {
565 ST_HEADER_LINE_PARAM,
570 state = ST_HEADER_LINE;
571 while (state != ST_FINISHED) {
572 if (state == ST_HEADER_LINE) {
573 if (read_contact_or_insert_pair_head(&token,&type))
return -1;
575 state = ST_DATA_LINE;
576 }
else if (token ==
',') {
577 state = ST_HEADER_LINE_PARAM;
581 }
else if (state == ST_HEADER_LINE_PARAM) {
585 if (read_contact_pair_param_name(name))
return -1;
589 if (read_contact_pair_param_type(&type))
return -1;
608 state = ST_DATA_INCLUDE;
610 state = ST_DATA_LINE;
612 }
else if (token ==
',') {
618 }
else if (state == ST_DATA_INCLUDE) {
622 state = ST_DATA_LINE;
623 }
else if (state == ST_DATA_LINE) {
624 if (read_contact_pair_data(name, type))
return -1;
645 fprintf(stderr,
"!ECOPY has not implemented yet\n");
654 fprintf(stderr,
"!EGEN has not implemented yet\n");
662 static int read_egrp_head(
void) {
681 static int read_egrp_param_egrp(
char *egrp) {
693 "EGRP must begin with a letter or '_'");
707 if (strcmp(egrp,
"ALL") == 0) {
714 static int read_egrp_data(
char *egrp) {
715 int i, n, *elem, token;
752 "',' or NL required after element ID");
782 static int read_egrp_generate(
char *egrp) {
783 int i, n,
id, *elem, token;
784 int elem1, elem2, elem3;
843 "',' or NL required after elem2");
851 "Cannot generate between %d and %d with an increment of %d",
852 elem1, elem2, elem3);
855 if ((elem2 - elem1) % elem3) {
857 "Cannot generate between %d and %d with an increment of %d",
858 elem1, elem2, elem3);
862 n = (elem2 - elem1) / elem3 + 1;
870 for (
id = elem1;
id <= elem2;
id += elem3) {
888 static int read_egroup(
void) {
891 int flag_generate = 0;
897 ST_HEADER_LINE_PARAM,
900 ST_DATA_LINE_GENERATE
903 state = ST_HEADER_LINE;
904 while (state != ST_FINISHED) {
905 if (state == ST_HEADER_LINE) {
906 if (read_egrp_head())
return -1;
907 state = ST_HEADER_LINE_PARAM;
908 }
else if (state == ST_HEADER_LINE_PARAM) {
912 if (read_egrp_param_egrp(egrp))
return -1;
930 state = ST_DATA_INCLUDE;
931 }
else if (flag_generate) {
932 state = ST_DATA_LINE_GENERATE;
934 state = ST_DATA_LINE;
941 }
else if (token ==
',') {
947 }
else if (state == ST_DATA_INCLUDE) {
952 state = flag_generate ? ST_DATA_LINE_GENERATE : ST_DATA_LINE;
953 }
else if (state == ST_DATA_LINE) {
957 if (read_egrp_data(egrp))
return -1;
965 }
else if (state == ST_DATA_LINE_GENERATE) {
969 if (read_egrp_generate(egrp))
return -1;
981 static int read_elem_head(
void) {
1000 static int read_elem_param_type(
int *type) {
1021 static int read_elem_param_egrp(
char *egrp) {
1033 "EGRP must begin with a letter or '_'");
1047 if (strcmp(egrp,
"ALL") == 0) {
1054 static int read_elem_param_nmatitem(
int *nmatitem) {
1068 if (*nmatitem < 0) {
1075 static int read_elem_data_conn(
int *
id,
int nnode,
int *node) {
1112 if (i == nnode - 1)
break;
1118 "',' or NL required after connectivity");
1127 static int read_elem_data_mat(
int nmatitem,
double *matitem) {
1131 for (i = 0; i < nmatitem; i++) {
1136 for (i = 0; i < nmatitem; i++) {
1150 if (i == nmatitem - 1) {
1165 static int read_element(
void) {
1170 double *matitem =
NULL;
1175 int flag_matitem = 0;
1181 st_header_line_param,
1185 st_data_line_matitem,
1186 st_data_line_regist,
1190 state = st_header_line;
1191 while (state != st_finished) {
1192 if (state == st_header_line) {
1193 if (read_elem_head())
return -1;
1194 state = st_header_line_param;
1195 }
else if (state == st_header_line_param) {
1199 if (read_elem_param_type(&type))
return -1;
1203 if (read_elem_param_egrp(egrp))
return -1;
1207 if (read_elem_param_nmatitem(&nmatitem))
return -1;
1227 }
else if (token ==
',') {
1233 }
else if (state == st_prepare) {
1251 if (flag_matitem && nmatitem) {
1254 if (matitem ==
NULL) {
1263 state = flag_input ? st_data_include : st_data_line_conn;
1264 }
else if (state == st_data_include) {
1269 state = st_data_line_conn;
1270 }
else if (state == st_data_line_conn) {
1273 if (read_elem_data_conn(&
id, nnode, node))
return -1;
1281 "',' or NL required after connectivity");
1290 state = st_data_line_matitem;
1296 state = st_data_line_regist;
1298 }
else if (state == st_data_line_matitem) {
1304 if (read_elem_data_mat(nmatitem, matitem))
return -1;
1305 state = st_data_line_regist;
1306 }
else if (state == st_data_line_regist) {
1327 state = st_data_line_conn;
1329 state = st_finalize;
1332 }
else if (state == st_finalize) {
1337 state = st_finished;
1348 static int read_equation_head(
int *last_token) {
1361 "',' or NL required after !EQUATION");
1364 *last_token = token;
1369 static int read_equation_data_line1(
int *neq,
double *cnst) {
1383 if (strcmp(p,
"link") == 0 || strcmp(p,
"LINK") == 0) {
1422 static int read_equation_data_line2(
int neq,
double cnst) {
1428 const int NITEM = 100;
1430 struct hecmw_io_mpcitem *mpcitem;
1431 bool isAllDof =
false;
1434 if (mpcitem ==
NULL) {
1442 if (strcmp(p,
"link") == 0 || strcmp(p,
"LINK") == 0) {
1450 for (i = 0; i < neq; i++) {
1461 strcpy(mpcitem[i].ngrp,
"");
1473 strcpy(mpcitem[i].ngrp, p);
1479 mpcitem[i].node = -1;
1500 if (mpcitem[i].dof == 0) {
1528 "',' or NL required after coefficient");
1531 if (token ==
',' && i == NITEM - 1) {
1544 for (i = 0; i < neq; i++) {
1548 for (i = 0; i < neq; i++) {
1552 for (i = 0; i < neq; i++) {
1563 }
else if (is_link == 1) {
1578 strcpy(mpcitem[0].ngrp,
"");
1593 strcpy(mpcitem[1].ngrp,
"");
1594 mpcitem[1].a = -1.0;
1619 static int read_equation(
void) {
1628 ST_HEADER_LINE_PARAM,
1634 state = ST_HEADER_LINE;
1635 while (state != ST_FINISHED) {
1636 if (state == ST_HEADER_LINE) {
1637 if (read_equation_head(&token))
return -1;
1639 state = ST_HEADER_LINE_PARAM;
1641 state = ST_DATA_LINE1;
1645 }
else if (state == ST_HEADER_LINE_PARAM) {
1659 state = flag_input ? ST_DATA_INCLUDE : ST_DATA_LINE1;
1664 }
else if (state == ST_DATA_INCLUDE) {
1668 state = ST_DATA_LINE1;
1669 }
else if (state == ST_DATA_LINE1) {
1670 if (read_equation_data_line1(&neq, &cnst))
return -1;
1671 state = ST_DATA_LINE2;
1672 }
else if (state == ST_DATA_LINE2) {
1674 if (read_equation_data_line2(neq, cnst))
return -1;
1679 state = ST_DATA_LINE1;
1682 if (strcmp(p,
"link") == 0 || strcmp(p,
"LINK") == 0) {
1683 state = ST_DATA_LINE1;
1685 state = ST_FINISHED;
1688 state = ST_FINISHED;
1701 static int read_header(
void) {
1726 while (*p && *p ==
' ') p++;
1727 if (p ==
NULL) p =
"";
1730 strncpy(
header->header, p, len);
1731 header->header[len] =
'\0';
1751 static int read_include(
void) {
1796 static int read_initial_head(
void) {
1815 static int read_initial_param_type(
int *type) {
1832 static int read_initial_data(
int type) {
1896 static int read_initial(
void) {
1904 ST_HEADER_LINE_PARAM,
1909 state = ST_HEADER_LINE;
1910 while (state != ST_FINISHED) {
1911 if (state == ST_HEADER_LINE) {
1912 if (read_initial_head())
return -1;
1913 state = ST_HEADER_LINE_PARAM;
1914 }
else if (state == ST_HEADER_LINE_PARAM) {
1918 if (read_initial_param_type(&type))
return -1;
1933 state = ST_DATA_INCLUDE;
1935 state = ST_DATA_LINE;
1942 }
else if (token ==
',') {
1948 }
else if (state == ST_DATA_INCLUDE) {
1952 state = ST_DATA_LINE;
1953 }
else if (state == ST_DATA_LINE) {
1955 if (read_initial_data(type))
return -1;
1960 state = ST_FINISHED;
1973 static int read_matitem_head(
int *item,
int *last_token) {
2008 *last_token = token;
2013 static int read_matitem_param_subitem(
int *subitem) {
2028 if (*subitem <= 0) {
2035 static int read_matitem_data(
int subitem,
int depend_temp,
2036 struct hecmw_io_matitem *matitem) {
2040 struct hecmw_io_matsubitem *p, *q, *msitem;
2043 if (msitem ==
NULL) {
2054 for (i = 0; i < subitem; i++) {
2058 for (i = 0; i < subitem; i++) {
2063 }
else if (token ==
',') {
2097 for (p = matitem->subitem; p; p = (q = p)->next)
2099 if (q && temp <= q->temp) {
2116 msitem->temp = temp;
2117 msitem->next =
NULL;
2120 for (p = matitem->subitem; p; p = (q = p)->next)
2123 matitem->subitem = msitem;
2131 static int read_matitem(
struct hecmw_io_matitem *matitem) {
2136 int flag_subitem = 0;
2137 int depend_temp = 0;
2141 ST_HEADER_LINE_PARAM,
2148 state = ST_HEADER_LINE;
2149 while (state != ST_FINISHED) {
2150 if (state == ST_HEADER_LINE) {
2151 if (read_matitem_head(&item, &token))
return -1;
2153 state = ST_HEADER_LINE_PARAM;
2158 }
else if (state == ST_HEADER_LINE_PARAM) {
2161 if (read_matitem_param_subitem(&subitem))
return -1;
2177 }
else if (state == ST_PREPARE) {
2182 matitem->item = item;
2183 matitem->nval = subitem;
2184 matitem->subitem =
NULL;
2189 state = ST_DATA_LINE;
2190 }
else if (state == ST_DATA_LINE) {
2195 if (read_matitem_data(subitem, depend_temp, matitem))
return -1;
2201 state = ST_FINISHED;
2211 static int read_material_head(
void) {
2230 static int read_material_param_name(
char *name) {
2242 "NAME must begin with a letter or '_'");
2263 static int read_material_param_item(
int *item) {
2284 static int matitem_comp(
const void *matitem1,
const void *matitem2) {
2285 const struct hecmw_io_matitem *m1, *m2;
2290 if (m1->item == m2->item)
return 0;
2291 if (m1->item < m2->item) {
2298 static int read_material_data(
int item,
char *name) {
2301 struct hecmw_io_matitem *matitem;
2310 if (matitem ==
NULL) {
2315 for (i = 0; i < item; i++) {
2316 if (read_matitem(&matitem[i]))
return -1;
2320 qsort(matitem, item,
sizeof(*matitem), matitem_comp);
2323 for (i = 0; i < item; i++) {
2324 if (matitem[i].item != i + 1) {
2331 strcpy(mat->
name, name);
2333 mat->
item = matitem;
2342 static int read_material(
void) {
2352 ST_HEADER_LINE_PARAM,
2357 state = ST_HEADER_LINE;
2358 while (state != ST_FINISHED) {
2359 if (state == ST_HEADER_LINE) {
2360 if (read_material_head())
return -1;
2361 state = ST_HEADER_LINE_PARAM;
2362 }
else if (state == ST_HEADER_LINE_PARAM) {
2366 if (read_material_param_name(name))
return -1;
2370 if (read_material_param_item(&item))
return -1;
2389 state = flag_input ? ST_DATA_INCLUDE : ST_DATA_LINE;
2390 }
else if (token ==
',') {
2396 }
else if (state == ST_DATA_INCLUDE) {
2400 state = ST_DATA_LINE;
2401 }
else if (state == ST_DATA_LINE) {
2403 if (read_material_data(item, name))
return -1;
2404 state = ST_FINISHED;
2418 fprintf(stderr,
"!NCOPY has not implemented yet\n");
2427 fprintf(stderr,
"!NFILL has not implemented yet\n");
2436 fprintf(stderr,
"!NGEN has not implemented yet\n");
2444 static int read_ngrp_head(
void) {
2463 static int read_ngrp_param_ngrp(
char *ngrp) {
2475 "NGRP must begin with a letter or '_'");
2489 if (strcmp(ngrp,
"EQUATION_BLOCK") == 0) {
2493 if (strcmp(ngrp,
"ALL") == 0) {
2500 static int read_ngrp_data(
char *ngrp) {
2501 int i, n, *node, token;
2538 "',' or NL required after node ID");
2566 static int read_ngrp_generate(
char *ngrp) {
2567 int i, n,
id, *node, token;
2568 int nod1, nod2, nod3;
2634 "Cannot generate between %d and %d with an increment of %d", nod1,
2638 if ((nod2 - nod1) % nod3) {
2640 "Cannot generate between %d and %d with an increment of %d", nod1,
2645 n = (nod2 - nod1) / nod3 + 1;
2653 for (
id = nod1;
id <= nod2;
id += nod3) {
2671 static int read_ngroup(
void) {
2674 int flag_generate = 0;
2680 st_header_line_param,
2683 st_data_line_generate
2686 state = st_header_line;
2687 while (state != st_finished) {
2688 if (state == st_header_line) {
2689 if (read_ngrp_head())
return -1;
2690 state = st_header_line_param;
2691 }
else if (state == st_header_line_param) {
2695 if (read_ngrp_param_ngrp(ngrp))
return -1;
2713 state = st_data_include;
2714 }
else if (flag_generate) {
2715 state = st_data_line_generate;
2717 state = st_data_line;
2724 }
else if (token ==
',') {
2730 }
else if (state == st_data_include) {
2734 state = flag_generate ? st_data_line_generate : st_data_line;
2735 }
else if (state == st_data_line) {
2737 if (read_ngrp_data(ngrp))
return -1;
2742 state = st_finished;
2745 }
else if (state == st_data_line_generate) {
2748 if (read_ngrp_generate(ngrp))
return -1;
2749 state = st_finished;
2760 static int read_node_head(
int *last_token) {
2775 *last_token = token;
2780 static int read_node_param_system(
int *system) {
2789 if (token !=
'C' && token !=
'R') {
2797 static int read_node_param_ngrp(
char *ngrp) {
2809 "NGRP must begin with a letter or '_'");
2823 if (strcmp(ngrp,
"ALL") == 0) {
2830 static int read_node_data(
int *id_arg,
double *x_arg,
double *y_arg,
2929 static int read_node_convert_coord(
int system,
double *x,
double *y,
2939 if (system ==
'C') {
2959 static int read_node(
void) {
2962 int flag_system = 0;
2969 ST_HEADER_LINE_PARAM,
2974 state = ST_HEADER_LINE;
2975 while (state != ST_FINISHED) {
2976 if (state == ST_HEADER_LINE) {
2977 if (read_node_head(&token))
return -1;
2979 state = ST_DATA_LINE;
2980 }
else if (token ==
',') {
2981 state = ST_HEADER_LINE_PARAM;
2985 }
else if (state == ST_HEADER_LINE_PARAM) {
2989 if (read_node_param_system(&system))
return -1;
2993 if (read_node_param_ngrp(ngrp))
return -1;
3007 state = flag_input ? ST_DATA_INCLUDE : ST_DATA_LINE;
3008 }
else if (token ==
',') {
3014 }
else if (state == ST_DATA_INCLUDE) {
3017 state = ST_DATA_LINE;
3018 }
else if (state == ST_DATA_LINE) {
3022 if (read_node_data(&
id, &
x, &
y, &
z))
return -1;
3023 if (read_node_convert_coord(system, &
x, &
y, &
z))
return -1;
3038 state = ST_FINISHED;
3040 state = ST_DATA_LINE;
3053 static int read_section_head(
void) {
3072 static int read_section_param_type(
int *type) {
3096 static int read_section_param_egrp(
char *egrp) {
3108 "EGRP must begin with a letter or '_'");
3125 static int read_section_param_material(
char *material) {
3137 "MATERIAL must begin with a letter or '_'");
3145 strcpy(material, p);
3156 read_section_param_composite(
int *composite)
3172 if(*composite <= 0) {
3180 static int read_section_param_secopt(
int *secopt_arg) {
3203 *secopt_arg = secopt;
3208 static int read_section_solid(
union hecmw_io_section_item *sect_item) {
3228 if (thickness <= 0.0) {
3234 sect_item->solid.thickness = thickness;
3239 static int read_section_shell(
union hecmw_io_section_item *sect_item) {
3241 int token, integpoints;
3251 if (thickness <= 0.0) {
3271 if (integpoints <= 0) {
3284 sect_item->shell.thickness = thickness;
3285 sect_item->shell.integpoints = integpoints;
3290 static int read_section_beam(
union hecmw_io_section_item *sect_item) {
3291 double nx, ny, nz, area, Iyy, Izz, Jx;
3423 sect_item->beam.vxyz[0] = nx;
3424 sect_item->beam.vxyz[1] = ny;
3425 sect_item->beam.vxyz[2] = nz;
3426 sect_item->beam.area = area;
3427 sect_item->beam.Iyy = Iyy;
3428 sect_item->beam.Izz = Izz;
3429 sect_item->beam.Jx = Jx;
3434 static int read_section_interface(
union hecmw_io_section_item *sect_item) {
3437 double gapcon = 0.0;
3438 double gaprad1 = 0.0;
3439 double gaprad2 = 0.0;
3450 if (thickness <= 0.0) {
3459 "',' or NL reuqired after THICKNESS");
3468 }
else if (token ==
',') {
3481 "',' or NL reuiqred after GAPCON");
3490 }
else if (token ==
',') {
3503 "',' or NL reuqired after GAPRAD1");
3529 sect_item->interface.thickness = thickness;
3530 sect_item->interface.gapcon = gapcon;
3531 sect_item->interface.gaprad1 = gaprad1;
3532 sect_item->interface.gaprad2 = gaprad2;
3537 static int read_section(
void) {
3542 union hecmw_io_section_item sect_item;
3545 int flag_material = 0;
3546 int flag_composite = 0;
3547 int flag_secopt = 0;
3554 ST_HEADER_LINE_PARAM,
3559 ST_DATA_LINE_INTERFACE,
3563 state = ST_HEADER_LINE;
3564 while (state != ST_FINISHED) {
3565 if (state == ST_HEADER_LINE) {
3566 if (read_section_head())
return -1;
3567 state = ST_HEADER_LINE_PARAM;
3568 }
else if (state == ST_HEADER_LINE_PARAM) {
3572 if (read_section_param_type(&type))
return -1;
3576 if (read_section_param_egrp(egrp))
return -1;
3580 if (flag_composite) {
3584 if (read_section_param_material(material))
return -1;
3593 if(read_section_param_composite(&composite))
return -1;
3598 if (read_section_param_secopt(&secopt))
return -1;
3623 state = ST_DATA_INCLUDE;
3625 state = ST_DATA_LINE_SOLID;
3627 state = ST_DATA_LINE_SHELL;
3629 state = ST_DATA_LINE_BEAM;
3631 state = ST_DATA_LINE_INTERFACE;
3635 }
else if (token ==
',') {
3641 }
else if (state == ST_DATA_INCLUDE) {
3648 state = ST_DATA_LINE_SOLID;
3650 state = ST_DATA_LINE_SHELL;
3652 state = ST_DATA_LINE_BEAM;
3654 state = ST_DATA_LINE_INTERFACE;
3658 }
else if (state == ST_DATA_LINE_SOLID) {
3663 if (read_section_solid(§_item))
return -1;
3664 state = ST_DATA_LINE_REGIST;
3665 }
else if (state == ST_DATA_LINE_SHELL) {
3670 if (read_section_shell(§_item))
return -1;
3671 state = ST_DATA_LINE_REGIST;
3672 }
else if (state == ST_DATA_LINE_BEAM) {
3677 if (read_section_beam(§_item))
return -1;
3678 state = ST_DATA_LINE_REGIST;
3679 }
else if (state == ST_DATA_LINE_INTERFACE) {
3684 if (read_section_interface(§_item))
return -1;
3685 state = ST_DATA_LINE_REGIST;
3686 }
else if (state == ST_DATA_LINE_REGIST) {
3697 sect.sect = sect_item;
3704 state = ST_FINISHED;
3715 static int read_sgrp_head(
void) {
3734 static int read_sgrp_param_sgrp(
char *sgrp) {
3746 "SGRP must begin with a letter or '_'");
3763 static int read_sgrp_data(
char *sgrp) {
3764 int i, n, *elem, *surf, token;
3765 struct hecmw_io_id *elem_head, *surf_head, *elem_prev, *surf_prev;
3766 struct hecmw_io_id *eid, *sid, *pe, *qe, *ps, *qs;
3769 elem_head = surf_head =
NULL;
3770 elem_prev = surf_prev =
NULL;
3789 if (elem_head ==
NULL) {
3790 elem_head = elem_prev = eid;
3792 elem_prev->
next = eid;
3818 if (surf_head ==
NULL) {
3819 surf_head = surf_prev = sid;
3821 surf_prev->
next = sid;
3831 "',' or NL required after surface ID");
3853 for (i = 0; i < n; i++) {
3874 static int read_sgroup(
void) {
3882 ST_HEADER_LINE_PARAM,
3887 state = ST_HEADER_LINE;
3888 while (state != ST_FINISHED) {
3889 if (state == ST_HEADER_LINE) {
3890 if (read_sgrp_head())
return -1;
3891 state = ST_HEADER_LINE_PARAM;
3892 }
else if (state == ST_HEADER_LINE_PARAM) {
3896 if (read_sgrp_param_sgrp(sgrp))
return -1;
3915 state = flag_input ? ST_DATA_INCLUDE : ST_DATA_LINE;
3916 }
else if (token ==
',') {
3922 }
else if (state == ST_DATA_INCLUDE) {
3926 state = ST_DATA_LINE;
3927 }
else if (state == ST_DATA_LINE) {
3929 if (read_sgrp_data(sgrp))
return -1;
3934 state = ST_FINISHED;
3936 state = ST_DATA_LINE;
3950 read_system_head(
void)
3981 }
else if(token ==
',') {
4000 }
else if(token ==
',') {
4033 *last_token = token;
4048 }
else if(token ==
',') {
4067 }
else if(token ==
',') {
4114 }
else if(token ==
',') {
4133 }
else if(token ==
',') {
4184 if(system ==
NULL) {
4200 state = ST_HEADER_LINE;
4201 while(state != ST_FINISHED) {
4202 if(state == ST_HEADER_LINE) {
4203 if(read_system_head())
return -1;
4210 state = ST_FINISHED;
4212 state = ST_DATA_LINE1;
4215 }
else if(state == ST_DATA_LINE1) {
4216 if(read_system_data_line1a(system, &token))
return -1;
4218 state = ST_FINISHED;
4223 if(read_system_data_line1b(system))
return -1;
4226 state = ST_FINISHED;
4228 state = ST_DATA_LINE2;
4231 }
else if(state == ST_DATA_LINE2) {
4232 if(read_system_data_line2(system))
return -1;
4233 state = ST_FINISHED;
4249 static int read_zero(
void) {
4284 if (new_zero ==
NULL) {
4299 static int read_connectivity(
void) {
4313 "',' or NL reqyured after !CONNECTIVITY");
4359 connectivity_type = type;
4371 static struct read_func_table {
4374 } read_func_table[] = {
4399 #define N_READ_FUNC (sizeof(read_func_table) / sizeof(read_func_table[0]))
4402 static ReadFunc get_read_func(
int token) {
4406 if (token == read_func_table[i].token) {
4407 return read_func_table[i].func;
4413 static int parse(
void) {
4423 func = get_read_func(token);
4434 if ((*func)())
return -1;
4445 if (filename ==
NULL) {
4448 "Not specified filename for HECMW-ENTIRE mesh input routine");
4458 strcpy(grid_filename, filename);
4461 if ((fp = fopen(filename,
"r")) ==
NULL) {
4480 strcpy(grid_filename,
"Unknown");
4493 if (local_mesh ==
NULL)
return NULL;
4496 strcpy(grid_filename,
"Unknown");
HECMW_Comm HECMW_comm_get_comm(void)
#define HECMW_MAX_NODE_MAX
#define HECMW_FILENAME_LEN
int HECMW_convert_connectivity(int from, int hecmw_etype, int *conn)
#define HECMW_CONNTYPE_ABAQUS
#define HECMW_CONNTYPE_NASTRAN
#define HECMW_CONNTYPE_HECMW
int HECMW_set_error(int errorno, const char *fmt,...)
int HECMW_get_max_node(int etype)
int HECMW_cylindrical_to_cartesian(const struct hecmw_coord *coord, struct hecmw_coord *result)
double HECMW_degree_to_radian(double deg)
char * HECMW_heclex_get_text(void)
int HECMW_heclex_next_token(void)
double HECMW_heclex_get_number(void)
int HECMW_heclex_switch_to_include(const char *filename)
int HECMW_heclex_unput_token(void)
int HECMW_heclex_get_lineno(void)
int HECMW_heclex_set_input(FILE *fp)
@ HECMW_HECLEX_K_SURF_SURF
@ HECMW_HECLEX_K_GENERATE
@ HECMW_HECLEX_H_EMBED_PAIR
@ HECMW_HECLEX_H_EQUATION
@ HECMW_HECLEX_K_COMPOSITE
@ HECMW_HECLEX_K_DEFINITION
@ HECMW_HECLEX_K_MATERIAL
@ HECMW_HECLEX_H_CONNECTIVITY
@ HECMW_HECLEX_K_ABSOLUTE
@ HECMW_HECLEX_K_RELATIVE
@ HECMW_HECLEX_H_MATERIAL
@ HECMW_HECLEX_K_NODE_SURF
@ HECMW_HECLEX_H_AMPLITUDE
@ HECMW_HECLEX_H_CONTACT_PAIR
@ HECMW_HECLEX_K_INTERFACE
@ HECMW_HECLEX_K_STEP_TIME
@ HECMW_HECLEX_K_NODE_ELEM
@ HECMW_HECLEX_K_TEMPERATURE
@ HECMW_HECLEX_K_TIMEVALUE
int HECMW_heclex_is_including(void)
int HECMW_read_entire_mesh(const char *filename)
struct hecmwST_local_mesh * HECMW_get_entire_mesh(const char *filename)
struct hecmw_io_mpc * HECMW_io_add_mpc(int neq, const struct hecmw_io_mpcitem *mpcitem, double cnst)
int HECMW_io_check_mpc_dof(int dof)
int HECMW_io_is_reserved_name(const char *name)
int HECMW_io_add_ngrp(const char *name, int nnode, int *node)
struct hecmw_io_section * HECMW_io_add_sect(struct hecmw_io_section *sect)
int HECMW_io_add_sgrp(const char *name, int n_item, int *elem, int *surf)
struct hecmw_io_amplitude * HECMW_io_add_amp(const char *name, int definition, int time, int value, double val, double t)
int HECMW_io_add_egrp(const char *name, int nelem, int *elem)
struct hecmw_io_initial * HECMW_io_add_initial(int type, int node, const char *ngrp, double val)
struct hecmw_io_contact * HECMW_io_add_contact(const char *name, int type, const char *slave_grp, const char *master_grp)
struct hecmw_io_material * HECMW_io_add_mat(const char *name, struct hecmw_io_material *mat)
struct hecmwST_local_mesh * HECMW_io_make_local_mesh(void)
void HECMW_io_set_zero(struct hecmw_io_zero *zero)
struct hecmw_io_element * HECMW_io_add_elem(int id, int type, int *node, int nmatitem, double *matitem)
int HECMW_io_pre_process(void)
void HECMW_io_set_system(struct hecmw_system_param *system)
struct hecmw_io_node * HECMW_io_add_node(int id, double x, double y, double z)
int HECMW_io_post_process(void)
struct hecmw_io_material * HECMW_io_get_mat(const char *name)
int HECMW_io_set_gridfile(char *gridfile)
int HECMW_io_finalize(void)
struct hecmw_system_param * HECMW_io_get_system(void)
void HECMW_io_set_header(struct hecmw_io_header *header)
#define HECMW_INITIAL_TYPE_TEMPERATURE
int HECMW_log(int loglv, const char *fmt,...)
#define HECMW_malloc(size)
#define HECMW_IO_HEC_E0002
#define HECMW_IO_HEC_E0600
#define HECMW_IO_HEC_E1106
#define HECMW_IO_HEC_E0601
#define HECMW_IO_HEC_E0604
#define HECMW_IO_HEC_E2000
#define HECMW_IO_HEC_E0900
#define HECMW_IO_HEC_E2101
#define HECMW_IO_HEC_E1500
#define HECMW_IO_HEC_E1104
#define HECMW_IO_HEC_E1100
#define HECMW_IO_HEC_E1700
#define HECMW_IO_HEC_E1800
#define HECMW_IO_HEC_E1709
#define HECMW_IO_HEC_E1105
#define HECMW_IO_HEC_E1001
#define HECMW_IO_HEC_E0701
#define HECMW_IO_HEC_E0702
#define HECMW_IO_HEC_E0001
#define HECMW_IO_HEC_E1103
#define HECMW_IO_HEC_E1710
#define HECMW_IO_HEC_E0098
#define HECMW_IO_HEC_E2100
#define HECMW_IO_HEC_E1702
#define HECMW_IO_HEC_E0703
#define HECMW_IO_HEC_E0003
#define HECMW_IO_HEC_E1708
#define HECMW_IO_HEC_E1704
#define HECMW_IO_HEC_E0606
#define HECMW_IO_HEC_E1900
#define HECMW_IO_HEC_E0800
#define HECMW_IO_HEC_E1706
#define HECMW_IO_HEC_E1502
#define HECMW_IO_HEC_E1707
#define HECMW_IO_HEC_E0099
#define HECMW_IO_HEC_E0100
#define HECMW_IO_HEC_E0602
#define HECMW_IO_HEC_E1000
#define HECMW_IO_HEC_E1703
#define HECMW_IO_HEC_E1002
#define HECMW_IO_HEC_E1107
#define HECMW_IO_HEC_E0502
#define HECMW_IO_HEC_E1102
#define HECMW_IO_HEC_E0501
#define HECMW_IO_HEC_E0901
#define HECMW_IO_HEC_E1801
#define HECMW_IO_HEC_E1501
#define HECMW_IO_HEC_E0500
#define HECMW_IO_HEC_E0200
#define HECMW_IO_HEC_E1101
#define HECMW_IO_HEC_E0700
#define HECMW_IO_HEC_E1503
#define HECMW_IO_HEC_E1600
#define HECMW_IO_HEC_E1601
#define HECMW_IO_HEC_E1705
#define HECMW_IO_HEC_E0503
#define HECMW_IO_HEC_E0603
#define HECMW_IO_HEC_E0101
#define HECMW_IO_HEC_E1701
char * HECMW_dirname(const char *path)
int HECMW_get_path_separator(void)
int HECMW_is_absolute_path(const char *path)
#define HECMW_AMP_TYPEDEF_TABULAR
#define HECMW_SECT_TYPE_SOLID
#define HECMW_SECT_OPT_PSTRAIN
#define HECMW_SECT_TYPE_SHELL
#define HECMW_SECT_TYPE_INTERFACE
#define HECMW_SECT_OPT_ASYMMETRY_RI
#define HECMW_CONTACT_TYPE_NODE_SURF
#define HECMW_SECT_OPT_PSTRESS
#define HECMW_CONTACT_TYPE_NODE_ELEM
#define HECMW_AMP_TYPEVAL_RELATIVE
#define HECMW_AMP_TYPEVAL_ABSOLUTE
#define HECMW_CONTACT_TYPE_SURF_SURF
#define HECMW_SECT_OPT_ASYMMETRY
#define HECMW_SECT_TYPE_BEAM
#define HECMW_AMP_TYPETIME_STEP
#define HECMW_SECT_OPT_PSTRAIN_RI
#define HECMW_SECT_OPT_PSTRESS_RI
int HECMW_system(struct hecmw_system_param *param, struct hecmw_coord *coord, struct hecmw_coord *result)
void HECMW_abort(HECMW_Comm comm)
char * HECMW_toupper(char *s)
void HECMW_print_msg(int loglv, int msgno, const char *fmt,...)
int HECMW_snprintf(char *str, size_t size, const char *format,...)
int HECMW_vsnprintf(char *str, size_t size, const char *format, va_list ap)
#define HECMW_assert(cond)
Separator_result * separator
struct hecmw_io_id * next
struct hecmw_io_material * next
struct hecmw_io_material::hecmw_io_matitem * item
char name[HECMW_NAME_LEN+1]
char egrp[HECMW_NAME_LEN+1]
union hecmw_io_section::hecmw_io_section_item sect
char material[HECMW_NAME_LEN+1]