62 VPRIVATE
int NOsh_parseREAD(
66 VPRIVATE
int NOsh_parsePRINT(
70 VPRIVATE
int NOsh_parseELEC(
75 VPRIVATE
int NOsh_parseAPOLAR(
80 VEXTERNC
int NOsh_parseFEM(
86 VEXTERNC
int NOsh_parseMG(
92 VEXTERNC
int NOsh_parseAPOL(
98 VPRIVATE
int NOsh_setupCalcMG(
103 VPRIVATE
int NOsh_setupCalcMGAUTO(
108 VPRIVATE
int NOsh_setupCalcMGMANUAL(
113 VPRIVATE
int NOsh_setupCalcMGPARA(
118 VPRIVATE
int NOsh_setupCalcFEM(
123 VPRIVATE
int NOsh_setupCalcFEMANUAL(
128 VPRIVATE
int NOsh_setupCalcAPOL(
133 #if !defined(VINLINE_NOSH) 136 VASSERT(thee != VNULL);
137 VASSERT(imol < thee->nmol);
141 VASSERT(thee != VNULL);
142 VASSERT(imol < thee->nmol);
146 VASSERT(thee != VNULL);
147 VASSERT(imol < thee->nmol);
151 VASSERT(thee != VNULL);
152 VASSERT(imol < thee->nmol);
156 VASSERT(thee != VNULL);
157 VASSERT(imol < thee->nmol);
161 VASSERT(thee != VNULL);
162 VASSERT(imol < thee->nmol);
166 VASSERT(thee != VNULL);
167 VASSERT(imol < thee->nmol);
171 VASSERT(thee != VNULL);
172 VASSERT(icalc < thee->ncalc);
173 return thee->
calc[icalc];
176 VASSERT(thee != VNULL);
177 VASSERT(i < thee->ndiel);
181 VASSERT(thee != VNULL);
182 VASSERT(i < thee->nkappa);
186 VASSERT(thee != VNULL);
187 VASSERT(i < thee->npot);
191 VASSERT(thee != VNULL);
192 VASSERT(i < thee->ncharge);
200 VASSERT(thee != VNULL);
201 VASSERT(iprint < thee->nprint);
206 VASSERT(thee != VNULL);
207 VASSERT(iprint < thee->nprint);
212 VASSERT(thee != VNULL);
213 VASSERT(icalc < thee->ncalc);
218 VASSERT(thee != VNULL);
219 VASSERT(icalc < thee->ncalc);
224 VASSERT(thee != VNULL);
225 VASSERT(ielec < thee->nelec + 1);
230 VASSERT(thee != VNULL);
231 VASSERT(iprint < thee->nprint);
232 VASSERT(iarg < thee->printnarg[iprint]);
233 return thee->
printop[iprint][iarg];
237 VASSERT(thee != VNULL);
238 VASSERT(iprint < thee->nprint);
239 VASSERT(iarg < thee->printnarg[iprint]);
247 thee = (
NOsh*)Vmem_malloc(VNULL, 1,
sizeof(
NOsh) );
248 VASSERT( thee != VNULL);
258 if (thee == VNULL)
return 0;
275 thee->
calc[i] = VNULL;
276 thee->
elec[i] = VNULL;
277 thee->
apol[i] = VNULL;
280 thee->
alist[i] = VNULL;
290 if ((*thee) != VNULL) {
292 Vmem_free(VNULL, 1,
sizeof(
NOsh), (
void **)thee);
332 Vnm_print(2,
"NOsh_calc_ctor: unknown calculation type (%d)!\n",
347 if (calc == VNULL)
return;
360 Vnm_print(2,
"NOsh_calc_ctor: unknown calculation type (%d)!\n",
366 Vmem_free(VNULL, 1,
sizeof(
NOsh_calc), (
void **)thee);
376 VASSERT(thee != VNULL);
377 VASSERT(source != VNULL);
379 if (source->
mgparm != VNULL)
400 sock = Vio_ctor(
"FILE",
"ASC", VNULL, filename,
"r");
414 char tok[VMAX_BUFSIZE];
417 Vnm_print(2,
"NOsh_parseInput: Got NULL thee!\n");
422 Vnm_print(2,
"NOsh_parseInput: Got pointer to NULL socket!\n");
423 Vnm_print(2,
"NOsh_parseInput: The specified input file was not found!\n");
428 Vnm_print(2,
"NOsh_parseInput: Already parsed an input file!\n");
432 if (Vio_accept(sock, 0) < 0) {
433 Vnm_print(2,
"NOsh_parseInput: Problem reading from socket!\n");
438 Vio_setWhiteChars(sock, MCwhiteChars);
439 Vio_setCommChars(sock, MCcommChars);
442 Vnm_print(0,
"NOsh_parseInput: Starting file parsing...\n");
443 while (Vio_scanf(sock,
"%s", tok) == 1) {
459 Vnm_print(0,
"NOsh: Parsing READ section\n");
460 if (!NOsh_parseREAD(thee, sock))
return 0;
461 Vnm_print(0,
"NOsh: Done parsing READ section \ 462 (nmol=%d, ndiel=%d, nkappa=%d, ncharge=%d, npot=%d)\n", thee->
nmol, thee->
ndiel,
465 Vnm_print(0,
"NOsh: Parsing PRINT section\n");
466 if (!NOsh_parsePRINT(thee, sock))
return 0;
467 Vnm_print(0,
"NOsh: Done parsing PRINT section\n");
469 Vnm_print(0,
"NOsh: Parsing ELEC section\n");
470 if (!NOsh_parseELEC(thee, sock))
return 0;
471 Vnm_print(0,
"NOsh: Done parsing ELEC section (nelec = %d)\n",
474 Vnm_print(0,
"NOsh: Parsing APOLAR section\n");
475 if (!NOsh_parseAPOLAR(thee, sock))
return 0;
476 Vnm_print(0,
"NOsh: Done parsing APOLAR section (nelec = %d)\n",
479 Vnm_print(0,
"NOsh: Done parsing file (got QUIT)\n");
482 Vnm_print(2,
"NOsh_parseInput: Ignoring undefined keyword %s!\n", tok);
491 VPRIVATE
int NOsh_parseREAD_MOL(
NOsh *thee, Vio *sock) {
493 char tok[VMAX_BUFSIZE], str[VMAX_BUFSIZE]=
"", strnew[VMAX_BUFSIZE]=
"";
496 VJMPERR1(Vio_scanf(sock,
"%s", tok) == 1);
499 VJMPERR1(Vio_scanf(sock,
"%s", tok) == 1);
502 while (tok[strlen(tok)-1] !=
'"') {
505 VJMPERR1(Vio_scanf(sock,
"%s", tok) == 1);
508 strncpy(strnew, str+1, strlen(str)-2);
511 Vnm_print(0,
"NOsh: Storing molecule %d path %s\n",
514 strncpy(thee->
molpath[thee->
nmol], tok, VMAX_ARGLEN);
518 VJMPERR1(Vio_scanf(sock,
"%s", tok) == 1);
521 while (tok[strlen(tok)-1] !=
'"') {
524 VJMPERR1(Vio_scanf(sock,
"%s", tok) == 1);
527 strncpy(strnew, str+1, strlen(str)-2);
530 Vnm_print(0,
"NOsh: Storing molecule %d path %s\n",
533 strncpy(thee->
molpath[thee->
nmol], tok, VMAX_ARGLEN);
537 VJMPERR1(Vio_scanf(sock,
"%s", tok) == 1);
540 while (tok[strlen(tok)-1] !=
'"') {
543 VJMPERR1(Vio_scanf(sock,
"%s", tok) == 1);
546 strncpy(strnew, str+1, strlen(str)-2);
549 Vnm_print(0,
"NOsh: Storing molecule %d path %s\n",
552 strncpy(thee->
molpath[thee->
nmol], tok, VMAX_ARGLEN);
555 Vnm_print(2,
"NOsh_parseREAD: Ignoring undefined mol format \ 563 Vnm_print(2,
"NOsh_parseREAD_MOL: Ran out of tokens while parsing READ section!\n");
568 VPRIVATE
int NOsh_parseREAD_PARM(
NOsh *thee, Vio *sock) {
570 char tok[VMAX_BUFSIZE], str[VMAX_BUFSIZE]=
"", strnew[VMAX_BUFSIZE]=
"";
573 VJMPERR1(Vio_scanf(sock,
"%s", tok) == 1);
576 VJMPERR1(Vio_scanf(sock,
"%s", tok) == 1);
579 while (tok[strlen(tok)-1] !=
'"') {
582 VJMPERR1(Vio_scanf(sock,
"%s", tok) == 1);
585 strncpy(strnew, str+1, strlen(str)-2);
589 Vnm_print(2,
"NOsh: Hey! You already specified a parameterfile (%s)!\n", thee->
parmpath);
590 Vnm_print(2,
"NOsh: I'm going to ignore this one (%s)!\n", tok);
594 strncpy(thee->
parmpath, tok, VMAX_ARGLEN);
598 VJMPERR1(Vio_scanf(sock,
"%s", tok) == 1);
601 while (tok[strlen(tok)-1] !=
'"') {
604 VJMPERR1(Vio_scanf(sock,
"%s", tok) == 1);
607 strncpy(strnew, str+1, strlen(str)-2);
611 Vnm_print(2,
"NOsh: Hey! You already specified a parameterfile (%s)!\n", thee->
parmpath);
612 Vnm_print(2,
"NOsh: I'm going to ignore this one (%s)!\n", tok);
616 strncpy(thee->
parmpath, tok, VMAX_ARGLEN);
620 Vnm_print(2,
"NOsh_parseREAD: Ignoring undefined parm format \ 627 Vnm_print(2,
"NOsh_parseREAD_PARM: Ran out of tokens while parsing READ section!\n");
632 VPRIVATE
int NOsh_parseREAD_DIEL(
NOsh *thee, Vio *sock) {
634 char tok[VMAX_BUFSIZE], str[VMAX_BUFSIZE]=
"", strnew[VMAX_BUFSIZE]=
"";
637 VJMPERR1(Vio_scanf(sock,
"%s", tok) == 1);
643 Vnm_print(2,
"NOsh_parseREAD: Ignoring undefined format \ 648 VJMPERR1(Vio_scanf(sock,
"%s", tok) == 1);
651 while (tok[strlen(tok)-1] !=
'"') {
654 VJMPERR1(Vio_scanf(sock,
"%s", tok) == 1);
657 strncpy(strnew, str+1, strlen(str)-2);
660 Vnm_print(0,
"NOsh: Storing x-shifted dielectric map %d path \ 661 %s\n", thee->
ndiel, tok);
663 VJMPERR1(Vio_scanf(sock,
"%s", tok) == 1);
664 Vnm_print(0,
"NOsh: Storing y-shifted dielectric map %d path \ 665 %s\n", thee->
ndiel, tok);
667 VJMPERR1(Vio_scanf(sock,
"%s", tok) == 1);
668 Vnm_print(0,
"NOsh: Storing z-shifted dielectric map %d path \ 669 %s\n", thee->
ndiel, tok);
677 Vnm_print(2,
"NOsh_parseREAD_DIEL: Ran out of tokens while parsing READ \ 683 VPRIVATE
int NOsh_parseREAD_KAPPA(
NOsh *thee, Vio *sock) {
685 char tok[VMAX_BUFSIZE], str[VMAX_BUFSIZE]=
"", strnew[VMAX_BUFSIZE]=
"";
688 VJMPERR1(Vio_scanf(sock,
"%s", tok) == 1);
694 Vnm_print(2,
"NOsh_parseREAD: Ignoring undefined format \ 699 VJMPERR1(Vio_scanf(sock,
"%s", tok) == 1);
702 while (tok[strlen(tok)-1] !=
'"') {
705 VJMPERR1(Vio_scanf(sock,
"%s", tok) == 1);
708 strncpy(strnew, str+1, strlen(str)-2);
711 Vnm_print(0,
"NOsh: Storing kappa map %d path %s\n",
720 Vnm_print(2,
"NOsh_parseREAD: Ran out of tokens while parsing READ \ 726 VPRIVATE
int NOsh_parseREAD_POTENTIAL(
NOsh *thee, Vio *sock) {
728 char tok[VMAX_BUFSIZE], str[VMAX_BUFSIZE]=
"", strnew[VMAX_BUFSIZE]=
"";
731 VJMPERR1(Vio_scanf(sock,
"%s", tok) == 1);
737 Vnm_print(2,
"NOsh_parseREAD: Ignoring undefined format \ 742 VJMPERR1(Vio_scanf(sock,
"%s", tok) == 1);
745 while (tok[strlen(tok)-1] !=
'"') {
748 VJMPERR1(Vio_scanf(sock,
"%s", tok) == 1);
751 strncpy(strnew, str+1, strlen(str)-2);
754 Vnm_print(0,
"NOsh: Storing potential map %d path %s\n",
757 strncpy(thee->
potpath[thee->
npot], tok, VMAX_ARGLEN);
763 Vnm_print(2,
"NOsh_parseREAD: Ran out of tokens while parsing READ \ 769 VPRIVATE
int NOsh_parseREAD_CHARGE(
NOsh *thee, Vio *sock) {
771 char tok[VMAX_BUFSIZE], str[VMAX_BUFSIZE]=
"", strnew[VMAX_BUFSIZE]=
"";
774 VJMPERR1(Vio_scanf(sock,
"%s", tok) == 1);
780 Vnm_print(2,
"NOsh_parseREAD: Ignoring undefined format \ 785 VJMPERR1(Vio_scanf(sock,
"%s", tok) == 1);
788 while (tok[strlen(tok)-1] !=
'"') {
791 VJMPERR1(Vio_scanf(sock,
"%s", tok) == 1);
794 strncpy(strnew, str+1, strlen(str)-2);
797 Vnm_print(0,
"NOsh: Storing charge map %d path %s\n",
806 Vnm_print(2,
"NOsh_parseREAD: Ran out of tokens while parsing READ \ 812 VPRIVATE
int NOsh_parseREAD_MESH(
NOsh *thee, Vio *sock) {
814 char tok[VMAX_BUFSIZE], str[VMAX_BUFSIZE]=
"", strnew[VMAX_BUFSIZE]=
"";
817 VJMPERR1(Vio_scanf(sock,
"%s", tok) == 1);
820 VJMPERR1(Vio_scanf(sock,
"%s", tok) == 1);
823 while (tok[strlen(tok)-1] !=
'"') {
826 VJMPERR1(Vio_scanf(sock,
"%s", tok) == 1);
829 strncpy(strnew, str+1, strlen(str)-2);
832 Vnm_print(0,
"NOsh: Storing mesh %d path %s\n",
838 Vnm_print(2,
"NOsh_parseREAD: Ignoring undefined mesh format \ 845 Vnm_print(2,
"NOsh_parseREAD: Ran out of tokens while parsing READ \ 852 VPRIVATE
int NOsh_parseREAD(
NOsh *thee, Vio *sock) {
854 char tok[VMAX_BUFSIZE];
857 Vnm_print(2,
"NOsh_parseREAD: Got NULL thee!\n");
862 Vnm_print(2,
"NOsh_parseREAD: Got pointer to NULL socket!\n");
867 Vnm_print(2,
"NOsh_parseREAD: Already parsed an input file!\n");
872 while (Vio_scanf(sock,
"%s", tok) == 1) {
874 Vnm_print(0,
"NOsh: Done parsing READ section\n");
877 NOsh_parseREAD_MOL(thee, sock);
879 NOsh_parseREAD_PARM(thee,sock);
881 NOsh_parseREAD_DIEL(thee,sock);
883 NOsh_parseREAD_KAPPA(thee,sock);
885 NOsh_parseREAD_POTENTIAL(thee,sock);
887 NOsh_parseREAD_CHARGE(thee,sock);
889 NOsh_parseREAD_MESH(thee,sock);
891 Vnm_print(2,
"NOsh_parseREAD: Ignoring undefined keyword %s!\n",
897 Vnm_print(2,
"NOsh_parseREAD: Ran out of tokens while parsing READ \ 903 VPRIVATE
int NOsh_parsePRINT(
NOsh *thee, Vio *sock) {
905 char tok[VMAX_BUFSIZE];
906 char name[VMAX_BUFSIZE];
907 int ti, idx, expect, ielec, iapol;
910 Vnm_print(2,
"NOsh_parsePRINT: Got NULL thee!\n");
915 Vnm_print(2,
"NOsh_parsePRINT: Got pointer to NULL socket!\n");
920 Vnm_print(2,
"NOsh_parsePRINT: Already parsed an input file!\n");
926 Vnm_print(2,
"NOsh_parsePRINT: Exceeded max number (%d) of PRINT \ 934 VJMPERR1(Vio_scanf(sock,
"%s", tok) == 1);
954 Vnm_print(2,
"NOsh_parsePRINT: Undefined keyword %s while parsing \ 955 PRINT section!\n", tok);
962 while (Vio_scanf(sock,
"%s", tok) == 1) {
969 Vnm_print(0,
"NOsh: Done parsing PRINT section\n");
972 Vnm_print(2,
"NOsh_parsePRINT: Got premature END to PRINT!\n");
978 if ((sscanf(tok,
"%d", &ti) == 1) &&
984 Vnm_print(2,
"NOsh_parsePRINT: Syntax error in PRINT \ 985 section while reading %s!\n", tok);
995 Vnm_print(2,
"NOsh_parsePRINT: Exceeded max number \ 996 (%d) of arguments for PRINT section!\n",
1001 Vnm_print(2,
"NOsh_parsePRINT: Syntax error in PRINT \ 1002 section while reading %s!\n", tok);
1012 Vnm_print(2,
"NOsh_parseREAD: Exceeded max number \ 1013 (%d) of arguments for PRINT section!\n",
1018 Vnm_print(2,
"NOsh_parsePRINT: Syntax error in PRINT \ 1019 section while reading %s!\n", tok);
1023 }
else if (sscanf(tok,
"%s", name) == 1) {
1025 for (ielec=0; ielec<thee->
nelec; ielec++) {
1032 for (iapol=0; iapol<thee->
napol; iapol++) {
1040 Vnm_print(2,
"No ELEC or APOL statement has been named %s!\n",
1045 Vnm_print(2,
"NOsh_parsePRINT: Syntax error in PRINT \ 1046 section while reading %s!\n", tok);
1051 Vnm_print(2,
"NOsh_parsePRINT: Undefined keyword %s while \ 1052 parsing PRINT section!\n", tok);
1063 Vnm_print(2,
"NOsh_parsePRINT: Ran out of tokens while parsing PRINT \ 1069 VPRIVATE
int NOsh_parseELEC(
NOsh *thee, Vio *sock) {
1073 char tok[VMAX_BUFSIZE];
1075 if (thee == VNULL) {
1076 Vnm_print(2,
"NOsh_parseELEC: Got NULL thee!\n");
1080 if (sock == VNULL) {
1081 Vnm_print(2,
"NOsh_parseELEC: Got pointer to NULL socket!\n");
1086 Vnm_print(2,
"NOsh_parseELEC: Already parsed an input file!\n");
1093 Vnm_print(2,
"NOsh: Too many electrostatics calculations in this \ 1095 Vnm_print(2,
"NOsh: Current max is %d; ignoring this calculation\n",
1101 if (Vio_scanf(sock,
"%s", tok) == 1) {
1103 Vio_scanf(sock,
"%s", tok);
1105 if (Vio_scanf(sock,
"%s", tok) != 1) {
1106 Vnm_print(2,
"NOsh_parseELEC: Ran out of tokens while reading \ 1116 return NOsh_parseMG(thee, sock, calc);
1122 return NOsh_parseMG(thee, sock, calc);
1128 return NOsh_parseMG(thee, sock, calc);
1134 return NOsh_parseMG(thee, sock, calc);
1140 return NOsh_parseFEM(thee, sock, calc);
1142 Vnm_print(2,
"NOsh_parseELEC: The method (\"mg\" or \"fem\") or \ 1143 \"name\" must be the first keyword in the ELEC section\n");
1148 Vnm_print(2,
"NOsh_parseELEC: Ran out of tokens while reading ELEC section!\n");
1153 VPRIVATE
int NOsh_parseAPOLAR(
NOsh *thee, Vio *sock) {
1157 char tok[VMAX_BUFSIZE];
1159 if (thee == VNULL) {
1160 Vnm_print(2,
"NOsh_parseAPOLAR: Got NULL thee!\n");
1164 if (sock == VNULL) {
1165 Vnm_print(2,
"NOsh_parseAPOLAR: Got pointer to NULL socket!\n");
1170 Vnm_print(2,
"NOsh_parseAPOLAR: Already parsed an input file!\n");
1177 Vnm_print(2,
"NOsh: Too many non-polar calculations in this \ 1179 Vnm_print(2,
"NOsh: Current max is %d; ignoring this calculation\n",
1185 if (Vio_scanf(sock,
"%s", tok) == 1) {
1187 Vio_scanf(sock,
"%s", tok);
1194 return NOsh_parseAPOL(thee, sock, calc);
1196 if (Vio_scanf(sock,
"%s", tok) != 1) {
1197 Vnm_print(2,
"NOsh_parseAPOLAR: Ran out of tokens while reading \ 1198 APOLAR section!\n");
1217 VASSERT(thee != VNULL);
1218 for (imol=0; imol<thee->
nmol; imol++) {
1219 thee->
alist[imol] = alist[imol];
1223 for (ielec=0; ielec<(thee->
nelec); ielec++) {
1225 elec = thee->
elec[ielec];
1230 Vnm_print(2,
"NOsh_setupElecCalc: Calculation of forces disabled because surface \ 1240 VASSERT(mgparm != VNULL);
1242 VASSERT(mgparm->
centmol >= 0);
1245 VASSERT(mymol != VNULL);
1246 for (i=0; i<3; i++) {
1254 VASSERT(mymol != VNULL);
1255 for (i=0; i<3; i++) {
1263 VASSERT(mymol != VNULL);
1264 for (i=0; i<3; i++) {
1268 NOsh_setupCalcMG(thee, elec);
1271 NOsh_setupCalcFEM(thee, elec);
1274 Vnm_print(2,
"NOsh_setupCalc: Invalid calculation type (%d)!\n",
1283 Vnm_print(0,
"NOsh_setupCalc: Mapping ELEC statement %d (%d) to \ 1284 calculation %d (%d)\n", ielec, ielec+1, thee->
elec2calc[ielec],
1299 VASSERT(thee != VNULL);
1300 for (imol=0; imol<thee->
nmol; imol++) {
1301 thee->
alist[imol] = alist[imol];
1304 for (iapol=0; iapol<(thee->
napol); iapol++) {
1306 calc = thee->
apol[iapol];
1311 NOsh_setupCalcAPOL(thee, calc);
1315 Vnm_print(2,
"NOsh_setupCalc: Invalid calculation type (%d)!\n", calc->
calctype);
1322 Vnm_print(0,
"NOsh_setupCalc: Mapping APOL statement %d (%d) to calculation %d (%d)\n", iapol, iapol+1, thee->
apol2calc[iapol], thee->
apol2calc[iapol]+1);
1332 VPUBLIC
int NOsh_parseMG(
1338 char tok[VMAX_BUFSIZE];
1344 if (thee == VNULL) {
1345 Vnm_print(2,
"NOsh: Got NULL thee!\n");
1348 if (sock == VNULL) {
1349 Vnm_print(2,
"NOsh: Got pointer to NULL socket!\n");
1352 if (elec == VNULL) {
1353 Vnm_print(2,
"NOsh: Got pointer to NULL elec object!\n");
1357 if (mgparm == VNULL) {
1358 Vnm_print(2,
"NOsh: Got pointer to NULL mgparm object!\n");
1362 if (pbeparm == VNULL) {
1363 Vnm_print(2,
"NOsh: Got pointer to NULL pbeparm object!\n");
1367 Vnm_print(0,
"NOsh_parseMG: Parsing parameters for MG calculation\n");
1380 while (Vio_scanf(sock,
"%s", tok) == 1) {
1382 Vnm_print(0,
"NOsh_parseMG: Parsing %s...\n", tok);
1395 Vnm_print(0,
"NOsh_parseMG: parsePBE error!\n");
1397 }
else if (rc == 0) {
1401 Vnm_print(0,
"NOsh_parseMG: parseMG error!\n");
1403 }
else if (rc == 0) {
1405 Vnm_print(2,
"NOsh: Unrecognized keyword: %s\n", tok);
1413 if (rc == -1)
return 0;
1414 if (rc == 0)
return 0;
1418 Vnm_print(2,
"NOsh: MG parameters not set correctly!\n");
1425 VPRIVATE
int NOsh_setupCalcMG(
1432 VASSERT(thee != VNULL);
1433 VASSERT(calc != VNULL);
1435 VASSERT(mgparm != VNULL);
1440 switch (mgparm->
type) {
1442 return NOsh_setupCalcMGMANUAL(thee, calc);
1444 return NOsh_setupCalcMGMANUAL(thee, calc);
1446 return NOsh_setupCalcMGAUTO(thee, calc);
1448 return NOsh_setupCalcMGPARA(thee, calc);
1450 Vnm_print(2,
"NOsh_setupCalcMG: undefined MG calculation type (%d)!\n",
1459 VPRIVATE
int NOsh_setupCalcFEM(
1464 VASSERT(thee != VNULL);
1465 VASSERT(calc != VNULL);
1466 VASSERT(calc->
femparm != VNULL);
1472 return NOsh_setupCalcFEMANUAL(thee, calc);
1474 Vnm_print(2,
"NOsh_parseFEM: unknown calculation type (%d)!\n",
1484 VPRIVATE
int NOsh_setupCalcMGMANUAL(
1493 if (thee == VNULL) {
1494 Vnm_print(2,
"NOsh_setupCalcMGMANUAL: Got NULL thee!\n");
1497 if (elec == VNULL) {
1498 Vnm_print(2,
"NOsh_setupCalcMGMANUAL: Got NULL calc!\n");
1502 if (mgparm == VNULL) {
1503 Vnm_print(2,
"NOsh_setupCalcMGMANUAL: Got NULL mgparm -- was this calculation \ 1508 if (pbeparm == VNULL) {
1509 Vnm_print(2,
"NOsh_setupCalcMGMANUAL: Got NULL pbeparm -- was this calculation \ 1517 mgparm->
grid[0] = mgparm->
glen[0]/((double)(mgparm->
dime[0]-1));
1518 mgparm->
grid[1] = mgparm->
glen[1]/((double)(mgparm->
dime[1]-1));
1519 mgparm->
grid[2] = mgparm->
glen[2]/((double)(mgparm->
dime[2]-1));
1523 mgparm->
glen[0] = mgparm->
grid[0]*((double)(mgparm->
dime[0]-1));
1524 mgparm->
glen[1] = mgparm->
grid[1]*((double)(mgparm->
dime[1]-1));
1525 mgparm->
glen[2] = mgparm->
grid[2]*((double)(mgparm->
dime[2]-1));
1532 Vnm_print(2,
"NOsh: Too many calculations in this run!\n");
1533 Vnm_print(2,
"NOsh: Current max is %d; ignoring this calculation\n",
1552 VPUBLIC
int NOsh_setupCalcMGAUTO(
1559 double fgrid[3], cgrid[3];
1560 double d[3], minf[3], maxf[3], minc[3], maxc[3];
1561 double redfrac, redrat[3], td;
1562 int ifocus, nfocus, tnfocus[3];
1574 if (thee == VNULL) {
1575 Vnm_print(2,
"NOsh_setupCalcMGAUTO: Got NULL thee!\n");
1578 if (elec == VNULL) {
1579 Vnm_print(2,
"NOsh_setupCalcMGAUTO: Got NULL elec!\n");
1582 if (elec->
mgparm == VNULL) {
1583 Vnm_print(2,
"NOsh_setupCalcMGAUTO: Got NULL mgparm!\n");
1587 Vnm_print(2,
"NOsh_setupCalcMGAUTO: Got NULL pbeparm!\n");
1591 Vnm_print(0,
"NOsh_setupCalcMGAUTO(%s, %d): coarse grid center = %g %g %g\n",
1596 Vnm_print(0,
"NOsh_setupCalcMGAUTO(%s, %d): fine grid center = %g %g %g\n",
1603 for (j=0; j<3; j++) {
1608 Vnm_print(0,
"NOsh_setupCalcMGAUTO (%s, %d): Coarse grid spacing = %g, %g, %g\n",
1609 __FILE__, __LINE__, cgrid[0], cgrid[1], cgrid[2]);
1610 Vnm_print(0,
"NOsh_setupCalcMGAUTO (%s, %d): Fine grid spacing = %g, %g, %g\n",
1611 __FILE__, __LINE__, fgrid[0], fgrid[1], fgrid[2]);
1612 Vnm_print(0,
"NOsh_setupCalcMGAUTO (%s, %d): Displacement between fine and \ 1613 coarse grids = %g, %g, %g\n", __FILE__, __LINE__, d[0], d[1], d[2]);
1617 for (j=0; j<3; j++) {
1618 if (fgrid[j]/cgrid[j] <
VREDFRAC) {
1619 redfrac = fgrid[j]/cgrid[j];
1621 tnfocus[j] = (int)ceil(td) + 1;
1622 }
else tnfocus[j] = 2;
1624 nfocus = VMAX2(VMAX2(tnfocus[0], tnfocus[1]), tnfocus[2]);
1628 for (j=0; j<3; j++) {
1629 redrat[j] = VPOW((fgrid[j]/cgrid[j]), 1.0/((
double)nfocus-1.0));
1631 Vnm_print(0,
"NOsh: %d levels of focusing with %g, %g, %g reductions\n",
1632 nfocus, redrat[0], redrat[1], redrat[2]);
1637 Vnm_print(2,
"NOsh: Require more calculations than max (%d)!\n",
1642 for (ifocus=0; ifocus<nfocus; ifocus++) {
1645 icalc = thee->
ncalc;
1650 calcf = thee->
calc[icalc];
1653 calcc = thee->
calc[icalc-1];
1663 for (j=0; j<3; j++) {
1668 for (j=0; j<3; j++) {
1680 for (j=0; j<3; j++) {
1683 }
else if (ifocus == (nfocus-1)) {
1686 for (j=0; j<3; j++) {
1695 for (j=0; j<3; j++) {
1706 Vnm_print(0,
"NOsh_setupCalcMGAUTO (%s, %d): starting mesh \ 1707 repositioning.\n", __FILE__, __LINE__);
1708 Vnm_print(0,
"NOsh_setupCalcMGAUTO (%s, %d): coarse mesh center = \ 1709 %g %g %g\n", __FILE__, __LINE__,
1713 Vnm_print(0,
"NOsh_setupCalcMGAUTO (%s, %d): coarse mesh upper corner = \ 1714 %g %g %g\n", __FILE__, __LINE__,
1718 Vnm_print(0,
"NOsh_setupCalcMGAUTO (%s, %d): coarse mesh lower corner = \ 1719 %g %g %g\n", __FILE__, __LINE__,
1723 Vnm_print(0,
"NOsh_setupCalcMGAUTO (%s, %d): initial fine mesh upper corner = \ 1724 %g %g %g\n", __FILE__, __LINE__,
1728 Vnm_print(0,
"NOsh_setupCalcMGAUTO (%s, %d): initial fine mesh lower corner = \ 1729 %g %g %g\n", __FILE__, __LINE__,
1733 for (j=0; j<3; j++) {
1740 d[j] = minc[j] - minf[j];
1741 if (d[j] >= VSMALL) {
1742 if (ifocus == (nfocus-1)) {
1743 Vnm_print(2,
"NOsh_setupCalcMGAUTO: Error! Finest \ 1744 mesh has fallen off the coarser meshes!\n");
1745 Vnm_print(2,
"NOsh_setupCalcMGAUTO: difference in min %d-\ 1746 direction = %g\n", j, d[j]);
1747 Vnm_print(2,
"NOsh_setupCalcMGAUTO: min fine = %g %g %g\n",
1748 minf[0], minf[1], minf[2]);
1749 Vnm_print(2,
"NOsh_setupCalcMGAUTO: min coarse = %g %g %g\n",
1750 minc[0], minc[1], minc[2]);
1753 Vnm_print(0,
"NOsh_setupCalcMGAUTO (%s, %d): ifocus = %d, \ 1754 fixing mesh min violation (%g in %d-direction).\n", __FILE__, __LINE__, ifocus,
1765 d[j] = maxf[j] - maxc[j];
1766 if (d[j] >= VSMALL) {
1767 if (ifocus == (nfocus-1)) {
1768 Vnm_print(2,
"NOsh_setupCalcMGAUTO: Error! Finest \ 1769 mesh has fallen off the coarser meshes!\n");
1770 Vnm_print(2,
"NOsh_setupCalcMGAUTO: difference in %d-\ 1771 direction = %g\n", j, d[j]);
1777 Vnm_print(2,
"NOsh_setupCalcMGAUTO: Error! Both \ 1778 ends of the finer mesh do not fit in the bigger mesh!\n");
1781 Vnm_print(0,
"NOsh_setupCalcMGAUTO(%s, %d): ifocus = %d, \ 1782 fixing mesh max violation (%g in %d-direction).\n", __FILE__, __LINE__, ifocus,
1789 Vnm_print(0,
"NOsh_setupCalcMGAUTO (%s, %d): final fine mesh upper corner = \ 1790 %g %g %g\n", __FILE__, __LINE__,
1794 Vnm_print(0,
"NOsh_setupCalcMGAUTO (%s, %d): final fine mesh lower corner = \ 1795 %g %g %g\n", __FILE__, __LINE__,
1810 Vnm_print(0,
"NOsh_setupMGAUTO: Resetting boundary flags\n");
1812 for (j=0; j<3; j++) {
1827 VPUBLIC
int NOsh_setupCalcMGPARA(
1837 double hx, hy, hzed;
1838 double xofrac, yofrac, zofrac;
1839 int rank, size, npx, npy, npz, nproc, ip, jp, kp;
1840 int xeffGlob, yeffGlob, zeffGlob, xDisj, yDisj, zDisj;
1841 int xigminDisj, xigmaxDisj, yigminDisj, yigmaxDisj, zigminDisj, zigmaxDisj;
1842 int xigminOlap, xigmaxOlap, yigminOlap, yigmaxOlap, zigminOlap, zigmaxOlap;
1843 int xOlapReg, yOlapReg, zOlapReg;
1844 double xlenDisj, ylenDisj, zlenDisj;
1845 double xcentDisj, ycentDisj, zcentDisj;
1846 double xcentOlap, ycentOlap, zcentOlap;
1847 double xlenOlap, ylenOlap, zlenOlap;
1848 double xminOlap, xmaxOlap, yminOlap, ymaxOlap, zminOlap, zmaxOlap;
1849 double xminDisj, xmaxDisj, yminDisj, ymaxDisj, zminDisj, zmaxDisj;
1850 double xcent, ycent, zcent;
1853 VASSERT(thee != VNULL);
1854 VASSERT(elec != VNULL);
1856 VASSERT(mgparm != VNULL);
1859 ofrac = mgparm->
ofrac;
1860 npx = mgparm->
pdime[0];
1861 npy = mgparm->
pdime[1];
1862 npz = mgparm->
pdime[2];
1863 nproc = npx*npy*npz;
1871 Vnm_tprint(2,
"NOsh_setupCalcMGPARA: Oops! You're trying to perform \ 1872 an 'mg-para' (parallel) calculation\n");
1873 Vnm_tprint(2,
"NOsh_setupCalcMGPARA: with a version of APBS that wasn't \ 1874 compiled with MPI!\n");
1875 Vnm_tprint(2,
"NOsh_setupCalcMGPARA: Perhaps you meant to use the \ 1877 Vnm_tprint(2,
"NOsh_setupCalcMGPARA: Bailing out!\n");
1885 Vnm_print(0,
"NOsh_setupCalcMGPARA: Hello from processor %d of %d\n", rank,
1890 if (rank > (nproc-1)) {
1891 Vnm_print(2,
"NOsh_setupMGPARA: There are more processors available than\ 1892 the %d you requested.\n", nproc);
1893 Vnm_print(2,
"NOsh_setupMGPARA: Eliminating processor %d\n", rank);
1901 Vnm_print(2,
"NOsh_setupMGPARA: There are too few processors (%d) to \ 1902 satisfy requirements (%d)\n", size, nproc);
1906 Vnm_print(0,
"NOsh_setupMGPARA: Hello (again) from processor %d of %d\n",
1911 rank = mgparm->
async;
1918 if (rank > (nproc-1)) {
1919 Vnm_print(2,
"NOsh_setupMGPARA: The processor id you requested (%d) \ 1920 is not within the range of processors available (0-%d)\n", rank, (nproc-1));
1926 kp = (int)floor(rank/(npx*npy));
1927 jp = (int)floor((rank-kp*npx*npy)/npx);
1928 ip = rank - kp*npx*npy - jp*npx;
1929 Vnm_print(0,
"NOsh_setupMGPARA: Hello world from PE (%d, %d, %d)\n",
1933 if (npx == 1) xofrac = 0.0;
1934 else xofrac =
ofrac;
1935 if (npy == 1) yofrac = 0.0;
1936 else yofrac =
ofrac;
1937 if (npz == 1) zofrac = 0.0;
1938 else zofrac =
ofrac;
1941 xDisj = (int)
VFLOOR(mgparm->
dime[0]/(1 + 2*xofrac) + 0.5);
1942 xeffGlob = npx*xDisj;
1943 hx = mgparm->
fglen[0]/(double)(xeffGlob-1);
1944 yDisj = (int)
VFLOOR(mgparm->
dime[1]/(1 + 2*yofrac) + 0.5);
1945 yeffGlob = npy*yDisj;
1946 hy = mgparm->
fglen[1]/(double)(yeffGlob-1);
1947 zDisj = (int)
VFLOOR(mgparm->
dime[2]/(1 + 2*zofrac) + 0.5);
1948 zeffGlob = npz*zDisj;
1949 hzed = mgparm->
fglen[2]/(double)(zeffGlob-1);
1950 Vnm_print(0,
"NOsh_setupMGPARA: Global Grid size = (%d, %d, %d)\n",
1951 xeffGlob, yeffGlob, zeffGlob);
1952 Vnm_print(0,
"NOsh_setupMGPARA: Global Grid Spacing = (%.3f, %.3f, %.3f)\n",
1954 Vnm_print(0,
"NOsh_setupMGPARA: Processor Grid Size = (%d, %d, %d)\n",
1955 xDisj, yDisj, zDisj);
1958 xigminDisj = ip*xDisj;
1959 xigmaxDisj = xigminDisj + xDisj - 1;
1960 yigminDisj = jp*yDisj;
1961 yigmaxDisj = yigminDisj + yDisj - 1;
1962 zigminDisj = kp*zDisj;
1963 zigmaxDisj = zigminDisj + zDisj - 1;
1964 Vnm_print(0,
"NOsh_setupMGPARA: Min Grid Points for this proc. (%d, %d, %d)\n",
1965 xigminDisj, yigminDisj, zigminDisj);
1966 Vnm_print(0,
"NOsh_setupMGPARA: Max Grid Points for this proc. (%d, %d, %d)\n",
1967 xigmaxDisj, yigmaxDisj, zigmaxDisj);
1971 xminDisj = VMAX2(hx*(xigminDisj-0.5), 0.0);
1972 xmaxDisj = VMIN2(hx*(xigmaxDisj+0.5), mgparm->
fglen[0]);
1973 xlenDisj = xmaxDisj - xminDisj;
1974 yminDisj = VMAX2(hy*(yigminDisj-0.5), 0.0);
1975 ymaxDisj = VMIN2(hy*(yigmaxDisj+0.5), mgparm->
fglen[1]);
1976 ylenDisj = ymaxDisj - yminDisj;
1977 zminDisj = VMAX2(hzed*(zigminDisj-0.5), 0.0);
1978 zmaxDisj = VMIN2(hzed*(zigmaxDisj+0.5), mgparm->
fglen[2]);
1979 zlenDisj = zmaxDisj - zminDisj;
1981 xcent = 0.5*mgparm->
fglen[0];
1982 ycent = 0.5*mgparm->
fglen[1];
1983 zcent = 0.5*mgparm->
fglen[2];
1985 xcentDisj = xminDisj + 0.5*xlenDisj - xcent;
1986 ycentDisj = yminDisj + 0.5*ylenDisj - ycent;
1987 zcentDisj = zminDisj + 0.5*zlenDisj - zcent;
1988 if (VABS(xcentDisj) < VSMALL) xcentDisj = 0.0;
1989 if (VABS(ycentDisj) < VSMALL) ycentDisj = 0.0;
1990 if (VABS(zcentDisj) < VSMALL) zcentDisj = 0.0;
1992 Vnm_print(0,
"NOsh_setupMGPARA: Disj part length = (%g, %g, %g)\n",
1993 xlenDisj, ylenDisj, zlenDisj);
1994 Vnm_print(0,
"NOsh_setupMGPARA: Disj part center displacement = (%g, %g, %g)\n",
1995 xcentDisj, ycentDisj, zcentDisj);
2001 if (npx != 1) xOlapReg = (int)
VFLOOR(xofrac*mgparm->
fglen[0]/npx/hx + 0.5) + 1;
2002 if (npy != 1) yOlapReg = (int)
VFLOOR(yofrac*mgparm->
fglen[1]/npy/hy + 0.5) + 1;
2003 if (npz != 1) zOlapReg = (int)
VFLOOR(zofrac*mgparm->
fglen[2]/npz/hzed + 0.5) + 1;
2005 Vnm_print(0,
"NOsh_setupMGPARA: No. of Grid Points in Overlap (%d, %d, %d)\n",
2006 xOlapReg, yOlapReg, zOlapReg);
2008 if (ip == 0) xigminOlap = 0;
2009 else if (ip == (npx - 1)) xigminOlap = xeffGlob - mgparm->
dime[0];
2010 else xigminOlap = xigminDisj - xOlapReg;
2011 xigmaxOlap = xigminOlap + mgparm->
dime[0] - 1;
2013 if (jp == 0) yigminOlap = 0;
2014 else if (jp == (npy - 1)) yigminOlap = yeffGlob - mgparm->
dime[1];
2015 else yigminOlap = yigminDisj - yOlapReg;
2016 yigmaxOlap = yigminOlap + mgparm->
dime[1] - 1;
2018 if (kp == 0) zigminOlap = 0;
2019 else if (kp == (npz - 1)) zigminOlap = zeffGlob - mgparm->
dime[2];
2020 else zigminOlap = zigminDisj - zOlapReg;
2021 zigmaxOlap = zigminOlap + mgparm->
dime[2] - 1;
2023 Vnm_print(0,
"NOsh_setupMGPARA: Min Grid Points with Overlap (%d, %d, %d)\n",
2024 xigminOlap, yigminOlap, zigminOlap);
2025 Vnm_print(0,
"NOsh_setupMGPARA: Max Grid Points with Overlap (%d, %d, %d)\n",
2026 xigmaxOlap, yigmaxOlap, zigmaxOlap);
2028 xminOlap = hx * xigminOlap;
2029 xmaxOlap = hx * xigmaxOlap;
2030 yminOlap = hy * yigminOlap;
2031 ymaxOlap = hy * yigmaxOlap;
2032 zminOlap = hzed * zigminOlap;
2033 zmaxOlap = hzed * zigmaxOlap;
2035 xlenOlap = xmaxOlap - xminOlap;
2036 ylenOlap = ymaxOlap - yminOlap;
2037 zlenOlap = zmaxOlap - zminOlap;
2039 xcentOlap = (xminOlap + 0.5*xlenOlap) - xcent;
2040 ycentOlap = (yminOlap + 0.5*ylenOlap) - ycent;
2041 zcentOlap = (zminOlap + 0.5*zlenOlap) - zcent;
2042 if (VABS(xcentOlap) < VSMALL) xcentOlap = 0.0;
2043 if (VABS(ycentOlap) < VSMALL) ycentOlap = 0.0;
2044 if (VABS(zcentOlap) < VSMALL) zcentOlap = 0.0;
2046 Vnm_print(0,
"NOsh_setupMGPARA: Olap part length = (%g, %g, %g)\n",
2047 xlenOlap, ylenOlap, zlenOlap);
2048 Vnm_print(0,
"NOsh_setupMGPARA: Olap part center displacement = (%g, %g, %g)\n",
2049 xcentOlap, ycentOlap, zcentOlap);
2069 Vnm_print(0,
"NOsh_setupMGPARA: partDisjOwnSide[LEFT] = %d\n",
2071 Vnm_print(0,
"NOsh_setupMGPARA: partDisjOwnSide[RIGHT] = %d\n",
2073 Vnm_print(0,
"NOsh_setupMGPARA: partDisjOwnSide[FRONT] = %d\n",
2075 Vnm_print(0,
"NOsh_setupMGPARA: partDisjOwnSide[BACK] = %d\n",
2077 Vnm_print(0,
"NOsh_setupMGPARA: partDisjOwnSide[UP] = %d\n",
2079 Vnm_print(0,
"NOsh_setupMGPARA: partDisjOwnSide[DOWN] = %d\n",
2083 mgparm->
fglen[0] = xlenOlap;
2084 mgparm->
fglen[1] = ylenOlap;
2085 mgparm->
fglen[2] = zlenOlap;
2092 mgparm->
fcenter[0] += xcentOlap;
2093 mgparm->
fcenter[1] += ycentOlap;
2094 mgparm->
fcenter[2] += zcentOlap;
2096 Vnm_print(0,
"NOsh_setupCalcMGPARA (%s, %d): Set up *relative* partition \ 2097 centers...\n", __FILE__, __LINE__);
2098 Vnm_print(0,
"NOsh_setupCalcMGPARA (%s, %d): Absolute centers will be set \ 2099 in NOsh_setupMGAUTO\n", __FILE__, __LINE__);
2100 Vnm_print(0,
"NOsh_setupCalcMGPARA (%s, %d): partDisjCenter = %g %g %g\n",
2105 Vnm_print(0,
"NOsh_setupCalcMGPARA (%s, %d): ccenter = %g %g %g\n",
2110 Vnm_print(0,
"NOsh_setupCalcMGPARA (%s, %d): fcenter = %g %g %g\n",
2118 return NOsh_setupCalcMGAUTO(thee, elec);
2122 VPUBLIC
int NOsh_parseFEM(
2128 char tok[VMAX_BUFSIZE];
2135 if (thee == VNULL) {
2136 Vnm_print(2,
"NOsh_parseFEM: Got NULL thee!\n");
2139 if (sock == VNULL) {
2140 Vnm_print(2,
"NOsh_parseFEM: Got pointer to NULL socket!\n");
2143 if (elec == VNULL) {
2144 Vnm_print(2,
"NOsh_parseFEM: Got pointer to NULL elec object!\n");
2148 if (feparm == VNULL) {
2149 Vnm_print(2,
"NOsh_parseFEM: Got pointer to NULL feparm object!\n");
2153 if (feparm == VNULL) {
2154 Vnm_print(2,
"NOsh_parseFEM: Got pointer to NULL pbeparm object!\n");
2158 Vnm_print(0,
"NOsh_parseFEM: Parsing parameters for FEM calculation\n");
2162 while (Vio_scanf(sock,
"%s", tok) == 1) {
2164 Vnm_print(0,
"NOsh_parseFEM: Parsing %s...\n", tok);
2177 Vnm_print(0,
"NOsh_parseFEM: parsePBE error!\n");
2179 }
else if (rc == 0) {
2183 Vnm_print(0,
"NOsh_parseFEM: parseMG error!\n");
2185 }
else if (vrc == VRC_WARNING) {
2187 Vnm_print(2,
"NOsh: Unrecognized keyword: %s\n", tok);
2195 if (rc == -1)
return 0;
2196 if (rc == 0)
return 0;
2200 Vnm_print(2,
"NOsh: FEM parameters not set correctly!\n");
2208 VPRIVATE
int NOsh_setupCalcFEMANUAL(
2217 VASSERT(thee != VNULL);
2218 VASSERT(elec != VNULL);
2220 VASSERT(feparm != VNULL);
2229 Vnm_print(2,
"NOsh: Too many calculations in this run!\n");
2230 Vnm_print(2,
"NOsh: Current max is %d; ignoring this calculation\n",
2245 VPUBLIC
int NOsh_parseAPOL(
2251 char tok[VMAX_BUFSIZE];
2256 if (thee == VNULL) {
2257 Vnm_print(2,
"NOsh_parseAPOL: Got NULL thee!\n");
2260 if (sock == VNULL) {
2261 Vnm_print(2,
"NOsh_parseAPOL: Got pointer to NULL socket!\n");
2264 if (elec == VNULL) {
2265 Vnm_print(2,
"NOsh_parseAPOL: Got pointer to NULL elec object!\n");
2269 if (apolparm == VNULL) {
2270 Vnm_print(2,
"NOsh_parseAPOL: Got pointer to NULL feparm object!\n");
2274 Vnm_print(0,
"NOsh_parseAPOL: Parsing parameters for APOL calculation\n");
2278 while (Vio_scanf(sock,
"%s", tok) == 1) {
2280 Vnm_print(0,
"NOsh_parseAPOL: Parsing %s...\n", tok);
2292 Vnm_print(0,
"NOsh_parseFEM: parseMG error!\n");
2294 }
else if (rc == 0) {
2296 Vnm_print(2,
"NOsh: Unrecognized keyword: %s\n", tok);
2304 if (rc == -1)
return 0;
2305 if (rc == 0)
return 0;
2309 Vnm_print(2,
"NOsh: APOL parameters not set correctly!\n");
2317 VPRIVATE
int NOsh_setupCalcAPOL(
2324 VASSERT(thee != VNULL);
2325 VASSERT(apol != VNULL);
2332 Vnm_print(2,
"NOsh: Too many calculations in this run!\n");
2333 Vnm_print(2,
"NOsh: Current max is %d; ignoring this calculation\n",
VPUBLIC Vrc_Codes MGparm_parseToken(MGparm *thee, char tok[VMAX_BUFSIZE], Vio *sock)
Parse an MG keyword from an input file.
VPUBLIC FEMparm * FEMparm_ctor(FEMparm_CalcType type)
Construct FEMparm.
VPUBLIC int NOsh_setupApolCalc(NOsh *thee, Valist *alist[NOSH_MAXMOL])
Setup the series of non-polar calculations.
Vdata_Format meshfmt[NOSH_MAXMOL]
#define VFLOOR(value)
Wrapped floor to fix floating point issues in the Intel compiler.
VPUBLIC int NOsh_apol2calc(NOsh *thee, int icalc)
Return the name of an apol statement.
VPUBLIC int NOsh_printNarg(NOsh *thee, int iprint)
Return number of arguments to PRINT statement (.
enum eVdata_Format Vdata_Format
Declaration of the Vdata_Format type as the Vdata_Format enum.
int apol2calc[NOSH_MAXCALC]
VPUBLIC char * NOsh_getPotpath(NOsh *thee, int imol)
Returns path to specified potential map.
VPUBLIC Vrc_Codes APOLparm_parseToken(APOLparm *thee, char tok[VMAX_BUFSIZE], Vio *sock)
Parse an MG keyword from an input file.
#define NOSH_MAXMOL
Maximum number of molecules in a run.
VPUBLIC int NOsh_ctor2(NOsh *thee, int rank, int size)
FORTRAN stub to construct NOsh.
Vdata_Format dielfmt[NOSH_MAXMOL]
#define NOSH_MAXPRINT
Maximum number of PRINT statements in a run.
#define VAPBS_DOWN
Face definition for a volume.
char potpath[NOSH_MAXMOL][VMAX_ARGLEN]
VPUBLIC char * NOsh_getDielXpath(NOsh *thee, int imol)
Returns path to specified x-shifted dielectric map.
NOsh_PrintType printwhat[NOSH_MAXPRINT]
enum eNOsh_PrintType NOsh_PrintType
Declare NOsh_PrintType type.
VPUBLIC void MGparm_dtor(MGparm **thee)
Object destructor.
VPUBLIC void NOsh_dtor(NOsh **thee)
Object destructor.
char elecname[NOSH_MAXCALC][VMAX_ARGLEN]
VPUBLIC void FEMparm_copy(FEMparm *thee, FEMparm *source)
Copy target object into thee.
VPUBLIC PBEparm * PBEparm_ctor()
Construct PBEparm object.
NOsh_calc * calc[NOSH_MAXCALC]
Contains declarations for class NOsh.
VPRIVATE char * MCcommChars
Comment characters for socket reads.
VPUBLIC Vrc_Codes FEMparm_parseToken(FEMparm *thee, char tok[VMAX_BUFSIZE], Vio *sock)
Parse an MG keyword from an input file.
#define VAPBS_UP
Face definition for a volume.
VPUBLIC int FEMparm_check(FEMparm *thee)
Consistency check for parameter values stored in object.
VPUBLIC int NOsh_parseInputFile(NOsh *thee, char *filename)
Parse an input file only from a file.
VPUBLIC void NOsh_calc_dtor(NOsh_calc **thee)
Object destructor.
char dielXpath[NOSH_MAXMOL][VMAX_ARGLEN]
VPUBLIC void FEMparm_dtor(FEMparm **thee)
Object destructor.
VPUBLIC Vrc_Codes APOLparm_check(APOLparm *thee)
Consistency check for parameter values stored in object.
#define NOSH_MAXPOP
Maximum number of operations in a PRINT statement.
VPUBLIC NOsh_PrintType NOsh_printWhat(NOsh *thee, int iprint)
Return an integer ID of the observable to print (.
VPUBLIC char * NOsh_getDielZpath(NOsh *thee, int imol)
Returns path to specified z-shifted dielectric map.
VPUBLIC MGparm * MGparm_ctor(MGparm_CalcType type)
Construct MGparm object.
Vdata_Format potfmt[NOSH_MAXMOL]
VPUBLIC NOsh_calc * NOsh_getCalc(NOsh *thee, int icalc)
Returns specified calculation object.
NOsh_calc * elec[NOSH_MAXCALC]
VPUBLIC int PBEparm_parseToken(PBEparm *thee, char tok[VMAX_BUFSIZE], Vio *sock)
Parse a keyword from an input file.
Vdata_Format kappafmt[NOSH_MAXMOL]
VPUBLIC void MGparm_copy(MGparm *thee, MGparm *parm)
Copy MGparm object into thee.
#define VEMBED(rctag)
Allows embedding of RCS ID tags in object files.
VPUBLIC int NOsh_setupElecCalc(NOsh *thee, Valist *alist[NOSH_MAXMOL])
Setup the series of electrostatics calculations.
VPUBLIC int NOsh_parseInput(NOsh *thee, Vio *sock)
Parse an input file from a socket.
VPUBLIC int Vstring_strcasecmp(const char *s1, const char *s2)
Case-insensitive string comparison (BSD standard)
VPUBLIC int Vstring_isdigit(const char *tok)
A modified sscanf that examines the complete string.
VPUBLIC void PBEparm_copy(PBEparm *thee, PBEparm *parm)
Copy PBEparm object into thee.
VPUBLIC int NOsh_printOp(NOsh *thee, int iprint, int iarg)
Return integer ID for specified operation (.
Parameter structure for FEM-specific variables from input files.
VPUBLIC void APOLparm_copy(APOLparm *thee, APOLparm *source)
Copy target object into thee.
VPUBLIC void PBEparm_dtor(PBEparm **thee)
Object destructor.
VPUBLIC int NOsh_getPotfmt(NOsh *thee, int i)
Returns format of specified potential map.
int printcalc[NOSH_MAXPRINT][NOSH_MAXPOP]
VPUBLIC int PBEparm_check(PBEparm *thee)
Consistency check for parameter values stored in object.
#define VAPBS_BACK
Face definition for a volume.
NOsh_MolFormat molfmt[NOSH_MAXMOL]
char chargepath[NOSH_MAXMOL][VMAX_ARGLEN]
Valist * alist[NOSH_MAXMOL]
VPUBLIC Vrc_Codes MGparm_check(MGparm *thee)
Consistency check for parameter values stored in object.
Parameter structure for PBE variables from input files.
enum eNOsh_ParmFormat NOsh_ParmFormat
Declare NOsh_ParmFormat type.
#define VAPBS_FRONT
Face definition for a volume.
PBEparm_calcForce calcforce
int printnarg[NOSH_MAXPRINT]
enum eNOsh_CalcType NOsh_CalcType
Declare NOsh_CalcType type.
NOsh_calc * apol[NOSH_MAXCALC]
char dielZpath[NOSH_MAXMOL][VMAX_ARGLEN]
Parameter structure for MG-specific variables from input files.
Vdata_Format chargefmt[NOSH_MAXMOL]
VPUBLIC char * NOsh_getMolpath(NOsh *thee, int imol)
Returns path to specified molecule.
VPUBLIC void NOsh_dtor2(NOsh *thee)
FORTRAN stub for object destructor.
VPUBLIC NOsh * NOsh_ctor(int rank, int size)
Construct NOsh.
VPUBLIC APOLparm * APOLparm_ctor()
Construct APOLparm.
VPUBLIC void APOLparm_dtor(APOLparm **thee)
Object destructor.
Container class for list of atom objects.
VPUBLIC int NOsh_getChargefmt(NOsh *thee, int i)
Returns format of specified charge map.
VPUBLIC char * NOsh_getKappapath(NOsh *thee, int imol)
Returns path to specified kappa map.
VPUBLIC int NOsh_printCalc(NOsh *thee, int iprint, int iarg)
Return calculation ID for specified PRINT statement (.
Class for parsing fixed format input files.
char meshpath[NOSH_MAXMOL][VMAX_ARGLEN]
Calculation class for use when parsing fixed format input files.
int elec2calc[NOSH_MAXCALC]
VPUBLIC char * NOsh_getDielYpath(NOsh *thee, int imol)
Returns path to specified y-shifted dielectric map.
VPUBLIC char * NOsh_elecname(NOsh *thee, int ielec)
Return an integer mapping of an ELEC statement to a calculation ID (.
#define NOSH_MAXCALC
Maximum number of calculations in a run.
enum eNOsh_MolFormat NOsh_MolFormat
Declare NOsh_MolFormat type.
VPUBLIC int NOsh_calc_copy(NOsh_calc *thee, NOsh_calc *source)
Copy NOsh_calc object into thee.
VPUBLIC NOsh_calc * NOsh_calc_ctor(NOsh_CalcType calctype)
Construct NOsh_calc.
char parmpath[VMAX_ARGLEN]
int printop[NOSH_MAXPRINT][NOSH_MAXPOP]
char molpath[NOSH_MAXMOL][VMAX_ARGLEN]
VPUBLIC int NOsh_getKappafmt(NOsh *thee, int i)
Returns format of specified kappa map.
VPRIVATE char * MCwhiteChars
Whitespace characters for socket reads.
VPUBLIC int NOsh_elec2calc(NOsh *thee, int icalc)
Return the name of an elec statement.
char apolname[NOSH_MAXCALC][VMAX_ARGLEN]
VPUBLIC char * NOsh_getChargepath(NOsh *thee, int imol)
Returns path to specified charge distribution map.
Parameter structure for APOL-specific variables from input files.
VPUBLIC int NOsh_getDielfmt(NOsh *thee, int i)
Returns format of specified dielectric map.
#define VREDFRAC
Maximum reduction of grid spacing during a focusing calculation.
#define VAPBS_LEFT
Face definition for a volume.
#define VAPBS_RIGHT
Face definition for a volume.
char dielYpath[NOSH_MAXMOL][VMAX_ARGLEN]
char kappapath[NOSH_MAXMOL][VMAX_ARGLEN]