aboutsummaryrefslogtreecommitdiff
path: root/src/symmetry.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-07-07 13:40:19 +0200
committerThomas White <taw@physics.org>2012-02-22 15:26:53 +0100
commit9b0820345e2afdabefee38a7212b9edf8c464d56 (patch)
tree4a860b95a369a8af867eeb31b98b461058a8aa01 /src/symmetry.c
parentd63f622ba7178d7d46c4718cb7bf5cd5eb6fa57b (diff)
Add point group "-1"
Diffstat (limited to 'src/symmetry.c')
-rw-r--r--src/symmetry.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/symmetry.c b/src/symmetry.c
index 921041d4..ee8ead3c 100644
--- a/src/symmetry.c
+++ b/src/symmetry.c
@@ -33,6 +33,8 @@ static int check_cond(signed int h, signed int k, signed int l, const char *sym)
{
if ( strcmp(sym, "1") == 0 )
return ( 1 );
+ if ( strcmp(sym, "-1") == 0 )
+ return ( 1 );
if ( strcmp(sym, "6") == 0 )
return ( ((h>0) && (k>=0)) || ((h==0) && (k==0)) );
if ( strcmp(sym, "6/m") == 0 )
@@ -57,8 +59,13 @@ static int check_cond(signed int h, signed int k, signed int l, const char *sym)
int num_equivs(signed int h, signed int k, signed int l, const char *sym)
{
+ /* 000 is always unique */
+ if ( (h==0) && (k==0) && (l==0) ) return 1;
+
if ( strcmp(sym, "1") == 0 ) return 1;
+ if ( strcmp(sym, "-1") == 0 ) return 2;
+
if ( strcmp(sym, "6") == 0 ) {
if ( (h==0) && (k==0) ) return 2; /* a */
return 6; /* b */
@@ -96,6 +103,13 @@ void get_equiv(signed int h, signed int k, signed int l,
*he = h; *ke = k; *le = l; return;
}
+ if ( strcmp(sym, "-1") == 0 ) {
+ switch ( idx ) {
+ case 0 : *he = h; *ke = k; *le = l; return;
+ case 1 : *he = -h; *ke = -k; *le = -l; return;
+ }
+ }
+
if ( strcmp(sym, "6") == 0 ) {
/* a */
if ( (h==0) && (k==0) ) {