--- trunk/OOPSE/utils/sysbuilder/latticeBilayer.cpp 2003/11/06 22:01:37 855 +++ trunk/OOPSE/utils/sysbuilder/latticeBilayer.cpp 2003/11/21 20:10:02 874 @@ -549,7 +549,7 @@ int main(int argC,char* argV[]){ simInit->setSimInfo( mainInfo ); simInit->suspendInit(); simInit->parseFile( inName ); - simInit->createSim(); + simInit->createSim(); delete simInit; @@ -581,7 +581,7 @@ int buildLatticeBilayer(double aLat, double *posX, *posY, *posZ; double pos[3], posA[3], posB[3]; - const double waterFudge = 5.0; + const double waterFudge = 6.0; int i,j,k,l; int nAtoms, atomIndex, molIndex, molID; @@ -597,7 +597,6 @@ int buildLatticeBilayer(double aLat, int targetWaters; Atom** atoms; - SimInfo* simnfo; SimInfo* testInfo; coord testSite; SimState* theConfig; @@ -617,10 +616,6 @@ int buildLatticeBilayer(double aLat, molStart = NULL; - // create the simInfo objects - - simnfo = new SimInfo; - // set the the lipidStamp foundLipid = 0; @@ -694,11 +689,15 @@ int buildLatticeBilayer(double aLat, } zHeight = maxZ - minZ; - nCells = (int) sqrt( (double)targetNlipids * bLat / (4.0 * aLat) ); + std::cerr << "aLat = " << aLat << "; bLat = " << bLat << "\n"; + nCells = (int)ceil( sqrt( (double)targetNlipids * bLat / (4.0 * aLat) )); + nx = nCells; ny = (int) ((double)nCells * aLat / bLat); + std::cerr << "nx = " << nx << "; ny = " << ny << "\n"; + boxX = nx * aLat; boxY = ny * bLat; @@ -904,11 +903,12 @@ int buildLatticeBilayer(double aLat, // create the real Atom arrays - theConfig = simnfo->getConfiguration(); + delete[] (mainInfo->atoms); + theConfig = mainInfo->getConfiguration(); theConfig->createArrays( nAtoms ); - simnfo->atoms = new Atom*[nAtoms]; - simnfo->n_atoms = nAtoms; - atoms = simnfo->atoms; + mainInfo->atoms = new Atom*[nAtoms]; + mainInfo->n_atoms = nAtoms; + atoms = mainInfo->atoms; // wrap back to <0,0,0> as center @@ -927,7 +927,6 @@ int buildLatticeBilayer(double aLat, Hmat[2][2] = boxZ; mainInfo->setBoxM( Hmat ); - simnfo->setBoxM( Hmat ); for(j=0;jwrapVector( lipidSites[j].pos ); + mainInfo->wrapVector( lipidSites[j].pos ); } for(j=0;jwrapVector( waterSites[j].pos ); + mainInfo->wrapVector( waterSites[j].pos ); } // initialize lipid positions @@ -966,12 +965,9 @@ int buildLatticeBilayer(double aLat, molIndex++; } - strcpy( simnfo->sampleName, mainInfo->sampleName ); - strcpy( simnfo->finalName, mainInfo->finalName ); - // set up the writer and write out - writer = new DumpWriter( simnfo ); + writer = new DumpWriter( mainInfo ); writer->writeFinal( 0.0 ); std::cout << "\n"