# | Line 549 | Line 549 | int main(int argC,char* argV[]){ | |
---|---|---|
549 | simInit->setSimInfo( mainInfo ); | |
550 | simInit->suspendInit(); | |
551 | simInit->parseFile( inName ); | |
552 | < | simInit->createSim(); |
552 | > | simInit->createSim(); |
553 | ||
554 | delete simInit; | |
555 | ||
# | Line 581 | Line 581 | int buildLatticeBilayer(double aLat, | |
581 | double *posX, *posY, *posZ; | |
582 | double pos[3], posA[3], posB[3]; | |
583 | ||
584 | < | const double waterFudge = 5.0; |
584 | > | const double waterFudge = 6.0; |
585 | ||
586 | int i,j,k,l; | |
587 | int nAtoms, atomIndex, molIndex, molID; | |
# | Line 597 | Line 597 | int buildLatticeBilayer(double aLat, | |
597 | int targetWaters; | |
598 | ||
599 | Atom** atoms; | |
600 | – | SimInfo* simnfo; |
600 | SimInfo* testInfo; | |
601 | coord testSite; | |
602 | SimState* theConfig; | |
# | Line 617 | Line 616 | int buildLatticeBilayer(double aLat, | |
616 | ||
617 | molStart = NULL; | |
618 | ||
620 | – | // create the simInfo objects |
621 | – | |
622 | – | simnfo = new SimInfo; |
623 | – | |
619 | // set the the lipidStamp | |
620 | ||
621 | foundLipid = 0; | |
# | Line 694 | Line 689 | int buildLatticeBilayer(double aLat, | |
689 | } | |
690 | zHeight = maxZ - minZ; | |
691 | ||
692 | < | nCells = (int) sqrt( (double)targetNlipids * bLat / (4.0 * aLat) ); |
692 | > | std::cerr << "aLat = " << aLat << "; bLat = " << bLat << "\n"; |
693 | ||
694 | + | nCells = (int)ceil( sqrt( (double)targetNlipids * bLat / (4.0 * aLat) )); |
695 | + | |
696 | nx = nCells; | |
697 | ny = (int) ((double)nCells * aLat / bLat); | |
698 | ||
699 | + | std::cerr << "nx = " << nx << "; ny = " << ny << "\n"; |
700 | + | |
701 | boxX = nx * aLat; | |
702 | boxY = ny * bLat; | |
703 | ||
# | Line 904 | Line 903 | int buildLatticeBilayer(double aLat, | |
903 | ||
904 | // create the real Atom arrays | |
905 | ||
906 | < | theConfig = simnfo->getConfiguration(); |
906 | > | delete[] (mainInfo->atoms); |
907 | > | theConfig = mainInfo->getConfiguration(); |
908 | theConfig->createArrays( nAtoms ); | |
909 | < | simnfo->atoms = new Atom*[nAtoms]; |
910 | < | simnfo->n_atoms = nAtoms; |
911 | < | atoms = simnfo->atoms; |
909 | > | mainInfo->atoms = new Atom*[nAtoms]; |
910 | > | mainInfo->n_atoms = nAtoms; |
911 | > | atoms = mainInfo->atoms; |
912 | ||
913 | // wrap back to <0,0,0> as center | |
914 | ||
# | Line 927 | Line 927 | int buildLatticeBilayer(double aLat, | |
927 | Hmat[2][2] = boxZ; | |
928 | ||
929 | mainInfo->setBoxM( Hmat ); | |
930 | – | simnfo->setBoxM( Hmat ); |
930 | ||
931 | for(j=0;j<nLipids;j++){ | |
932 | ||
# | Line 935 | Line 934 | int buildLatticeBilayer(double aLat, | |
934 | lipidSites[j].pos[1] -= centerY; | |
935 | lipidSites[j].pos[2] -= centerZ; | |
936 | ||
937 | < | simnfo->wrapVector( lipidSites[j].pos ); |
937 | > | mainInfo->wrapVector( lipidSites[j].pos ); |
938 | } | |
939 | ||
940 | for(j=0;j<nWaters;j++){ | |
# | Line 944 | Line 943 | int buildLatticeBilayer(double aLat, | |
943 | waterSites[j].pos[1] -= centerY; | |
944 | waterSites[j].pos[2] -= centerZ; | |
945 | ||
946 | < | simnfo->wrapVector( waterSites[j].pos ); |
946 | > | mainInfo->wrapVector( waterSites[j].pos ); |
947 | } | |
948 | ||
949 | // initialize lipid positions | |
# | Line 966 | Line 965 | int buildLatticeBilayer(double aLat, | |
965 | molIndex++; | |
966 | } | |
967 | ||
969 | – | strcpy( simnfo->sampleName, mainInfo->sampleName ); |
970 | – | strcpy( simnfo->finalName, mainInfo->finalName ); |
971 | – | |
968 | // set up the writer and write out | |
969 | ||
970 | < | writer = new DumpWriter( simnfo ); |
970 | > | writer = new DumpWriter( mainInfo ); |
971 | writer->writeFinal( 0.0 ); | |
972 | ||
973 | std::cout << "\n" |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |