Bsoft  2.1.0
Bernard's software package
symmetry.h File Reference

Header file for general symmetry functions. More...

#include "View.h"
#include "Bstring.h"

Go to the source code of this file.

Classes

struct  Bsymop
 
struct  Bsymmetry
 

Macros

#define _Bsymmetry_
 

Functions

Bsymmetry * init_point_group_symmetry (Bstring symmetry_string)
 Sets up a symmetry structure from a string identifier. More...
 
int kill_symmetry (Bsymmetry *sym)
 Deallocates a symmetry structure. More...
 
Bstring symmetry_clean_pointgroup (Bstring &symmetry_string)
 Corrects an existing point group string. More...
 
string symmetry_helical_label (double helix_rise, double helix_angle, int dyad_axis, int cyclic, double seam_shift)
 Returns the label for helical symmetry. More...
 
int symmetry_order (Bsymmetry *sym)
 Returns the symmetry order. More...
 
View view_symmetry_reference (Bsymmetry *sym)
 Returns an asymmetric unit reference point. More...
 
Matrix3 symmetry_rotate_to_axis (Bsymmetry *sym, long axis, long axis_flag)
 Rotation matrix to orient a symmetry axis on the z axis. More...
 
vector< Vector3< double > > symmetry_get_axes (Bsymmetry *sym)
 Get all symmetry axes. More...
 
View * symmetry_get_all_views (Bsymmetry *sym, View asu_view)
 Get all symmetry-related views of one given view. More...
 
View * symmetry_get_all_views (Bsymmetry *sym, View *views)
 
Matrix3 * symmetry_get_all_matrices (Bsymmetry *sym, long &nsym)
 Get all symmetry-related views of one given view. More...
 
View * asymmetric_unit_views (Bsymmetry *sym, double theta_step, double phi_step, int flag)
 Initializes a well-distributed set of views in an asymmetric unit. More...
 
View * asymmetric_unit_views (Bsymmetry *sym, double theta_step, double phi_step, double alpha_step, int flag)
 
View * side_views (Bsymmetry *sym, double side_ang, double theta_step, double phi_step)
 Initializes a set of views around the z-axis for helical projection. More...
 
View * side_views (Bsymmetry *sym, double side_ang, double theta_step, double phi_step, double alpha_step)
 
int change_views_to_asymmetric_unit (Bsymmetry *sym, View *view)
 Change the views to those in the asymmetric unit. More...
 
View find_asymmetric_unit_view (Bsymmetry *sym, View theview)
 Finds the corresponding view in the asymmetric unit. More...
 
View find_closest_symmetric_view (Bsymmetry *sym, View view_ref, View view)
 Finds the closest symmetric match between two views. More...
 
View * reference_asymmetric_unit_views (Bsymmetry *sym)
 Returns a reference view for each asymmetric unit. More...
 
View random_symmetric_view (View &asu_view, Bsymmetry *sym)
 Returns a randomly picked symmetry view. More...
 
int test_asymmetric_unit_view (View theview, Bsymmetry *sym)
 Returns an asymmetric unit index number. More...
 
float * sym_matrices_from_text_list (int nsym, char *symop, int line_len)
 Calculates symmetry matrices from a list of strings. More...
 
int sym_show_matrices (Bsymmetry *sym)
 Show symmetry matrices. More...
 
int sym_show_operational_matrices (Bsymmetry *sym)
 Show symmetry matrices associated with each symmetry operator. More...
 
int sym_show_pdb_matrices (Bsymmetry *sym)
 Show PDB format symmetry matrices associated with each symmetry operator. More...
 

Detailed Description

Header file for general symmetry functions.

Author
Bernard Heymann
Date
Created: 20010420
Modified: 20191222

Definition in file symmetry.h.

Macro Definition Documentation

◆ _Bsymmetry_

#define _Bsymmetry_

Definition at line 45 of file symmetry.h.

Function Documentation

◆ asymmetric_unit_views() [1/2]

View* asymmetric_unit_views ( Bsymmetry *  sym,
double  theta_step,
double  phi_step,
double  alpha_step,
int  flag 
)

Definition at line 740 of file symmetry.cpp.

◆ asymmetric_unit_views() [2/2]

View* asymmetric_unit_views ( Bsymmetry *  sym,
double  theta_step,
double  phi_step,
int  flag 
)

Initializes a well-distributed set of views in an asymmetric unit.

Parameters
*symsymmetry structure.
theta_stepangular step size from primary symmetry axis (radians).
phi_stepangular step size around primary symmetry axis (radians).
flagflag for generating a full asymmetric unit (default 0=half).
Returns
View* a linked list of views.
A set of views is calculated with tesselation within each asymmetric
unit such that the views are well-distributed.
If the full flag is set, both halves of the asymmetric unit are covered.

Definition at line 564 of file symmetry.cpp.

◆ change_views_to_asymmetric_unit()

int change_views_to_asymmetric_unit ( Bsymmetry *  sym,
View *  view 
)

Change the views to those in the asymmetric unit.

Parameters
*symsymmetry structure.
*viewlist of views (replaced).
Returns
int 0.
The view is replaced with the one in the standard asymmetric unit.

Definition at line 828 of file symmetry.cpp.

◆ find_asymmetric_unit_view()

View find_asymmetric_unit_view ( Bsymmetry *  sym,
View  theview 
)

Finds the corresponding view in the asymmetric unit.

Parameters
*symsymmetry structure.
theviewview.
Returns
View the asymmetric unit view.
The asymmetric unit view is found and the the new view with the 
link from the old view is returned.

Definition at line 850 of file symmetry.cpp.

◆ find_closest_symmetric_view()

View find_closest_symmetric_view ( Bsymmetry *  sym,
View  view_ref,
View  view 
)

Finds the closest symmetric match between two views.

Parameters
*symsymmetry structure.
view_refreference view.
viewtest view.
Returns
View matched symmetric version of test view.
A list of symmetry-related views of the test view is searched
for the closest to the reference view.
The matched view is returned.

Definition at line 933 of file symmetry.cpp.

◆ init_point_group_symmetry()

Bsymmetry* init_point_group_symmetry ( Bstring  symmetry_string)

Sets up a symmetry structure from a string identifier.

Parameters
symmetry_stringstring containing point group identifier.
Returns
Bsymmetry* sym new symmetry structure.
The point group symmetries are identified by the following strings:
    C<n>            cyclic point group of order n.
    D<n>            dihedral point group of order n.
    T               tetrahedral point group.
    O               octahedral/cubic point group.
    I               icosahedral/dodecahedral point group.
    H<r>,<a>,<d>    helical symmetry with rise r, rise angle a and dyad d (1/2).
For the higher symmetries the following adjustments are available:
    T-3             no three-fold operator.
    O-3             no three-fold operator.
    I-3             no three-fold operator.
    I90             90 degrees rotated around z-axis.
    I90-3           90 degrees rotated around z-axis and no three-fold operator.
If the point group string is empty (NULL), the default is C1 (asymmetric).

Definition at line 39 of file symmetry.cpp.

◆ kill_symmetry()

int kill_symmetry ( Bsymmetry *  sym)

Deallocates a symmetry structure.

Parameters
*symsymmetry structure.
Returns
int 0.

Definition at line 207 of file symmetry.cpp.

◆ random_symmetric_view()

View random_symmetric_view ( View &  asu_view,
Bsymmetry *  sym 
)

Returns a randomly picked symmetry view.

Parameters
&asu_viewasymmetric unit view.
*symsymmetry structure.
Returns
View picked view.

Definition at line 1005 of file symmetry.cpp.

◆ reference_asymmetric_unit_views()

View* reference_asymmetric_unit_views ( Bsymmetry *  sym)

Returns a reference view for each asymmetric unit.

Parameters
*symsymmetry structure.
Returns
View* reference views.

Definition at line 966 of file symmetry.cpp.

◆ side_views() [1/2]

View* side_views ( Bsymmetry *  sym,
double  side_ang,
double  theta_step,
double  phi_step 
)

Initializes a set of views around the z-axis for helical projection.

Parameters
*symsymmetry structure.
side_angstarting angle (radians).
theta_stepangular step size perpendicular to equator (radians).
phi_stepangular step size around equator (radians).
Returns
View* a set of 4-value views.
A set of views is calculated corresponding to views around the z-axis
including some tilting to account for oblique views.

Definition at line 763 of file symmetry.cpp.

◆ side_views() [2/2]

View* side_views ( Bsymmetry *  sym,
double  side_ang,
double  theta_step,
double  phi_step,
double  alpha_step 
)

Definition at line 808 of file symmetry.cpp.

◆ sym_matrices_from_text_list()

float* sym_matrices_from_text_list ( int  nsym,
char *  symop,
int  line_len 
)

Calculates symmetry matrices from a list of strings.

Parameters
nsymnumber of symmetry operators.
*symoparray of symmetry operator lines.
line_lenlength of text line in the array.
Returns
float* a set of 12-value symmetry matrices.
The list of strings is expected to be packed into a single character
array with a fixed length for each string. Each string encodes a
symmetry operation in terms of x, y and z operations in reciprocal
space. 

Definition at line 1063 of file symmetry.cpp.

◆ sym_show_matrices()

int sym_show_matrices ( Bsymmetry *  sym)

Show symmetry matrices.

Parameters
*symsymmetry structure.
Returns
int number of symmetry matrices.

Definition at line 1112 of file symmetry.cpp.

◆ sym_show_operational_matrices()

int sym_show_operational_matrices ( Bsymmetry *  sym)

Show symmetry matrices associated with each symmetry operator.

Parameters
*symsymmetry structure.
Returns
int number of symmetry matrices.

Definition at line 1140 of file symmetry.cpp.

◆ sym_show_pdb_matrices()

int sym_show_pdb_matrices ( Bsymmetry *  sym)

Show PDB format symmetry matrices associated with each symmetry operator.

Parameters
*symsymmetry structure.
Returns
int number of symmetry matrices.

Definition at line 1161 of file symmetry.cpp.

◆ symmetry_clean_pointgroup()

Bstring symmetry_clean_pointgroup ( Bstring &  symmetry_string)

Corrects an existing point group string.

Parameters
&symmetry_stringstring containing point group identifier.
Returns
Bstring the clean string.
A point group string is converted to .

Definition at line 226 of file symmetry.cpp.

◆ symmetry_get_all_matrices()

Matrix3* symmetry_get_all_matrices ( Bsymmetry *  sym,
long &  nsym 
)

Get all symmetry-related views of one given view.

Parameters
*symsymmetry structure.
&nsymnumber of matrices.
Returns
Matrix3* array of matrices.
The number of views generated for a point group symmetry is
calculated as the product of the order fields in the symmetry
structure.

Definition at line 514 of file symmetry.cpp.

◆ symmetry_get_all_views() [1/2]

View* symmetry_get_all_views ( Bsymmetry *  sym,
View *  views 
)

Definition at line 486 of file symmetry.cpp.

◆ symmetry_get_all_views() [2/2]

View* symmetry_get_all_views ( Bsymmetry *  sym,
View  asu_view 
)

Get all symmetry-related views of one given view.

Parameters
*symsymmetry structure.
asu_viewasymmetric unit vector and rotation angle.
Returns
View* linked list of views.
The number of views generated for a point group symmetry is
calculated as the product of the order fields in the symmetry
structure.

Definition at line 442 of file symmetry.cpp.

◆ symmetry_get_axes()

vector<Vector3<double> > symmetry_get_axes ( Bsymmetry *  sym)

Get all symmetry axes.

Parameters
*symsymmetry structure.
Returns
vector<Vector3<double>> array of axes.

Definition at line 378 of file symmetry.cpp.

◆ symmetry_helical_label()

string symmetry_helical_label ( double  helix_rise,
double  helix_angle,
int  dyad_axis,
int  cyclic,
double  seam_shift 
)

Returns the label for helical symmetry.

Parameters
helix_risehelical rise (angstroms).
helix_anglehelical rotation angle (radians).
dyad_axispresence of dyad axis (1/2).
cycliccyclic symmetry.
seam_shiftfractional shift for seamed helices.
Returns
string label.
Thge symmetry order is defined as the product of all the individual
orders of the symmetry operations, or alternatively, the number of views.

Definition at line 280 of file symmetry.cpp.

◆ symmetry_order()

int symmetry_order ( Bsymmetry *  sym)

Returns the symmetry order.

Parameters
*symsymmetry structure.
Returns
int order.
The symmetry order is defined as the product of all the individual
orders of the symmetry operations, or alternatively, the number of views.

Definition at line 301 of file symmetry.cpp.

◆ symmetry_rotate_to_axis()

Matrix3 symmetry_rotate_to_axis ( Bsymmetry *  sym,
long  axis,
long  axis_flag 
)

Rotation matrix to orient a symmetry axis on the z axis.

Parameters
*symsymmetry structure.
axisdesired symmetry axis order.
axis_flagview modifier.
Returns
Matrix3 new rotation matrix.

Definition at line 347 of file symmetry.cpp.

◆ test_asymmetric_unit_view()

int test_asymmetric_unit_view ( View  theview,
Bsymmetry *  sym 
)

Returns an asymmetric unit index number.

Parameters
theviewview to test.
*symsymmetry structure.
Returns
int view number.

Definition at line 1029 of file symmetry.cpp.

◆ view_symmetry_reference()

View view_symmetry_reference ( Bsymmetry *  sym)

Returns an asymmetric unit reference point.

Parameters
*symsymmetry structure.
Returns
View reference view.

Definition at line 315 of file symmetry.cpp.