aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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);