| 1 |
|
#include <algorithm> |
| 2 |
< |
#include <cstdlib> |
| 2 |
> |
#include <stdlib.h> |
| 3 |
|
#include <iostream> |
| 4 |
< |
#include <cmath> |
| 4 |
> |
#include <math.h> |
| 5 |
|
#include <string> |
| 6 |
|
#include <sprng.h> |
| 7 |
– |
|
| 7 |
|
#include "SimSetup.hpp" |
| 8 |
|
#include "ReadWrite.hpp" |
| 9 |
|
#include "parse_me.h" |
| 31 |
|
using namespace std; |
| 32 |
|
|
| 33 |
|
SimSetup::SimSetup(){ |
| 34 |
+ |
|
| 35 |
+ |
initSuspend = false; |
| 36 |
|
isInfoArray = 0; |
| 37 |
|
nInfo = 1; |
| 38 |
|
|
| 55 |
|
info = the_info; |
| 56 |
|
nInfo = theNinfo; |
| 57 |
|
isInfoArray = 1; |
| 58 |
+ |
initSuspend = true; |
| 59 |
|
} |
| 60 |
|
|
| 61 |
|
|
| 103 |
|
|
| 104 |
|
sysObjectsCreation(); |
| 105 |
|
|
| 104 |
– |
// check on the post processing info |
| 105 |
– |
|
| 106 |
– |
finalInfoCheck(); |
| 107 |
– |
|
| 106 |
|
// initialize the system coordinates |
| 107 |
|
|
| 108 |
< |
if (!isInfoArray){ |
| 108 |
> |
if ( !initSuspend ){ |
| 109 |
|
initSystemCoords(); |
| 110 |
|
|
| 111 |
|
if( !(globals->getUseInitTime()) ) |
| 112 |
|
info[0].currentTime = 0.0; |
| 113 |
|
} |
| 114 |
|
|
| 115 |
+ |
// check on the post processing info |
| 116 |
+ |
|
| 117 |
+ |
finalInfoCheck(); |
| 118 |
+ |
|
| 119 |
|
// make the output filenames |
| 120 |
|
|
| 121 |
|
makeOutNames(); |
| 696 |
|
} |
| 697 |
|
|
| 698 |
|
// check for the temperature set flag |
| 699 |
< |
|
| 699 |
> |
|
| 700 |
|
if (globals->haveTempSet()) |
| 701 |
|
info[i].setTemp = globals->getTempSet(); |
| 702 |
< |
|
| 703 |
< |
// get some of the tricky things that may still be in the globals |
| 704 |
< |
|
| 703 |
< |
double boxVector[3]; |
| 704 |
< |
if (globals->haveBox()){ |
| 705 |
< |
boxVector[0] = globals->getBox(); |
| 706 |
< |
boxVector[1] = globals->getBox(); |
| 707 |
< |
boxVector[2] = globals->getBox(); |
| 708 |
< |
|
| 709 |
< |
info[i].setBox(boxVector); |
| 710 |
< |
} |
| 711 |
< |
else if (globals->haveDensity()){ |
| 712 |
< |
double vol; |
| 713 |
< |
vol = (double) tot_nmol / globals->getDensity(); |
| 714 |
< |
boxVector[0] = pow(vol, (1.0 / 3.0)); |
| 715 |
< |
boxVector[1] = boxVector[0]; |
| 716 |
< |
boxVector[2] = boxVector[0]; |
| 717 |
< |
|
| 718 |
< |
info[i].setBox(boxVector); |
| 719 |
< |
} |
| 720 |
< |
else{ |
| 721 |
< |
if (!globals->haveBoxX()){ |
| 722 |
< |
sprintf(painCave.errMsg, |
| 723 |
< |
"SimSetup error, no periodic BoxX size given.\n"); |
| 724 |
< |
painCave.isFatal = 1; |
| 725 |
< |
simError(); |
| 726 |
< |
} |
| 727 |
< |
boxVector[0] = globals->getBoxX(); |
| 728 |
< |
|
| 729 |
< |
if (!globals->haveBoxY()){ |
| 730 |
< |
sprintf(painCave.errMsg, |
| 731 |
< |
"SimSetup error, no periodic BoxY size given.\n"); |
| 732 |
< |
painCave.isFatal = 1; |
| 733 |
< |
simError(); |
| 734 |
< |
} |
| 735 |
< |
boxVector[1] = globals->getBoxY(); |
| 736 |
< |
|
| 737 |
< |
if (!globals->haveBoxZ()){ |
| 738 |
< |
sprintf(painCave.errMsg, |
| 739 |
< |
"SimSetup error, no periodic BoxZ size given.\n"); |
| 740 |
< |
painCave.isFatal = 1; |
| 741 |
< |
simError(); |
| 742 |
< |
} |
| 743 |
< |
boxVector[2] = globals->getBoxZ(); |
| 744 |
< |
|
| 745 |
< |
info[i].setBox(boxVector); |
| 746 |
< |
} |
| 747 |
< |
} |
| 748 |
< |
|
| 702 |
> |
|
| 703 |
> |
} |
| 704 |
> |
|
| 705 |
|
//setup seed for random number generator |
| 706 |
|
int seedValue; |
| 707 |
|
|
| 805 |
|
theEst = globals->getEST(); |
| 806 |
|
} |
| 807 |
|
|
| 808 |
< |
info[i].setEcr(theEcr, theEst); |
| 808 |
> |
info[i].setDefaultEcr(theEcr, theEst); |
| 809 |
|
|
| 810 |
|
if (!globals->haveDielectric()){ |
| 811 |
|
sprintf(painCave.errMsg, |
| 850 |
|
theEst = globals->getEST(); |
| 851 |
|
} |
| 852 |
|
|
| 853 |
< |
info[i].setEcr(theEcr, theEst); |
| 853 |
> |
info[i].setDefaultEcr(theEcr, theEst); |
| 854 |
|
} |
| 855 |
|
} |
| 856 |
|
} |