 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
29 "Usage: bmm [options] in1.star [in2.star ...]",
30 "--------------------------------------------",
31 "Mechanical modeling.",
34 "-center Center before all other operations.",
35 "-minimize 150 Number of iterations for minimizing a model.",
36 "-dynamics 500 Number of iterations for running dynamics on a model.",
39 "-all Reset selection to all components before other selections.",
40 "-select #Mod1@14 Select models and components.",
43 "-verbose 7 Verbosity of output.",
44 "-componentradius 0.5 Component display radius.",
45 "-linkradius 0.5 Link display radius.",
47 "Parameters for minimization:",
48 "-shift 6.8 Maximum shift per iteration (angstrom, default infinite).",
50 "Parameters for dynamics:",
51 "-timestep 0.01 Integration time step (default 0.001).",
52 "-velocitylimit 0.01 Limit on the velocity (default 0.1 per time step).",
53 "-friction 0.2 Friction constant (default 1 = no friction).",
55 "Parameters for mechanics:",
56 "-neighbors 7,45 Neighbor designation: number and neighborhood scale (default 8,50).",
57 "-Kdistance 0.1 Distance force constant (default 0).",
58 "-Klink 0.01 Link force constant (default 0).",
59 "-Kangle 0.1 Angle force constant (default 0).",
60 "-Kpolyangle 0.1 Polygon angle force constant (default 0).",
61 "-Kpolygon 0.001 Polygon regularity force constant (default 0).",
62 "-Kpolyplane 0.1 Polygon planarity force constant (default 0).",
63 "-Kpoint 0.1,0.02 Point force constant and decay (default 0,0.01).",
64 "-Kradial 0.1 Radial force constant (default 0).",
65 "-radius 212 Reference radial distance (default 0).",
66 "-Kplane 0.2 Neighbor plane force constant (default 0).",
67 "-Kguide 0.5 Polyhedron guide force constant (default 0).",
68 "-Kmap 0.5 Map force constant (default 0).",
69 "-sigma 17 Sigma determining kernel size for fitting a map (default map pixel size).",
72 "-parameters parm.star Model parameter file (default atom_prop.star).",
73 "-guide file.star Polyhedron guide model file.",
76 "-output file.star Output model file.",
77 "-writeparam dm.star Write model parameter file.",
82 int main(
int argc,
char **argv)
92 double timestep(0.001);
93 double velocitylimit(0.1);
96 double neighbor_scale(50);
100 double Kpolyangle(0);
102 double Kpolyplane(0);
122 for ( curropt = option; curropt; curropt = curropt->
next ) {
123 if ( curropt->
tag ==
"center" ) center = 1;
124 if ( curropt->
tag ==
"minimize" ) {
126 cerr <<
"-minimize: The number of iterations must be specified!" << endl;
129 if ( curropt->
tag ==
"dynamics" ) {
131 cerr <<
"-dynamics: The number of iterations must be specified!" << endl;
134 if ( curropt->
tag ==
"all" ) reset = 1;
135 if ( curropt->
tag ==
"select" )
136 mod_select = curropt->
value;
137 if ( curropt->
tag ==
"componentradius" )
138 if ( ( compradius = curropt->
value.
real() ) < 0.001 )
139 cerr <<
"-componentradius: The component display radius must be specified!" << endl;
140 if ( curropt->
tag ==
"linkradius" )
141 if ( ( linkradius = curropt->
value.
real() ) < 0.001 )
142 cerr <<
"-linkradius: The link display radius must be specified!" << endl;
143 if ( curropt->
tag ==
"shift" )
144 if ( ( max_shift = curropt->
value.
real() ) < 0.001 )
145 cerr <<
"-shift: The maximum shift distance must be specified!" << endl;
146 if ( curropt->
tag ==
"timestep" )
147 if ( ( timestep = curropt->
value.
real() ) < 0.001 )
148 cerr <<
"-timestep: The time step must be specified!" << endl;
149 if ( curropt->
tag ==
"velocitylimit" )
150 if ( ( velocitylimit = curropt->
value.
real() ) < 0.001 )
151 cerr <<
"-velocitylimit: The velocity limit must be specified!" << endl;
152 if ( curropt->
tag ==
"friction" )
153 if ( ( Kfriction = curropt->
value.
real() ) < 1e-30 )
154 cerr <<
"-friction: The friction constant must be specified!" << endl;
155 if ( curropt->
tag ==
"neighbors" )
156 if ( curropt->
values(neighbors, neighbor_scale) < 1 )
157 cerr <<
"-neighbors: The number of neighbors must be specified!" << endl;
158 if ( curropt->
tag ==
"Kdistance" )
159 if ( ( Kdistance = curropt->
value.
real() ) < 1e-30 )
160 cerr <<
"-Kdistance: The distance force constant must be specified!" << endl;
161 if ( curropt->
tag ==
"Klink" )
162 if ( ( Klink = curropt->
value.
real() ) < 1e-30 )
163 cerr <<
"-Klink: The link force constant must be specified!" << endl;
164 if ( curropt->
tag ==
"Kangle" )
165 if ( ( Kangle = curropt->
value.
real() ) < 1e-30 )
166 cerr <<
"-Kangle: The angle force constant must be specified!" << endl;
167 if ( curropt->
tag ==
"Kpolyangle" )
168 if ( ( Kpolyangle = curropt->
value.
real() ) < 1e-30 )
169 cerr <<
"-Kpolyangle: The angle force constant for polygons must be specified!" << endl;
170 if ( curropt->
tag ==
"Kpolygon" )
171 if ( ( Kpolygon = curropt->
value.
real() ) < 1e-30 )
172 cerr <<
"-Kpolygon: The polygon regularity force constant must be specified!" << endl;
173 if ( curropt->
tag ==
"Kpolyplane" )
174 if ( ( Kpolyplane = curropt->
value.
real() ) < 1e-30 )
175 cerr <<
"-Kpolyplane: The polygon planarity force constant must be specified!" << endl;
176 if ( curropt->
tag ==
"Kpoint" )
177 if ( curropt->
values(Kpoint, decay) < 1 )
178 cerr <<
"-Kpoint: The point force constant must be specified!" << endl;
179 if ( curropt->
tag ==
"Kradial" )
180 if ( ( Kradial = curropt->
value.
real() ) < 1e-30 )
181 cerr <<
"-Kradial: The radial force constant must be specified!" << endl;
182 if ( curropt->
tag ==
"radius" )
183 if ( ( radius = curropt->
value.
real() ) < 1e-30 )
184 cerr <<
"-radius: The reference radial distance must be specified!" << endl;
185 if ( curropt->
tag ==
"Kplane" )
186 if ( ( Kplane = curropt->
value.
real() ) < 1e-30 )
187 cerr <<
"-Kplane: The neighbor plane force constant must be specified!" << endl;
188 if ( curropt->
tag ==
"Kguide" )
189 if ( ( Kguide = curropt->
value.
real() ) < 1e-30 )
190 cerr <<
"-Kguide: The polyhedron guide force constant must be specified!" << endl;
191 if ( curropt->
tag ==
"Kmap" )
192 if ( ( Kmap = curropt->
value.
real() ) < 1e-30 )
193 cerr <<
"-Kmap: The map force constant must be specified!" << endl;
194 if ( curropt->
tag ==
"sigma" )
195 if ( ( sigma = curropt->
value.
real() ) < 1e-30 )
196 cerr <<
"-sigma: The sigma value must be specified!" << endl;
197 if ( curropt->
tag ==
"parameters" )
199 if ( curropt->
tag ==
"guide" )
201 if ( curropt->
tag ==
"output" )
203 if ( curropt->
tag ==
"writeparam" )
212 while ( optind < argc )
string_add(&file_list, argv[optind++]);
214 cerr <<
"Error: No model files specified!" << endl;
222 cerr <<
"Error: Input file not read!" << endl;
236 if ( timestep > 0 ) mp->
timestep = timestep;
237 if ( Kfriction > 0 ) mp->
Kfriction = Kfriction;
238 if ( Kdistance > 0 ) mp->
Kdistance = Kdistance;
239 if ( Klink > 0 ) mp->
Klink = Klink;
240 if ( Kangle > 0 ) mp->
Kangle = Kangle;
241 if ( Kpolyangle > 0 ) mp->
Kpolyangle = Kpolyangle;
242 if ( Kpolygon > 0 ) mp->
Kpolygon = Kpolygon;
243 if ( Kpolyplane > 0 ) mp->
Kpolyplane = Kpolyplane;
244 if ( Kpoint > 0 ) mp->
Kpoint = Kpoint;
245 if ( Kradial > 0 ) mp->
Kradial = Kradial;
246 if ( radius > 0 ) mp->
radius = radius;
247 if ( Kplane > 0 ) mp->
Kplane = Kplane;
248 if ( Kguide > 0 ) mp->
Kguide = Kguide;
249 if ( Kmap > 0 ) mp->
Kmap = Kmap;
250 if ( sigma > 0 ) mp->
sigma = sigma;
252 if ( Kguide > 0 && guidefile.
length() )
A class for a command line input option.
int model_param_write(Bstring &filename, Bmodparam *mp)
Writes a model parameter file.
int model_check(Bmodel *model, Bstring path)
Checks model properties.
int string_kill(Bstring *list)
Kills a string linked list.
Header file for reading and writing atomic model files.
int model_param_display(Bmodparam *mp)
Displays a model parameter in the shell.
int model_param_set_type_indices(Bmodel *model, Bmodparam *mp)
Sets the component type indices from the model parameters.
long model_set_link_radius(Bmodel *model, double linkrad)
Set the display radius for all links to a specific value.
int bexit(int value)
Exit function for cleanup and debugging.
Boption * get_option_list(const char *use[], int argc, char *argv[], int &optind)
Parses command line arguments based on a template.
Header file for option handlers.
Library routines used for model link processing.
long models_process(Bmodel *model, long(modfunc)(Bmodel *))
Process a list of models using the specified function.
int model_color_by_fom(Bmodel *model)
Colors model components by fom.
long model_selection_stats(Bmodel *model)
Calculates selection statistics.
long values(T1 &v1, T2 &v2)
int model_kill(Bmodel *model)
Deallocates all memory in the list.
Header file for reading and writing atomic model files.
Utilities for timing functions.
Functions to do molecular mechanics.
long model_reset_selection(Bmodel *model)
Resets the selection to all components.
double timer_start()
Starts timer and prints the time.
Header file for general utilities.
int write_model(Bstring &filename, Bmodel *model)
Writes model parameters.
int main(int argc, char **argv)
double timer_report(double lasttime)
Reports the time elapsed since a given time.
int model_set_neighbors(Bmodel *model, int number)
Sets the desired number of components as neighbors for each component.
Bmodparam * model_param_generate(Bmodel *model)
Generates a model parameter file from a model.
Functions to manipulate model component neighbors.
int option_kill(Boption *option)
Deallocates a linked list of option structures.
Library routines used for model processing.
Bmodparam * model_param_read(Bstring &filename)
Reads a model parameter file.
Bmodel * read_model(Bstring &filename)
int model_param_kill(Bmodparam *mp)
Deallocates memory for a model parameter structure.
long model_set_component_radius(Bmodel *model, double comprad)
Set the display radius for all components to a specific value.
double model_mechanics(Bmodel *model, Bmodparam *mp, int mm_type, int max_iter, double max_shift, double velocitylimit)
Minimizes the energy of a model.
Functions to color models.
Bstring * string_add(Bstring **list, const char *string)
Adds a string to a linked list.
Header to read and write model dynamics parameters in STAR format.
long model_select(Bmodel *model, Bstring &comptype)
Selects models, components and component types.