61#if !defined(VINLINE_MGPARM)
71 VASSERT( thee != VNULL);
92 thee->setrandorient = 0;
95 thee->pbcboxlen = 1e15;
99 printf(
"Found a pts flag in ctor: %d\n", thee->gridpt);
102 thee->setgrid2Dname = 0;
110 thee->settermcombine = 0;
117 for (i = 0; i<PBAMPARM_MAXMOL; i++) thee->xyzct[i] = 0;
123 if ((*thee) != VNULL) {
125 Vmem_free(VNULL, 1,
sizeof(
PBAMparm), (
void **)thee);
138 Vnm_print(0,
"PBAMparm_check: checking PBAMparm object of type %d.\n",
143 Vnm_print(2,
"PBAMparm_check: not filled!\n");
150 Vnm_print(2,
"PBAMparm_check: type not set");
159 VASSERT(thee != VNULL);
160 VASSERT(parm != VNULL);
165 thee->salt = parm->salt;
166 thee->setsalt = parm->setsalt;
167 for (i=0; i<
CHR_MAXLEN; i++) thee->runtype[i] = parm->runtype[i];
168 thee->setruntype = parm->setruntype;
170 for (i=0; i<
CHR_MAXLEN; i++) thee->runname[i] = parm->runname[i];
171 thee->setrunname = parm->setrunname;
173 thee->setrandorient = parm->setrandorient;
175 thee->setpbcs = parm->setpbcs;
176 thee->pbcboxlen = parm->pbcboxlen;
178 for (i=0; i<
CHR_MAXLEN; i++) thee->units[i] = parm->units[i];
179 thee->setunits = parm->setunits;
182 thee->gridpt = parm->gridpt;
183 thee->setgridpt = parm->setgridpt;
184 for (i=0; i<
CHR_MAXLEN; i++) thee->map3dname[i] = parm->map3dname[i];
185 thee->set3dmap = parm->set3dmap;
188 thee->grid2Dct = parm->grid2Dct;
189 for (i=0; i<PBAMPARM_MAXWRITE; i++)
193 thee->grid2Dname[i][j] = parm->grid2Dname[i][j];
194 thee->grid2Dax[i][j] = parm->grid2Dax[i][j];
196 thee->grid2Dloc[i] = parm->grid2Dloc[i];
199 for (i=0; i<
CHR_MAXLEN; i++) thee->dxname[i] = parm->dxname[i];
200 thee->setdxname = parm->setdxname;
203 thee->ntraj = parm->ntraj;
204 thee->setntraj = parm->setntraj;
206 for (i=0; i<
CHR_MAXLEN; i++) thee->termcombine[i] = parm->termcombine[i];
207 thee->settermcombine = parm->settermcombine;
209 thee->diffct = parm->diffct;
211 for (i=0; i<PBAMPARM_MAXMOL; i++)
215 thee->moveType[i][j] = parm->moveType[i][j];
217 thee->transDiff[i] = parm->transDiff[i];
218 thee->rotDiff[i] = parm->rotDiff[i];
221 thee->termct = parm->termct;
222 thee->setterm = parm->setterm;
223 thee->confilct = parm->confilct;
225 for (i=0; i<PBAMPARM_MAXWRITE; i++)
229 thee->termnam[i][j] = parm->termnam[i][j];
230 thee->confil[i][j] = parm->confil[i][j];
232 thee->termVal[i] = parm->termVal[i];
233 thee->termnu[i][0] = parm->termnu[i][0];
236 thee->setxyz = parm->setxyz;
237 for (i = 0; i<PBAMPARM_MAXMOL; i++)
239 thee->xyzct[i] = parm->xyzct[i];
240 for (j = 0; j<PBAMPARM_MAXWRITE; j++)
244 thee->xyzfil[i][j][k] = parm->xyzfil[i][j][k];
253 const char* name =
"salt";
254 char tok[VMAX_BUFSIZE];
256 if(Vio_scanf(sock,
"%s", tok) == 0) {
257 Vnm_print(2,
"parsePBAM: ran out of tokens on %s!\n", name);
261 if (sscanf(tok,
"%lf", &tf) == 0){
262 Vnm_print(2,
"NOsh: Read non-float (%s) while parsing %s keyword!\n", tok, name);
272 const char* name =
"runtype";
273 char tok[VMAX_BUFSIZE];
275 if(Vio_scanf(sock,
"%s", tok) == 0) {
276 Vnm_print(2,
"parsePBAM: ran out of tokens on %s!\n", name);
279 Vnm_print(2,
"parsePBAM: Dynamics has been moved out of the ELEC section!\n");
290 const char* name =
"runname";
291 char tok[VMAX_BUFSIZE];
293 if(Vio_scanf(sock,
"%s", tok) == 0) {
294 Vnm_print(2,
"parsePBAM: ran out of tokens on %s!\n", name);
305 const char* name =
"randorient";
306 thee->setrandorient=1;
311 const char* name =
"pbc";
312 char tok[VMAX_BUFSIZE];
315 if(Vio_scanf(sock,
"%s", tok) == 0) {
316 Vnm_print(2,
"parsePBAM: ran out of tokens on %s!\n", name);
320 if (sscanf(tok,
"%d", &td) == 0) {
321 Vnm_print(2,
"parsePBAM: Read non-int (%s) while parsing pbc keyword!\n", tok);
327 if (sscanf(tok,
"%lf", &tf) == 0){
328 Vnm_print(2,
"NOsh: Read non-float (%s) while parsing %s keyword!\n", tok, name);
331 thee->pbcboxlen = tf;
337 const char* name =
"units";
338 char tok[VMAX_BUFSIZE];
340 if(Vio_scanf(sock,
"%s", tok) == 0) {
341 Vnm_print(2,
"parsePBAM: ran out of tokens on %s!\n", name);
352 const char* name =
"dime";
353 char tok[VMAX_BUFSIZE];
355 if(Vio_scanf(sock,
"%s", tok) == 0) {
356 Vnm_print(2,
"parsePBAM: ran out of tokens on %s!\n", name);
360 if (sscanf(tok,
"%d", &td) == 0){
361 Vnm_print(2,
"NOsh: Read non-integer (%s) while parsing %s keyword!\n", tok, name);
364 printf(
"Found a dime flag in parse: %d\n", td);
372 const char* name =
"3dmap";
373 char tok[VMAX_BUFSIZE];
375 Vnm_print(2,
"PBAM: 3dmap keyword has been deprecated! Please use in conjuction with the write keyword.");
392 const char* name =
"grid2d";
393 char tok[VMAX_BUFSIZE];
396 if(Vio_scanf(sock,
"%s", tok) == 0) {
397 Vnm_print(2,
"parsePBAM: ran out of tokens on %s!\n", name);
400 strncpy(thee->grid2Dname[thee->grid2Dct], tok,
CHR_MAXLEN);
401 thee->setgrid2Dname=1;
404 if(Vio_scanf(sock,
"%s", tok) == 0) {
405 Vnm_print(2,
"parsePBAM: ran out of tokens on %s!\n", name);
408 strncpy(thee->grid2Dax[thee->grid2Dct], tok,
CHR_MAXLEN);
411 if(Vio_scanf(sock,
"%s", tok) == 0) {
412 Vnm_print(2,
"parsePBAM: ran out of tokens on %s!\n", name);
416 if (sscanf(tok,
"%lf", &tf) == 0){
417 Vnm_print(2,
"NOsh: Read non-float (%s) while parsing %s keyword!\n", tok, name);
420 thee->grid2Dloc[thee->grid2Dct] = tf;
421 thee->grid2Dct = thee->grid2Dct+1;
427 Vnm_print(2,
"PBAM's dx keyword is deprecated. Please use the write keyword!\n");
445 const char* name =
"termcombine";
446 char tok[VMAX_BUFSIZE];
448 if(Vio_scanf(sock,
"%s", tok) == 0) {
449 Vnm_print(2,
"parsePBAM: ran out of tokens on %s!\n", name);
453 thee->settermcombine=1;
458VPRIVATE Vrc_Codes PBAMparm_parseNtraj(
PBAMparm *thee, Vio *sock){
459 const char* name =
"ntraj";
460 char tok[VMAX_BUFSIZE];
462 if(Vio_scanf(sock,
"%s", tok) == 0) {
463 Vnm_print(2,
"parsePBAM: ran out of tokens on %s!\n", name);
467 if (sscanf(tok,
"%d", &td) == 0){
468 Vnm_print(2,
"NOsh: Read non-integer (%s) while parsing %s keyword!\n", tok, name);
478 const char* name =
"diff";
479 char tok[VMAX_BUFSIZE];
483 if(Vio_scanf(sock,
"%s", tok) == 0) {
484 Vnm_print(2,
"parsePBAM: ran out of tokens on %s!\n", name);
489 if (sscanf(tok,
"%d", &molind) == 0){
490 Vnm_print(2,
"NOsh: Read non-int (%s) while parsing %s keyword!\n", tok, name);
496 if(Vio_scanf(sock,
"%s", tok) == 0) {
497 Vnm_print(2,
"parsePBAM: ran out of tokens on %s!\n", name);
500 strncpy(thee->moveType[molind], tok,
CHR_MAXLEN);
504 if (strncmp(thee->moveType[molind],
"move", 4) == 0)
506 if(Vio_scanf(sock,
"%s", tok) == 0) {
507 Vnm_print(2,
"parsePBAM: ran out of tokens on %s!\n", name);
510 if (sscanf(tok,
"%lf", &tf) == 0){
511 Vnm_print(2,
"NOsh: Read non-float (%s) while parsing %s keyword!\n", tok, name);
514 thee->transDiff[molind] = tf;
518 if(Vio_scanf(sock,
"%s", tok) == 0) {
519 Vnm_print(2,
"parsePBAM: ran out of tokens on %s!\n", name);
522 if (sscanf(tok,
"%lf", &tf) == 0){
523 Vnm_print(2,
"NOsh: Read non-float (%s) while parsing %s keyword!\n", tok, name);
526 thee->rotDiff[molind] = tf;
528 }
else if (strncmp(thee->moveType[molind],
"rot", 3) == 0)
530 if(Vio_scanf(sock,
"%s", tok) == 0) {
531 Vnm_print(2,
"parsePBAM: ran out of tokens on %s!\n", name);
534 if (sscanf(tok,
"%lf", &tf) == 0){
535 Vnm_print(2,
"NOsh: Read non-float (%s) while parsing %s keyword!\n", tok, name);
538 thee->rotDiff[molind] = tf;
539 thee->transDiff[molind] = 0.0;
542 thee->transDiff[molind] = 0.0;
543 thee->rotDiff[molind] = 0.0;
549VPRIVATE Vrc_Codes PBAMparm_parseTerm(
PBAMparm *thee, Vio *sock){
550 const char* name =
"term";
551 char tok[VMAX_BUFSIZE];
556 if(Vio_scanf(sock,
"%s", tok) == 0) {
557 Vnm_print(2,
"parsePBAM: ran out of tokens on %s!\n", name);
560 if(strncmp(tok,
"position", 8)==0){
561 return PBAMparm_parseTerm(thee, sock);
563 strncpy(thee->termnam[thee->termct], tok,
CHR_MAXLEN);
567 if (strncmp(thee->termnam[thee->termct],
"contact", 7) == 0)
569 if(Vio_scanf(sock,
"%s", tok) == 0) {
570 Vnm_print(2,
"parsePBAM: ran out of tokens on %s!\n", name);
573 strncpy(thee->confil[thee->confilct], tok,
CHR_MAXLEN);
576 if(Vio_scanf(sock,
"%s", tok) == 0) {
577 Vnm_print(2,
"parsePBAM: ran out of tokens on %s!\n", name);
580 if (sscanf(tok,
"%lf", &tf) == 0){
581 Vnm_print(2,
"NOsh: Read non-float (%s) while parsing %s keyword!\n", tok, name);
585 thee->termVal[thee->termct] = tf;
586 thee->termnu[thee->termct][0] = 0;
589 }
else if (strncmp(thee->termnam[thee->termct],
"time", 4) == 0)
591 if(Vio_scanf(sock,
"%s", tok) == 0) {
592 Vnm_print(2,
"parsePBAM: ran out of tokens on %s!\n", name);
595 if (sscanf(tok,
"%lf", &tf) == 0){
596 Vnm_print(2,
"NOsh: Read non-float (%s) while parsing %s keyword!\n", tok, name);
599 thee->termVal[thee->termct] = tf;
600 thee->termnu[thee->termct][0] = 0;
604 if(Vio_scanf(sock,
"%s", tok) == 0) {
605 Vnm_print(2,
"parsePBAM: ran out of tokens on %s!\n", name);
608 if (sscanf(tok,
"%lf", &tf) == 0){
609 Vnm_print(2,
"NOsh: Read non-float (%s) while parsing %s keyword!\n", tok, name);
612 thee->termVal[thee->termct] = tf;
615 if(Vio_scanf(sock,
"%s", tok) == 0) {
616 Vnm_print(2,
"parsePBAM: ran out of tokens on %s!\n", name);
619 if (sscanf(tok,
"%d", &td) == 0){
620 Vnm_print(2,
"NOsh: Read non-float (%s) while parsing %s keyword!\n", tok, name);
623 thee->termnu[thee->termct][0] = td-1;
633 const char* name =
"xyz";
634 char tok[VMAX_BUFSIZE];
637 if(Vio_scanf(sock,
"%s", tok) == 0) {
638 Vnm_print(2,
"parsePBAM: ran out of tokens on %s!\n", name);
643 if (sscanf(tok,
"%d", &td) == 0){
644 Vnm_print(2,
"NOsh: Read non-int (%s) while parsing %s keyword!\n", tok, name);
647 printf(
"This is my mol in parseXYZ: %d", td);
652 if(Vio_scanf(sock,
"%s", tok) == 0) {
653 Vnm_print(2,
"parsePBAM: ran out of tokens on %s!\n", name);
656 strncpy(thee->xyzfil[mol][thee->xyzct[mol]], tok,
CHR_MAXLEN);
657 thee->xyzct[mol] += 1;
666 Vnm_print(2,
"parsePBAM: got NULL thee!\n");
670 Vnm_print(2,
"parsePBAM: got NULL socket!\n");
674 Vnm_print(0,
"PBAMparm_parseToken: trying %s...\n", tok);
704 return PBAMparm_parseNtraj(thee, sock);
710 return PBAMparm_parseTerm(thee, sock);
VPRIVATE Vrc_Codes PBAMparm_parse3Dmap(PBAMparm *thee, Vio *sock)
Find 3D map filename and save it.
VPUBLIC void PBAMparm_dtor2(PBAMparm *thee)
FORTRAN stub for object destructor ?????????!!!!!!!!!!!!
enum ePBAMparm_CalcType PBAMparm_CalcType
Declare PBAMparm_CalcType type.
VPUBLIC void PBAMparm_copy(PBAMparm *thee, PBAMparm *parm)
copy PBAMparm object int thee.
VPRIVATE Vrc_Codes PBAMparm_parseDX(PBAMparm *thee, Vio *sock)
Find DX filename and save it.
VPUBLIC void PBAMparm_dtor(PBAMparm **thee)
Object destructor.
VPUBLIC Vrc_Codes PBAMparm_ctor2(PBAMparm *thee, PBAMparm_CalcType type)
FORTRAN stub to construct PBAMparm object ?????????!!!!!!!
VPRIVATE Vrc_Codes PBAMparm_parsePBCS(PBAMparm *thee, Vio *sock)
Find PBC flag and save the type and the boxlength.
VPRIVATE Vrc_Codes PBAMparm_parseTermcombine(PBAMparm *thee, Vio *sock)
Find Termination logic and save it.
VPRIVATE Vrc_Codes PBAMparm_parseGridPts(PBAMparm *thee, Vio *sock)
Find Grid points and save them.
VPUBLIC Vrc_Codes PBAMparm_check(PBAMparm *thee)
Consistency check for parameter values stored in object.
VPRIVATE Vrc_Codes PBAMparm_parseSalt(PBAMparm *thee, Vio *sock)
Find salt conc and save it as a structure variable.
VPUBLIC PBAMparm * PBAMparm_ctor(PBAMparm_CalcType type)
Construct PBAMparm object.
#define CHR_MAXLEN
Number of things that can be written out in a single calculation.
VPRIVATE Vrc_Codes PBAMparm_parseGrid2D(PBAMparm *thee, Vio *sock)
Find 2D grid filename and save it.
VPRIVATE Vrc_Codes PBAMparm_parseXYZ(PBAMparm *thee, Vio *sock)
Find xyz files for each molecule for each traj and save them.
VPRIVATE Vrc_Codes PBAMparm_parseDiff(PBAMparm *thee, Vio *sock)
Find diffusion coeffs for each molecule and save them.
VPUBLIC Vrc_Codes PBAMparm_parseToken(PBAMparm *thee, char tok[VMAX_BUFSIZE], Vio *sock)
Parse an MG keyword from an input file.
VPRIVATE Vrc_Codes PBAMparm_parseRunType(PBAMparm *thee, Vio *sock)
Find runType and save it as a structure variable.
VPRIVATE Vrc_Codes PBAMparm_parseRunName(PBAMparm *thee, Vio *sock)
Find runName and save it as a structure variable.
VPRIVATE Vrc_Codes PBAMparm_parseRandorient(PBAMparm *thee, Vio *sock)
Find randomorientation flag and save it as a boolean.
VPRIVATE Vrc_Codes PBAMparm_parseUnits(PBAMparm *thee, Vio *sock)
Find units flag and save units.
#define VEMBED(rctag)
Allows embedding of RCS ID tags in object files.
VPUBLIC int Vstring_strcasecmp(const char *s1, const char *s2)
Case-insensitive string comparison (BSD standard)
Contains declarations for class PBAMparm.
Parameter structure for PBAM-specific variables from input files.