aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-09-14 14:40:28 +0200
committerThomas White <taw@physics.org>2012-02-22 15:26:57 +0100
commit3d19655709a6dbb6e82b3ef4b9e157e89d67371e (patch)
treee1f8e76c3e96d38d21cd9e79ddcd36616870ab78 /src
parentc1fe0c1cf3468fc88e683f766a21e50583b5600f (diff)
Add 222 and mmm
Diffstat (limited to 'src')
-rw-r--r--src/symmetry.c57
1 files changed, 55 insertions, 2 deletions
diff --git a/src/symmetry.c b/src/symmetry.c
index 6511d173..ee6aa8ac 100644
--- a/src/symmetry.c
+++ b/src/symmetry.c
@@ -20,7 +20,6 @@
#include "utils.h"
-
#ifdef DEBUG
#define SYM_DEBUG STATUS
#else /* DEBUG */
@@ -39,6 +38,15 @@ static int check_cond(signed int h, signed int k, signed int l, const char *sym)
|| ( (l==0) && (k>0) )
|| ( (l==0) && (k==0) && (h>=0) ) );
+ /* Orthorhombic */
+ if ( strcmp(sym, "mmm") == 0 )
+ return ( (h>=0) && (k>=0) && (l>=0) );
+ if ( strcmp(sym, "222") == 0 )
+ return ( (h>=0) && (k>0) )
+ || ( (h>0) && (k>=0) )
+ || ( (h>=0) && (k==0) && (l>=0) )
+ || ( (h==0) && (k>=0) && (l>=0) );
+
/* Tetragonal */
if ( strcmp(sym, "422") == 0 )
return ( (((h>=0) && (k>0)) || ((h==0) && (k==0)))
@@ -73,6 +81,10 @@ int num_general_equivs(const char *sym)
if ( strcmp(sym, "1") == 0 ) return 1;
if ( strcmp(sym, "-1") == 0 ) return 2;
+ /* Orthorhombic */
+ if ( strcmp(sym, "222") == 0 ) return 4;
+ if ( strcmp(sym, "mmm") == 0 ) return 8;
+
/* Tetragonal */
if ( strcmp(sym, "422") == 0 ) return 8;
@@ -107,6 +119,28 @@ void get_general_equiv(signed int h, signed int k, signed int l,
}
}
+ if ( strcmp(sym, "222") == 0 ) {
+ switch ( idx ) {
+ case 0 : *he = h; *ke = k; *le = l; return;
+ case 1 : *he = -h; *ke = -k; *le = l; return;
+ case 2 : *he = -h; *ke = k; *le = -l; return;
+ case 3 : *he = h; *ke = -k; *le = -l; return;
+ }
+ }
+
+ if ( strcmp(sym, "mmm") == 0 ) {
+ switch ( idx ) {
+ case 0 : *he = h; *ke = k; *le = l; return;
+ case 1 : *he = -h; *ke = -k; *le = l; return;
+ case 2 : *he = -h; *ke = k; *le = -l; return;
+ case 3 : *he = h; *ke = -k; *le = -l; return;
+ case 4 : *he = -h; *ke = -k; *le = -l; return;
+ case 5 : *he = h; *ke = k; *le = -l; return;
+ case 6 : *he = h; *ke = -k; *le = l; return;
+ case 7 : *he = -h; *ke = k; *le = l; return;
+ }
+ }
+
if ( strcmp(sym, "422") == 0 ) {
switch ( idx ) {
case 0 : *he = h; *ke = k; *le = l; return;
@@ -275,6 +309,9 @@ const char *get_holohedral(const char *sym)
if ( strcmp(sym, "1") == 0 ) return "-1";
if ( strcmp(sym, "-1") == 0 ) return "-1";
+ if ( strcmp(sym, "222") == 0 ) return "mmm";
+ if ( strcmp(sym, "mmm") == 0 ) return "mmm";
+
/* Tetragonal */
if ( strcmp(sym, "422") == 0 ) return "4/mmm";
@@ -441,6 +478,10 @@ int is_polyhedral(const char *sym)
if ( strcmp(sym, "1") == 0 ) return 0;
if ( strcmp(sym, "-1") == 0 ) return 0;
+ /* Orthorhombic */
+ if ( strcmp(sym, "222") == 0 ) return 0;
+ if ( strcmp(sym, "mmm") == 0 ) return 0;
+
/* Tetragonal */
if ( strcmp(sym, "422") == 0 ) return 0;
@@ -462,7 +503,11 @@ int rotational_order(const char *sym)
{
/* Triclinic */
if ( strcmp(sym, "1") == 0 ) return 1;
- if ( strcmp(sym, "-1") == 0 ) return 2 ;
+ if ( strcmp(sym, "-1") == 0 ) return 2;
+
+ /* Orthorhombic */
+ if ( strcmp(sym, "222") == 0 ) return 2;
+ if ( strcmp(sym, "mmm") == 0 ) return 2;
/* Tetragonal */
if ( strcmp(sym, "422") == 0 ) return 4;
@@ -485,6 +530,10 @@ int has_perpendicular_mirror(const char *sym)
if ( strcmp(sym, "1") == 0 ) return 0;
if ( strcmp(sym, "-1") == 0 ) return 0;
+ /* Orthorhombic */
+ if ( strcmp(sym, "222") == 0 ) return 0;
+ if ( strcmp(sym, "mmm") == 0 ) return 1;
+
/* Tetragonal */
if ( strcmp(sym, "422") == 0 ) return 0;
@@ -506,6 +555,10 @@ int has_bisecting_mirror_or_diad(const char *sym)
if ( strcmp(sym, "1") == 0 ) return 0;
if ( strcmp(sym, "-1") == 0 ) return 0;
+ /* Orthorhombic */
+ if ( strcmp(sym, "222") == 0 ) return 1;
+ if ( strcmp(sym, "mmm") == 0 ) return 1;
+
/* Tetragonal */
if ( strcmp(sym, "422") == 0 ) return 0;