APBS  1.5
pbeparm.c
Go to the documentation of this file.
1 
57 #include "pbeparm.h"
58 
59 VEMBED(rcsid="$Id$")
60 
61 #if !defined(VINLINE_MGPARM)
62 
63 #endif /* if !defined(VINLINE_MGPARM) */
64 
65 VPUBLIC double PBEparm_getIonCharge(PBEparm *thee, int i) {
66  VASSERT(thee != VNULL);
67  VASSERT(i < thee->nion);
68  return thee->ionq[i];
69 }
70 
71 VPUBLIC double PBEparm_getIonConc(PBEparm *thee, int i) {
72  VASSERT(thee != VNULL);
73  VASSERT(i < thee->nion);
74  return thee->ionc[i];
75 }
76 
77 VPUBLIC double PBEparm_getIonRadius(PBEparm *thee, int i) {
78  VASSERT(thee != VNULL);
79  VASSERT(i < thee->nion);
80  return thee->ionr[i];
81 }
82 
83 /*----------------------------------------------------------------------*/
84 /* Added by Michael Grabe */
85 /*----------------------------------------------------------------------*/
86 
87 VPUBLIC double PBEparm_getzmem(PBEparm *thee) {
88  VASSERT(thee != VNULL);
89  return thee->zmem;
90 }
91 VPUBLIC double PBEparm_getLmem(PBEparm *thee) {
92  VASSERT(thee != VNULL);
93  return thee->Lmem;
94 }
95 VPUBLIC double PBEparm_getmembraneDiel(PBEparm *thee) {
96  VASSERT(thee != VNULL);
97  return thee->mdie;
98 }
99 VPUBLIC double PBEparm_getmemv(PBEparm *thee) {
100  VASSERT(thee != VNULL);
101  return thee->memv;
102 }
103 
104 VPUBLIC PBEparm* PBEparm_ctor() {
105 
106  /* Set up the structure */
107  PBEparm *thee = VNULL;
108  thee = (PBEparm*)Vmem_malloc(VNULL, 1, sizeof(PBEparm));
109  VASSERT( thee != VNULL);
110  VASSERT( PBEparm_ctor2(thee) );
111 
112  return thee;
113 }
114 
115 VPUBLIC int PBEparm_ctor2(PBEparm *thee) {
116 
117  int i;
118 
119  if (thee == VNULL) return 0;
120 
121  thee->parsed = 0;
122 
123  thee->setmolid = 0;
124  thee->setpbetype = 0;
125  thee->setbcfl = 0;
126  thee->setnion = 0;
127  for (i=0; i<MAXION; i++){
128  thee->setion[i] = 0;
129  thee->ionq[i] = 0.0;
130  thee->ionc[i] = 0.0;
131  thee->ionr[i] = 0.0;
132  }
133  thee->setpdie = 0;
134  thee->setsdie = 0;
135  thee->setsrfm = 0;
136  thee->setsrad = 0;
137  thee->setswin = 0;
138  thee->settemp = 0;
139  thee->setcalcenergy = 0;
140  thee->setcalcforce = 0;
141  thee->setsdens = 0;
142  thee->numwrite = 0;
143  thee->setwritemat = 0;
144  thee->nion = 0;
145  thee->sdens = 0;
146  thee->swin = 0;
147  thee->srad = 1.4;
148  thee->useDielMap = 0;
149  thee->useKappaMap = 0;
150  thee->usePotMap = 0;
151  thee->useChargeMap = 0;
152 
153  /*----------------------------------------------*/
154  /* Added by Michael Grabe */
155  /*----------------------------------------------*/
156 
157  thee->setzmem = 0;
158  thee->setLmem = 0;
159  thee->setmdie = 0;
160  thee->setmemv = 0;
161 
162  /*----------------------------------------------*/
163 
164  thee->smsize = 0.0;
165  thee->smvolume = 0.0;
166 
167  thee->setsmsize = 0;
168  thee->setsmvolume = 0;
169 
170  return 1;
171 }
172 
173 VPUBLIC void PBEparm_dtor(PBEparm **thee) {
174  if ((*thee) != VNULL) {
175  PBEparm_dtor2(*thee);
176  Vmem_free(VNULL, 1, sizeof(PBEparm), (void **)thee);
177  (*thee) = VNULL;
178  }
179 }
180 
181 VPUBLIC void PBEparm_dtor2(PBEparm *thee) { ; }
182 
183 VPUBLIC int PBEparm_check(PBEparm *thee) {
184 
185  int i;
186 
187  /* Check to see if we were even filled... */
188  if (!thee->parsed) {
189  Vnm_print(2, "PBEparm_check: not filled!\n");
190  return 0;
191  }
192 
193  if (!thee->setmolid) {
194  Vnm_print(2, "PBEparm_check: MOL not set!\n");
195  return 0;
196  }
197  if (!thee->setpbetype) {
198  Vnm_print(2, "PBEparm_check: LPBE/NPBE/LRPBE/NRPBE/SMPBE not set!\n");
199  return 0;
200  }
201  if (!thee->setbcfl) {
202  Vnm_print(2, "PBEparm_check: BCFL not set!\n");
203  return 0;
204  }
205  if (!thee->setnion) {
206  thee->setnion = 1;
207  thee->nion = 0;
208  }
209  for (i=0; i<thee->nion; i++) {
210  if (!thee->setion[i]) {
211  Vnm_print(2, "PBEparm_check: ION #%d not set!\n",i);
212  return 0;
213  }
214  }
215  if (!thee->setpdie) {
216  Vnm_print(2, "PBEparm_check: PDIE not set!\n");
217  return 0;
218  }
219  if (((thee->srfm==VSM_MOL) || (thee->srfm==VSM_MOLSMOOTH)) \
220  && (!thee->setsdens) && (thee->srad > VSMALL)) {
221  Vnm_print(2, "PBEparm_check: SDENS not set!\n");
222  return 0;
223  }
224  if (!thee->setsdie) {
225  Vnm_print(2, "PBEparm_check: SDIE not set!\n");
226  return 0;
227  }
228  if (!thee->setsrfm) {
229  Vnm_print(2, "PBEparm_check: SRFM not set!\n");
230  return 0;
231  }
232  if (((thee->srfm==VSM_MOL) || (thee->srfm==VSM_MOLSMOOTH)) \
233  && (!thee->setsrad)) {
234  Vnm_print(2, "PBEparm_check: SRAD not set!\n");
235  return 0;
236  }
237  if ((thee->srfm==VSM_SPLINE) && (!thee->setswin)) {
238  Vnm_print(2, "PBEparm_check: SWIN not set!\n");
239  return 0;
240  }
241  if ((thee->srfm==VSM_SPLINE3) && (!thee->setswin)) {
242  Vnm_print(2, "PBEparm_check: SWIN not set!\n");
243  return 0;
244  }
245  if ((thee->srfm==VSM_SPLINE4) && (!thee->setswin)) {
246  Vnm_print(2, "PBEparm_check: SWIN not set!\n");
247  return 0;
248  }
249  if (!thee->settemp) {
250  Vnm_print(2, "PBEparm_check: TEMP not set!\n");
251  return 0;
252  }
253  if (!thee->setcalcenergy) thee->calcenergy = PCE_NO;
254  if (!thee->setcalcforce) thee->calcforce = PCF_NO;
255  if (!thee->setwritemat) thee->writemat = 0;
256 
257  /*--------------------------------------------------------*/
258  /* Added by Michael Grabe */
259  /*--------------------------------------------------------*/
260 
261  if ((!thee->setzmem) && (thee->bcfl == 3)){
262  Vnm_print(2, "PBEparm_check: ZMEM not set!\n");
263  return 0;
264  }
265  if ((!thee->setLmem) && (thee->bcfl == 3)){
266  Vnm_print(2, "PBEparm_check: LMEM not set!\n");
267  return 0;
268  }
269  if ((!thee->setmdie) && (thee->bcfl == 3)){
270  Vnm_print(2, "PBEparm_check: MDIE not set!\n");
271  return 0;
272  }
273  if ((!thee->setmemv) && (thee->bcfl == 3)){
274  Vnm_print(2, "PBEparm_check: MEMV not set!\n");
275  return 0;
276  }
277 
278  /*--------------------------------------------------------*/
279 
280  return 1;
281 }
282 
283 VPUBLIC void PBEparm_copy(PBEparm *thee, PBEparm *parm) {
284 
285  int i, j;
286 
287  VASSERT(thee != VNULL);
288  VASSERT(parm != VNULL);
289 
290  thee->molid = parm->molid;
291  thee->setmolid = parm->setmolid;
292  thee->useDielMap = parm->useDielMap;
293  thee->dielMapID = parm->dielMapID;
294  thee->useKappaMap = parm->useKappaMap;
295  thee->kappaMapID = parm->kappaMapID;
296  thee->usePotMap = parm->usePotMap;
297  thee->potMapID = parm->potMapID;
298  thee->useChargeMap = parm->useChargeMap;
299  thee->chargeMapID = parm->chargeMapID;
300  thee->pbetype = parm->pbetype;
301  thee->setpbetype = parm->setpbetype;
302  thee->bcfl = parm->bcfl;
303  thee->setbcfl = parm->setbcfl;
304  thee->nion = parm->nion;
305  thee->setnion = parm->setnion;
306  for (i=0; i<MAXION; i++) {
307  thee->ionq[i] = parm->ionq[i];
308  thee->ionc[i] = parm->ionc[i];
309  thee->ionr[i] = parm->ionr[i];
310  thee->setion[i] = parm->setion[i];
311  };
312  thee->pdie = parm->pdie;
313  thee->setpdie = parm->setpdie;
314  thee->sdens = parm->sdens;
315  thee->setsdens = parm->setsdens;
316  thee->sdie = parm->sdie;
317  thee->setsdie = parm->setsdie;
318  thee->srfm = parm->srfm;
319  thee->setsrfm = parm->setsrfm;
320  thee->srad = parm->srad;
321  thee->setsrad = parm->setsrad;
322  thee->swin = parm->swin;
323  thee->setswin = parm->setswin;
324  thee->temp = parm->temp;
325  thee->settemp = parm->settemp;
326  thee->calcenergy = parm->calcenergy;
327  thee->setcalcenergy = parm->setcalcenergy;
328  thee->calcforce = parm->calcforce;
329  thee->setcalcforce = parm->setcalcforce;
330 
331  /*----------------------------------------------------*/
332  /* Added by Michael Grabe */
333  /*----------------------------------------------------*/
334 
335  thee->zmem = parm->zmem;
336  thee->setzmem = parm->setzmem;
337  thee->Lmem = parm->Lmem;
338  thee->setLmem = parm->setLmem;
339  thee->mdie = parm->mdie;
340  thee->setmdie = parm->setmdie;
341  thee->memv = parm->memv;
342  thee->setmemv = parm->setmemv;
343 
344  /*----------------------------------------------------*/
345 
346  thee->numwrite = parm->numwrite;
347  for (i=0; i<PBEPARM_MAXWRITE; i++) {
348  thee->writetype[i] = parm->writetype[i];
349  thee->writefmt[i] = parm->writefmt[i];
350  for (j=0; j<VMAX_ARGLEN; j++)
351  thee->writestem[i][j] = parm->writestem[i][j];
352  }
353  thee->writemat = parm->writemat;
354  thee->setwritemat = parm->setwritemat;
355  for (i=0; i<VMAX_ARGLEN; i++) thee->writematstem[i] = parm->writematstem[i];
356  thee->writematflag = parm->writematflag;
357 
358  thee->smsize = parm->smsize;
359  thee->smvolume = parm->smvolume;
360 
361  thee->setsmsize = parm->setsmsize;
362  thee->setsmvolume = parm->setsmvolume;
363 
364  thee->parsed = parm->parsed;
365 
366 }
367 
368 VPRIVATE int PBEparm_parseLPBE(PBEparm *thee, Vio *sock) {
369  Vnm_print(0, "NOsh: parsed lpbe\n");
370  thee->pbetype = PBE_LPBE;
371  thee->setpbetype = 1;
372  return 1;
373 }
374 
375 VPRIVATE int PBEparm_parseNPBE(PBEparm *thee, Vio *sock) {
376  Vnm_print(0, "NOsh: parsed npbe\n");
377  thee->pbetype = PBE_NPBE;
378  thee->setpbetype = 1;
379  return 1;
380 }
381 
382 VPRIVATE int PBEparm_parseMOL(PBEparm *thee, Vio *sock) {
383  int ti;
384  char tok[VMAX_BUFSIZE];
385 
386  VJMPERR1(Vio_scanf(sock, "%s", tok) == 1);
387  if (sscanf(tok, "%d", &ti) == 0) {
388  Vnm_print(2, "NOsh: Read non-int (%s) while parsing MOL \
389 keyword!\n", tok);
390  return -1;
391  }
392  thee->molid = ti;
393  thee->setmolid = 1;
394  return 1;
395 
396  VERROR1:
397  Vnm_print(2, "parsePBE: ran out of tokens!\n");
398  return -1;
399 }
400 
401 VPRIVATE int PBEparm_parseLRPBE(PBEparm *thee, Vio *sock) {
402  Vnm_print(0, "NOsh: parsed lrpbe\n");
403  thee->pbetype = PBE_LRPBE;
404  thee->setpbetype = 1;
405  return 1;
406 }
407 
408 VPRIVATE int PBEparm_parseNRPBE(PBEparm *thee, Vio *sock) {
409  Vnm_print(0, "NOsh: parsed nrpbe\n");
410  thee->pbetype = PBE_NRPBE;
411  thee->setpbetype = 1;
412  return 1;
413 }
414 
415 VPRIVATE int PBEparm_parseSMPBE(PBEparm *thee, Vio *sock) {
416 
417  int i;
418 
419  char type[VMAX_BUFSIZE]; /* vol or size (keywords) */
420  char value[VMAX_BUFSIZE]; /* floating point value */
421 
422  char setVol = 1;
423  char setSize = 1;
424  char keyValuePairs = 2;
425 
426  double size, volume;
427 
428  for(i=0;i<keyValuePairs;i++){
429 
430  /* The line two tokens at a time */
431  VJMPERR1(Vio_scanf(sock, "%s", type) == 1);
432  VJMPERR1(Vio_scanf(sock, "%s", value) == 1);
433 
434  if(!strcmp(type,"vol")){
435  if ((setVol = sscanf(value, "%lf", &volume)) == 0){
436  Vnm_print(2,"NOsh: Read non-float (%s) while parsing smpbe keyword!\n", value);
437  return VRC_FAILURE;
438  }
439  }else if(!strcmp(type,"size")){
440  if ((setSize = sscanf(value, "%lf", &size)) == 0){
441  Vnm_print(2,"NOsh: Read non-float (%s) while parsing smpbe keyword!\n", value);
442  return VRC_FAILURE;
443  }
444  }else{
445  Vnm_print(2,"NOsh: Read non-float (%s) while parsing smpbe keyword!\n", value);
446  return VRC_FAILURE;
447  }
448  }
449 
450  /* If either the volume or size isn't set, throw an error */
451  if((setVol == 0) || (setSize == 0)){
452  Vnm_print(2,"NOsh: Error while parsing smpbe keywords! Only size or vol was specified.\n");
453  return VRC_FAILURE;
454  }
455 
456  Vnm_print(0, "NOsh: parsed smpbe\n");
457  thee->pbetype = PBE_SMPBE;
458  thee->setpbetype = 1;
459 
460  thee->smsize = size;
461  thee->setsmsize = 1;
462 
463  thee->smvolume = volume;
464  thee->setsmvolume = 1;
465 
466  return VRC_SUCCESS;
467 
468 VERROR1:
469  Vnm_print(2, "parsePBE: ran out of tokens!\n");
470  return VRC_FAILURE;
471 
472 }
473 
474 VPRIVATE int PBEparm_parseBCFL(PBEparm *thee, Vio *sock) {
475  char tok[VMAX_BUFSIZE];
476  int ti;
477 
478  VJMPERR1(Vio_scanf(sock, "%s", tok) == 1);
479 
480  /* We can either parse int flag... */
481  if (sscanf(tok, "%d", &ti) == 1) {
482 
483  thee->bcfl = (Vbcfl)ti;
484  thee->setbcfl = 1;
485  /* Warn that this usage is deprecated */
486  Vnm_print(2, "parsePBE: Warning -- parsed deprecated \"bcfl %d\" \
487 statement\n", ti);
488  Vnm_print(2, "parsePBE: Please use \"bcfl ");
489  switch (thee->bcfl) {
490  case BCFL_ZERO:
491  Vnm_print(2, "zero");
492  break;
493  case BCFL_SDH:
494  Vnm_print(2, "sdh");
495  break;
496  case BCFL_MDH:
497  Vnm_print(2, "mdh");
498  break;
499  case BCFL_FOCUS:
500  Vnm_print(2, "focus");
501  break;
502  case BCFL_MEM:
503  Vnm_print(2, "mem");
504  break;
505  case BCFL_MAP:
506  Vnm_print(2, "map");
507  break;
508  default:
509  Vnm_print(2, "UKNOWN");
510  break;
511  }
512  Vnm_print(2, "\" instead.\n");
513  return 1;
514 
515  /* ...or the word */
516  } else {
517 
518  if (Vstring_strcasecmp(tok, "zero") == 0) {
519  thee->bcfl = BCFL_ZERO;
520  thee->setbcfl = 1;
521  return 1;
522  } else if (Vstring_strcasecmp(tok, "sdh") == 0) {
523  thee->bcfl = BCFL_SDH;
524  thee->setbcfl = 1;
525  return 1;
526  } else if (Vstring_strcasecmp(tok, "mdh") == 0) {
527  thee->bcfl = BCFL_MDH;
528  thee->setbcfl = 1;
529  return 1;
530  } else if (Vstring_strcasecmp(tok, "focus") == 0) {
531  thee->bcfl = BCFL_FOCUS;
532  thee->setbcfl = 1;
533  return 1;
534  } else if (Vstring_strcasecmp(tok, "mem") == 0) {
535  thee->bcfl = BCFL_MEM;
536  thee->setbcfl = 1;
537  return 1;
538  } else if (Vstring_strcasecmp(tok, "map") == 0) {
539  thee->bcfl = BCFL_MAP;
540  thee->setbcfl = 1;
541  return 1;
542  } else {
543  Vnm_print(2, "NOsh: parsed unknown BCFL parameter (%s)!\n",
544  tok);
545  return -1;
546  }
547  }
548  return 0;
549 
550  VERROR1:
551  Vnm_print(2, "parsePBE: ran out of tokens!\n");
552  return -1;
553 }
554 
555 VPRIVATE int PBEparm_parseION(PBEparm *thee, Vio *sock) {
556 
557  int i;
558  int meth = 0;
559 
560  char tok[VMAX_BUFSIZE];
561  char value[VMAX_BUFSIZE];
562 
563  double tf;
564  double charge, conc, radius;
565 
566  int setCharge = 0;
567  int setConc = 0;
568  int setRadius = 0;
569  int keyValuePairs = 3;
570 
571  /* Get the initial token for the ION statement */
572  VJMPERR1(Vio_scanf(sock, "%s", tok) == 1);
573 
574  /* Scan the token once to determine the type (old style or new keyValue pair) */
575  meth = sscanf(tok, "%lf", &tf);
576  /* If tok is a non-zero float value, we are using the old method */
577  if(meth != 0){
578 
579  Vnm_print(2, "NOsh: Deprecated use of ION keyword! Use key-value pairs\n", tok);
580 
581  if (sscanf(tok, "%lf", &tf) == 0) {
582  Vnm_print(2, "NOsh: Read non-float (%s) while parsing ION keyword!\n", tok);
583  return VRC_FAILURE;
584  }
585  thee->ionq[thee->nion] = tf;
586  VJMPERR1(Vio_scanf(sock, "%s", tok) == 1);
587  if (sscanf(tok, "%lf", &tf) == 0) {
588  Vnm_print(2, "NOsh: Read non-float (%s) while parsing ION keyword!\n", tok);
589  return VRC_FAILURE;
590  }
591  thee->ionc[thee->nion] = tf;
592  VJMPERR1(Vio_scanf(sock, "%s", tok) == 1);
593  if (sscanf(tok, "%lf", &tf) == 0) {
594  Vnm_print(2, "NOsh: Read non-float (%s) while parsing ION keyword!\n", tok);
595  return VRC_FAILURE;
596  }
597  thee->ionr[thee->nion] = tf;
598 
599  }else{
600 
601  /* Three key-value pairs (charge, radius and conc) */
602  for(i=0;i<keyValuePairs;i++){
603 
604  /* Now scan for the value (float) to be used with the key token parsed
605  * above the if-else statement */
606  VJMPERR1(Vio_scanf(sock, "%s", value) == 1);
607  if(!strcmp(tok,"charge")){
608  setCharge = sscanf(value, "%lf", &charge);
609  if (setCharge == 0){
610  Vnm_print(2,"NOsh: Read non-float (%s) while parsing ION %s keyword!\n", value, tok);
611  return VRC_FAILURE;
612  }
613  thee->ionq[thee->nion] = charge;
614  }else if(!strcmp(tok,"radius")){
615  setRadius = sscanf(value, "%lf", &radius);
616  if (setRadius == 0){
617  Vnm_print(2,"NOsh: Read non-float (%s) while parsing ION %s keyword!\n", value, tok);
618  return VRC_FAILURE;
619  }
620  thee->ionr[thee->nion] = radius;
621  }else if(!strcmp(tok,"conc")){
622  setConc = sscanf(value, "%lf", &conc);
623  if (setConc == 0){
624  Vnm_print(2,"NOsh: Read non-float (%s) while parsing ION %s keyword!\n", value, tok);
625  return VRC_FAILURE;
626  }
627  thee->ionc[thee->nion] = conc;
628  }else{
629  Vnm_print(2,"NOsh: Illegal or missing key-value pair for ION keyword!\n");
630  return VRC_FAILURE;
631  }
632 
633  /* If all three values haven't be set (setValue = 0) then read the next token */
634  if((setCharge != 1) || (setConc != 1) || (setRadius != 1)){
635  VJMPERR1(Vio_scanf(sock, "%s", tok) == 1);
636  }
637 
638  } /* end for */
639  } /* end if */
640 
641  /* Finally set the setion, nion and setnion flags and return success */
642  thee->setion[thee->nion] = 1;
643  (thee->nion)++;
644  thee->setnion = 1;
645  return VRC_SUCCESS;
646 
647  VERROR1:
648  Vnm_print(2, "parsePBE: ran out of tokens!\n");
649  return VRC_FAILURE;
650 }
651 
652 VPRIVATE int PBEparm_parsePDIE(PBEparm *thee, Vio *sock) {
653  char tok[VMAX_BUFSIZE];
654  double tf;
655 
656  VJMPERR1(Vio_scanf(sock, "%s", tok) == 1);
657  if (sscanf(tok, "%lf", &tf) == 0) {
658  Vnm_print(2, "NOsh: Read non-float (%s) while parsing PDIE \
659 keyword!\n", tok);
660  return -1;
661  }
662  thee->pdie = tf;
663  thee->setpdie = 1;
664  return 1;
665 
666  VERROR1:
667  Vnm_print(2, "parsePBE: ran out of tokens!\n");
668  return -1;
669 }
670 
671 VPRIVATE int PBEparm_parseSDENS(PBEparm *thee, Vio *sock) {
672  char tok[VMAX_BUFSIZE];
673  double tf;
674 
675  VJMPERR1(Vio_scanf(sock, "%s", tok) == 1);
676  if (sscanf(tok, "%lf", &tf) == 0) {
677  Vnm_print(2, "NOsh: Read non-float (%s) while parsing SDENS \
678 keyword!\n", tok);
679  return -1;
680  }
681  thee->sdens = tf;
682  thee->setsdens = 1;
683  return 1;
684 
685  VERROR1:
686  Vnm_print(2, "parsePBE: ran out of tokens!\n");
687  return -1;
688 }
689 
690 VPRIVATE int PBEparm_parseSDIE(PBEparm *thee, Vio *sock) {
691  char tok[VMAX_BUFSIZE];
692  double tf;
693 
694  VJMPERR1(Vio_scanf(sock, "%s", tok) == 1);
695  if (sscanf(tok, "%lf", &tf) == 0) {
696  Vnm_print(2, "NOsh: Read non-float (%s) while parsing SDIE \
697 keyword!\n", tok);
698  return -1;
699  }
700  thee->sdie = tf;
701  thee->setsdie = 1;
702  return 1;
703 
704  VERROR1:
705  Vnm_print(2, "parsePBE: ran out of tokens!\n");
706  return -1;
707 }
708 
709 VPRIVATE int PBEparm_parseSRFM(PBEparm *thee, Vio *sock) {
710  char tok[VMAX_BUFSIZE];
711  int ti;
712 
713  VJMPERR1(Vio_scanf(sock, "%s", tok) == 1);
714 
715  /* Parse old-style int arg */
716  if (sscanf(tok, "%d", &ti) == 1) {
717  thee->srfm = (Vsurf_Meth)ti;
718  thee->setsrfm = 1;
719 
720  Vnm_print(2, "parsePBE: Warning -- parsed deprecated \"srfm %d\" \
721 statement.\n", ti);
722  Vnm_print(2, "parsePBE: Please use \"srfm ");
723  switch (thee->srfm) {
724  case VSM_MOL:
725  Vnm_print(2, "mol");
726  break;
727  case VSM_MOLSMOOTH:
728  Vnm_print(2, "smol");
729  break;
730  case VSM_SPLINE:
731  Vnm_print(2, "spl2");
732  break;
733  case VSM_SPLINE3:
734  Vnm_print(2, "spl3");
735  break;
736  case VSM_SPLINE4:
737  Vnm_print(2, "spl4");
738  break;
739  default:
740  Vnm_print(2, "UNKNOWN");
741  break;
742  }
743  Vnm_print(2, "\" instead.\n");
744  return 1;
745 
746  /* Parse newer text-based args */
747  } else if (Vstring_strcasecmp(tok, "mol") == 0) {
748  thee->srfm = VSM_MOL;
749  thee->setsrfm = 1;
750  return 1;
751  } else if (Vstring_strcasecmp(tok, "smol") == 0) {
752  thee->srfm = VSM_MOLSMOOTH;
753  thee->setsrfm = 1;
754  return 1;
755  } else if (Vstring_strcasecmp(tok, "spl2") == 0) {
756  thee->srfm = VSM_SPLINE;
757  thee->setsrfm = 1;
758  return 1;
759  } else if (Vstring_strcasecmp(tok, "spl3") == 0) {
760  thee->srfm = VSM_SPLINE3;
761  thee->setsrfm = 1;
762  return 1;
763  } else if (Vstring_strcasecmp(tok, "spl4") == 0) {
764  thee->srfm = VSM_SPLINE4;
765  thee->setsrfm = 1;
766  return 1;
767  } else {
768  Vnm_print(2, "NOsh: Unrecongnized keyword (%s) when parsing \
769 srfm!\n", tok);
770  return -1;
771  }
772 
773  return 0;
774 
775  VERROR1:
776  Vnm_print(2, "parsePBE: ran out of tokens!\n");
777  return -1;
778 }
779 
780 VPRIVATE int PBEparm_parseSRAD(PBEparm *thee, Vio *sock) {
781  char tok[VMAX_BUFSIZE];
782  double tf;
783 
784  VJMPERR1(Vio_scanf(sock, "%s", tok) == 1);
785  if (sscanf(tok, "%lf", &tf) == 0) {
786  Vnm_print(2, "NOsh: Read non-float (%s) while parsing SRAD \
787 keyword!\n", tok);
788  return -1;
789  }
790  thee->srad = tf;
791  thee->setsrad = 1;
792  return 1;
793 
794  VERROR1:
795  Vnm_print(2, "parsePBE: ran out of tokens!\n");
796  return -1;
797 }
798 
799 VPRIVATE int PBEparm_parseSWIN(PBEparm *thee, Vio *sock) {
800  char tok[VMAX_BUFSIZE];
801  double tf;
802 
803  VJMPERR1(Vio_scanf(sock, "%s", tok) == 1);
804  if (sscanf(tok, "%lf", &tf) == 0) {
805  Vnm_print(2, "NOsh: Read non-float (%s) while parsing SWIN \
806 keyword!\n", tok);
807  return -1;
808  }
809  thee->swin = tf;
810  thee->setswin = 1;
811  return 1;
812 
813  VERROR1:
814  Vnm_print(2, "parsePBE: ran out of tokens!\n");
815  return -1;
816 }
817 
818 VPRIVATE int PBEparm_parseTEMP(PBEparm *thee, Vio *sock) {
819  char tok[VMAX_BUFSIZE];
820  double tf;
821 
822  VJMPERR1(Vio_scanf(sock, "%s", tok) == 1);
823  if (sscanf(tok, "%lf", &tf) == 0) {
824  Vnm_print(2, "NOsh: Read non-float (%s) while parsing TEMP \
825 keyword!\n", tok);
826  return -1;
827  }
828  thee->temp = tf;
829  thee->settemp = 1;
830  return 1;
831 
832  VERROR1:
833  Vnm_print(2, "parsePBE: ran out of tokens!\n");
834  return -1;
835 }
836 
837 VPRIVATE int PBEparm_parseUSEMAP(PBEparm *thee, Vio *sock) {
838  char tok[VMAX_BUFSIZE];
839  int ti;
840 
841  VJMPERR1(Vio_scanf(sock, "%s", tok) == 1);
842  Vnm_print(0, "PBEparm_parseToken: Read %s...\n", tok);
843  if (Vstring_strcasecmp(tok, "diel") == 0) {
844  thee->useDielMap = 1;
845  VJMPERR1(Vio_scanf(sock, "%s", tok) == 1);
846  if (sscanf(tok, "%d", &ti) == 0) {
847  Vnm_print(2, "NOsh: Read non-int (%s) while parsing \
848 USEMAP DIEL keyword!\n", tok);
849  return -1;
850  }
851  thee->dielMapID = ti;
852  return 1;
853  } else if (Vstring_strcasecmp(tok, "kappa") == 0) {
854  thee->useKappaMap = 1;
855  VJMPERR1(Vio_scanf(sock, "%s", tok) == 1);
856  if (sscanf(tok, "%d", &ti) == 0) {
857  Vnm_print(2, "NOsh: Read non-int (%s) while parsing \
858 USEMAP KAPPA keyword!\n", tok);
859  return -1;
860  }
861  thee->kappaMapID = ti;
862  return 1;
863  } else if (Vstring_strcasecmp(tok, "pot") == 0) {
864  thee->usePotMap = 1;
865  VJMPERR1(Vio_scanf(sock, "%s", tok) == 1);
866  if (sscanf(tok, "%d", &ti) == 0) {
867  Vnm_print(2, "NOsh: Read non-int (%s) while parsing \
868  USEMAP POT keyword!\n", tok);
869  return -1;
870  }
871  thee->potMapID = ti;
872  return 1;
873  } else if (Vstring_strcasecmp(tok, "charge") == 0) {
874  thee->useChargeMap = 1;
875  VJMPERR1(Vio_scanf(sock, "%s", tok) == 1);
876  if (sscanf(tok, "%d", &ti) == 0) {
877  Vnm_print(2, "NOsh: Read non-int (%s) while parsing \
878 USEMAP CHARGE keyword!\n", tok);
879  return -1;
880  }
881  thee->chargeMapID = ti;
882  return 1;
883  } else {
884  Vnm_print(2, "NOsh: Read undefined keyword (%s) while parsing \
885 USEMAP statement!\n", tok);
886  return -1;
887  }
888  return 0;
889 
890  VERROR1:
891  Vnm_print(2, "parsePBE: ran out of tokens!\n");
892  return -1;
893 }
894 
895 VPRIVATE int PBEparm_parseCALCENERGY(PBEparm *thee, Vio *sock) {
896  char tok[VMAX_BUFSIZE];
897  int ti;
898 
899  VJMPERR1(Vio_scanf(sock, "%s", tok) == 1);
900  /* Parse number */
901  if (sscanf(tok, "%d", &ti) == 1) {
902  thee->calcenergy = (PBEparm_calcEnergy)ti;
903  thee->setcalcenergy = 1;
904 
905  Vnm_print(2, "parsePBE: Warning -- parsed deprecated \"calcenergy \
906 %d\" statement.\n", ti);
907  Vnm_print(2, "parsePBE: Please use \"calcenergy ");
908  switch (thee->calcenergy) {
909  case PCE_NO:
910  Vnm_print(2, "no");
911  break;
912  case PCE_TOTAL:
913  Vnm_print(2, "total");
914  break;
915  case PCE_COMPS:
916  Vnm_print(2, "comps");
917  break;
918  default:
919  Vnm_print(2, "UNKNOWN");
920  break;
921  }
922  Vnm_print(2, "\" instead.\n");
923  return 1;
924  } else if (Vstring_strcasecmp(tok, "no") == 0) {
925  thee->calcenergy = PCE_NO;
926  thee->setcalcenergy = 1;
927  return 1;
928  } else if (Vstring_strcasecmp(tok, "total") == 0) {
929  thee->calcenergy = PCE_TOTAL;
930  thee->setcalcenergy = 1;
931  return 1;
932  } else if (Vstring_strcasecmp(tok, "comps") == 0) {
933  thee->calcenergy = PCE_COMPS;
934  thee->setcalcenergy = 1;
935  return 1;
936  } else {
937  Vnm_print(2, "NOsh: Unrecognized parameter (%s) while parsing \
938 calcenergy!\n", tok);
939  return -1;
940  }
941  return 0;
942 
943  VERROR1:
944  Vnm_print(2, "parsePBE: ran out of tokens!\n");
945  return -1;
946 }
947 
948 VPRIVATE int PBEparm_parseCALCFORCE(PBEparm *thee, Vio *sock) {
949  char tok[VMAX_BUFSIZE];
950  int ti;
951 
952  VJMPERR1(Vio_scanf(sock, "%s", tok) == 1);
953  /* Parse number */
954  if (sscanf(tok, "%d", &ti) == 1) {
955  thee->calcforce = (PBEparm_calcForce)ti;
956  thee->setcalcforce = 1;
957 
958  Vnm_print(2, "parsePBE: Warning -- parsed deprecated \"calcforce \
959 %d\" statement.\n", ti);
960  Vnm_print(2, "parsePBE: Please use \"calcforce ");
961  switch (thee->calcenergy) {
962  case PCF_NO:
963  Vnm_print(2, "no");
964  break;
965  case PCF_TOTAL:
966  Vnm_print(2, "total");
967  break;
968  case PCF_COMPS:
969  Vnm_print(2, "comps");
970  break;
971  default:
972  Vnm_print(2, "UNKNOWN");
973  break;
974  }
975  Vnm_print(2, "\" instead.\n");
976  return 1;
977  } else if (Vstring_strcasecmp(tok, "no") == 0) {
978  thee->calcforce = PCF_NO;
979  thee->setcalcforce = 1;
980  return 1;
981  } else if (Vstring_strcasecmp(tok, "total") == 0) {
982  thee->calcforce = PCF_TOTAL;
983  thee->setcalcforce = 1;
984  return 1;
985  } else if (Vstring_strcasecmp(tok, "comps") == 0) {
986  thee->calcforce = PCF_COMPS;
987  thee->setcalcforce = 1;
988  return 1;
989  } else {
990  Vnm_print(2, "NOsh: Unrecognized parameter (%s) while parsing \
991 calcforce!\n", tok);
992  return -1;
993  }
994  return 0;
995 
996  VERROR1:
997  Vnm_print(2, "parsePBE: ran out of tokens!\n");
998  return -1;
999 }
1000 
1001 /*----------------------------------------------------------*/
1002 /* Added by Michael Grabe */
1003 /*----------------------------------------------------------*/
1004 
1005 VPRIVATE int PBEparm_parseZMEM(PBEparm *thee, Vio *sock) {
1006  char tok[VMAX_BUFSIZE];
1007  double tf;
1008 
1009  VJMPERR1(Vio_scanf(sock, "%s", tok) == 1);
1010  if (sscanf(tok, "%lf", &tf) == 0) {
1011  Vnm_print(2, "NOsh: Read non-float (%s) while parsing ZMEM \
1012  keyword!\n", tok);
1013  return -1;
1014  }
1015  thee->zmem = tf;
1016  thee->setzmem = 1;
1017  return 1;
1018 
1019 VERROR1:
1020  Vnm_print(2, "parsePBE: ran out of tokens!\n");
1021  return -1;
1022 }
1023 
1024 
1025 VPRIVATE int PBEparm_parseLMEM(PBEparm *thee, Vio *sock) {
1026  char tok[VMAX_BUFSIZE];
1027  double tf;
1028 
1029  VJMPERR1(Vio_scanf(sock, "%s", tok) == 1);
1030  if (sscanf(tok, "%lf", &tf) == 0) {
1031  Vnm_print(2, "NOsh: Read non-float (%s) while parsing LMEM \
1032  keyword!\n", tok);
1033  return -1;
1034  }
1035  thee->Lmem = tf;
1036  thee->setLmem = 1;
1037  return 1;
1038 
1039 VERROR1:
1040  Vnm_print(2, "parsePBE: ran out of tokens!\n");
1041  return -1;
1042 }
1043 
1044 VPRIVATE int PBEparm_parseMDIE(PBEparm *thee, Vio *sock) {
1045  char tok[VMAX_BUFSIZE];
1046  double tf;
1047 
1048  VJMPERR1(Vio_scanf(sock, "%s", tok) == 1);
1049  if (sscanf(tok, "%lf", &tf) == 0) {
1050  Vnm_print(2, "NOsh: Read non-float (%s) while parsing MDIE \
1051  keyword!\n", tok);
1052  return -1;
1053  }
1054  thee->mdie = tf;
1055  thee->setmdie = 1;
1056  return 1;
1057 
1058 VERROR1:
1059  Vnm_print(2, "parsePBE: ran out of tokens!\n");
1060  return -1;
1061 }
1062 
1063 VPRIVATE int PBEparm_parseMEMV(PBEparm *thee, Vio *sock) {
1064  char tok[VMAX_BUFSIZE];
1065  double tf;
1066 
1067  VJMPERR1(Vio_scanf(sock, "%s", tok) == 1);
1068  if (sscanf(tok, "%lf", &tf) == 0) {
1069  Vnm_print(2, "NOsh: Read non-float (%s) while parsing MEMV \
1070  keyword!\n", tok);
1071  return -1;
1072  }
1073  thee->memv = tf;
1074  thee->setmemv = 1;
1075  return 1;
1076 
1077 VERROR1:
1078  Vnm_print(2, "parsePBE: ran out of tokens!\n");
1079  return -1;
1080 }
1081 
1082 /*----------------------------------------------------------*/
1083 
1084 VPRIVATE int PBEparm_parseWRITE(PBEparm *thee, Vio *sock) {
1085  char tok[VMAX_BUFSIZE], str[VMAX_BUFSIZE]="", strnew[VMAX_BUFSIZE]="";
1086  Vdata_Type writetype;
1087  Vdata_Format writefmt;
1088 
1089  VJMPERR1(Vio_scanf(sock, "%s", tok) == 1);
1090  if (Vstring_strcasecmp(tok, "pot") == 0) {
1091  writetype = VDT_POT;
1092  } else if (Vstring_strcasecmp(tok, "atompot") == 0) {
1093  writetype = VDT_ATOMPOT;
1094  } else if (Vstring_strcasecmp(tok, "charge") == 0) {
1095  writetype = VDT_CHARGE;
1096  } else if (Vstring_strcasecmp(tok, "smol") == 0) {
1097  writetype = VDT_SMOL;
1098  } else if (Vstring_strcasecmp(tok, "dielx") == 0) {
1099  writetype = VDT_DIELX;
1100  } else if (Vstring_strcasecmp(tok, "diely") == 0) {
1101  writetype = VDT_DIELY;
1102  } else if (Vstring_strcasecmp(tok, "dielz") == 0) {
1103  writetype = VDT_DIELZ;
1104  } else if (Vstring_strcasecmp(tok, "kappa") == 0) {
1105  writetype = VDT_KAPPA;
1106  } else if (Vstring_strcasecmp(tok, "sspl") == 0) {
1107  writetype = VDT_SSPL;
1108  } else if (Vstring_strcasecmp(tok, "vdw") == 0) {
1109  writetype = VDT_VDW;
1110  } else if (Vstring_strcasecmp(tok, "ivdw") == 0) {
1111  writetype = VDT_IVDW;
1112  } else if (Vstring_strcasecmp(tok, "lap") == 0) {
1113  writetype = VDT_LAP;
1114  } else if (Vstring_strcasecmp(tok, "edens") == 0) {
1115  writetype = VDT_EDENS;
1116  } else if (Vstring_strcasecmp(tok, "ndens") == 0) {
1117  writetype = VDT_NDENS;
1118  } else if (Vstring_strcasecmp(tok, "qdens") == 0) {
1119  writetype = VDT_QDENS;
1120  } else {
1121  Vnm_print(2, "PBEparm_parse: Invalid data type (%s) to write!\n",
1122  tok);
1123  return -1;
1124  }
1125  VJMPERR1(Vio_scanf(sock, "%s", tok) == 1);
1126  if (Vstring_strcasecmp(tok, "dx") == 0) {
1127  writefmt = VDF_DX;
1128  }
1129  else if(Vstring_strcasecmp(tok, "dxbin") == 0){
1130  writefmt = VDF_DXBIN;
1131  } else if (Vstring_strcasecmp(tok, "uhbd") == 0) {
1132  writefmt = VDF_UHBD;
1133  } else if (Vstring_strcasecmp(tok, "avs") == 0) {
1134  writefmt = VDF_AVS;
1135  } else if (Vstring_strcasecmp(tok, "gz") == 0) {
1136  writefmt = VDF_GZ;
1137  } else if (Vstring_strcasecmp(tok, "flat") == 0) {
1138  writefmt = VDF_FLAT;
1139  } else {
1140  Vnm_print(2, "PBEparm_parse: Invalid data format (%s) to write!\n",
1141  tok);
1142  return -1;
1143  }
1144  VJMPERR1(Vio_scanf(sock, "%s", tok) == 1);
1145  if (tok[0]=='"') {
1146  strcpy(strnew, "");
1147  while (tok[strlen(tok)-1] != '"') {
1148  strcat(str, tok);
1149  strcat(str, " ");
1150  VJMPERR1(Vio_scanf(sock, "%s", tok) == 1);
1151  }
1152  strcat(str, tok);
1153  strncpy(strnew, str+1, strlen(str)-2);
1154  strcpy(tok, strnew);
1155  }
1156  if (thee->numwrite < (PBEPARM_MAXWRITE-1)) {
1157  strncpy(thee->writestem[thee->numwrite], tok, VMAX_ARGLEN);
1158  thee->writetype[thee->numwrite] = writetype;
1159  thee->writefmt[thee->numwrite] = writefmt;
1160  (thee->numwrite)++;
1161  } else {
1162  Vnm_print(2, "PBEparm_parse: You have exceeded the maximum number of write statements!\n");
1163  Vnm_print(2, "PBEparm_parse: Ignoring additional write statements!\n");
1164  }
1165  return 1;
1166 
1167  VERROR1:
1168  Vnm_print(2, "parsePBE: ran out of tokens!\n");
1169  return -1;
1170 }
1171 
1172 VPRIVATE int PBEparm_parseWRITEMAT(PBEparm *thee, Vio *sock) {
1173  char tok[VMAX_BUFSIZE], str[VMAX_BUFSIZE]="", strnew[VMAX_BUFSIZE]="";
1174 
1175  VJMPERR1(Vio_scanf(sock, "%s", tok) == 1);
1176  if (Vstring_strcasecmp(tok, "poisson") == 0) {
1177  thee->writematflag = 0;
1178  } else if (Vstring_strcasecmp(tok, "full") == 0) {
1179  thee->writematflag = 1;
1180  } else {
1181  Vnm_print(2, "NOsh: Invalid format (%s) while parsing \
1182 WRITEMAT keyword!\n", tok);
1183  return -1;
1184  }
1185 
1186  VJMPERR1(Vio_scanf(sock, "%s", tok) == 1);
1187  if (tok[0]=='"') {
1188  strcpy(strnew, "");
1189  while (tok[strlen(tok)-1] != '"') {
1190  strcat(str, tok);
1191  strcat(str, " ");
1192  VJMPERR1(Vio_scanf(sock, "%s", tok) == 1);
1193  }
1194  strcat(str, tok);
1195  strncpy(strnew, str+1, strlen(str)-2);
1196  strcpy(tok, strnew);
1197  }
1198  strncpy(thee->writematstem, tok, VMAX_ARGLEN);
1199  thee->setwritemat = 1;
1200  thee->writemat = 1;
1201  return 1;
1202 
1203  VERROR1:
1204  Vnm_print(2, "parsePBE: ran out of tokens!\n");
1205  return -1;
1206 
1207 }
1208 
1209 VPUBLIC int PBEparm_parseToken(PBEparm *thee, char tok[VMAX_BUFSIZE],
1210  Vio *sock) {
1211 
1212  if (thee == VNULL) {
1213  Vnm_print(2, "parsePBE: got NULL thee!\n");
1214  return -1;
1215  }
1216  if (sock == VNULL) {
1217  Vnm_print(2, "parsePBE: got NULL socket!\n");
1218  return -1;
1219  }
1220 
1221  Vnm_print(0, "PBEparm_parseToken: trying %s...\n", tok);
1222 
1223  if (Vstring_strcasecmp(tok, "mol") == 0) {
1224  return PBEparm_parseMOL(thee, sock);
1225  } else if (Vstring_strcasecmp(tok, "lpbe") == 0) {
1226  return PBEparm_parseLPBE(thee, sock);
1227  } else if (Vstring_strcasecmp(tok, "npbe") == 0) {
1228  return PBEparm_parseNPBE(thee, sock);
1229  } else if (Vstring_strcasecmp(tok, "lrpbe") == 0) {
1230  return PBEparm_parseLRPBE(thee, sock);
1231  } else if (Vstring_strcasecmp(tok, "nrpbe") == 0) {
1232  return PBEparm_parseNRPBE(thee, sock);
1233  } else if (Vstring_strcasecmp(tok, "smpbe") == 0) {
1234  return PBEparm_parseSMPBE(thee, sock);
1235  } else if (Vstring_strcasecmp(tok, "bcfl") == 0) {
1236  return PBEparm_parseBCFL(thee, sock);
1237  } else if (Vstring_strcasecmp(tok, "ion") == 0) {
1238  return PBEparm_parseION(thee, sock);
1239  } else if (Vstring_strcasecmp(tok, "pdie") == 0) {
1240  return PBEparm_parsePDIE(thee, sock);
1241  } else if (Vstring_strcasecmp(tok, "sdens") == 0) {
1242  return PBEparm_parseSDENS(thee, sock);
1243  } else if (Vstring_strcasecmp(tok, "sdie") == 0) {
1244  return PBEparm_parseSDIE(thee, sock);
1245  } else if (Vstring_strcasecmp(tok, "srfm") == 0) {
1246  return PBEparm_parseSRFM(thee, sock);
1247  } else if (Vstring_strcasecmp(tok, "srad") == 0) {
1248  return PBEparm_parseSRAD(thee, sock);
1249  } else if (Vstring_strcasecmp(tok, "swin") == 0) {
1250  return PBEparm_parseSWIN(thee, sock);
1251  } else if (Vstring_strcasecmp(tok, "temp") == 0) {
1252  return PBEparm_parseTEMP(thee, sock);
1253  } else if (Vstring_strcasecmp(tok, "usemap") == 0) {
1254  return PBEparm_parseUSEMAP(thee, sock);
1255  } else if (Vstring_strcasecmp(tok, "calcenergy") == 0) {
1256  return PBEparm_parseCALCENERGY(thee, sock);
1257  } else if (Vstring_strcasecmp(tok, "calcforce") == 0) {
1258  return PBEparm_parseCALCFORCE(thee, sock);
1259  } else if (Vstring_strcasecmp(tok, "write") == 0) {
1260  return PBEparm_parseWRITE(thee, sock);
1261  } else if (Vstring_strcasecmp(tok, "writemat") == 0) {
1262  return PBEparm_parseWRITEMAT(thee, sock);
1263 
1264  /*----------------------------------------------------------*/
1265  /* Added by Michael Grabe */
1266  /*----------------------------------------------------------*/
1267 
1268  } else if (Vstring_strcasecmp(tok, "zmem") == 0) {
1269  return PBEparm_parseZMEM(thee, sock);
1270  } else if (Vstring_strcasecmp(tok, "Lmem") == 0) {
1271  return PBEparm_parseLMEM(thee, sock);
1272  } else if (Vstring_strcasecmp(tok, "mdie") == 0) {
1273  return PBEparm_parseMDIE(thee, sock);
1274  } else if (Vstring_strcasecmp(tok, "memv") == 0) {
1275  return PBEparm_parseMEMV(thee, sock);
1276  }
1277 
1278  /*----------------------------------------------------------*/
1279 
1280  return 0;
1281 
1282 }
Definition: vhal.h:271
int setcalcenergy
Definition: pbeparm.h:166
Definition: vhal.h:314
Definition: vhal.h:215
enum eVdata_Format Vdata_Format
Declaration of the Vdata_Format type as the Vdata_Format enum.
Definition: vhal.h:323
int potMapID
Definition: pbeparm.h:129
enum eVsurf_Meth Vsurf_Meth
Declaration of the Vsurf_Meth type as the Vsurf_Meth enum.
Definition: vhal.h:133
int useKappaMap
Definition: pbeparm.h:124
int chargeMapID
Definition: pbeparm.h:133
#define PBEPARM_MAXWRITE
Number of things that can be written out in a single calculation.
Definition: pbeparm.h:75
double Lmem
Definition: pbeparm.h:176
int setmolid
Definition: pbeparm.h:120
int setcalcforce
Definition: pbeparm.h:168
int molid
Definition: pbeparm.h:119
double smvolume
Definition: pbeparm.h:162
int setpdie
Definition: pbeparm.h:145
Vdata_Format writefmt[PBEPARM_MAXWRITE]
Definition: pbeparm.h:189
int setsdens
Definition: pbeparm.h:147
double swin
Definition: pbeparm.h:154
VPUBLIC PBEparm * PBEparm_ctor()
Construct PBEparm object.
Definition: pbeparm.c:104
Vhal_PBEType pbetype
Definition: pbeparm.h:134
VPUBLIC int PBEparm_ctor2(PBEparm *thee)
FORTRAN stub to construct PBEparm object.
Definition: pbeparm.c:115
int setbcfl
Definition: pbeparm.h:137
VPUBLIC double PBEparm_getIonRadius(PBEparm *thee, int i)
Get radius (A) of specified ion species.
Definition: pbeparm.c:77
int nion
Definition: pbeparm.h:138
int setion[MAXION]
Definition: pbeparm.h:143
Definition: vhal.h:209
Definition: pbeparm.h:82
double sdie
Definition: pbeparm.h:148
double temp
Definition: pbeparm.h:156
int writematflag
Definition: pbeparm.h:196
int setmemv
Definition: pbeparm.h:181
double sdens
Definition: pbeparm.h:146
Vsurf_Meth srfm
Definition: pbeparm.h:150
int useChargeMap
Definition: pbeparm.h:131
int setsmvolume
Definition: pbeparm.h:163
enum eVbcfl Vbcfl
Declare Vbcfl type.
Definition: vhal.h:223
Definition: pbeparm.h:98
int setsmsize
Definition: pbeparm.h:160
double ionr[MAXION]
Definition: pbeparm.h:142
double zmem
Definition: pbeparm.h:174
VPUBLIC int PBEparm_parseToken(PBEparm *thee, char tok[VMAX_BUFSIZE], Vio *sock)
Parse a keyword from an input file.
Definition: pbeparm.c:1209
Definition: vhal.h:315
int setmdie
Definition: pbeparm.h:179
Definition: vhal.h:141
Definition: vhal.h:277
int setsrad
Definition: pbeparm.h:153
Definition: vhal.h:279
#define VEMBED(rctag)
Allows embedding of RCS ID tags in object files.
Definition: vhal.h:556
VPUBLIC void PBEparm_dtor2(PBEparm *thee)
FORTRAN stub for object destructor.
Definition: pbeparm.c:181
double mdie
Definition: pbeparm.h:178
Definition: vhal.h:312
Definition: vhal.h:310
int dielMapID
Definition: pbeparm.h:123
VPUBLIC int Vstring_strcasecmp(const char *s1, const char *s2)
Case-insensitive string comparison (BSD standard)
Definition: vstring.c:66
int setzmem
Definition: pbeparm.h:175
Definition: vhal.h:103
VPUBLIC void PBEparm_copy(PBEparm *thee, PBEparm *parm)
Copy PBEparm object into thee.
Definition: pbeparm.c:283
VPUBLIC void PBEparm_dtor(PBEparm **thee)
Object destructor.
Definition: pbeparm.c:173
int setpbetype
Definition: pbeparm.h:135
double smsize
Definition: pbeparm.h:159
Definition: vhal.h:275
Definition: vhal.h:216
enum ePBEparm_calcEnergy PBEparm_calcEnergy
Define ePBEparm_calcEnergy enumeration as PBEparm_calcEnergy.
Definition: pbeparm.h:91
VPUBLIC int PBEparm_check(PBEparm *thee)
Consistency check for parameter values stored in object.
Definition: pbeparm.c:183
PBEparm_calcEnergy calcenergy
Definition: pbeparm.h:165
Definition: vhal.h:273
Definition: vhal.h:311
Contains declarations for class PBEparm.
int setsdie
Definition: pbeparm.h:149
double ionc[MAXION]
Definition: pbeparm.h:141
Parameter structure for PBE variables from input files.
Definition: pbeparm.h:117
Definition: vhal.h:211
Definition: vhal.h:140
int setswin
Definition: pbeparm.h:155
int settemp
Definition: pbeparm.h:157
PBEparm_calcForce calcforce
Definition: pbeparm.h:167
Vbcfl bcfl
Definition: pbeparm.h:136
double pdie
Definition: pbeparm.h:144
double ionq[MAXION]
Definition: pbeparm.h:140
Definition: vhal.h:281
int useDielMap
Definition: pbeparm.h:121
double memv
Definition: pbeparm.h:180
int setnion
Definition: pbeparm.h:139
enum eVdata_Type Vdata_Type
Declaration of the Vdata_Type type as the Vdata_Type enum.
Definition: vhal.h:302
int kappaMapID
Definition: pbeparm.h:126
char writematstem[VMAX_ARGLEN]
Definition: pbeparm.h:195
double srad
Definition: pbeparm.h:152
enum ePBEparm_calcForce PBEparm_calcForce
Define ePBEparm_calcForce enumeration as PBEparm_calcForce.
Definition: pbeparm.h:107
VPUBLIC double PBEparm_getIonCharge(PBEparm *thee, int i)
Get charge (e) of specified ion species.
Definition: pbeparm.c:65
int writemat
Definition: pbeparm.h:191
Vdata_Type writetype[PBEPARM_MAXWRITE]
Definition: pbeparm.h:188
#define MAXION
The maximum number of ion species that can be involved in a single PBE calculation.
Definition: vhal.h:377
int numwrite
Definition: pbeparm.h:185
int usePotMap
Definition: pbeparm.h:127
char writestem[PBEPARM_MAXWRITE][VMAX_ARGLEN]
Definition: pbeparm.h:186
int parsed
Definition: pbeparm.h:201
VPUBLIC double PBEparm_getIonConc(PBEparm *thee, int i)
Get concentration (M) of specified ion species.
Definition: pbeparm.c:71
int setwritemat
Definition: pbeparm.h:194
int setsrfm
Definition: pbeparm.h:151
int setLmem
Definition: pbeparm.h:177