# | Line 98 | Line 98 | void SimSetup::createSim(void){ | |
---|---|---|
98 | ||
99 | // gather all of the information from the Bass file | |
100 | ||
101 | – | std::cerr << "gathering info\n"; |
102 | – | |
101 | gatherInfo(); | |
102 | ||
103 | // creation of complex system objects | |
104 | ||
107 | – | std::cerr << "creating system objects\n"; |
108 | – | |
105 | sysObjectsCreation(); | |
106 | ||
107 | // check on the post processing info | |
112 | – | |
113 | – | std::cerr << "performing final info check.\n"; |
108 | ||
109 | finalInfoCheck(); | |
110 | ||
111 | // initialize the system coordinates | |
118 | – | |
119 | – | std::cerr << "about to init coords\n"; |
112 | ||
113 | if( !isInfoArray ) initSystemCoords(); | |
114 | ||
# | Line 899 | Line 891 | void SimSetup::initSystemCoords( void ){ | |
891 | ||
892 | char* inName; | |
893 | ||
902 | – | std::cerr << "Setting atom Coords\n"; |
894 | ||
895 | (info[0].getConfiguration())->createArrays( info[0].n_atoms ); | |
896 | ||
# | Line 912 | Line 903 | void SimSetup::initSystemCoords( void ){ | |
903 | if( worldRank == 0 ){ | |
904 | #endif //is_mpi | |
905 | inName = globals->getInitialConfig(); | |
906 | + | double* tempDouble = new double[1000000]; |
907 | fileInit = new InitializeFromFile( inName ); | |
908 | #ifdef IS_MPI | |
909 | }else fileInit = new InitializeFromFile( NULL ); | |
# | Line 1620 | Line 1612 | void SimSetup::setupZConstraint(SimInfo& theInfo) | |
1612 | " , you must set sample time.\n"); | |
1613 | painCave.isFatal = 1; | |
1614 | simError(); | |
1623 | – | } |
1624 | – | |
1625 | – | // |
1626 | – | nZConstraints = globals->getNzConstraints(); |
1627 | – | zconStamp = globals->getZconStamp(); |
1628 | – | ZConsParaItem tempParaItem; |
1629 | – | |
1630 | – | ZConsParaData* zconsParaData = new ZConsParaData(); |
1631 | – | zconsParaData->setID(ZCONSPARADATA_ID); |
1632 | – | |
1633 | – | for(int i = 0; i < nZConstraints; i++){ |
1634 | – | tempParaItem.havingZPos = zconStamp[i]->haveZpos(); |
1635 | – | tempParaItem.zPos = zconStamp[i]->getZpos(); |
1636 | – | tempParaItem.zconsIndex = zconStamp[i]->getMolIndex(); |
1637 | – | tempParaItem.kRatio = zconStamp[i]->getKratio(); |
1638 | – | |
1639 | – | zconsParaData->addItem(tempParaItem); |
1615 | } | |
1616 | ||
1642 | – | //sort the parameters by index of molecules |
1643 | – | zconsParaData->sortByIndex(); |
1644 | – | |
1645 | – | //push data into siminfo, therefore, we can retrieve later |
1646 | – | theInfo.addProperty(zconsParaData); |
1647 | – | |
1617 | //push zconsTol into siminfo, if user does not specify | |
1618 | //value for zconsTol, a default value will be used | |
1619 | DoubleData* zconsTol = new DoubleData(); | |
# | Line 1653 | Line 1622 | void SimSetup::setupZConstraint(SimInfo& theInfo) | |
1622 | zconsTol->setData(globals->getZconsTol()); | |
1623 | } | |
1624 | else{ | |
1625 | < | double defaultZConsTol = 1E-6; |
1625 | > | double defaultZConsTol = 0.01; |
1626 | sprintf( painCave.errMsg, | |
1627 | "ZConstraint Waring: Tolerance for z-constraint methodl is not specified\n" | |
1628 | " , default value %f is used.\n", defaultZConsTol); | |
# | Line 1663 | Line 1632 | void SimSetup::setupZConstraint(SimInfo& theInfo) | |
1632 | zconsTol->setData(defaultZConsTol); | |
1633 | } | |
1634 | theInfo.addProperty(zconsTol); | |
1635 | + | |
1636 | + | //set Force Substraction Policy |
1637 | + | StringData* zconsForcePolicy = new StringData(); |
1638 | + | zconsForcePolicy->setID(ZCONSFORCEPOLICY_ID); |
1639 | + | |
1640 | + | if(globals->haveZconsForcePolicy()){ |
1641 | + | zconsForcePolicy->setData(globals->getZconsForcePolicy()); |
1642 | + | } |
1643 | + | else{ |
1644 | + | sprintf( painCave.errMsg, |
1645 | + | "ZConstraint Warning: User does not set force substraction policy, " |
1646 | + | "average force substraction policy is used\n"); |
1647 | + | painCave.isFatal = 0; |
1648 | + | simError(); |
1649 | + | zconsForcePolicy->setData("BYNUMBER"); |
1650 | + | } |
1651 | ||
1652 | + | theInfo.addProperty(zconsForcePolicy); |
1653 | + | |
1654 | //Determine the name of ouput file and add it into SimInfo's property list | |
1655 | //Be careful, do not use inFileName, since it is a pointer which | |
1656 | //point to a string at master node, and slave nodes do not contain that string | |
# | Line 1676 | Line 1663 | void SimSetup::setupZConstraint(SimInfo& theInfo) | |
1663 | zconsFilename->setID(ZCONSFILENAME_ID); | |
1664 | zconsFilename->setData(zconsOutput); | |
1665 | ||
1666 | < | theInfo.addProperty(zconsFilename); |
1666 | > | theInfo.addProperty(zconsFilename); |
1667 | > | |
1668 | > | //setup index, pos and other parameters of z-constraint molecules |
1669 | > | nZConstraints = globals->getNzConstraints(); |
1670 | > | theInfo.nZconstraints = nZConstraints; |
1671 | > | |
1672 | > | zconStamp = globals->getZconStamp(); |
1673 | > | ZConsParaItem tempParaItem; |
1674 | > | |
1675 | > | ZConsParaData* zconsParaData = new ZConsParaData(); |
1676 | > | zconsParaData->setID(ZCONSPARADATA_ID); |
1677 | > | |
1678 | > | for(int i = 0; i < nZConstraints; i++){ |
1679 | > | tempParaItem.havingZPos = zconStamp[i]->haveZpos(); |
1680 | > | tempParaItem.zPos = zconStamp[i]->getZpos(); |
1681 | > | tempParaItem.zconsIndex = zconStamp[i]->getMolIndex(); |
1682 | > | tempParaItem.kRatio = zconStamp[i]->getKratio(); |
1683 | > | |
1684 | > | zconsParaData->addItem(tempParaItem); |
1685 | > | } |
1686 | > | |
1687 | > | //sort the parameters by index of molecules |
1688 | > | zconsParaData->sortByIndex(); |
1689 | > | |
1690 | > | //push data into siminfo, therefore, we can retrieve later |
1691 | > | theInfo.addProperty(zconsParaData); |
1692 | > | |
1693 | } |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |