aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2018-02-01 15:37:08 +0100
committerThomas White <taw@physics.org>2018-02-27 17:12:42 +0100
commit224a636f1b86d8107c94492d6c5eaaef059312f8 (patch)
tree9007bd3c3699c72e80bab27cd3524b2de5221817
parent54006b85266f4de00c4c6caf4d062be4e1c73c3d (diff)
Create a new UnitCell when rotating the crystal
-rw-r--r--src/post-refinement.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/post-refinement.c b/src/post-refinement.c
index 088e25dd..c89669c1 100644
--- a/src/post-refinement.c
+++ b/src/post-refinement.c
@@ -289,6 +289,7 @@ static double residual_f(const gsl_vector *v, void *pp)
RefList *list;
struct image im;
Crystal *cr;
+ UnitCell *cell;
double res;
int i;
@@ -297,6 +298,9 @@ static double residual_f(const gsl_vector *v, void *pp)
}
cr = crystal_copy(pv->cr);
+ cell = cell_new_from_cell(crystal_get_cell(cr));
+ if ( cell == NULL ) return GSL_NAN;
+ crystal_set_cell(cr, cell);
im = *crystal_get_image(cr);
crystal_set_image(cr, &im);
apply_parameters(v, pv->initial, pv->rv, cr);