aboutsummaryrefslogtreecommitdiff
path: root/src/symmetry.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-08-12 14:01:34 +0200
committerThomas White <taw@physics.org>2012-02-22 15:26:55 +0100
commita5698d7f25c4cd10c883d29fc116c2258e9f11db (patch)
treed66b5138f8d6b558cd95e9a4ac1a0251debfd885 /src/symmetry.c
parent03a7397635e2982343bfe50859238343c68bc03b (diff)
Add point group 422
Diffstat (limited to 'src/symmetry.c')
-rw-r--r--src/symmetry.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/symmetry.c b/src/symmetry.c
index db42a855..bb9e966e 100644
--- a/src/symmetry.c
+++ b/src/symmetry.c
@@ -31,12 +31,20 @@
/* Check if a reflection is in the asymmetric unit cell */
static int check_cond(signed int h, signed int k, signed int l, const char *sym)
{
+ /* Triclinic */
if ( strcmp(sym, "1") == 0 )
return ( 1 );
if ( strcmp(sym, "-1") == 0 )
return ( (l>0)
|| ( (l==0) && (k>0) )
|| ( (l==0) && (k==0) && (h>=0) ) );
+
+ /* Tetragonal */
+ if ( strcmp(sym, "422") == 0 )
+ return ( (((h>=0) && (k>0)) || ((h==0) && (k==0)))
+ && (h>=k) );
+
+ /* Hexagonal */
if ( strcmp(sym, "6") == 0 )
return ( ((h>0) && (k>=0)) || ((h==0) && (k==0)) );
if ( strcmp(sym, "6/m") == 0 )
@@ -65,6 +73,9 @@ int num_general_equivs(const char *sym)
if ( strcmp(sym, "1") == 0 ) return 1;
if ( strcmp(sym, "-1") == 0 ) return 2;
+ /* Tetragonal */
+ if ( strcmp(sym, "422") == 0 ) return 8;
+
/* Hexagonal */
if ( strcmp(sym, "6") == 0 ) return 6;
if ( strcmp(sym, "6/m") == 0 ) return 12;
@@ -96,6 +107,19 @@ void get_general_equiv(signed int h, signed int k, signed int l,
}
}
+ if ( strcmp(sym, "422") == 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, "6") == 0 ) {
switch ( idx ) {
case 0 : *he = h; *ke = k; *le = l; return;
@@ -251,6 +275,9 @@ const char *get_holohedral(const char *sym)
if ( strcmp(sym, "1") == 0 ) return "-1";
if ( strcmp(sym, "-1") == 0 ) return "-1";
+ /* Tetragonal */
+ if ( strcmp(sym, "422") == 0 ) return "4/mmm";
+
/* Hexagonal */
if ( strcmp(sym, "6") == 0 ) return "6/mmm";
if ( strcmp(sym, "6/m") == 0 ) return "6/mmm";