aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-11-16 10:12:22 +0100
committerThomas White <taw@physics.org>2012-02-22 15:27:05 +0100
commitcde4c385e0ff5ccc945a65dd57c992f2e3ae34dd (patch)
tree79d20f12eb358cb78a8a0822a3429fc2aea62e45 /src
parent67bc653a2b13f3cdcd81c7bcd6e7bbc4d60db7f2 (diff)
Add 4/m (also add missing bits of other groups)
Diffstat (limited to 'src')
-rw-r--r--src/symmetry.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/symmetry.c b/src/symmetry.c
index 9153049d..773437d2 100644
--- a/src/symmetry.c
+++ b/src/symmetry.c
@@ -54,6 +54,8 @@ static int check_cond(signed int h, signed int k, signed int l, const char *sym)
if ( strcmp(sym, "422") == 0 )
return ( (((h>0) && (k>=0)) || ((h==0) && (k==0)))
&& (h>=k) );
+ if ( strcmp(sym, "4/m") == 0 )
+ return ( (((h>0) && (k>=0)) || ((h==0) && (k==0))) && (l>=0) );
if ( strcmp(sym, "4") == 0 )
return ( ((h>0) && (k>=0)) || ((h==0) && (k==0)) );
@@ -92,6 +94,7 @@ int num_general_equivs(const char *sym)
/* Tetragonal */
if ( strcmp(sym, "4") == 0 ) return 4;
+ if ( strcmp(sym, "4/m") == 0 ) return 8;
if ( strcmp(sym, "422") == 0 ) return 8;
if ( strcmp(sym, "4/mmm") == 0 ) return 16;
@@ -157,6 +160,19 @@ void get_general_equiv(signed int h, signed int k, signed int l,
}
}
+ if ( strcmp(sym, "4/m") == 0 ) {
+ switch ( idx ) {
+ case 0 : *he = h; *ke = k; *le = l; return;
+ case 1 : *he = -h; *ke = -k; *le = l; return;
+ case 2 : *he = -k; *ke = h; *le = l; return;
+ case 3 : *he = k; *ke = -h; *le = l; return;
+ case 4 : *he = -h; *ke = -k; *le = -l; return;
+ case 5 : *he = h; *ke = k; *le = -l; return;
+ case 6 : *he = k; *ke = -h; *le = -l; return;
+ case 7 : *he = -k; *ke = h; *le = -l; return;
+ }
+ }
+
if ( strcmp(sym, "422") == 0 ) {
switch ( idx ) {
case 0 : *he = h; *ke = k; *le = l; return;
@@ -498,6 +514,8 @@ int is_polyhedral(const char *sym)
if ( strcmp(sym, "mmm") == 0 ) return 0;
/* Tetragonal */
+ if ( strcmp(sym, "4") == 0 ) return 0;
+ if ( strcmp(sym, "4/m") == 0 ) return 0;
if ( strcmp(sym, "422") == 0 ) return 0;
if ( strcmp(sym, "4/mmm") == 0 ) return 0;
@@ -526,6 +544,8 @@ int rotational_order(const char *sym)
if ( strcmp(sym, "mmm") == 0 ) return 2;
/* Tetragonal */
+ if ( strcmp(sym, "4") == 0 ) return 4;
+ if ( strcmp(sym, "4/m") == 0 ) return 4;
if ( strcmp(sym, "422") == 0 ) return 4;
if ( strcmp(sym, "4/mmm") == 0 ) return 4;
@@ -552,6 +572,8 @@ int has_perpendicular_mirror(const char *sym)
if ( strcmp(sym, "mmm") == 0 ) return 1;
/* Tetragonal */
+ if ( strcmp(sym, "4") == 0 ) return 0;
+ if ( strcmp(sym, "4/m") == 0 ) return 1;
if ( strcmp(sym, "422") == 0 ) return 0;
if ( strcmp(sym, "4/mmm") == 0 ) return 1;
@@ -578,6 +600,8 @@ int has_bisecting_mirror_or_diad(const char *sym)
if ( strcmp(sym, "mmm") == 0 ) return 1;
/* Tetragonal */
+ if ( strcmp(sym, "4") == 0 ) return 0;
+ if ( strcmp(sym, "4/m") == 0 ) return 0;
if ( strcmp(sym, "422") == 0 ) return 0;
if ( strcmp(sym, "4/mmm") == 0 ) return 1;