| 1 |
– |
|
| 1 |
|
#include <cstdlib> |
| 2 |
|
#include <cstdio> |
| 3 |
|
#include <cstring> |
| 53 |
|
// char* in_name; |
| 54 |
|
char* id; |
| 55 |
|
|
| 56 |
< |
int* hasErrors; |
| 56 |
> |
int hasErrors; |
| 57 |
|
|
| 59 |
– |
|
| 60 |
– |
MakeStamps* the_stamps = NULL; |
| 61 |
– |
Globals* the_globals = NULL; |
| 62 |
– |
Component** the_components = NULL; |
| 63 |
– |
LinkedMolStamp* headStamp = NULL; |
| 64 |
– |
LinkedMolStamp* currStamp; |
| 65 |
– |
|
| 58 |
|
// initialize all functions and variables |
| 59 |
|
|
| 60 |
|
initSimError(); |
| 66 |
|
headInc = NULL; |
| 67 |
|
|
| 68 |
|
bsInfo.includes = NULL; |
| 77 |
– |
bsInfo.componentsNmol = NULL; |
| 78 |
– |
bsInfo.compStamps = NULL; |
| 79 |
– |
bsInfo.havePressure = 0; |
| 80 |
– |
bsInfo.haveTauBarostat = 0; |
| 81 |
– |
bsInfo.haveTauThermostat = 0; |
| 82 |
– |
bsInfo.haveQmass = 0; |
| 69 |
|
|
| 84 |
– |
//Nanobuilder components. |
| 85 |
– |
bsInfo.latticeType = FCC_LATTICE_TYPE; // set lattice type to FCC. |
| 86 |
– |
bsInfo.hasVacancies = 0; //set vacancies to false. |
| 87 |
– |
bsInfo.buildCoreShell = 0; |
| 70 |
|
|
| 89 |
– |
bsInfo.latticeSpacing = 0.0; |
| 90 |
– |
bsInfo.coreRadius = 0.0; |
| 91 |
– |
bsInfo.particleRadius = 0.0; |
| 92 |
– |
bsInfo.shellRadius = 0.0; |
| 93 |
– |
bsInfo.vacancyRadius = 0.0; |
| 94 |
– |
bsInfo.vacancyFraction = 0.0; |
| 95 |
– |
bsInfo.soluteX = 0.0; |
| 96 |
– |
|
| 97 |
– |
|
| 98 |
– |
|
| 99 |
– |
headStamp = new LinkedMolStamp(); |
| 100 |
– |
the_stamps = new MakeStamps(); |
| 101 |
– |
the_globals = new Globals(); |
| 102 |
– |
set_interface_stamps( the_stamps, the_globals ); |
| 103 |
– |
|
| 71 |
|
// parse command line arguments |
| 72 |
|
|
| 73 |
|
if (cmdline_parser (argc, argv, &args_info) != 0) |
| 76 |
|
// Handle command line arguments. |
| 77 |
|
sysType = grabCmdArgs(); |
| 78 |
|
|
| 79 |
< |
// Keep me |
| 80 |
< |
if(in_name == NULL){ |
| 79 |
> |
// Keep me |
| 80 |
> |
if(in_name == NULL){ |
| 81 |
|
sprintf( painCave.errMsg, |
| 82 |
|
"No input bass file was specified.\n"); |
| 83 |
|
painCave.isFatal = 0; |
| 84 |
|
simError(); |
| 85 |
< |
usage(); |
| 85 |
> |
cmdline_parser_print_help(); |
| 86 |
|
} |
| 87 |
|
|
| 88 |
|
if( sysType < 0 ){ |
| 90 |
|
"No system type was specified.\n"); |
| 91 |
|
painCave.isFatal = 0; |
| 92 |
|
simError(); |
| 93 |
< |
usage(); |
| 93 |
> |
cmdline_parser_print_help(); |
| 94 |
|
} |
| 95 |
|
|
| 96 |
|
|
| 255 |
|
} |
| 256 |
|
|
| 257 |
|
// get and set the boxSize |
| 258 |
+ |
|
| 259 |
+ |
bsInfo.haveBox = false; |
| 260 |
+ |
|
| 261 |
+ |
std::cerr << "Box setting..."; |
| 262 |
+ |
|
| 263 |
+ |
std::cerr <<" haveBox= " << the_globals->haveBox() << "\n"; |
| 264 |
|
|
| 265 |
|
if( the_globals->haveBox() ){ |
| 266 |
|
bsInfo.boxX = the_globals->getBox(); |
| 267 |
|
bsInfo.boxY = the_globals->getBox(); |
| 268 |
|
bsInfo.boxZ = the_globals->getBox(); |
| 269 |
+ |
bsInfo.haveBox = true; |
| 270 |
+ |
std::cerr<< "box=>yes\n"; |
| 271 |
|
} |
| 272 |
|
else if( the_globals->haveDensity() ){ |
| 273 |
|
|
| 276 |
|
bsInfo.boxX = pow( vol, ( 1.0 / 3.0 ) ); |
| 277 |
|
bsInfo.boxY = bsInfo.boxX; |
| 278 |
|
bsInfo.boxZ = bsInfo.boxY; |
| 279 |
+ |
bsInfo.haveBox = true; |
| 280 |
+ |
|
| 281 |
+ |
std::cerr<< "dens=>yes\n"; |
| 282 |
|
} |
| 283 |
|
else{ |
| 284 |
< |
if( !the_globals->haveBoxX() ){ |
| 307 |
< |
sprintf( painCave.errMsg, |
| 308 |
< |
"sysBuild error, no periodic BoxX size given.\n" ); |
| 309 |
< |
painCave.isFatal = 1; |
| 310 |
< |
simError(); |
| 311 |
< |
} |
| 312 |
< |
bsInfo.boxX = the_globals->getBoxX(); |
| 313 |
< |
|
| 314 |
< |
if( !the_globals->haveBoxY() ){ |
| 315 |
< |
sprintf( painCave.errMsg, |
| 316 |
< |
"sysBuild error, no periodic BoxY size given.\n" ); |
| 317 |
< |
painCave.isFatal = 1; |
| 318 |
< |
simError(); |
| 319 |
< |
} |
| 320 |
< |
bsInfo.boxY = the_globals->getBoxY(); |
| 321 |
< |
|
| 322 |
< |
if( !the_globals->haveBoxZ() ){ |
| 323 |
< |
sprintf( painCave.errMsg, |
| 324 |
< |
"SimSetup error, no periodic BoxZ size given.\n" ); |
| 325 |
< |
painCave.isFatal = 1; |
| 326 |
< |
simError(); |
| 327 |
< |
} |
| 328 |
< |
bsInfo.boxZ = the_globals->getBoxZ(); |
| 284 |
> |
std::cerr<< "none.\n"; |
| 285 |
|
} |
| 286 |
|
|
| 287 |
|
|
| 288 |
< |
//************************************************************ |
| 288 |
> |
// ************************************************************ |
| 289 |
|
// that should be all we need from bass. now to switch to the |
| 290 |
|
// appropriate system builder. |
| 291 |
|
// *********************************************************** |
| 292 |
< |
|
| 293 |
< |
|
| 292 |
> |
|
| 293 |
> |
nanoBuilder* buildNano; |
| 294 |
> |
|
| 295 |
|
switch( sysType ){ |
| 296 |
|
|
| 297 |
|
case BILAYER: |
| 300 |
|
|
| 301 |
|
case NANOPARTICLE: |
| 302 |
|
|
| 303 |
< |
// nanoBuilder buildNano(hasErrors); |
| 304 |
< |
|
| 305 |
< |
// buildNano.buildNanoParticle(); |
| 306 |
< |
|
| 303 |
> |
buildNano = new nanoBuilder(hasErrors); |
| 304 |
> |
|
| 305 |
> |
buildNano->buildNanoParticle(); |
| 306 |
> |
|
| 307 |
|
break; |
| 308 |
|
|
| 309 |
|
default: |
| 321 |
|
if( headStamp!= NULL ) delete headStamp; |
| 322 |
|
if( the_stamps != NULL ) delete the_stamps; |
| 323 |
|
if( the_globals != NULL ) delete the_globals; |
| 324 |
< |
if( the_components != NULL ) delete[] the_components; |
| 324 |
> |
// if( the_components != NULL ) delete[] the_components; |
| 325 |
|
|
| 326 |
|
if( bsInfo.componentsNmol != NULL ) delete[] bsInfo.componentsNmol; |
| 327 |
|
if( bsInfo.compStamps != NULL ) delete[] bsInfo.compStamps; |
| 446 |
|
} |
| 447 |
|
|
| 448 |
|
if (args_info.inputs_num) { //Get input file name |
| 449 |
< |
in_name = args_info.inputs[1]; |
| 449 |
> |
in_name = args_info.inputs[0]; |
| 450 |
> |
cerr << in_name << "\n"; |
| 451 |
|
} |
| 452 |
|
else { |
| 453 |
|
sprintf( painCave.errMsg, |