| Bsoft 2.0.5 Bernard's software package

Classes | Macros | Functions
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...
Vector3< double > * | symmetry_get_axes (Bsymmetry *sym, long &nax)
| 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: 20190417

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,
|  | int | flag
| ) |  |

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

Parameters

  *sym | symmetry structure.
  theta_step | angular step size from primary symmetry axis (radians).
  phi_step | angular step size around primary symmetry axis (radians).
  flag | flag 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 570 of file symmetry.cpp.

## ◆ asymmetric_unit_views() [2/2]

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

Definition at line 746 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

  *sym | symmetry structure.
  *view | list of views (replaced).

Returns
  int 0.

      The view is replaced with the one in the standard asymmetric unit.

Definition at line 834 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

  *sym | symmetry structure.
  theview | view.

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 856 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

  *sym | symmetry structure.
  view_ref | reference view.
  view | test 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 939 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_string | string 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

  *sym | symmetry 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_view | asymmetric unit view.
  *sym | symmetry structure.

Returns
  View picked view.

Definition at line 1011 of file symmetry.cpp.

## ◆ reference_asymmetric_unit_views()

View* reference_asymmetric_unit_views | ( | Bsymmetry * | sym | ) |

Returns a reference view for each asymmetric unit.

Parameters

  *sym | symmetry structure.

Returns
  View* reference views.

Definition at line 972 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

  *sym | symmetry structure.
  side_ang | starting angle (radians).
  theta_step | angular step size perpendicular to equator (radians).
  phi_step | angular 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 769 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 814 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

  nsym | number of symmetry operators.
  *symop | array of symmetry operator lines.
  line_len | length 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 1069 of file symmetry.cpp.

## ◆ sym_show_matrices()

int sym_show_matrices | ( | Bsymmetry * | sym | ) |

Show symmetry matrices.

Parameters

  *sym | symmetry structure.

Returns
  int number of symmetry matrices.

Definition at line 1118 of file symmetry.cpp.

## ◆ sym_show_operational_matrices()

int sym_show_operational_matrices | ( | Bsymmetry * | sym | ) |

Show symmetry matrices associated with each symmetry operator.

Parameters

  *sym | symmetry structure.

Returns
  int number of symmetry matrices.

Definition at line 1146 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

  *sym | symmetry structure.

Returns
  int number of symmetry matrices.

Definition at line 1167 of file symmetry.cpp.

## ◆ symmetry_clean_pointgroup()

Bstring symmetry_clean_pointgroup | ( | Bstring & | symmetry_string | ) |

Corrects an existing point group string.

Parameters

  &symmetry_string | string 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

  *sym | symmetry structure.
  &nsym | number 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 520 of file symmetry.cpp.

## ◆ symmetry_get_all_views() [1/2]

View* symmetry_get_all_views | ( | Bsymmetry * | sym,
|  | View | asu_view
| ) |  |

Get all symmetry-related views of one given view.

Parameters

  *sym | symmetry structure.
  asu_view | asymmetric 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 448 of file symmetry.cpp.

## ◆ symmetry_get_all_views() [2/2]

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

Definition at line 492 of file symmetry.cpp.

## ◆ symmetry_get_axes()

Vector3<double>* symmetry_get_axes | ( | Bsymmetry * | sym,
|  | long & | nax
| ) |  |

Get all symmetry axes.

Parameters

  *sym | symmetry structure.
  &nax | pointer to number of axes.

Returns
  Vector3<double>* array of axes.

Definition at line 379 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_rise | helical rise (angstroms).
  helix_angle | helical rotation angle (radians).
  dyad_axis | presence of dyad axis (1/2).
  cyclic | cyclic symmetry.
  seam_shift | fractional 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

  *sym | symmetry 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

  *sym | symmetry structure.
  axis | desired symmetry axis order.
  axis_flag | view 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

  theview | view to test.
  *sym | symmetry structure.

Returns
  int view number.

Definition at line 1035 of file symmetry.cpp.

## ◆ view_symmetry_reference()

View view_symmetry_reference | ( | Bsymmetry * | sym | ) |

Returns an asymmetric unit reference point.

Parameters

  *sym | symmetry structure.

Returns
  View reference view.

Definition at line 315 of file symmetry.cpp.