119G_MODULE_EXPORT
void set_max (GtkEntry * entry, gpointer data)
121 int c = GPOINTER_TO_INT(data);
145G_MODULE_EXPORT
void set_delta (GtkEntry * entry, gpointer data)
147 int c = GPOINTER_TO_INT(data);
154 j = gtk_combo_box_get_active(GTK_COMBO_BOX(
rings_box[0]));
238 gchar * str =
"Maximum <b><i>l</i></b>, <i>l<sub>max</sub></i> in [2-40]";
255 gchar * val_b[3]={
"Number of configurations:",
256 "\tTime step δt used during the dynamics:",
257 "\tNumber of step(s) between each configuration:"};
263 add_box_child_start (GTK_ORIENTATION_HORIZONTAL,
hbox,
markup_label (g_strdup_printf (
"<b>%d</b>",
active_project -> steps), -1, 50, 0.5, 0.5), FALSE, FALSE, 0);
285 gtk_combo_box_set_active (GTK_COMBO_BOX(tcombo),
active_project -> tunit);
300G_MODULE_EXPORT
void set_numa (GtkEntry * entry, gpointer data)
336GtkWidget *
combox_rings (gchar * str,
int num, gchar * list_item[num],
int id)
341 GtkWidget * fixed = gtk_fixed_new ();
345 gtk_fixed_put (GTK_FIXED(fixed),
rings_box[
id], -1, -1);
363 int id = GPOINTER_TO_INT(data);
372 i = gtk_combo_box_get_active(GTK_COMBO_BOX(
rings_box[0]));
390 i = gtk_combo_box_get_active(GTK_COMBO_BOX(
rings_box[0]));
405G_MODULE_EXPORT
void toggle_rings (GtkCheckButton * but, gpointer data)
415G_MODULE_EXPORT
void toggle_rings (GtkToggleButton * but, gpointer data)
418 int oid = GPOINTER_TO_INT(data);
422 status = gtk_check_button_get_active (but);
424 status = gtk_toggle_button_get_active (but);
430 i = gtk_combo_box_get_active(GTK_COMBO_BOX(
rings_box[0]));
447 else if (oid == 1 &&
status)
455 else if (oid == 2 &&
status)
476 gchar * defs[6]={
"All rings (No rules)",
479 "Primitives [4, 5, 6]",
481 gchar * val_a[2]={
"Definition of ring to be used: ",
"Atom(s) to initiate the search from: "};
482 gchar * val_b[2][2]={{
"<i><b>n</b><sub>max</sub></i> = maximum size for a ring <sup>*</sup>",
483 "Maximum number of rings of size <i><b>n</b></i> per MD step <sup>**</sup>"},
484 {
"<i><b>n</b><sub>max</sub></i> = maximum size for a chain <sup>*</sup>",
485 "Maximum number of chains of size <i><b>n</b></i> per MD step <sup>**</sup>"}};
486 gchar * val_c[2][4]={{
"Only search for ABAB rings",
"No homopolar bonds in the rings (A-A, B-B ...) <sup>***</sup>",
"No homopolar bonds in the connectivity matrix",
" "},
487 {
"Only search for AAAA chains",
"Only search for ABAB chains",
488 "No homopolar bonds in the chains (A-A, B-B ...) <sup>***</sup>",
"Only search for 1-(2)<sub>n</sub>-1 coordinated atom chains, ie. isolated chains."}};
489 gchar * val_d={
"\n*\t<i><b>n</b><sub>max</sub></i> in total number of nodes (or atoms)\n"
490 "**\tvalue used for memory allocation = f(<i><b>n</b><sub>max</sub></i>, system studied)\n"
491 "***\tBut homopolar bonds can shorten the rings"};
492 gchar * val_e={
"\n<sub>[1] S. V. King. <i>Nature</i>, <b>213</b>:1112 (1967).\n"
493 "[2] L. Guttman. <i>J. Non-Cryst. Solids.</i>, <b>116</b>:145-147 (1990).\n"
494 "[3] D. S. Franzblau. <i>Phys. Rev. B</i>, <b>44</b>(10):4925-4930 (1991).\n"
495 "[4] K. Goetzke and H. J. Klein. <i>J. Non-Cryst. Solids.</i>, <b>127</b>:215-220 (1991).\n"
496 "[5] X. Yuan and A. N. Cormack. <i>Comp. Mat. Sci.</i>, <b>24</b>:343-360 (2002).\n"
497 "[6] F. Wooten. <i>Acta Cryst. A</i>, <b>58</b>(4):346-351 (2002).</sub>"};
503 list_node[0] = g_strdup_printf (
"All");
561G_MODULE_EXPORT
void run_toggle_bond (GtkNativeDialog * info, gint response_id, gpointer data)
563 GtkFileChooser * chooser = GTK_FILE_CHOOSER((GtkFileChooserNative *)info);
574G_MODULE_EXPORT
void run_toggle_bond (GtkDialog * info, gint response_id, gpointer data)
576 GtkFileChooser * chooser = GTK_FILE_CHOOSER((GtkWidget *)info);
578 if (response_id == GTK_RESPONSE_ACCEPT)
585 gtk_check_button_set_active ((GtkCheckButton *)data, FALSE);
587 gtk_toggle_button_set_active ((GtkToggleButton *)data, FALSE);
606G_MODULE_EXPORT
void toggle_bond (GtkCheckButton * Button, gpointer data)
616G_MODULE_EXPORT
void toggle_bond (GtkToggleButton * Button, gpointer data)
619 int i = GPOINTER_TO_INT (data);
622 status = gtk_check_button_get_active (Button);
624 status = gtk_toggle_button_get_active (Button);
637 show_info (
"Activate this option and the result of the nearest neighbors\n"
638 "analysis will be saved during the search in a file that you may\n"
641 GtkFileChooserNative * info;
647 GTK_FILE_CHOOSER_ACTION_SAVE,
649 GtkFileChooser * chooser = GTK_FILE_CHOOSER(info);
651 gtk_file_chooser_set_do_overwrite_confirmation (chooser, TRUE);
654 gtk_file_chooser_set_current_name (chooser,
"neighbors.dat");
656 run_this_gtk_native_dialog ((GtkNativeDialog *)info, G_CALLBACK(
run_toggle_bond), Button);
680 "to discretize the real space between 0.0 and D<sub>max</sub>\n",
calc_win);
685 show_warning (
"You must specify a maximum wave vector Q<sub>max</sub>[FFT]\n"
686 "for the FFT, with Q<sub>min</sub> < Q<sub>max</sub>[FFT] <= Q<sub>max</sub>",
calc_win);
706 show_warning (
"You must specify a maximum wave vector Q<sub>max</sub>\n"
707 "note that Q<sub>max</sub> must be > Q<sub>min</sub>",
calc_win);
713 "to discretize the reciprocal space between 0.0 and Q<sub>max</sub>\n",
calc_win);
732 "to discretize the real space between\n"
733 "the shortest and the highest inter-atomic distances",
calc_win);
738 show_warning (
"You must specify a number of δ° >= 2\n"
739 "to discretize the angular space between 0 and 180°",
calc_win);
758 gchar * sobj[2]={
"ring",
"chain"};
762 str = g_strdup_printf (
"You must specify a maximum %s size > 1 for the search", sobj[
search_type]);
769 str = g_strdup_printf (
"You must specify a number of %ss per size 'n' and per node\n"
770 "this value is used when allocating the memory to store the results\n"
771 "and depends on both the maximum %s size used in the search\n"
772 "and the system studied.\n"
773 "We recommend a value at least equal to 100.\n"
774 "If it appears that the value given is not big enough\n"
775 "(ex: more than 100 different %ss of size 'n' for a single node)\n"
776 "then the search will failed but the program will propose\n"
777 "you to initiate a new search using a higher value",
798 "used to integrate the Newton's equations\n"
799 "of motion during the molecular dynamics\n",
calc_win);
805 "used to integrate the Newton's equations\n"
806 "of motion during the molecular dynamics\n",
calc_win);
819 "between each of the %d configurations\n"
820 "found for the molecular dynamics\n",
calc_win);
857 gchar * val_a[2]={
"Number of δr [D<sub>ij</sub>min-D<sub>ij</sub>max]",
858 "Number of δθ [0-180°]"};
859 gchar * val_b[4]={
"First coordination sphere properties",
860 "Bond and dihedral angles distribution",
861 "Search for molecules and isolated fragments",
862 "Output detailed results in text file"};
882 GtkWidget * checkbd =
check_button (val_b[i], -1, 40, FALSE, G_CALLBACK(
toggle_bond), (gpointer)GINT_TO_POINTER(i));
897 gchar * note[3] = {
"D<sub>max</sub> = ",
"Q<sub>min</sub> = ",
"Q<sub>max</sub> = "};
898 gchar * unit[3] = {
" Å",
" Å<sup>-1</sup>",
" Å<sup>-1</sup>"};
902 str = g_strdup_printf (
"%f",
val);
921G_MODULE_EXPORT
void expand_opt (GtkWidget * exp, gpointer data)
924 i = GPOINTER_TO_INT(data);
925 GtkExpander * expander = GTK_EXPANDER (exp);
927 gtk_window_set_resizable (GTK_WINDOW (wind), TRUE);
928 if (gtk_expander_get_expanded (expander))
951 gtk_widget_set_size_request (exp, -1, -1);
952 gtk_window_set_resizable (GTK_WINDOW (wind), FALSE);
965 int c = GPOINTER_TO_INT(data);
970 if (
c == 0 && (v < 0.0 || v > 1.0))
976 show_warning (
"Q<sub>lim</sub> must be ≥ Q<sub>min</sub> and ≤ Q<sub>max</sub>",
calc_win);
994G_MODULE_EXPORT
void set_sfact (GtkEntry * entry, gpointer data)
997 int i = GPOINTER_TO_INT(data);
1000 if (v <= 0.0 || v >= 1.0)
1043 l = GPOINTER_TO_INT(data);
1078 if (l == 0 || l == 3)
1120 if (l == 0 || l == 3)
1133 if (l == 1 || l == 2)
1152 if (l == 1 || l == 2) m = m+1;
1153 for (k=0 ; k<m; k++)
1171 if (l == 0 || l == 3)
1196 gchar * val_a[4]={
"Number of δr steps",
1197 "Number of δq steps",
1198 "Number of δq steps",
1199 "Number of δr steps"};
1200 gchar * val_b[3]={
"Q<sub>max</sub> [Å<sup>-1</sup>]",
1201 "Q<sub>max</sub> [Å<sup>-1</sup>]",
1202 "Q<sub>max</sub> for the FFT [Å<sup>-1</sup>]"};
1217 GtkWidget * entry=
create_entry (G_CALLBACK(
set_max), 100, 15, FALSE, GINT_TO_POINTER(
id));
1222 if (
id ==
GR ||
id ==
GK)
1230 if (
id ==
SK||
id ==
GK)
1238 if (
id ==
GR ||
id ==
GK)
1241 markup_label (
"D<sub>max</sub> is the maximum inter-atomic distance in the model", -1, -1, 0.0, 0.5),
1247 markup_label (
"Q<sub>min</sub> is the minimum wave vector for the model", -1, -1, 0.0, 0.5),
1253 markup_label (
"Q<sub>max</sub> is the maximum wave vector to compute S(q)", -1, -1, 0.0, 0.5),
1262 gchar * adv_name[2]={
"Probability to keep wave\nvector <i>q</i> > Q<sub>lim</sub> [0.0-1.0]",
1263 "Q<sub>lim</sub> [Å<sup>-1</sup>] in [Q<sub>min</sub>-Q<sub>max</sub>]"};
1264 GtkWidget * advanced_options =
create_expander (
" Advanced options", NULL);
1265 gtk_widget_set_size_request (advanced_options, -1, 20);
1278 fixed = gtk_fixed_new ();
1279 gtk_fixed_put (GTK_FIXED(fixed), aentry, 0.0, 0.0);
1282 g_signal_connect (G_OBJECT(advanced_options),
"activate", G_CALLBACK(
expand_opt), GINT_TO_POINTER(1));
1288 GtkWidget * smooth_options =
create_expander (
" Gaussian data smoothing", NULL);
1289 gtk_widget_set_size_request (smooth_options, -1, 20);
1298 g_signal_connect (G_OBJECT(smooth_options),
"activate", G_CALLBACK(
expand_opt), GINT_TO_POINTER(0));
1318 int id = GPOINTER_TO_INT(data);
1319 switch (response_id)
1321 case GTK_RESPONSE_APPLY:
1389 int id = GPOINTER_TO_INT(data);
1392 gtk_box_set_homogeneous (GTK_BOX(box), FALSE);
1421 gtk_window_set_icon (GTK_WINDOW (
calc_win), gdk_pixbuf_new_from_file(
calc_img[
id], NULL));
1424 gtk_widget_set_size_request (
vbox, -1, 30);
Binding to the Fortran90 subroutines.
int smooth_and_save_(double *, double *, double *, int *, int *, int *)
Callback declarations for main window.
void fill_tool_model()
fill the tool window tree model
void label(cairo_t *cr, double val, int axe, int p, project *this_proj)
draw axis label
double * duplicate_double(int num, double *old_val)
copy a list of double
double string_to_double(gpointer string)
convert string to double
Global variable declarations Global convenience function declarations Global data structure defin...
GtkWidget * dialog_cancel_apply(gchar *title, GtkWidget *parent, gboolean resiz)
create a dialog modal offering a choice to apply something or not
void run_this_gtk_dialog(GtkWidget *dial, GCallback handler, gpointer data)
run a GTK (3 and 4) basic GtkDialog
void file_chooser_set_current_folder(GtkFileChooser *chooser)
set current folder in a GtkFilechooser
GtkWidget * create_entry(GCallback handler, int dim, int cdim, gboolean key_release, gpointer data)
Create a GtkEntry.
void update_entry_double(GtkEntry *entry, double doubleval)
update the content of a GtkEntry as double
gboolean is_the_widget_visible(GtkWidget *widg)
test if a GtkWidget exist, then return if it is visible or not
gchar * file_chooser_get_file_name(GtkFileChooser *chooser)
get a file name from a GtkFileChooser (single file selected)
const gchar * entry_get_text(GtkEntry *entry)
get the text in a GtkEntry
chemical_data * active_chem
void update_entry_int(GtkEntry *entry, int intval)
update the content of a GtkEntry as int
GtkWidget * check_button(gchar *text, int dimx, int dimy, gboolean state, GCallback handler, gpointer data)
create a check button
G_MODULE_EXPORT void on_calc_bonds_released(GtkWidget *widg, gpointer data)
compute bonding properties
GtkWidget * create_button(gchar *text, int image_format, gchar *image, int dimx, int dimy, int relief, GCallback handler, gpointer data)
create a simple button
GtkWidget * get_top_level(GtkWidget *widg)
get the top level container, window, of a widget
GtkWidget * create_combo()
create a GtkCombox widget, note deprecated in GTK4
GtkWidget * dialog_get_content_area(GtkWidget *widg)
prepare GtkWidget to insert content in a GtkDialog window
GtkWidget * markup_label(gchar *text, int dimx, int dimy, float ax, float ay)
void add_box_child_start(int orientation, GtkWidget *widg, GtkWidget *child, gboolean expand, gboolean fill, int padding)
Add a GtkWidget in a GtkBox at the initial position.
void widget_set_sensitive(GtkWidget *widg, gboolean sensitive)
Set sensitivity for a GtkWidget, ensuring it is a GtkWidget.
void destroy_this_dialog(GtkDialog *dialog)
destroy a GtkDialog
GtkWidget * create_hbox(int spacing)
create a GtkBox with horizontal orientation
void combo_text_append(GtkWidget *combo, gchar *text)
append text in GtkComboBox widget
GtkWidget * destroy_this_widget(GtkWidget *widg)
destroy a GtkWidget
void add_container_child(int type, GtkWidget *widg, GtkWidget *child)
Add a GtkWidget into another GtkWidget.
void hide_the_widgets(GtkWidget *widg)
hide GtkWidget
GtkWidget * create_vbox(int spacing)
create a GtkBox with vertical orientation
GtkWidget * create_expander(gchar *name, gchar *file_img)
create GtkExpander
GtkWidget * create_file_chooser(const gchar *title, GtkWindow *parent, GtkFileChooserAction act, const gchar *act_name)
create a GtkFileChooser, utility to select file(s)
void destroy_this_native_dialog(GtkNativeDialog *dialog)
destroy a GtkNativeDialog
char * calc_name[NCALCS-2]
void show_the_widgets(GtkWidget *widg)
show GtkWidget
void show_warning(char *warning, GtkWidget *win)
show warning
void show_info(char *information, int val, GtkWidget *win)
add / show information message to widget
void show_error(char *error, int val, GtkWidget *win)
show error message
void update_after_calc(int calc)
To update all curve plots in the workspace after a calculation.
Messaging function declarations.
Function declarations for reading atomes project file Function declarations for saving atomes proje...
logical function smooth(tabtoliss, gtoliss, dimtoliss, sigmaliss)
Function declarations for workspace managment.