aboutsummaryrefslogtreecommitdiff
path: root/src/cell.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cell.c')
-rw-r--r--src/cell.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/src/cell.c b/src/cell.c
index 1054625c..144d9140 100644
--- a/src/cell.c
+++ b/src/cell.c
@@ -188,7 +188,8 @@ UnitCell *cell_new_from_parameters(double a, double b, double c,
}
-UnitCell *cell_new_from_axes(struct rvec as, struct rvec bs, struct rvec cs)
+UnitCell *cell_new_from_reciprocal_axes(struct rvec as, struct rvec bs,
+ struct rvec cs)
{
UnitCell *cell;
@@ -205,6 +206,23 @@ UnitCell *cell_new_from_axes(struct rvec as, struct rvec bs, struct rvec cs)
}
+UnitCell *cell_new_from_direct_axes(struct rvec a, struct rvec b, struct rvec c)
+{
+ UnitCell *cell;
+
+ cell = cell_new();
+ if ( cell == NULL ) return NULL;
+
+ cell->ax = a.u; cell->ay = a.v; cell->az = a.w;
+ cell->bx = b.u; cell->by = b.v; cell->bz = b.w;
+ cell->cx = c.u; cell->cy = c.v; cell->cz = c.w;
+
+ cell->rep = CELL_REP_CART;
+
+ return cell;
+}
+
+
UnitCell *cell_new_from_cell(UnitCell *orig)
{
UnitCell *new;
@@ -807,9 +825,9 @@ UnitCell *match_cell(UnitCell *cell, UnitCell *template, int verbose,
if ( fom3 < best_fom ) {
if ( new_cell != NULL ) free(new_cell);
- new_cell = cell_new_from_axes(cand[0][i].vec,
- cand[1][j].vec,
- cand[2][k].vec);
+ new_cell = cell_new_from_reciprocal_axes(
+ cand[0][i].vec, cand[1][j].vec,
+ cand[2][k].vec);
best_fom = fom3;
}