120G_MODULE_EXPORT
void set_max (GtkEntry * entry, gpointer data)
122 int c = GPOINTER_TO_INT(data);
146G_MODULE_EXPORT
void set_delta (GtkEntry * entry, gpointer data)
148 int c = GPOINTER_TO_INT(data);
246 gchar * str =
"Maximum <b><i>l</i></b>, <i>l<sub>max</sub></i> in [2-40]";
263 gchar * val_b[3]={
"Number of configurations:",
264 "\tTime step δt used during the dynamics:",
265 "\tNumber of step(s) between each configuration:"};
271 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);
307G_MODULE_EXPORT
void set_numa (GtkEntry * entry, gpointer data)
364GtkWidget *
combox_rings (gchar * str,
int num, gchar * list_item[num],
int id)
371 gtk_widget_set_size_request (
rings_box[
id], 180, -1);
394 int id = GPOINTER_TO_INT(data);
453G_MODULE_EXPORT
void toggle_rings (GtkCheckButton * but, gpointer data)
463G_MODULE_EXPORT
void toggle_rings (GtkToggleButton * but, gpointer data)
466 int oid = GPOINTER_TO_INT(data);
497 else if (oid == 1 &&
status)
501 else if (oid == 2 &&
status)
518 gchar * defs[6]={
"All rings (No rules)",
521 "Primitives [4, 5, 6]",
523 gchar * val_a[2]={
"Definition of ring to be used: ",
"Atom(s) to initiate the search from: "};
524 gchar * val_b[2][2]={{
"<i><b>n</b><sub>max</sub></i> = maximum size for a ring <sup>*</sup>",
525 "Maximum number of rings of size <i><b>n</b></i> per MD step <sup>**</sup>"},
526 {
"<i><b>n</b><sub>max</sub></i> = maximum size for a chain <sup>*</sup>",
527 "Maximum number of chains of size <i><b>n</b></i> per MD step <sup>**</sup>"}};
528 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",
" "},
529 {
"Only search for AAAA chains",
"Only search for ABAB chains",
530 "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."}};
531 gchar * start[3]={
"<sup>*</sup>",
"<sup>**</sup>",
"<sup>***</sup>"};
532 gchar * val_d[3]={
"<i><b>n</b><sub>max</sub></i> in total number of nodes (or atoms)",
533 "value used for memory allocation = f(<i><b>n</b><sub>max</sub></i>, system studied)",
534 "but homopolar bonds can shorten the rings"};
535 gchar * val_e={
"\n<sub>[1] S. V. King. <i>Nature</i>, <b>213</b>:1112 (1967).</sub>\n"
536 "<sub>[2] L. Guttman. <i>J. Non-Cryst. Solids.</i>, <b>116</b>:145-147 (1990).</sub>\n"
537 "<sub>[3] D. S. Franzblau. <i>Phys. Rev. B</i>, <b>44</b>(10):4925-4930 (1991).</sub>\n"
538 "<sub>[4] K. Goetzke and H. J. Klein. <i>J. Non-Cryst. Solids.</i>, <b>127</b>:215-220 (1991).</sub>\n"
539 "<sub>[5] X. Yuan and A. N. Cormack. <i>Comp. Mat. Sci.</i>, <b>24</b>:343-360 (2002).</sub>\n"
540 "<sub>[6] F. Wooten. <i>Acta Cryst. A</i>, <b>58</b>(4):346-351 (2002).</sub>"};
546 list_node[0] = g_strdup_printf (
"All");
549 list_node[1] = g_strdup_printf (
"Chemical species");
646G_MODULE_EXPORT
void run_toggle_bond (GtkNativeDialog * info, gint response_id, gpointer data)
648 GtkFileChooser * chooser = GTK_FILE_CHOOSER((GtkFileChooserNative *)info);
659G_MODULE_EXPORT
void run_toggle_bond (GtkDialog * info, gint response_id, gpointer data)
661 GtkFileChooser * chooser = GTK_FILE_CHOOSER((GtkWidget *)info);
663 if (response_id == GTK_RESPONSE_ACCEPT)
687G_MODULE_EXPORT
void toggle_bond (GtkCheckButton * Button, gpointer data)
697G_MODULE_EXPORT
void toggle_bond (GtkToggleButton * Button, gpointer data)
700 int i = GPOINTER_TO_INT (data);
713 show_info (
"Activate this option and the result of the nearest neighbors\n"
714 "analysis will be saved during the search in a file that you may\n"
717 GtkFileChooserNative * info;
723 GTK_FILE_CHOOSER_ACTION_SAVE,
725 GtkFileChooser * chooser = GTK_FILE_CHOOSER(info);
727 gtk_file_chooser_set_do_overwrite_confirmation (chooser, TRUE);
730 gtk_file_chooser_set_current_name (chooser,
"neighbors.dat");
732 run_this_gtk_native_dialog ((GtkNativeDialog *)info, G_CALLBACK(
run_toggle_bond), Button);
755 show_warning (
"You must specify a number of δr >= 2\n"
756 "to discretize the real space between 0.0 and D<sub>max</sub>\n",
calc_win);
761 show_warning (
"You must specify a maximum wave vector Q<sub>max</sub>[FFT]\n"
762 "for the FFT, with Q<sub>min</sub> < Q<sub>max</sub>[FFT] <= Q<sub>max</sub>",
calc_win);
782 show_warning (
"You must specify a maximum wave vector Q<sub>max</sub>\n"
783 "note that Q<sub>max</sub> must be > Q<sub>min</sub>",
calc_win);
788 show_warning (
"You must specify a number of δq >= 2\n"
789 "to discretize the reciprocal space between 0.0 and Q<sub>max</sub>\n",
calc_win);
807 show_warning (
"You must specify a number of δr >= 2\n"
808 "to discretize the real space between\n"
809 "the shortest and the highest inter-atomic distances",
calc_win);
814 show_warning (
"You must specify a number of δθ >= 2\n"
815 "to discretize the angular space between 0 and 180°",
calc_win);
834 gchar * sobj[2]={
"ring",
"chain"};
838 str = g_strdup_printf (
"You must specify a maximum %s size > 1 for the search", sobj[
search_type]);
845 str = g_strdup_printf (
"You must specify a number of %ss per size 'n' and per node\n"
846 "this value is used when allocating the memory to store the results\n"
847 "and depends on both the maximum %s size used in the search\n"
848 "and the system studied.\n"
849 "We recommend a value at least equal to 100.\n"
850 "If it appears that the value given is not big enough\n"
851 "(ex: more than 100 different %ss of size 'n' for a single node)\n"
852 "then the search will failed but the program will propose\n"
853 "you to initiate a new search using a higher value",
873 show_warning (
"You must specify the time step δt\n"
874 "used to integrate the Newton's equations\n"
875 "of motion during the molecular dynamics\n",
calc_win);
881 "used to integrate the Newton's equations\n"
882 "of motion during the molecular dynamics\n",
calc_win);
895 "between each of the %d configurations\n"
896 "found for the molecular dynamics\n",
calc_win);
933 gchar * val_a[2]={
"Number of δr [D<sub>ij</sub>min-D<sub>ij</sub>max]",
934 "Number of δθ [0-180°]"};
935 gchar * val_b[4]={
"First coordination sphere properties",
936 "Bond and dihedral angles distribution",
937 "Search for molecules and isolated fragments",
938 "Output detailed results in text file"};
958 GtkWidget * checkbd =
check_button (val_b[i], -1, 40, FALSE, G_CALLBACK(
toggle_bond), (gpointer)GINT_TO_POINTER(i));
973 gchar * note[3] = {
"D<sub>max</sub> = ",
"Q<sub>min</sub> = ",
"Q<sub>max</sub> = "};
974 gchar * unit[3] = {
" Å",
" Å<sup>-1</sup>",
" Å<sup>-1</sup>"};
978 str = g_strdup_printf (
"%f",
val);
997G_MODULE_EXPORT
void expand_opt (GtkWidget * exp, gpointer data)
1000 i = GPOINTER_TO_INT(data);
1001 GtkExpander * expander = GTK_EXPANDER (exp);
1003 gtk_window_set_resizable (GTK_WINDOW (wind), TRUE);
1004 if (gtk_expander_get_expanded (expander))
1027 gtk_widget_set_size_request (exp, -1, -1);
1028 gtk_window_set_resizable (GTK_WINDOW (wind), FALSE);
1041 int c = GPOINTER_TO_INT(data);
1046 if (
c == 0 && (v < 0.0 || v > 1.0))
1052 show_warning (
"Q<sub>lim</sub> must be ≥ Q<sub>min</sub> and ≤ Q<sub>max</sub>",
calc_win);
1070G_MODULE_EXPORT
void set_sfact (GtkEntry * entry, gpointer data)
1073 int i = GPOINTER_TO_INT(data);
1076 if (v <= 0.0 || v >= 1.0)
1119 l = GPOINTER_TO_INT(data);
1154 if (l == 0 || l == 3)
1196 if (l == 0 || l == 3)
1209 if (l == 1 || l == 2)
1228 if (l == 1 || l == 2) m = m+1;
1229 for (k=0 ; k<m; k++)
1247 if (l == 0 || l == 3)
1272 gchar * val_a[4]={
"Number of δr steps",
1273 "Number of δq steps",
1274 "Number of δq steps",
1275 "Number of δr steps"};
1276 gchar * val_b[3]={
"Q<sub>max</sub> [Å<sup>-1</sup>]",
1277 "Q<sub>max</sub> [Å<sup>-1</sup>]",
1278 "Q<sub>max</sub> for the FFT [Å<sup>-1</sup>]"};
1293 GtkWidget * entry=
create_entry (G_CALLBACK(
set_max), 100, 15, FALSE, GINT_TO_POINTER(
id));
1298 if (
id ==
GR ||
id ==
GK)
1306 if (
id ==
SK||
id ==
GK)
1314 if (
id ==
GR ||
id ==
GK)
1317 markup_label (
"D<sub>max</sub> is the maximum inter-atomic distance in the model", -1, -1, 0.0, 0.5),
1323 markup_label (
"Q<sub>min</sub> is the minimum wave vector for the model", -1, -1, 0.0, 0.5),
1329 markup_label (
"Q<sub>max</sub> is the maximum wave vector to compute S(q)", -1, -1, 0.0, 0.5),
1338 gchar * adv_name[2]={
"Probability to keep wave\nvector <i>q</i> > Q<sub>lim</sub> [0.0-1.0]",
1339 "Q<sub>lim</sub> [Å<sup>-1</sup>] in [Q<sub>min</sub>-Q<sub>max</sub>]"};
1340 GtkWidget * advanced_options =
create_expander (
" Advanced options", NULL);
1341 gtk_widget_set_size_request (advanced_options, -1, 20);
1354 fixed = gtk_fixed_new ();
1355 gtk_fixed_put (GTK_FIXED(fixed), aentry, 0.0, 0.0);
1358 g_signal_connect (G_OBJECT(advanced_options),
"activate", G_CALLBACK(
expand_opt), GINT_TO_POINTER(1));
1364 GtkWidget * smooth_options =
create_expander (
" Gaussian data smoothing", NULL);
1365 gtk_widget_set_size_request (smooth_options, -1, 20);
1374 g_signal_connect (G_OBJECT(smooth_options),
"activate", G_CALLBACK(
expand_opt), GINT_TO_POINTER(0));
1394 int id = GPOINTER_TO_INT(data);
1395 switch (response_id)
1397 case GTK_RESPONSE_APPLY:
1465 int id = GPOINTER_TO_INT(data);
1468 gtk_box_set_homogeneous (GTK_BOX(
box), FALSE);
1497 gtk_window_set_icon (GTK_WINDOW (
calc_win), gdk_pixbuf_new_from_file(
calc_img[
id], NULL));
1500 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
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
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 * 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 * 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
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.
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.