aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRichard Kirian <rkirian@asu.edu>2010-12-07 18:42:09 -0700
committerThomas White <taw@physics.org>2012-02-22 15:27:08 +0100
commitc85230a897b62f223951f7cc5693c6175e2d673d (patch)
treefb1d189c6d9ea1e862b15421dd623a94f544216f /src
parent6e98120c33371e139b4a54ca45f0cbb4ebd34951 (diff)
added spacegroup to cell info
Diffstat (limited to 'src')
-rw-r--r--src/cell.c15
-rw-r--r--src/cell.h3
2 files changed, 16 insertions, 2 deletions
diff --git a/src/cell.c b/src/cell.c
index 67c49610..fa3cfb0a 100644
--- a/src/cell.c
+++ b/src/cell.c
@@ -58,7 +58,7 @@ struct _unitcell {
double azs; double bzs; double czs;
char *pointgroup;
-
+ char *spacegroup;
};
@@ -469,6 +469,15 @@ const char *cell_get_pointgroup(UnitCell *cell)
}
+const char *cell_get_spacegroup(UnitCell *cell)
+{
+ return cell->spacegroup;
+}
+
+
+
+
+
/********************************* Utilities **********************************/
static const char *cell_rep(UnitCell *cell)
@@ -877,9 +886,11 @@ UnitCell *load_cell_from_pdb(const char *filename)
sym = strndup(line+55, 10);
notrail(sym);
cell_set_pointgroup_from_pdb(cell, sym);
- free(sym);
+ cell->spacegroup = sym;
+
} else {
cell_set_pointgroup_from_pdb(cell, "P 1");
+ cell->spacegroup = strdup("P 1");
ERROR("CRYST1 line without space group.\n");
}
}
diff --git a/src/cell.h b/src/cell.h
index 5a6bfda9..5e9facb0 100644
--- a/src/cell.h
+++ b/src/cell.h
@@ -72,6 +72,8 @@ extern void cell_set_reciprocal(UnitCell *cell,
extern const char *cell_get_pointgroup(UnitCell *cell);
+extern const char *cell_get_spacegroup(UnitCell *cell);
+
extern double resolution(UnitCell *cell,
signed int h, signed int k, signed int l);
@@ -84,4 +86,5 @@ extern UnitCell *match_cell(UnitCell *cell, UnitCell *template, int verbose,
extern UnitCell *load_cell_from_pdb(const char *filename);
+
#endif /* CELL_H */