From 2a5a1e3d7a7a6ab5d9510d734f712de3a013bfce Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 30 Jun 2010 18:09:44 +0200 Subject: Add special positions for 6/mmm --- src/symmetry.c | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) (limited to 'src/symmetry.c') diff --git a/src/symmetry.c b/src/symmetry.c index 58e38503..b4ecdc1b 100644 --- a/src/symmetry.c +++ b/src/symmetry.c @@ -54,14 +54,24 @@ static int check_cond(signed int h, signed int k, signed int l, const char *sym) } -/* FIXME: Should take into account special indices - * e.g. l==0 has fewer equivalent reflections */ int num_equivs(signed int h, signed int k, signed int l, const char *sym) { if ( strcmp(sym, "1") == 0 ) return 1; - if ( strcmp(sym, "6") == 0 ) return 6; - if ( strcmp(sym, "6/m") == 0 ) return 12; - if ( strcmp(sym, "6/mmm") == 0 ) return 24; + + if ( strcmp(sym, "6") == 0 ) return 6; /* FIXME */ + + if ( strcmp(sym, "6/m") == 0 ) return 12; /* FIXME */ + + if ( strcmp(sym, "6/mmm") == 0 ) { + if ( (h==0) && (k==0) ) return 2; /* a */ + if ( (l==0) && (h==k) ) return 6; /* b */ + if ( (l==0) && (k==0) ) return 6; /* c */ + if ( h == k ) return 12; /* d */ + if ( k == 0 ) return 12; /* e */ + if ( l == 0 ) return 12; /* f */ + return 24; /* g */ + } + /* TODO: Add more groups here */ return 1; @@ -108,6 +118,14 @@ void get_equiv(signed int h, signed int k, signed int l, if ( strcmp(sym, "6/mmm") == 0 ) { signed int i = -h-k; + /* Special table for a */ + if ( (h==0) && (k==0) ) { + switch ( idx ) { + case 0 : *he = 0; *ke = 0; *le = l; return; + case 1 : *he = 0; *ke = 0; *le = -l; return; + } + } + /* Common table for b-g */ switch ( idx ) { case 0 : *he = h; *ke = k; *le = l; return; case 1 : *he = i; *ke = h; *le = l; return; -- cgit v1.2.3