Bsoft  2.1.0
Bernard's software package
symmetry.h
Go to the documentation of this file.
1 
9 #include "View.h"
10 #include "Bstring.h"
11 
12 #ifndef _Bsymmetry_
13 /************************************************************************
14 @Object: struct Bsymop
15 @Description:
16  General symmetry operator.
17 @Features:
18  Both point groups and space groups are covered.
19  A symmetry operator describes the complete series of rotations around
20  an axis, with the number of operations given by the order field
21  and the rotation angle given by the angle field. The shift field
22  is used in gliding operations, such as needed for helical symmetry.
23 *************************************************************************/
24 struct Bsymop {
25  Vector3<double> axis; // Symmetry axis
26  int order; // Number of times the operation is applied, 1=identity
27  double angle; // Rotation angle, derived from order when 0
28  double shift; // Shift up symmetry axis for helix
29 } ;
30 
31 /************************************************************************
32 @Object: struct Bsymmetry
33 @Description:
34  General symmetry structure.
35 @Features:
36  Both point groups and space groups are covered.
37 *************************************************************************/
38 struct Bsymmetry {
39  int point; // Point group (< 1 if a crystal)
40  int space; // Space group (< 1 if not a crystal)
41  Bstring label; // Symmetry label string
42  int n; // Number of symmetry operators
43  Bsymop* op; // Symmetry operators
44 } ;
45 #define _Bsymmetry_
46 #endif
47 
48 // Function prototypes
50 int kill_symmetry(Bsymmetry* sym);
51 Bstring symmetry_clean_pointgroup(Bstring& symmetry_string);
52 string symmetry_helical_label(double helix_rise, double helix_angle,
53  int dyad_axis, int cyclic, double seam_shift);
54 int symmetry_order(Bsymmetry* sym);
56 Matrix3 symmetry_rotate_to_axis(Bsymmetry* sym, long axis, long axis_flag);
57 vector<Vector3<double>> symmetry_get_axes(Bsymmetry* sym);
58 View* symmetry_get_all_views(Bsymmetry* sym, View asu_view);
61 View* asymmetric_unit_views(Bsymmetry* sym, double theta_step, double phi_step, int flag);
62 View* asymmetric_unit_views(Bsymmetry* sym, double theta_step, double phi_step, double alpha_step, int flag);
63 View* side_views(Bsymmetry* sym, double side_ang, double theta_step, double phi_step);
64 View* side_views(Bsymmetry* sym, double side_ang, double theta_step, double phi_step, double alpha_step);
67 View find_closest_symmetric_view(Bsymmetry* sym, View view_ref, View view);
69 View random_symmetric_view(View& asu_view, Bsymmetry* sym);
70 int test_asymmetric_unit_view(View theview, Bsymmetry* sym);
71 float* sym_matrices_from_text_list(int nsym, char* symop, int line_len);
75 
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.
Definition: symmetry.cpp:347
Bsymmetry::n
int n
Definition: symmetry.h:42
symmetry_get_all_views
View * symmetry_get_all_views(Bsymmetry *sym, View asu_view)
Get all symmetry-related views of one given view.
Definition: symmetry.cpp:442
Bsymmetry::space
int space
Definition: symmetry.h:40
Bsymmetry::point
int point
Definition: symmetry.h:39
Bstring
Definition: Bstring.h:29
Vector3< double >
asymmetric_unit_views
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.
Definition: symmetry.cpp:564
View
Definition: View.h:26
Bsymmetry
Definition: symmetry.h:38
Bsymop::axis
Vector3< double > axis
Definition: symmetry.h:25
change_views_to_asymmetric_unit
int change_views_to_asymmetric_unit(Bsymmetry *sym, View *view)
Change the views to those in the asymmetric unit.
Definition: symmetry.cpp:828
test_asymmetric_unit_view
int test_asymmetric_unit_view(View theview, Bsymmetry *sym)
Returns an asymmetric unit index number.
Definition: symmetry.cpp:1029
Matrix3
Definition: Matrix3.h:18
symmetry_get_all_matrices
Matrix3 * symmetry_get_all_matrices(Bsymmetry *sym, long &nsym)
Get all symmetry-related views of one given view.
Definition: symmetry.cpp:514
symmetry_order
int symmetry_order(Bsymmetry *sym)
Returns the symmetry order.
Definition: symmetry.cpp:301
sym_show_pdb_matrices
int sym_show_pdb_matrices(Bsymmetry *sym)
Show PDB format symmetry matrices associated with each symmetry operator.
Definition: symmetry.cpp:1161
symmetry_get_axes
vector< Vector3< double > > symmetry_get_axes(Bsymmetry *sym)
Get all symmetry axes.
Definition: symmetry.cpp:378
Bsymop::order
int order
Definition: symmetry.h:26
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.
Definition: symmetry.cpp:1063
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.
Definition: symmetry.cpp:280
find_asymmetric_unit_view
View find_asymmetric_unit_view(Bsymmetry *sym, View theview)
Finds the corresponding view in the asymmetric unit.
Definition: symmetry.cpp:850
Bstring.h
Header file for the string class.
view_symmetry_reference
View view_symmetry_reference(Bsymmetry *sym)
Returns an asymmetric unit reference point.
Definition: symmetry.cpp:315
side_views
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.
Definition: symmetry.cpp:763
Bsymop::shift
double shift
Definition: symmetry.h:28
find_closest_symmetric_view
View find_closest_symmetric_view(Bsymmetry *sym, View view_ref, View view)
Finds the closest symmetric match between two views.
Definition: symmetry.cpp:933
init_point_group_symmetry
Bsymmetry * init_point_group_symmetry(Bstring symmetry_string)
Sets up a symmetry structure from a string identifier.
Definition: symmetry.cpp:39
sym_show_operational_matrices
int sym_show_operational_matrices(Bsymmetry *sym)
Show symmetry matrices associated with each symmetry operator.
Definition: symmetry.cpp:1140
random_symmetric_view
View random_symmetric_view(View &asu_view, Bsymmetry *sym)
Returns a randomly picked symmetry view.
Definition: symmetry.cpp:1005
View.h
View object.
kill_symmetry
int kill_symmetry(Bsymmetry *sym)
Deallocates a symmetry structure.
Definition: symmetry.cpp:207
Bsymmetry::op
Bsymop * op
Definition: symmetry.h:43
reference_asymmetric_unit_views
View * reference_asymmetric_unit_views(Bsymmetry *sym)
Returns a reference view for each asymmetric unit.
Definition: symmetry.cpp:966
Bsymmetry::label
Bstring label
Definition: symmetry.h:41
symmetry_clean_pointgroup
Bstring symmetry_clean_pointgroup(Bstring &symmetry_string)
Corrects an existing point group string.
Definition: symmetry.cpp:226
Bsymop
Definition: symmetry.h:24
sym_show_matrices
int sym_show_matrices(Bsymmetry *sym)
Show symmetry matrices.
Definition: symmetry.cpp:1112
Bsymop::angle
double angle
Definition: symmetry.h:27