# | Line 11 | Line 11 | |
---|---|---|
11 | ||
12 | #include "sysBuild.hpp" | |
13 | #include "bilayerSys.hpp" | |
14 | + | //#include "nanoBuilder.hpp" |
15 | ||
16 | // this routine is defined in BASS_interface.cpp | |
17 | extern void set_interface_stamps( MakeStamps* ms, Globals* g ); | |
# | Line 18 | Line 19 | extern void set_interface_stamps( MakeStamps* ms, Glob | |
19 | ||
20 | // case asignments | |
21 | #define BILAYER 1 | |
22 | + | #define NANO 2 |
23 | ||
22 | – | |
24 | char* program_name; | |
25 | bassInfo bsInfo; | |
26 | void usage(void); | |
# | Line 41 | Line 42 | int main( int argc, char* argv[]){ | |
42 | ||
43 | MakeStamps* the_stamps = NULL; | |
44 | Globals* the_globals = NULL; | |
45 | < | MoleculeStamp** the_components = NULL; |
45 | > | Component** the_components = NULL; |
46 | LinkedMolStamp* headStamp = NULL; | |
47 | LinkedMolStamp* currStamp; | |
48 | ||
48 | – | if( |
49 | – | |
49 | // initialize all functions and variables | |
50 | ||
51 | initSimError(); | |
# | Line 61 | Line 60 | int main( int argc, char* argv[]){ | |
60 | bsInfo.componentsNmol = NULL; | |
61 | bsInfo.compStamps = NULL; | |
62 | bsInfo.havePressure = 0; | |
63 | < | bsInfo.haveTauBarrostat = 0; |
63 | > | bsInfo.haveTauBarostat = 0; |
64 | bsInfo.haveTauThermostat = 0; | |
65 | bsInfo.haveQmass = 0; | |
66 | ||
# | Line 90 | Line 89 | int main( int argc, char* argv[]){ | |
89 | simError(); | |
90 | usage(); | |
91 | } | |
92 | + | |
93 | sysType = BILAYER; | |
94 | + | |
95 | + | i++; |
96 | + | if( i>=argc ){ |
97 | + | sprintf( painCave.errMsg, |
98 | + | "\n" |
99 | + | "not enough arguments for bilayer\n"); |
100 | + | painCave.isFatal = 0; |
101 | + | simError(); |
102 | + | usage(); |
103 | + | } |
104 | + | strcpy( bsInfo.lipidName, argv[i] ); |
105 | + | |
106 | + | i++; |
107 | + | if( i>=argc ){ |
108 | + | sprintf( painCave.errMsg, |
109 | + | "\n" |
110 | + | "not enough arguments for bilayer\n"); |
111 | + | painCave.isFatal = 0; |
112 | + | simError(); |
113 | + | usage(); |
114 | + | } |
115 | + | strcpy( bsInfo.waterName, argv[i] ); |
116 | + | |
117 | } | |
118 | ||
119 | else{ | |
# | Line 129 | Line 152 | int main( int argc, char* argv[]){ | |
152 | if( headInc == NULL ){ | |
153 | headInc = new includeLinked; | |
154 | headInc->next = NULL; | |
155 | < | strcopy( headInc->name, argv[i] ); |
155 | > | strcpy( headInc->name, argv[i] ); |
156 | } | |
157 | else{ | |
158 | prevInc = headInc; | |
159 | currInc = headInc->next; | |
160 | while( currInc != NULL ){ | |
161 | prevInc = currInc; | |
162 | < | currInc = previnc->next; |
162 | > | currInc = prevInc->next; |
163 | } | |
164 | currInc = new includeLinked; | |
165 | currInc->next = NULL; | |
166 | < | strcopy( currInc->name, argv[i] ); |
166 | > | strcpy( currInc->name, argv[i] ); |
167 | prevInc->next = currInc; | |
168 | } | |
169 | ||
# | Line 221 | Line 244 | int main( int argc, char* argv[]){ | |
244 | // open and parse the bass file. | |
245 | ||
246 | set_interface_stamps( the_stamps, the_globals ); | |
247 | < | yacc_BASS( info.in_name ); |
247 | > | yacc_BASS( in_name ); |
248 | ||
249 | // set the easy ones first | |
250 | bsInfo.targetTemp = the_globals->getTargetTemp(); | |
# | Line 254 | Line 277 | int main( int argc, char* argv[]){ | |
277 | bsInfo.haveTauThermostat = 1;; | |
278 | } | |
279 | else if (the_globals->haveQmass()){ | |
280 | < | bsinfo.Qmass = the_globals->getQmass(); |
280 | > | bsInfo.Qmass = the_globals->getQmass(); |
281 | bsInfo.haveQmass = 1; | |
282 | } | |
283 | else { | |
# | Line 308 | Line 331 | int main( int argc, char* argv[]){ | |
331 | sprintf( painCave.errMsg, | |
332 | "sysBuild Warning. Unrecognized Ensemble -> %s, " | |
333 | "reverting to NVE for this simulation.\n", | |
334 | < | ensemble ); |
334 | > | bsInfo.ensemble ); |
335 | painCave.isFatal = 0; | |
336 | simError(); | |
337 | strcpy( bsInfo.ensemble, "NVE" ); | |
# | Line 371 | Line 394 | int main( int argc, char* argv[]){ | |
394 | if( the_globals->haveBox() ){ | |
395 | bsInfo.boxX = the_globals->getBox(); | |
396 | bsInfo.boxY = the_globals->getBox(); | |
397 | < | bsinfo.boxZ = the_globals->getBox(); |
397 | > | bsInfo.boxZ = the_globals->getBox(); |
398 | } | |
399 | else if( the_globals->haveDensity() ){ | |
400 | ||
401 | double vol; | |
402 | < | vol = (double)tot_nmol / the_globals->getDensity(); |
402 | > | vol = (double)bsInfo.totNmol / the_globals->getDensity(); |
403 | bsInfo.boxX = pow( vol, ( 1.0 / 3.0 ) ); | |
404 | < | bsInfo.boxY = simnfo->box_x; |
405 | < | bsInfo.boxZ = simnfo->box_x; |
404 | > | bsInfo.boxY = bsInfo.boxX; |
405 | > | bsInfo.boxZ = bsInfo.boxY; |
406 | } | |
407 | else{ | |
408 | if( !the_globals->haveBoxX() ){ | |
# | Line 419 | Line 442 | int main( int argc, char* argv[]){ | |
442 | case BILAYER: | |
443 | ||
444 | buildBilayer( isRandom ); | |
445 | + | break; |
446 | + | |
447 | + | case NANO: |
448 | + | // buildNano( isRandom ); |
449 | break; | |
450 | ||
451 | default: | |
# | Line 426 | Line 453 | int main( int argc, char* argv[]){ | |
453 | "Unknown system type: %d\n", sysType ); | |
454 | painCave.isFatal = 1; | |
455 | simError(); | |
456 | + | |
457 | } | |
458 | ||
459 | ||
# | Line 472 | Line 500 | void usage(){ | |
500 | "\n" | |
501 | " long:\n" | |
502 | " -----\n" | |
503 | < | " --bilayer Tries to build a basic bilayer with the specified number\n" |
504 | < | " of lipids in the input bass file. The bilayer will be\n" |
505 | < | " surrounded by the number of solvent molecules given\n" |
506 | < | " in the bass file.\n" |
507 | < | " -note: combined with \"-r\" the simulation will start in\n" |
508 | < | " an FCC lattice with randomly assigned latice\n" |
481 | < | " sites for all atoms involved.\n" |
503 | > | " --bilayer <lipid> <water> Tries to build a basic bilayer with the specified number\n" |
504 | > | " of lipids in the input bass file. The bilayer will be\n" |
505 | > | " surrounded by the number of solvent molecules given\n" |
506 | > | " in the bass file.\n" |
507 | > | " -note: combined with \"-r\" the simulation will start\n" |
508 | > | " the lipids randomly oriented in a sea of waters.\n" |
509 | "\n" | |
510 | "\n", | |
511 | program_name); |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |