From 189da15810deabd739d7c11c6e95fea55739fe60 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Sat, 1 Aug 2020 15:13:49 +0200 Subject: Initial import from archive --- src/refine.h | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 src/refine.h (limited to 'src/refine.h') diff --git a/src/refine.h b/src/refine.h new file mode 100644 index 0000000..2646b23 --- /dev/null +++ b/src/refine.h @@ -0,0 +1,102 @@ +/* + * refine.h + * + * Model Refintement + * + * (c) 2006-2007 Thomas White + * + * synth2d - Two-Dimensional Crystallographic Fourier Synthesis + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#ifndef REFINE_H +#define REFINE_H + +#include + +typedef enum { + COORDINATE_X, + COORDINATE_Y, + COORDINATE_Z +} CoordinateSelector; + +typedef enum { + REFINE_SPEC_NONE = 0, + REFINE_SPEC_X = 1<<0, + REFINE_SPEC_Y = 1<<1, + REFINE_SPEC_Z = 1<<2, + REFINE_SPEC_B = 1<<3, + REFINE_SPEC_OCC = 1<<4, + REFINE_SPEC_THICKNESS = 1<<16, + REFINE_SPEC_INTENSITIES = 1<<18 +} RefinementSpec; + +typedef enum { + REFINE_TYPE_NONE = 0, + REFINE_TYPE_NEIGHBOURSEARCH, + REFINE_TYPE_BRENT, + REFINE_TYPE_LMDER, + REFINE_TYPE_LSQ, + REFINE_TYPE_CGRAD +} RefinementType; + +typedef struct { + + /* Model this refinement refers to */ + struct struct_atomicmodel *model; + + /* Refinement specifications */ + RefinementSpec spec; + RefinementType type; + + /* Dialog box bits */ + GtkWidget *spec_x; + GtkWidget *spec_y; + GtkWidget *spec_z; + GtkWidget *spec_b; + GtkWidget *spec_thickness; + GtkWidget *spec_occ; + GtkWidget *type_neighboursearch; + GtkWidget *type_brent; + GtkWidget *type_lmder; + GtkWidget *type_lsq; + GtkWidget *type_cgrad; + GtkWidget *nbsearch_shift; + GtkWidget *target_amplitudes; + GtkWidget *target_intensities; + GtkWidget *stop; + GtkWidget *go; + + /* Thread control */ + GThread *work_thread; + unsigned int running; + unsigned int run_semaphore; + GStaticMutex display_mutex; + guint display_callback; + +} RefinementWindow; + +#include "reflist.h" + +typedef struct { + struct struct_atomicmodel *model; + ReflectionList *reflections; /* Observations */ + unsigned int cur_mod_atom; + CoordinateSelector cur_mod_coor; + double scale; + RefinementSpec spec; +} RefinementPair; + +extern void refine_open(struct struct_atomicmodel *model); + +#define LSQ_MSLS_SHIFT 0.000000001 +#define MAX_REFINEMENT_ITERATIONS 400 + +extern void refine_schedule_update(struct struct_atomicmodel *model); + +#endif /* REFINE_H */ + -- cgit v1.2.3