 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
29 "Usage: bpoly [options] in1.star [in2.star...]",
30 "---------------------------------------------",
31 "Manipulate model polyhedral coordinate files.",
34 "-center Center before all other operations.",
35 "-rename Rename components based on the number of links.",
36 "-vertextypes 1 Determine vertex types from adjacent polygons (1=3-digit, 2=6-digit).",
37 "-views local Calculate views for components. Modes: origin: current origin,",
38 " com: center-of-mass origin, map: map origin, local: neigbor plane.",
39 "-analyze Analyze the polyhedrons.",
40 "-angles Analyze the angles in polyhedrons.",
41 "-energy 112.4 Calculate the energy components of models using the given reference angle.",
42 " If the angle is 0, the inner polygon angle will be used as reference.",
43 "-pentagon Calculate the pentagon adjacency.",
44 "-sphericity Estimate the spherical nature of the polyhedron.",
45 "-ellipsoidicity Estimate the ellipsoid nature of the polyhedron.",
46 "-wiener Calculate the Wiener index for each polyhedron.",
47 "-eigen Do an eigenanalysis for each polyhedron.",
48 "-coordinates Generate new coordinates based on spherical harmonics.",
49 "-dual Calculate the dual of a polyhedron.",
50 "-faces 5 Generate a dual using only the faces of the given order.",
51 "-find 34.7 Find symmetry axes with an RMSD below the given value.",
52 "-regularize 150 Number of iterations for regularizing a polyhedron.",
55 "-all Reset selection to all components before other selections.",
56 "-closed order,3 Select based on valency (valency,<n>) or polygon order (order,<n>).",
57 "-select #232@14 Select models and components.",
60 "-verbose 7 Verbosity of output.",
61 "-componentradius 0.5 Component display radius.",
62 "-linkradius 0.5 Link display radius.",
64 "Regularization parameters:",
65 "-distance 212 Interaction reference distance.",
66 "-linklength 150 Vertex link reference length.",
67 "-Kdistance 0.1 Distance force constant (default 0).",
68 "-Klink 0.01 Link force constant (default 0.1).",
69 "-Kpolyangle 0.1 Angle force constant (default 0.01).",
70 "-Kpolygon 0.001 Polygon regularity force constant (default 0).",
71 "-Kpolyplane 0.1 Polygon planarity force constant (default 0).",
72 "-Kpoint 0.1,0.02 Point force constant and decay (default 0,0.01).",
75 "-parameters parm.star Molecular parameter file (default atom_prop.star).",
78 "-output file.star Output model parameter file.",
83 int main(
int argc,
char **argv)
108 double compradius(0);
109 double linkradius(0);
110 double linklength(0);
113 double Kpolyangle(0.01);
115 double Kpolyplane(0);
126 for ( curropt = option; curropt; curropt = curropt->
next ) {
127 if ( curropt->
tag ==
"all" ) reset = 1;
128 if ( curropt->
tag ==
"closed" ) {
129 if ( curropt->
value[0] ==
'v' ) closure_rule = 1;
130 if ( curropt->
value[0] ==
'o' ) closure_rule = 2;
134 if ( curropt->
tag ==
"select" )
135 mod_select = curropt->
value;
136 if ( curropt->
tag ==
"center" ) center = 1;
137 if ( curropt->
tag ==
"rename" ) rename = 1;
138 if ( curropt->
tag ==
"vertextypes" )
140 cerr <<
"-vertextypes: A selection number must be specified!" << endl;
141 if ( curropt->
tag ==
"views" ) calc_views = curropt->
value.
lower();
142 if ( curropt->
tag ==
"analyze" ) analyze = 1;
143 if ( curropt->
tag ==
"angles" ) angles = 1;
144 if ( curropt->
tag ==
"energy" ) {
145 if ( ( angle_ref = curropt->
value.
real() ) < 1e-30 )
146 cerr <<
"-energy: A reference angle must be specified!" << endl;
148 angle_ref *=
M_PI/180.0;
149 if ( angle_ref <= 0 ) angle_ref = -1;
152 if ( curropt->
tag ==
"pentagon" ) pentagon = 1;
153 if ( curropt->
tag ==
"sphericity" )
sphere = 1;
154 if ( curropt->
tag ==
"ellipsoidicity" ) ellips = 1;
155 if ( curropt->
tag ==
"wiener" ) wiener = 1;
156 if ( curropt->
tag ==
"eigen" ) eigen = 1;
157 if ( curropt->
tag ==
"coordinates" ) coor = 1;
158 if ( curropt->
tag ==
"dual" ) dual = 1;
159 if ( curropt->
tag ==
"faces" )
161 cerr <<
"-faces: A polygon order must be specified!" << endl;
162 if ( curropt->
tag ==
"find" )
163 if ( ( find = curropt->
value.
real() ) < 1e-30 )
164 cerr <<
"-find: A RMSD cutoff must be specified!" << endl;
165 if ( curropt->
tag ==
"regularize" )
167 cerr <<
"-regularize: The number of iterations must be specified!" << endl;
168 if ( curropt->
tag ==
"distance" )
170 cerr <<
"-distance: The reference distance separating vertices must be specified!" << endl;
171 if ( curropt->
tag ==
"componentradius" )
172 if ( ( compradius = curropt->
value.
real() ) < 1e-30 )
173 cerr <<
"-componentradius: The component display radius must be specified!" << endl;
174 if ( curropt->
tag ==
"linkradius" )
175 if ( ( linkradius = curropt->
value.
real() ) < 1e-30 )
176 cerr <<
"-linkradius: The link display radius must be specified!" << endl;
177 if ( curropt->
tag ==
"linklength" )
178 if ( ( linklength = curropt->
value.
real() ) < 1e-30 )
179 cerr <<
"-linklength: The link length must be specified!" << endl;
180 if ( curropt->
tag ==
"Kdistance" )
181 if ( ( Kdistance = curropt->
value.
real() ) < 1e-30 )
182 cerr <<
"-Kdistance: The distance interaction strength must be specified!" << endl;
183 if ( curropt->
tag ==
"Klink" )
184 if ( ( Klink = curropt->
value.
real() ) < 1e-30 )
185 cerr <<
"-Klink: The link strength must be specified!" << endl;
186 if ( curropt->
tag ==
"Kpolyangle" )
187 if ( ( Kpolyangle = curropt->
value.
real() ) < 1e-30 )
188 cerr <<
"-Kpolyangle: The angle strength must be specified!" << endl;
189 if ( curropt->
tag ==
"Kpolygon" )
190 if ( ( Kpolygon = curropt->
value.
real() ) < 1e-30 )
191 cerr <<
"-Kpolygon: The polygon regularity strength must be specified!" << endl;
192 if ( curropt->
tag ==
"Kpolyplane" )
193 if ( ( Kpolyplane = curropt->
value.
real() ) < 1e-30 )
194 cerr <<
"-Kpolyplane: The polygon planarity strength must be specified!" << endl;
195 if ( curropt->
tag ==
"Kpoint" )
196 if ( curropt->
values(Kpoint, decay) < 1 )
197 cerr <<
"-Kpoint: The point force strength must be specified!" << endl;
198 if ( curropt->
tag ==
"parameters" )
200 if ( curropt->
tag ==
"output" )
209 while ( optind < argc )
string_add(&file_list, argv[optind++]);
211 cerr <<
"Error: No model files specified!" << endl;
219 cerr <<
"Error: Input file not read!" << endl;
255 cout <<
"Model\tSphericity\tEllipsoidicity" << endl;
259 cout << mp->
id <<
tab << sph <<
tab << ell << endl;
262 cout <<
"Model\tSphericity" << endl;
265 cout << mp->
id <<
tab << sph << endl;
267 }
else if ( ellips ) {
268 cout <<
"Model\tEllipsoidicity" << endl;
271 cout << mp->
id <<
tab << ell << endl;
279 if ( dual || faces ) {
293 cout <<
"Model\tPgroup" << endl;
305 Klink, Kpolyangle, Kpolygon, Kpolyplane, Kpoint, decay);
A class for a command line input option.
int main(int argc, char **argv)
int model_check(Bmodel *model, Bstring path)
Checks model properties.
long model_rename_components(Bmodel *model)
Rename components.
vector< double > model_poly_sphere_coor(Bmodel *model)
Generates coordinates for components based on the eigenvectors of the adjacency matrix.
int string_kill(Bstring *list)
Kills a string linked list.
Header file for reading and writing atomic model files.
int model_vertex_types(Bmodel *model)
Determines the vertex type based on adjacent polygons.
long model_set_link_length(Bmodel *model, double linklength)
Sets the reference link lengths.
double model_ellipsoidicity(Bmodel *model)
Calculates how close the model is to an ellipsoid shape.
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.
int model_poly_angles(Bmodel *model)
Calculates all the polygon angles.
Library routines used for model processing.
double model_wiener_index(Bmodel *model)
Calculates the Wiener index.
vector< double > model_poly_eigenvalues(Bmodel *model, int show)
Generates the eigenvalues of the adjacency matrix for a model.
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_regularize(Bmodel *model, int reg_iter, double distance, double Kdistance, double Klink, double Kangle, double Kpoly, double Kpolyplane, double Kpoint, double decay)
Regularizes a model.
long model_selection_stats(Bmodel *model)
Calculates selection statistics.
long values(T1 &v1, T2 &v2)
Bstring model_poly_find_symmetry(Bmodel *model, double find)
Finds the symmetry axes associated with polyhedral elements.
Bmodel * model_poly_dual(Bmodel *model, int order)
Calculates the dual of a polyhedral network.
int model_poly_pentagon_adjacency(Bmodel *model)
Calculates the number of edges shared by pentagons.
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_calculate_views(Bmodel *model, Bstring &mode)
Calculates the views associated with each component.
double distance(vector< T1 > &v1, vector< T2 > &v2)
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.
ostream & tab(ostream &out)
double model_poly_energy(Bmodel *model, double angle_ref)
Calculates the different energy terms for all models.
int model_extended_vertex_types(Bmodel *model)
Determines the vertex type based on adjacent and opposed polygons.
double timer_report(double lasttime)
Reports the time elapsed since a given time.
Library routines used for analysing model component views.
long model_select_closed(Bmodel *model, int closure_rule, int val_order)
Determines if a polyhedron is closed given a rule.
int model_poly_analyze(Bmodel *model)
Analyzes a model for polygon regularity and planarity.
Functions to manipulate polyhedral coordinate files.
int option_kill(Boption *option)
Deallocates a linked list of option structures.
int model_poly_generate(Bmodel *model)
Generates polygons based on a vertex network.
Library routines used for model processing.
Bmodel * read_model(Bstring &filename)
double model_sphericity(Bmodel *model)
Calculates how close the model is to a spherical shape.
bool contains(const Bstring &s)
long model_set_component_radius(Bmodel *model, double comprad)
Set the display radius for all components to a specific value.
Library routines used for shell model processing.
Bstring * string_add(Bstring **list, const char *string)
Adds a string to a linked list.
long model_select(Bmodel *model, Bstring &comptype)
Selects models, components and component types.