From cde4c385e0ff5ccc945a65dd57c992f2e3ae34dd Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 16 Nov 2010 10:12:22 +0100 Subject: Add 4/m (also add missing bits of other groups) --- src/symmetry.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src') 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; -- cgit v1.2.3