--- trunk/OOPSE/utils/sysbuilder/sysBuild.cpp 2003/08/11 22:12:31 678 +++ trunk/OOPSE/utils/sysbuilder/sysBuild.cpp 2003/10/27 16:20:59 822 @@ -1,4 +1,3 @@ - #include #include #include @@ -54,15 +53,8 @@ int main( int argc, char* argv[]){ // char* in_name; char* id; - int* hasErrors; + int hasErrors; - - MakeStamps* the_stamps = NULL; - Globals* the_globals = NULL; - Component** the_components = NULL; - LinkedMolStamp* headStamp = NULL; - LinkedMolStamp* currStamp; - // initialize all functions and variables initSimError(); @@ -74,33 +66,8 @@ int main( int argc, char* argv[]){ headInc = NULL; bsInfo.includes = NULL; - bsInfo.componentsNmol = NULL; - bsInfo.compStamps = NULL; - bsInfo.havePressure = 0; - bsInfo.haveTauBarostat = 0; - bsInfo.haveTauThermostat = 0; - bsInfo.haveQmass = 0; - - //Nanobuilder components. - bsInfo.latticeType = FCC_LATTICE_TYPE; // set lattice type to FCC. - bsInfo.hasVacancies = 0; //set vacancies to false. - bsInfo.buildCoreShell = 0; - - bsInfo.latticeSpacing = 0.0; - bsInfo.coreRadius = 0.0; - bsInfo.particleRadius = 0.0; - bsInfo.shellRadius = 0.0; - bsInfo.vacancyRadius = 0.0; - bsInfo.vacancyFraction = 0.0; - bsInfo.soluteX = 0.0; - - headStamp = new LinkedMolStamp(); - the_stamps = new MakeStamps(); - the_globals = new Globals(); - set_interface_stamps( the_stamps, the_globals ); - // parse command line arguments if (cmdline_parser (argc, argv, &args_info) != 0) @@ -109,13 +76,13 @@ int main( int argc, char* argv[]){ // Handle command line arguments. sysType = grabCmdArgs(); -// Keep me -if(in_name == NULL){ + // Keep me + if(in_name == NULL){ sprintf( painCave.errMsg, "No input bass file was specified.\n"); painCave.isFatal = 0; simError(); - usage(); + cmdline_parser_print_help(); } if( sysType < 0 ){ @@ -123,7 +90,7 @@ if(in_name == NULL){ "No system type was specified.\n"); painCave.isFatal = 0; simError(); - usage(); + cmdline_parser_print_help(); } @@ -138,7 +105,6 @@ if(in_name == NULL){ bsInfo.outPrefix = out_prefix; bsInfo.includes = headInc; - // open and parse the bass file. set_interface_stamps( the_stamps, the_globals ); @@ -288,11 +254,19 @@ if(in_name == NULL){ } // get and set the boxSize + + bsInfo.haveBox = false; + std::cerr << "Box setting..."; + + std::cerr <<" haveBox= " << the_globals->haveBox() << "\n"; + if( the_globals->haveBox() ){ bsInfo.boxX = the_globals->getBox(); bsInfo.boxY = the_globals->getBox(); bsInfo.boxZ = the_globals->getBox(); + bsInfo.haveBox = true; + std::cerr<< "box=>yes\n"; } else if( the_globals->haveDensity() ){ @@ -301,40 +275,22 @@ if(in_name == NULL){ bsInfo.boxX = pow( vol, ( 1.0 / 3.0 ) ); bsInfo.boxY = bsInfo.boxX; bsInfo.boxZ = bsInfo.boxY; + bsInfo.haveBox = true; + + std::cerr<< "dens=>yes\n"; } else{ - if( !the_globals->haveBoxX() ){ - sprintf( painCave.errMsg, - "sysBuild error, no periodic BoxX size given.\n" ); - painCave.isFatal = 1; - simError(); - } - bsInfo.boxX = the_globals->getBoxX(); - - if( !the_globals->haveBoxY() ){ - sprintf( painCave.errMsg, - "sysBuild error, no periodic BoxY size given.\n" ); - painCave.isFatal = 1; - simError(); - } - bsInfo.boxY = the_globals->getBoxY(); - - if( !the_globals->haveBoxZ() ){ - sprintf( painCave.errMsg, - "SimSetup error, no periodic BoxZ size given.\n" ); - painCave.isFatal = 1; - simError(); - } - bsInfo.boxZ = the_globals->getBoxZ(); + std::cerr<< "none.\n"; } - //************************************************************ + // ************************************************************ // that should be all we need from bass. now to switch to the // appropriate system builder. // *********************************************************** - - + + nanoBuilder* buildNano; + switch( sysType ){ case BILAYER: @@ -343,10 +299,10 @@ if(in_name == NULL){ case NANOPARTICLE: - // nanoBuilder buildNano(hasErrors); - - // buildNano.buildNanoParticle(); - + buildNano = new nanoBuilder(hasErrors); + + buildNano->buildNanoParticle(); + break; default: @@ -364,7 +320,7 @@ if(in_name == NULL){ if( headStamp!= NULL ) delete headStamp; if( the_stamps != NULL ) delete the_stamps; if( the_globals != NULL ) delete the_globals; - if( the_components != NULL ) delete[] the_components; + // if( the_components != NULL ) delete[] the_components; if( bsInfo.componentsNmol != NULL ) delete[] bsInfo.componentsNmol; if( bsInfo.compStamps != NULL ) delete[] bsInfo.compStamps; @@ -489,7 +445,8 @@ int grabCmdArgs(){ } if (args_info.inputs_num) { //Get input file name - in_name = args_info.inputs[1]; + in_name = args_info.inputs[0]; + cerr << in_name << "\n"; } else { sprintf( painCave.errMsg,