| 1 |
+ |
|
| 2 |
|
#include <cstdlib> |
| 3 |
|
#include <cstdio> |
| 4 |
|
#include <cstring> |
| 12 |
|
|
| 13 |
|
#include "sysBuild.hpp" |
| 14 |
|
#include "bilayerSys.hpp" |
| 15 |
+ |
#include "nanoBuilder.hpp" |
| 16 |
|
|
| 17 |
|
// this routine is defined in BASS_interface.cpp |
| 18 |
|
extern void set_interface_stamps( MakeStamps* ms, Globals* g ); |
| 20 |
|
|
| 21 |
|
// case asignments |
| 22 |
|
#define BILAYER 1 |
| 23 |
+ |
#define NANOPARTICLE 2 |
| 24 |
|
|
| 22 |
– |
|
| 25 |
|
char* program_name; |
| 26 |
|
bassInfo bsInfo; |
| 27 |
|
void usage(void); |
| 90 |
|
simError(); |
| 91 |
|
usage(); |
| 92 |
|
} |
| 93 |
+ |
|
| 94 |
|
sysType = BILAYER; |
| 95 |
+ |
|
| 96 |
+ |
i++; |
| 97 |
+ |
if( i>=argc ){ |
| 98 |
+ |
sprintf( painCave.errMsg, |
| 99 |
+ |
"\n" |
| 100 |
+ |
"not enough arguments for bilayer\n"); |
| 101 |
+ |
painCave.isFatal = 0; |
| 102 |
+ |
simError(); |
| 103 |
+ |
usage(); |
| 104 |
+ |
} |
| 105 |
+ |
strcpy( bsInfo.lipidName, argv[i] ); |
| 106 |
+ |
|
| 107 |
+ |
i++; |
| 108 |
+ |
if( i>=argc ){ |
| 109 |
+ |
sprintf( painCave.errMsg, |
| 110 |
+ |
"\n" |
| 111 |
+ |
"not enough arguments for bilayer\n"); |
| 112 |
+ |
painCave.isFatal = 0; |
| 113 |
+ |
simError(); |
| 114 |
+ |
usage(); |
| 115 |
+ |
} |
| 116 |
+ |
strcpy( bsInfo.waterName, argv[i] ); |
| 117 |
+ |
|
| 118 |
+ |
} |
| 119 |
+ |
|
| 120 |
+ |
else{ |
| 121 |
+ |
sprintf( painCave.errMsg, |
| 122 |
+ |
"Invalid option \"%s\"\n", argv[i] ); |
| 123 |
+ |
painCave.isFatal = 0; |
| 124 |
+ |
simError(); |
| 125 |
+ |
usage(); |
| 126 |
+ |
} |
| 127 |
+ |
} |
| 128 |
+ |
else if( !strcmp( argv[i], "--nanoparticle" ) ){ |
| 129 |
+ |
if( sysType > 0 ){ |
| 130 |
+ |
sprintf( painCave.errMsg, |
| 131 |
+ |
"You cannot specify more than one system to build.\n" ); |
| 132 |
+ |
painCave.isFatal = 0; |
| 133 |
+ |
simError(); |
| 134 |
+ |
usage(); |
| 135 |
+ |
} |
| 136 |
+ |
|
| 137 |
+ |
sysType = NANOPARTICLE; |
| 138 |
+ |
|
| 139 |
+ |
i++; |
| 140 |
+ |
if( i>=argc ){ |
| 141 |
+ |
sprintf( painCave.errMsg, |
| 142 |
+ |
"\n" |
| 143 |
+ |
"not enough arguments for nanoparticle\n"); |
| 144 |
+ |
painCave.isFatal = 0; |
| 145 |
+ |
simError(); |
| 146 |
+ |
usage(); |
| 147 |
+ |
} |
| 148 |
+ |
strcpy( bsInfo.coreName, argv[i] ); |
| 149 |
+ |
|
| 150 |
+ |
i++; |
| 151 |
+ |
if( i>=argc ){ |
| 152 |
+ |
sprintf( painCave.errMsg, |
| 153 |
+ |
"\n" |
| 154 |
+ |
"not enough arguments for nanoparticle\n"); |
| 155 |
+ |
painCave.isFatal = 0; |
| 156 |
+ |
simError(); |
| 157 |
+ |
usage(); |
| 158 |
+ |
} |
| 159 |
+ |
strcpy( bsInfo.shellName, argv[i] ); |
| 160 |
+ |
|
| 161 |
|
} |
| 162 |
|
|
| 163 |
|
else{ |
| 486 |
|
case BILAYER: |
| 487 |
|
|
| 488 |
|
buildBilayer( isRandom ); |
| 489 |
+ |
break; |
| 490 |
+ |
|
| 491 |
+ |
case NANO: |
| 492 |
+ |
|
| 493 |
+ |
|
| 494 |
|
break; |
| 495 |
|
|
| 496 |
|
default: |
| 498 |
|
"Unknown system type: %d\n", sysType ); |
| 499 |
|
painCave.isFatal = 1; |
| 500 |
|
simError(); |
| 501 |
+ |
|
| 502 |
|
} |
| 503 |
|
|
| 504 |
|
|
| 545 |
|
"\n" |
| 546 |
|
" long:\n" |
| 547 |
|
" -----\n" |
| 548 |
< |
" --bilayer Tries to build a basic bilayer with the specified number\n" |
| 549 |
< |
" of lipids in the input bass file. The bilayer will be\n" |
| 550 |
< |
" surrounded by the number of solvent molecules given\n" |
| 551 |
< |
" in the bass file.\n" |
| 552 |
< |
" -note: combined with \"-r\" the simulation will start in\n" |
| 553 |
< |
" an FCC lattice with randomly assigned latice\n" |
| 479 |
< |
" sites for all atoms involved.\n" |
| 548 |
> |
" --bilayer <lipid> <water> Tries to build a basic bilayer with the specified number\n" |
| 549 |
> |
" of lipids in the input bass file. The bilayer will be\n" |
| 550 |
> |
" surrounded by the number of solvent molecules given\n" |
| 551 |
> |
" in the bass file.\n" |
| 552 |
> |
" -note: combined with \"-r\" the simulation will start\n" |
| 553 |
> |
" the lipids randomly oriented in a sea of waters.\n" |
| 554 |
|
"\n" |
| 555 |
|
"\n", |
| 556 |
|
program_name); |