diff options
author | Thomas White <taw@physics.org> | 2010-06-30 18:09:44 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:26:52 +0100 |
commit | 2a5a1e3d7a7a6ab5d9510d734f712de3a013bfce (patch) | |
tree | 2d075af3f2fa5a0956a0f8ff6d449dc80beeafba /src | |
parent | 67a226a71fa4d609a52b83987c32fe969f572f91 (diff) |
Add special positions for 6/mmm
Diffstat (limited to 'src')
-rw-r--r-- | src/symmetry.c | 28 |
1 files changed, 23 insertions, 5 deletions
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; |