aboutsummaryrefslogtreecommitdiff
path: root/src/symmetry.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-08-16 17:10:11 +0200
committerThomas White <taw@physics.org>2012-02-22 15:26:55 +0100
commitac20d7cd290e7bac157b9b90a73a04a956ab6ee3 (patch)
treefba201da581382f001c7dd3fe7f8d81c258ac71a /src/symmetry.c
parent02e1ef093dc34e79e832764029db838cd5c13261 (diff)
Determine orientation range for template matching
Diffstat (limited to 'src/symmetry.c')
-rw-r--r--src/symmetry.c87
1 files changed, 87 insertions, 0 deletions
diff --git a/src/symmetry.c b/src/symmetry.c
index bb9e966e..6611e617 100644
--- a/src/symmetry.c
+++ b/src/symmetry.c
@@ -431,3 +431,90 @@ int find_unique_equiv(ReflItemList *items, signed int h, signed int k,
return found;
}
+
+
+/* Returns true if the point group is 23, m-3, 432, -43m or m-3m
+ * (i.e. T, Th, O, Td or Oh) */
+int is_polyhedral(const char *sym)
+{
+ /* Triclinic */
+ if ( strcmp(sym, "1") == 0 ) return 0;
+ if ( strcmp(sym, "-1") == 0 ) return 0;
+
+ /* Tetragonal */
+ if ( strcmp(sym, "422") == 0 ) return 0;
+
+ /* Hexagonal */
+ if ( strcmp(sym, "6") == 0 ) return 0;
+ if ( strcmp(sym, "6/m") == 0 ) return 0;
+ if ( strcmp(sym, "6/mmm") == 0 ) return 0;
+
+ /* TODO: Add more groups here */
+
+ ERROR("Don't know if '%s' is polyhedral or not.\n", sym);
+ abort();
+}
+
+
+/* Returns the order of the highest axis of proper or improper rotation */
+int rotational_order(const char *sym)
+{
+ /* Triclinic */
+ if ( strcmp(sym, "1") == 0 ) return 1;
+ if ( strcmp(sym, "-1") == 0 ) return 2 ;
+
+ /* Tetragonal */
+ if ( strcmp(sym, "422") == 0 ) return 4;
+
+ /* Hexagonal */
+ if ( strcmp(sym, "6") == 0 ) return 6;
+ if ( strcmp(sym, "6/m") == 0 ) return 6;
+ if ( strcmp(sym, "6/mmm") == 0 ) return 6;
+
+ /* TODO: Add more groups here */
+
+ ERROR("Couldn't find rotational order for '%s'.\n", sym);
+ abort();
+}
+
+
+int has_perpendicular_mirror(const char *sym)
+{
+ /* Triclinic */
+ if ( strcmp(sym, "1") == 0 ) return 0;
+ if ( strcmp(sym, "-1") == 0 ) return 0;
+
+ /* Tetragonal */
+ if ( strcmp(sym, "422") == 0 ) return 0;
+
+ /* Hexagonal */
+ if ( strcmp(sym, "6") == 0 ) return 0;
+ if ( strcmp(sym, "6/m") == 0 ) return 1;
+ if ( strcmp(sym, "6/mmm") == 0 ) return 1;
+
+ /* TODO: Add more groups here */
+
+ ERROR("Couldn't find mirror definition for '%s'.\n", sym);
+ abort();
+}
+
+
+int has_bisecting_mirror_or_diad(const char *sym)
+{
+ /* Triclinic */
+ if ( strcmp(sym, "1") == 0 ) return 0;
+ if ( strcmp(sym, "-1") == 0 ) return 0;
+
+ /* Tetragonal */
+ if ( strcmp(sym, "422") == 0 ) return 0;
+
+ /* Hexagonal */
+ if ( strcmp(sym, "6") == 0 ) return 0;
+ if ( strcmp(sym, "6/m") == 0 ) return 1;
+ if ( strcmp(sym, "6/mmm") == 0 ) return 1;
+
+ /* TODO: Add more groups here */
+
+ ERROR("Couldn't find mirror definition for '%s'.\n", sym);
+ abort();
+}