diff options
author | Thomas White <taw@physics.org> | 2011-07-20 19:08:33 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:27:34 +0100 |
commit | 93f5d444a533651154a7cf507f02c1eb40fad087 (patch) | |
tree | 23c9d2b78b27ffb2502524fb8797c54e278a41c6 /src | |
parent | c1103a3d7f0cdbc06f74c46fdcc02b06264aeb5e (diff) |
More PG checking
Diffstat (limited to 'src')
-rw-r--r-- | src/symmetry.c | 27 | ||||
-rw-r--r-- | src/symmetry.h | 1 |
2 files changed, 26 insertions, 2 deletions
diff --git a/src/symmetry.c b/src/symmetry.c index b0e430b5..6c290756 100644 --- a/src/symmetry.c +++ b/src/symmetry.c @@ -405,8 +405,9 @@ static SymOpList *make_4m() static SymOpList *make_4() { SymOpList *new = new_symoplist(); - add_symop(new, v(0,1,0,0), v(1,0,0,0), v(0,0,0,1), 4); /* 4 */ - return NULL; + add_symop(new, v(0,-1,0,0), v(1,0,0,0), v(0,0,0,1), 4); /* 4 */ + new->name = strdup("4"); + return expand_ops(new); } @@ -673,6 +674,28 @@ void get_asymm(const SymOpList *ops, } +static int is_inversion(const struct sym_op *op) +{ + if ( (op->h[0]!=-1) || (op->h[1]!=0) || (op->h[2]!=0) ) return 0; + if ( (op->k[0]!=0) || (op->k[1]!=-1) || (op->k[2]!=0) ) return 0; + if ( (op->l[0]!=0) || (op->l[1]!=0) || (op->l[2]!=-1) ) return 0; + return 1; +} + + +int is_centrosymmetric(const SymOpList *s) +{ + int i, n; + + n = num_ops(s); + for ( i=0; i<n; i++ ) { + if ( is_inversion(&s->ops[i]) ) return 1; + } + + return 0; +} + + /** * get_twins: * diff --git a/src/symmetry.h b/src/symmetry.h index 45ffe318..4ecf11a4 100644 --- a/src/symmetry.h +++ b/src/symmetry.h @@ -48,6 +48,7 @@ extern void get_equiv(const SymOpList *ops, const SymOpMask *m, int idx, signed int h, signed int k, signed int l, signed int *he, signed int *ke, signed int *le); +extern int is_centrosymmetric(const SymOpList *s); extern SymOpList *get_twins(const SymOpList *source, const SymOpList *target); #endif /* SYMMETRY_H */ |