# | Line 2 | Line 2 | |
---|---|---|
2 | #include <cstdio> | |
3 | #include <cstring> | |
4 | ||
5 | – | |
5 | #include "simError.h" | |
6 | ||
7 | + | #include "bilayerSys.hpp" |
8 | + | |
9 | // quick case asignments | |
10 | ||
11 | #define BILAYER 1 | |
# | Line 22 | Line 23 | int main( int argc, char* argv[]){ | |
23 | char current_flag; | |
24 | char* out_prefix; | |
25 | char* in_name; | |
26 | + | |
27 | + | sysBuildInfo info; |
28 | ||
29 | // initialize simError | |
30 | initSimError(); | |
# | Line 96 | Line 99 | int main( int argc, char* argv[]){ | |
99 | ||
100 | default: | |
101 | sprintf(painCave.errMsg, | |
102 | < | "Bad option \"-%s\"\n", current_flag); |
102 | > | "Bad option \"-%c\"\n", current_flag); |
103 | painCave.isFatal = 0; | |
104 | simError(); | |
105 | usage(); | |
# | Line 125 | Line 128 | int main( int argc, char* argv[]){ | |
128 | } | |
129 | ||
130 | if(in_name == NULL){ | |
131 | + | sprintf( painCave.errMsg, |
132 | + | "No input bass file was specified.\n"); |
133 | + | painCave.isFatal = 0; |
134 | + | simError(); |
135 | usage(); | |
136 | } | |
137 | + | |
138 | + | if( sysType < 0 ){ |
139 | + | sprintf( painCave.errMsg, |
140 | + | "No system type was specified.\n"); |
141 | + | painCave.isFatal = 0; |
142 | + | simError(); |
143 | + | usage(); |
144 | + | } |
145 | ||
146 | ||
147 | + | // if no output prefix is given default to "donkey". |
148 | + | |
149 | + | if( !have_prefix ){ |
150 | + | out_prefix = strdup( "donkey" ); |
151 | + | } |
152 | + | |
153 | + | info.in_name = in_name; |
154 | + | info.out_prefix = out_prefix; |
155 | + | info.isRandom = isRandom; |
156 | ||
157 | + | // switch the system type |
158 | + | |
159 | + | switch( sysType ){ |
160 | + | |
161 | + | case BILAYER: |
162 | + | |
163 | + | buildBilayer( info ); |
164 | + | break; |
165 | + | |
166 | + | default: |
167 | + | sprintf( painCave.errMsg, |
168 | + | "Unknown system type: %d\n", sysType ); |
169 | + | painCave.isFatal = 1; |
170 | + | simError(); |
171 | + | } |
172 | ||
134 | – | |
135 | – | |
136 | – | |
137 | – | |
173 | return 0; | |
174 | } | |
175 | ||
# | Line 163 | Line 198 | void usage(){ | |
198 | " in the bass file.\n" | |
199 | " -note: combined with \"-r\" the simulation will start in\n" | |
200 | " an FCC lattice with randomly assigned latice\n" | |
201 | < | " for all atoms involved.\n" |
201 | > | " sites for all atoms involved.\n" |
202 | "\n" | |
203 | "\n", | |
204 | program_name); |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |