aboutsummaryrefslogtreecommitdiff
path: root/src/cell_tool.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2018-10-25 16:48:36 +0200
committerThomas White <taw@physics.org>2019-03-11 16:49:36 +0100
commit4337cafe052c4ad238c969dfa4cb7c7ac52f5e07 (patch)
tree5ef5e684565a388c266793db5f965a57467b10e6 /src/cell_tool.c
parenta9203226058dfd8ba35aa2e192ca51e030d3394a (diff)
Use IntegerMatrix for all unit cell transformations
Get rid of UnitCellTransformation, a thin wrapper which didn't do anything.
Diffstat (limited to 'src/cell_tool.c')
-rw-r--r--src/cell_tool.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/cell_tool.c b/src/cell_tool.c
index e8e60f30..12a00192 100644
--- a/src/cell_tool.c
+++ b/src/cell_tool.c
@@ -105,7 +105,6 @@ static int comparecells(UnitCell *cell, const char *comparecell,
for ( i[7]=-maxorder; i[7]<=+maxorder; i[7]++ ) {
for ( i[8]=-maxorder; i[8]<=+maxorder; i[8]++ ) {
- UnitCellTransformation *tfn;
UnitCell *nc;
IntegerMatrix *m;
int j, k;
@@ -120,8 +119,7 @@ static int comparecells(UnitCell *cell, const char *comparecell,
if ( intmat_det(m) < 1 ) continue;
- tfn = tfn_from_intmat(m);
- nc = cell_transform(cell, tfn);
+ nc = cell_transform(cell, m);
if ( compare_cell_parameters(cell2, nc, ltl, atl) ) {
STATUS("-----------------------------------------------"
@@ -131,7 +129,6 @@ static int comparecells(UnitCell *cell, const char *comparecell,
}
intmat_free(m);
- tfn_free(tfn);
cell_free(nc);
}
@@ -283,7 +280,6 @@ static int find_ambi(UnitCell *cell, SymOpList *sym, double ltl, double atl)
for ( i[7]=-maxorder; i[7]<=+maxorder; i[7]++ ) {
for ( i[8]=-maxorder; i[8]<=+maxorder; i[8]++ ) {
- UnitCellTransformation *tfn;
UnitCell *nc;
IntegerMatrix *m;
int j, k;
@@ -298,8 +294,7 @@ static int find_ambi(UnitCell *cell, SymOpList *sym, double ltl, double atl)
if ( intmat_det(m) != +1 ) continue;
- tfn = tfn_from_intmat(m);
- nc = cell_transform(cell, tfn);
+ nc = cell_transform(cell, m);
if ( compare_cell_parameters(cell, nc, ltl, atl) ) {
if ( !intmat_is_identity(m) ) add_symop(ops, m);
@@ -311,7 +306,6 @@ static int find_ambi(UnitCell *cell, SymOpList *sym, double ltl, double atl)
intmat_free(m);
}
- tfn_free(tfn);
cell_free(nc);
}
@@ -345,15 +339,15 @@ static int find_ambi(UnitCell *cell, SymOpList *sym, double ltl, double atl)
static int uncenter(UnitCell *cell, const char *out_file)
{
UnitCell *cnew;
- UnitCellTransformation *trans;
+ IntegerMatrix *m;
- cnew = uncenter_cell(cell, &trans);
+ cnew = uncenter_cell(cell, &m);
STATUS("------------------> The primitive unit cell:\n");
cell_print(cnew);
- STATUS("------------------> The decentering transformation:\n");
- tfn_print(trans);
+ STATUS("------------------> The centering transformation:\n");
+ intmat_print(m);
if ( out_file != NULL ) {
FILE *fh = fopen(out_file, "w");