130G_MODULE_EXPORT
void set_max (GtkEntry * entry, gpointer data)
132 int c = GPOINTER_TO_INT(data);
161 gchar * freq_unit[5]={
" THz",
" THz",
" MHz",
" KHz",
" Hz"};
167 if ( delt > 0.0 && num_delt && t_unit > -1)
170 double omega_max =
pi/(delt * num_delt);
172 str = g_strdup_printf (
"%f", (t_unit == 1) ? omega_max : omega_max * 1000.0);
179 str = g_strdup_printf (_(
"Update step(s) between conf. and δt to evaluate ω<sub>max</sub>"));
195G_MODULE_EXPORT
void set_delta (GtkEntry * entry, gpointer data)
197 int c = GPOINTER_TO_INT(data);
297 add_box_child_start (GTK_ORIENTATION_HORIZONTAL,
hbox,
markup_label ( _(
"Maximum <b><i>l</i></b>, <i>l<sub>max</sub></i> ∈ [2-40]"), 200, -1, 0.0, 0.5), FALSE, FALSE, 0);
314 gchar * val_b[3]={
i18n(
"Number of configurations:"),
315 i18n(
"\tTime step δt used during the dynamics:"),
316 i18n(
"\tNumber of step(s) between each configuration:")};
317 gchar * val_c[3]={
i18n(
"Number of configurations:"),
318 i18n(
"Time step δt"),
319 i18n(
"Step(s) between conf.")};
322 k = (cid ==
MSD) ? 15 : 0;
323 l = (cid ==
MSD) ? 350 : 150;
324 m = (cid ==
MSD) ? 0 : 5;
328 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, 10);
364G_MODULE_EXPORT
void set_numa (GtkEntry * entry, gpointer data)
421GtkWidget *
combox_rings (gchar * str,
int num, gchar * list_item[num],
int id)
428 gtk_widget_set_size_request (
rings_box[
id], 180, -1);
451 int id = GPOINTER_TO_INT(data);
510G_MODULE_EXPORT
void toggle_rings (GtkCheckButton * but, gpointer data)
520G_MODULE_EXPORT
void toggle_rings (GtkToggleButton * but, gpointer data)
523 int oid = GPOINTER_TO_INT(data);
557 else if (oid == 1 &&
status)
562 else if (oid == 2 &&
status)
580 gchar * defs[6]={
i18n(
"All Rings (No Rule)"),
581 i18n(
"King's [1, 3]"),
582 i18n(
"Guttman's [2]"),
583 i18n(
"Primitives [4, 5, 6]"),
584 i18n(
"Strongs [4, 5]")};
585 gchar * val_a[2]={
i18n(
"Definition of ring to be used: "),
i18n(
"Atom(s) to initiate the search from: ")};
586 gchar * val_b[2][2]={{
i18n(
"<i><b>n</b><sub>max</sub></i> = maximum size for a ring <sup>*</sup>"),
587 i18n(
"Maximum number of rings of size <i><b>n</b></i> per MD step <sup>**</sup>")},
588 {
i18n(
"<i><b>n</b><sub>max</sub></i> = maximum size for a chain <sup>*</sup>"),
589 i18n(
"Maximum number of chains of size <i><b>n</b></i> per MD step <sup>**</sup>")}};
590 gchar * val_c[2][4]={{
i18n(
"Only search for ABAB rings"),
i18n(
"No homopolar bonds in the rings (A-A, B-B ...) <sup>***</sup>"),
i18n(
"No homopolar bonds in the connectivity matrix"),
" "},
591 {
i18n(
"Only search for AAAA chains"),
i18n(
"Only search for ABAB chains"),
592 i18n(
"No homopolar bonds in the chains (A-A, B-B ...) <sup>***</sup>"),
i18n(
"Only search for 1-(2)<sub>n</sub>-1 coordinated atom chains, ie. isolated chains.")}};
593 gchar * start[3]={
"<sup>*</sup>",
"<sup>**</sup>",
"<sup>***</sup>"};
594 gchar * val_d[3]={
i18n(
"in total number of nodes (or atoms)"),
595 i18n(
"value used for memory allocation = f(<i><b>n</b><sub>max</sub></i>, system studied)"),
596 i18n(
"but homopolar bonds can shorten the rings")};
597 gchar * val_e={
i18n(
"<sub>[1] S. V. King. <i>Nature</i>, <b>213</b>:1112 (1967).</sub>\n"
598 "<sub>[2] L. Guttman. <i>J. Non-Cryst. Solids.</i>, <b>116</b>:145-147 (1990).</sub>\n"
599 "<sub>[3] D. S. Franzblau. <i>Phys. Rev. B</i>, <b>44</b>(10):4925-4930 (1991).</sub>\n"
600 "<sub>[4] K. Goetzke and H. J. Klein. <i>J. Non-Cryst. Solids.</i>, <b>127</b>:215-220 (1991).</sub>\n"
601 "<sub>[5] X. Yuan and A. N. Cormack. <i>Comp. Mat. Sci.</i>, <b>24</b>:343-360 (2002).</sub>\n"
602 "<sub>[6] F. Wooten. <i>Acta Cryst. A</i>, <b>58</b>(4):346-351 (2002).</sub>")};
608 list_node[0] = g_strdup_printf (_(
"All"));
611 list_node[1] = g_strdup_printf (_(
"Chemical Species"));
708G_MODULE_EXPORT
void run_toggle_bond (GtkNativeDialog * info, gint response_id, gpointer data)
710 GtkFileChooser * chooser = GTK_FILE_CHOOSER((GtkFileChooserNative *)info);
721G_MODULE_EXPORT
void run_toggle_bond (GtkDialog * info, gint response_id, gpointer data)
723 GtkFileChooser * chooser = GTK_FILE_CHOOSER((GtkWidget *)info);
725 if (response_id == GTK_RESPONSE_ACCEPT)
749G_MODULE_EXPORT
void toggle_bond (GtkCheckButton * Button, gpointer data)
759G_MODULE_EXPORT
void toggle_bond (GtkToggleButton * Button, gpointer data)
762 int i = GPOINTER_TO_INT (data);
775 show_info (_(
"The result of the nearest neighbors analysis\n"
776 "will be saved in a file that you may use afterwards.\n"), 0,
MainWindow);
778 GtkFileChooserNative * info;
784 GTK_FILE_CHOOSER_ACTION_SAVE,
786 GtkFileChooser * chooser = GTK_FILE_CHOOSER(info);
788 gtk_file_chooser_set_do_overwrite_confirmation (chooser, TRUE);
791 gtk_file_chooser_set_current_name (chooser,
"neighbors.dat");
793 run_this_gtk_native_dialog ((GtkNativeDialog *)info, G_CALLBACK(
run_toggle_bond), Button);
816 show_warning (_(
"You must specify a number of δr intevals >= 2\n"
817 "to discretize the real space between 0.0 and D<sub>max</sub>\n"),
calc_win);
822 show_warning (_(
"You must specify a maximum wave vector Q<sub>max</sub>[FFT]\n"
823 "for the FFT, with Q<sub>min</sub> < Q<sub>max</sub>[FFT] <= Q<sub>max</sub>"),
calc_win);
843 show_warning (_(
"You must specify a maximum wave vector Q<sub>max</sub>\n"
844 "note that Q<sub>max</sub> must be > Q<sub>min</sub>"),
calc_win);
849 show_warning (_(
"You must specify a number of δq intervals >= 2\n"
850 "to discretize the reciprocal space between 0.0 and Q<sub>max</sub>\n"),
calc_win);
868 show_warning (_(
"You must specify a number of δr intervals >= 2\n"
869 "to discretize the real space between\n"
870 "the shortest and the highest inter-atomic distances"),
calc_win);
875 show_warning (_(
"You must specify a number of δθ intervals >= 2\n"
876 "to discretize the angular space between 0 and 180°"),
calc_win);
892 gchar * sobj[2]={
i18n(
"ring"),
i18n(
"chain")};
896 str = g_strdup_printf (_(
"You must specify a maximum %s size > 1 for the search"), _(sobj[
search_type]));
903 str = g_strdup_printf (_(
"You must specify a number of %ss per size 'n' and per node\n"
904 "this value is used when allocating the memory to store the results\n"
905 "and depends on both the maximum %s size used in the search\n"
906 "and the system studied.\n"
907 "We recommend a value at least equal to 100.\n"
908 "If it appears that the value given is not big enough\n"
909 "(ex: more than 100 different %ss of size 'n' for a single node)\n"
910 "then the search will failed but the program will propose\n"
911 "you to initiate a new search using a higher value"),
927 if (
active_project -> analysis[
SPH] -> num_delta < 2 || active_project -> analysis[
SPH] -> num_delta > 40)
949 show_warning (_(
"You must specify the time step δt\n"
950 "used to integrate the Newton's equations\n"
951 "of motion during the molecular dynamics\n"),
calc_win);
957 "used to integrate the Newton's equations\n"
958 "of motion during the molecular dynamics\n"),
calc_win);
970 show_warning (_(
"You must specify the number of steps\n"
971 "between each of the %d configurations\n"
972 "found for the molecular dynamics\n"),
calc_win);
1011 gchar * val_a[2]={
i18n(
"Number of δr [D<sub>ij</sub>min-D<sub>ij</sub>max]"),
1012 i18n(
"Number of δθ [0-180°]")};
1013 gchar * val_b[4]={
i18n(
"First coordination sphere properties"),
1014 i18n(
"Bond and dihedral angles distribution"),
1015 i18n(
"Search for molecules and isolated fragments"),
1016 i18n(
"Output detailed results in text file")};
1036 GtkWidget * checkbd =
check_button (val_b[i], -1, 40, FALSE, G_CALLBACK(
toggle_bond), (gpointer)GINT_TO_POINTER(i));
1051 gchar * note[3] = {
"D<sub>max</sub> = ",
"Q<sub>min</sub> = ",
"Q<sub>max</sub> = "};
1052 gchar * unit[3] = {
" Å",
" Å<sup>-1</sup>",
" Å<sup>-1</sup>"};
1056 str = g_strdup_printf (
"%f",
val);
1079 i = GPOINTER_TO_INT(data);
1080 GtkExpander * expander = GTK_EXPANDER (exp);
1082 gtk_window_set_resizable (GTK_WINDOW (wind), TRUE);
1083 if (gtk_expander_get_expanded (expander))
1106 gtk_widget_set_size_request (exp, -1, -1);
1107 gtk_window_set_resizable (GTK_WINDOW (wind), FALSE);
1125 int idk = (idc -> a ==
SKD) ? 0 : 1;
1128 if (idc -> b == 0 && (v < 0.0 || v > 1.0))
1132 else if (idc -> b == 1 && (v < qmin || v > qmax))
1134 show_warning (_(
"Q<sub>lim</sub> must be ≥ Q<sub>min</sub> and ≤ Q<sub>max</sub>"),
calc_win);
1152G_MODULE_EXPORT
void set_sfact (GtkEntry * entry, gpointer data)
1155 int i = GPOINTER_TO_INT(data);
1158 if (v <= 0.0 || v >= 1.0)
1199 int g, h, i, j, k, l, m;
1201 l = GPOINTER_TO_INT(data);
1204 if (l ==
SKD || l ==
SKT)
1282 if (l ==
GDR || l ==
GDK)
1314 if (l ==
SQD || l ==
SKD || l ==
SKT) m = m+1;
1315 for (k=0 ; k<m; k++)
1327 if (l ==
SKD || l ==
SKT)
1334 if (l ==
GDR || l ==
GDK)
1338 else if (l ==
SQD || l ==
SKD)
1364 gchar * adv_name[2]={
i18n(
"Probability to keep wave\nvector <i>q</i> > Q<sub>lim</sub> ∈ [0.0-1.0]"),
1365 i18n(
"Q<sub>lim</sub> [Å<sup>-1</sup>] ∈ [Q<sub>min</sub>-Q<sub>max</sub>]")};
1366 GtkWidget * advanced_options =
create_expander (_(
" Advanced options"), NULL);
1367 gtk_widget_set_size_request (advanced_options, -1, 20);
1374 i = (skq ==
SKT) ? 1 : 0;
1382 fixed = gtk_fixed_new ();
1383 gtk_fixed_put (GTK_FIXED(fixed), aentry, 0.0, 0.0);
1386 g_signal_connect (G_OBJECT(advanced_options),
"activate", G_CALLBACK(
expand_opt), GINT_TO_POINTER(i));
1402 GtkWidget * smooth_options =
create_expander (_(
" Gaussian data smoothing"), NULL);
1403 gtk_widget_set_size_request (smooth_options, -1, 20);
1412 g_signal_connect (G_OBJECT(smooth_options),
"activate", G_CALLBACK(
expand_opt), GINT_TO_POINTER(0));
1430 gchar * val_a[4]={
i18n(
"Number of δr steps"),
1431 i18n(
"Number of δq steps"),
1432 i18n(
"Number of δq steps"),
1433 i18n(
"Number of δr steps")};
1434 gchar * val_b[3]={
i18n(
"Q<sub>max</sub> [Å<sup>-1</sup>]"),
1435 i18n(
"Q<sub>max</sub> [Å<sup>-1</sup>]"),
1436 i18n(
"Q<sub>max</sub> for the FFT [Å<sup>-1</sup>]")};
1457 GtkWidget * entry=
create_entry (G_CALLBACK(
set_max), 100, 15, FALSE, GINT_TO_POINTER(
id));
1462 if (
id ==
GDR ||
id ==
GDK)
1470 if (
id ==
SKD||
id ==
GDK)
1478 if (
id ==
GDR ||
id ==
GDK)
1481 markup_label (_(
"D<sub>max</sub> is the maximum inter-atomic distance in the model"), -1, -1, 0.0, 0.5),
1487 markup_label (_(
"Q<sub>min</sub> is the minimum wave vector for the model"), -1, -1, 0.0, 0.5),
1493 markup_label (_(
"Q<sub>max</sub> is the maximum wave vector to compute S(q)"), -1, -1, 0.0, 0.5),
1521 int sid = GPOINTER_TO_INT (data);
1524 if (sid && sid < active_project -> skt_n_data_sets - 1)
1534 if (v < active_project -> skt_step_id[sid+1])
active_project -> skt_step_id[sid] = v;
1549 int sid = GPOINTER_TO_INT (data);
1552 if (sid && sid < active_project -> sqw_n_data_sets - 1)
1626 add_box_child_start (GTK_ORIENTATION_HORIZONTAL,
hbox,
markup_label (g_strdup_printf(
"%d)\tδt= ", i+1), 150, -1, 0.75, 0.5), FALSE, FALSE, 10);
1632 add_box_child_start (GTK_ORIENTATION_HORIZONTAL,
hbox,
markup_label (g_strdup_printf(
"%d)\tq= ", i+1), 150, -1, 0.75, 0.5), FALSE, FALSE, 10);
1667 gchar * aco_info = g_strdup_printf (
"%s", (! cid) ? _(
"Number of <b>δt</b> results to save") : _(
"Number of <b>q</b> vectors to analyze"));
1684 gtk_widget_set_size_request (
spin, 25, -1);
1702 int pid = GPOINTER_TO_INT(data);
1754G_MODULE_EXPORT
void toggle_skt_all (GtkCheckButton * but, gpointer data)
1817 GtkWidget * vbox_skt[2];
1824 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox_skt, vbox_skt[i], FALSE, FALSE, 10);
1842 gchar * str = g_strdup_printf (
"%s", _(
"Number of δq steps"));
1853 str = g_strdup_printf (
"%s", _(
"Q<sub>max</sub> [Å<sup>-1</sup>]"));
1864 markup_label (_(
"Q<sub>min</sub> is the minimum wave vector for the model"), -1, -1, 0.0, 0.5),
1876 markup_label (_(
"δt<sub>min</sub> is the correlation threshold"), -1, -1, 0.0, 0.5),
1890 str = g_strdup_printf (
"%s", _(
"ω points in [0.0, ω<sub>max</sub>]"));
1908 add_box_child_start (GTK_ORIENTATION_VERTICAL, tbox,
markup_label (_(
"<b>atomes</b> cannot yet display 3D results,"), -1, -1, 0.5, 0.5), FALSE, FALSE, 0);
1909 add_box_child_start (GTK_ORIENTATION_VERTICAL, tbox,
markup_label (_(
"but we are working to add this feature !"), -1, -1, 0.5, 0.5), FALSE, FALSE, 0);
1911 add_box_child_start (GTK_ORIENTATION_VERTICAL, tbox,
markup_label (_(
"what to display using the 2D graph system:"), -1, -1, 0.5, 0.5), FALSE, FALSE, 0);
1913 GtkWidget * notebook = gtk_notebook_new ();
1915 gtk_widget_set_vexpand (notebook, TRUE);
1928 add_box_child_start (GTK_ORIENTATION_VERTICAL, nbox,
check_button(_(
"All <b>δt</b> correlated calculations"), -1, -1, FALSE, G_CALLBACK(
toggle_skt_all), NULL), FALSE, FALSE, 5);
1955 gtk_notebook_append_page (GTK_NOTEBOOK(notebook), scroll,
1956 markup_label((! i) ? _(
"<b>Intermediate scattering</b>: F(q,δt)") : _(
"<b>Dynamic calculations</b>: S(q,ω)"), -1, -1, 0.0, 0.5));
1972 int id = GPOINTER_TO_INT(data);
1973 switch (response_id)
1975 case GTK_RESPONSE_APPLY:
2051 int id = GPOINTER_TO_INT(data);
2054 gtk_box_set_homogeneous (GTK_BOX(
box), FALSE);
2083 gtk_window_set_icon (GTK_WINDOW (
calc_win), gdk_pixbuf_new_from_file(
graph_img[(
id <
ANG) ?
id :
id+1], NULL));
2086 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
double * duplicate_double(int num, double *old_val)
copy a list of double
double * allocdouble(int val)
allocate a double * pointer
int * allocint(int val)
allocate an int * pointer
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
int combo_get_active(GtkWidget *combo)
retrieve the active item's position
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
void append_comments(GtkWidget *vbox, gchar *symbol, gchar *legend)
append comments to a vertical box
GtkWidget * create_scroll(GtkWidget *box, int dimx, int dimy, int shadow)
create a scroll window
gboolean is_the_widget_visible(GtkWidget *widg)
test if a GtkWidget exist, then return if it is visible or not
void combo_set_active(GtkWidget *combo, int pos)
set the active item's position
gchar * graph_img[NCALCS]
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
void button_set_status(GtkWidget *button, int status)
set status of check / toggle button
GtkWidget * spin_button(GCallback handler, double value, double start, double end, double step, int digits, int dim, gpointer data)
create a spin button
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)
create a GtkLabel with pango markup
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
int button_get_status(GtkWidget *button)
get status of check / toggle button
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
void show_the_widgets(GtkWidget *widg)
show GtkWidget
gboolean spin(gpointer data)
spin
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)
update all curve plots in the workspace after a calculation
Messaging function declarations.
Preference variable 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.