| 16 |
|
|
| 17 |
|
#define NVE_ENS 0 |
| 18 |
|
#define NVT_ENS 1 |
| 19 |
< |
#define NPT_ENS 2 |
| 19 |
> |
#define NPTi_ENS 2 |
| 20 |
> |
#define NPTf_ENS 3 |
| 21 |
|
|
| 22 |
|
#define FF_DUFF 0 |
| 23 |
|
#define FF_LJ 1 |
| 113 |
|
|
| 114 |
|
if( !strcasecmp( ensemble, "NVE" )) ensembleCase = NVE_ENS; |
| 115 |
|
else if( !strcasecmp( ensemble, "NVT" )) ensembleCase = NVT_ENS; |
| 116 |
< |
else if( !strcasecmp( ensemble, "NPT" )) ensembleCase = NPT_ENS; |
| 116 |
> |
else if( !strcasecmp( ensemble, "NPTi" ) || !strcasecmp( ensemble, "NPT") ) |
| 117 |
> |
ensembleCase = NPTi_ENS; |
| 118 |
> |
else if( !strcasecmp( ensemble, "NPTf" )) ensembleCase = NPTf_ENS; |
| 119 |
|
else{ |
| 120 |
|
sprintf( painCave.errMsg, |
| 121 |
|
"SimSetup Warning. Unrecognized Ensemble -> %s, " |
| 482 |
|
|
| 483 |
|
// get some of the tricky things that may still be in the globals |
| 484 |
|
|
| 485 |
< |
|
| 485 |
> |
double boxVector[3]; |
| 486 |
|
if( the_globals->haveBox() ){ |
| 487 |
< |
simnfo->box_x = the_globals->getBox(); |
| 488 |
< |
simnfo->box_y = the_globals->getBox(); |
| 489 |
< |
simnfo->box_z = the_globals->getBox(); |
| 487 |
> |
boxVector[0] = the_globals->getBox(); |
| 488 |
> |
boxVector[1] = the_globals->getBox(); |
| 489 |
> |
boxVector[2] = the_globals->getBox(); |
| 490 |
> |
|
| 491 |
> |
simnfo->setBox( boxVector ); |
| 492 |
|
} |
| 493 |
|
else if( the_globals->haveDensity() ){ |
| 494 |
|
|
| 495 |
|
double vol; |
| 496 |
|
vol = (double)tot_nmol / the_globals->getDensity(); |
| 497 |
< |
simnfo->box_x = pow( vol, ( 1.0 / 3.0 ) ); |
| 498 |
< |
simnfo->box_y = simnfo->box_x; |
| 499 |
< |
simnfo->box_z = simnfo->box_x; |
| 497 |
> |
boxVector[0] = pow( vol, ( 1.0 / 3.0 ) ); |
| 498 |
> |
boxVector[1] = boxVector[0]; |
| 499 |
> |
boxVector[2] = boxVector[0]; |
| 500 |
> |
|
| 501 |
> |
simnfo->setBox( boxVector ); |
| 502 |
|
} |
| 503 |
|
else{ |
| 504 |
|
if( !the_globals->haveBoxX() ){ |
| 507 |
|
painCave.isFatal = 1; |
| 508 |
|
simError(); |
| 509 |
|
} |
| 510 |
< |
simnfo->box_x = the_globals->getBoxX(); |
| 510 |
> |
boxVector[0] = the_globals->getBoxX(); |
| 511 |
|
|
| 512 |
|
if( !the_globals->haveBoxY() ){ |
| 513 |
|
sprintf( painCave.errMsg, |
| 515 |
|
painCave.isFatal = 1; |
| 516 |
|
simError(); |
| 517 |
|
} |
| 518 |
< |
simnfo->box_y = the_globals->getBoxY(); |
| 518 |
> |
boxVector[1] = the_globals->getBoxY(); |
| 519 |
|
|
| 520 |
|
if( !the_globals->haveBoxZ() ){ |
| 521 |
|
sprintf( painCave.errMsg, |
| 523 |
|
painCave.isFatal = 1; |
| 524 |
|
simError(); |
| 525 |
|
} |
| 526 |
< |
simnfo->box_z = the_globals->getBoxZ(); |
| 526 |
> |
boxVector[2] = the_globals->getBoxZ(); |
| 527 |
> |
|
| 528 |
> |
simnfo->setBox( boxVector ); |
| 529 |
|
} |
| 530 |
|
|
| 531 |
|
#ifdef IS_MPI |
| 555 |
|
painCave.isFatal = 0; |
| 556 |
|
simError(); |
| 557 |
|
double smallest; |
| 558 |
< |
smallest = simnfo->box_x; |
| 559 |
< |
if (simnfo->box_y <= smallest) smallest = simnfo->box_y; |
| 560 |
< |
if (simnfo->box_z <= smallest) smallest = simnfo->box_z; |
| 558 |
> |
smallest = simnfo->boxLx; |
| 559 |
> |
if (simnfo->boxLy <= smallest) smallest = simnfo->boxLy; |
| 560 |
> |
if (simnfo->boxLz <= smallest) smallest = simnfo->boxLz; |
| 561 |
|
simnfo->ecr = 0.5 * smallest; |
| 562 |
|
} else { |
| 563 |
|
simnfo->ecr = the_globals->getECR(); |
| 595 |
|
painCave.isFatal = 0; |
| 596 |
|
simError(); |
| 597 |
|
double smallest; |
| 598 |
< |
smallest = simnfo->box_x; |
| 599 |
< |
if (simnfo->box_y <= smallest) smallest = simnfo->box_y; |
| 600 |
< |
if (simnfo->box_z <= smallest) smallest = simnfo->box_z; |
| 598 |
> |
smallest = simnfo->boxLx; |
| 599 |
> |
if (simnfo->boxLy <= smallest) smallest = simnfo->boxLy; |
| 600 |
> |
if (simnfo->boxLz <= smallest) smallest = simnfo->boxLz; |
| 601 |
|
simnfo->ecr = 0.5 * smallest; |
| 602 |
|
} else { |
| 603 |
|
simnfo->ecr = the_globals->getECR(); |
| 1124 |
|
have_extra =1; |
| 1125 |
|
|
| 1126 |
|
n_cells = (int)temp3 - 1; |
| 1127 |
< |
cellx = simnfo->box_x / temp3; |
| 1128 |
< |
celly = simnfo->box_y / temp3; |
| 1129 |
< |
cellz = simnfo->box_z / temp3; |
| 1127 |
> |
cellx = simnfo->boxLx / temp3; |
| 1128 |
> |
celly = simnfo->boxLy / temp3; |
| 1129 |
> |
cellz = simnfo->boxLz / temp3; |
| 1130 |
|
n_extra = tot_nmol - ( 4 * n_cells * n_cells * n_cells ); |
| 1131 |
|
temp1 = ((double)n_extra) / ( pow( temp3, 3.0 ) - pow( n_cells, 3.0 ) ); |
| 1132 |
|
n_per_extra = (int)ceil( temp1 ); |
| 1141 |
|
} |
| 1142 |
|
else{ |
| 1143 |
|
n_cells = (int)temp3; |
| 1144 |
< |
cellx = simnfo->box_x / temp3; |
| 1145 |
< |
celly = simnfo->box_y / temp3; |
| 1146 |
< |
cellz = simnfo->box_z / temp3; |
| 1144 |
> |
cellx = simnfo->boxLx / temp3; |
| 1145 |
> |
celly = simnfo->boxLy / temp3; |
| 1146 |
> |
cellz = simnfo->boxLz / temp3; |
| 1147 |
|
} |
| 1148 |
|
|
| 1149 |
|
current_mol = 0; |