 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
38 if ( !sym )
return -1;
41 cout <<
"Setting asymmetric unit for " <<
model->
id <<
" to symmetry " << sym->
label << endl;
47 for ( comp =
model->
comp; comp; comp = comp->
next, ncomp++ ) {
50 comp->
view = view_asu;
79 long ncomp(0), nlink(0), id(0);
83 for ( i=0; i<sym->
n; i++ ) nunits *= sym->
op[i].
order;
95 for ( new_comp = comp->
next; new_comp; new_comp = new_comp->
next ) {
104 cout <<
"Applying symmetry " << sym->
label <<
":" << endl;
105 cout <<
"Number of asymmetric units: " << nunits << endl;
106 cout <<
"Origin for symmetrization: " << origin << endl;
107 cout <<
"Reference symmetry axis: " << ref_view << endl;
108 cout <<
"Reference rotation angle: " << ref_view.
angle()*180/
M_PI << endl;
109 cout <<
"Overlap distance cutoff: " <<
distance << endl << endl;
111 cout << endl <<
"Applying symmetry " << sym->
label << endl << endl;
122 Blink* new_link = NULL;
123 Blink* link_start = NULL;
127 if ( id < comp->
id.integer() )
id = comp->
id.
integer();
137 for ( nlink = 0, link =
model->
link; link; link = link->
next ) nlink++;
139 for ( i=0; i<sym->
n; i++ ) {
140 new_axis = ref_mat * sym->
op[i].
axis;
141 for ( j=1; j<sym->
op[i].
order; j++ ) {
145 for ( k=0, link =
model->
link; k<nlink; link = link->next, k++ ) {
148 if ( !link_start ) link_start = new_link;
155 for ( k=0, comp =
model->
comp; k<ncomp; comp = comp->next, k++ ) {
160 v = comp->
loc - origin;
161 new_comp->
loc = (mat * v) + origin;
165 for ( link = link_start; link; link = link->
next ) {
166 if ( link->
comp[0] == comp ) link->
comp[0] = new_comp;
167 if ( link->
comp[1] == comp ) link->
comp[1] = new_comp;
287 for ( i=0; i<sym->
n; i++ ) nunits *= sym->
op[i].
order;
294 cout << endl <<
"Symmetrizing " << symmetry_string <<
":" << endl;
295 cout <<
"Number of asymmetric units: " << nunits << endl << endl;
297 cout << endl <<
"Symmetrizing " << symmetry_string << endl << endl;
300 double tol(1e-4), d, dmin, R(0);
309 for ( nasu=0, comp =
model->
comp; comp; comp = comp->
next ) {
314 if ( view.
distance(view_asu) < tol ) {
323 for ( dmin = 1e30, compasu =
model->
comp; compasu; compasu = compasu->
next )
if ( compasu->
sel ) {
340 cout <<
"Model: " <<
model->
id << endl;
341 cout <<
"Asymmetric unit components: " << nasu << endl;
342 cout <<
"Comp\tCount" << endl;
349 cout << comp->
id <<
tab << comp->
sel << endl;
357 cout <<
"Symmetry deviation: " << R <<
" A" << endl << endl;
392 for ( v = views->
next; v; v = v->
next ) {
double distance(const View &view)
View * symmetry_get_all_views(Bsymmetry *sym, View asu_view)
Get all symmetry-related views of one given view.
char * add_item(char **list, unsigned long size)
Adds an item to a linked list.
long model_apply_point_group(Bmodel *model, Bstring &symmetry_string, Vector3< double > origin, View ref_view, int flags)
Applying symmetry to model components.
int model_component_count(Bmodel *model)
Counts the total number of components.
Header file for general symmetry functions.
Header file for functions for creating random images.
3x3 Matrix manipulation functions
Bmodel * model_copy(Bmodel *model)
Copies a model.
Functions to compare models and components.
double distance(const Vector3 &v)
long model_symmetry_related(Bmodel *model, Bstring &symmetry_string)
Generates a list of symmetry-related models.
long model_find_asymmetric_unit(Bmodel *model, Bstring &symmetry_string)
Set model component locations within the asymmetric unit.
long model_symmetrize(Bmodel *model, Bstring &symmetry_string)
Symmetrize a model.
long model_average_overlapped_components(Bmodel *model, double distance)
Averages components within a distance.
long model_delete_non_selected(Bmodel **model)
Deletes selected components and associated links from the model.
Header file for reading and writing atomic model files.
View find_asymmetric_unit_view(Bsymmetry *sym, View theview)
Finds the corresponding view in the asymmetric unit.
double distance(vector< T1 > &v1, vector< T2 > &v2)
Library routines used to compare sets of atomic coordinates.
Header file for general utilities.
ostream & tab(ostream &out)
Vector3< double > vector3()
Bsymmetry * init_point_group_symmetry(Bstring symmetry_string)
Sets up a symmetry structure from a string identifier.
int kill_symmetry(Bsymmetry *sym)
Deallocates a symmetry structure.
Header file for generalized linked list functions.
Library routines used for model processing.
long models_apply_point_group(Bmodel *model, Bstring &symmetry_string, Vector3< double > origin, View ref_view, int flags)
Applying symmetry to model components.
int component_copy(Bcomponent *fromcomp, Bcomponent *tocomp)
Copies all elements from one component to another.
Library routines used for atomic coordinates.