atomes 1.1.16
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
dlp_control.c
Go to the documentation of this file.
1/* This file is part of the 'atomes' software
2
3'atomes' is free software: you can redistribute it and/or modify it under the terms
4of the GNU Affero General Public License as published by the Free Software Foundation,
5either version 3 of the License, or (at your option) any later version.
6
7'atomes' is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
8without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9See the GNU General Public License for more details.
10
11You should have received a copy of the GNU Affero General Public License along with 'atomes'.
12If not, see <https://www.gnu.org/licenses/>
13
14Copyright (C) 2022-2024 by CNRS and University of Strasbourg */
15
22/*
23* This file: 'dlp_control.c'
24*
25* Contains:
26*
27
28 - The functions to handle the creation of the DL-POLY CONTROL file
29
30*
31* List of functions:
32
33 G_MODULE_EXPORT void set_order (GtkComboBox * box, gpointer data);
34 G_MODULE_EXPORT void set_thermo_param (GtkEntry * res, gpointer data);
35 G_MODULE_EXPORT void check_nvs (GtkCheckButton * but, gpointer data);
36 G_MODULE_EXPORT void check_nvs (GtkToggleButton * but, gpointer data);
37 G_MODULE_EXPORT void check_semi (GtkCheckButton * but, gpointer data);
38 G_MODULE_EXPORT void check_semi (GtkToggleButton * but, gpointer data);
39 G_MODULE_EXPORT void set_thermostat (GtkComboBox * box, gpointer data);
40 G_MODULE_EXPORT void set_ensemble (GtkComboBox * box, gpointer data);
41 G_MODULE_EXPORT void set_md_param (GtkEntry * res, gpointer data);
42 G_MODULE_EXPORT void show_advance_time_step (GtkButton * but, gpointer data);
43 G_MODULE_EXPORT void set_md_combo (GtkComboBox * box, gpointer data);
44 G_MODULE_EXPORT void check_impact (GtkCheckButton * but, gpointer data);
45 G_MODULE_EXPORT void check_impact (GtkToggleButton * but, gpointer data);
46 G_MODULE_EXPORT void show_impact_dialog (GtkButton * but, gpointer data);
47 G_MODULE_EXPORT void set_equi_combo (GtkComboBox * box, gpointer data);
48 G_MODULE_EXPORT void set_equi_param (GtkEntry * res, gpointer data);
49 G_MODULE_EXPORT void check_equi (GtkCheckButton * but, gpointer data);
50 G_MODULE_EXPORT void check_equi (GtkToggleButton * but, gpointer data);
51 G_MODULE_EXPORT void set_out_param (GtkEntry * res, gpointer data);
52 G_MODULE_EXPORT void check_out (GtkCheckButton * but, gpointer data);
53 G_MODULE_EXPORT void check_out (GtkToggleButton * but, gpointer data);
54 G_MODULE_EXPORT void set_print_level (GtkComboBox * box, gpointer data);
55 G_MODULE_EXPORT void set_ana_param (GtkEntry * res, gpointer data);
56 G_MODULE_EXPORT void check_ana (GtkCheckButton * but, gpointer data);
57 G_MODULE_EXPORT void check_ana (GtkToggleButton * but, gpointer data);
58 G_MODULE_EXPORT void set_io_param (GtkEntry * res, gpointer data);
59 G_MODULE_EXPORT void check_io (GtkCheckButton * but, gpointer data);
60 G_MODULE_EXPORT void check_io (GtkToggleButton * but, gpointer data);
61 G_MODULE_EXPORT void set_io_method (GtkComboBox * box, gpointer data);
62 G_MODULE_EXPORT void set_elec_param (GtkEntry * res, gpointer data);
63 G_MODULE_EXPORT void adjust_precision (GtkSpinButton * res, gpointer data);
64 G_MODULE_EXPORT void set_elec_eval (GtkComboBox * box, gpointer data);
65 G_MODULE_EXPORT void check_elec (GtkCheckButton * but, gpointer data);
66 G_MODULE_EXPORT void check_elec (GtkToggleButton * but, gpointer data);
67 G_MODULE_EXPORT void set_vdw_param (GtkEntry * res, gpointer data);
68 G_MODULE_EXPORT void set_vdw_mix (GtkComboBox * box, gpointer data);
69 G_MODULE_EXPORT void check_vdw (GtkCheckButton * but, gpointer data);
70 G_MODULE_EXPORT void check_vdw (GtkToggleButton * but, gpointer data);
71 G_MODULE_EXPORT void check_met (GtkCheckButton * but, gpointer data);
72 G_MODULE_EXPORT void check_met (GtkToggleButton * but, gpointer data);
73 G_MODULE_EXPORT void set_sys_param (GtkEntry * res, gpointer data);
74 G_MODULE_EXPORT void set_sys_restart (GtkComboBox * box, gpointer data);
75 G_MODULE_EXPORT void check_sys (GtkCheckButton * but, gpointer data);
76 G_MODULE_EXPORT void check_sys (GtkToggleButton * but, gpointer data);
77
78 GtkWidget * create_thermo_options (int ensemble, int thermo);
79 GtkWidget * create_thermo_box (int ensemble);
80 GtkWidget * create_ensemble_box ();
81 GtkWidget * create_md_box ();
82 GtkWidget * create_equi_box ();
83 GtkWidget * create_traj_box ();
84 GtkWidget * create_dump_box ();
85 GtkWidget * create_out_box ();
86 GtkWidget * create_overall_box ();
87 GtkWidget * create_analyze_box ();
88 GtkWidget * create_job_box ();
89 GtkWidget * create_io_box ();
90 GtkWidget * create_misc_box ();
91 GtkWidget * create_elec_param_box ();
92 GtkWidget * create_electro_box ();
93 GtkWidget * create_vdws_box ();
94 GtkWidget * create_metal_box ();
95 GtkWidget * create_sys_box ();
96 GtkWidget * create_restart_box ();
97 GtkWidget * vbox_control (int f);
98
99*/
100
101#include "dlp_field.h"
102#include "callbacks.h"
103#include "interface.h"
104#include "project.h"
105#include "glwindow.h"
106#include "glview.h"
107#include "bind.h"
108
109extern ColRGBA init_color (int id, int numid);
110extern gboolean print_ana ();
111
112gchar * celemts[MAXDATC] = {"System information",
113 "Calculation details",
114 "Non-bonded interactions",
115 "Equilibration",
116 "Thermodynamics",
117 "Molecular dynamics",
118 "Output options",
119 "Computational details"};
120
121gchar * celets[MAXDATC] = {"system information",
122 "calculation details",
123 "non-bonded interactions",
124 "equilibration",
125 "thermodynamics",
126 "molecular dynamics",
127 "output options",
128 "computational details"};
129
130#define DLP_ENS 4
131#define DLP_ENS_TYPE 10
132gchar * md_ensemble[DLP_ENS] = {"NVE", "NVT", "NPT", "NST"};
133gchar * md_thermo[DLP_ENS_TYPE] = {"Evans", "Langevin", "Andersen", "Berendsen", "Nosë-Hoover", "Gentle Stochastic", "DPD", "Martyna-Tuckerman-Klein", "Two temperature model", "Inhomogeneous Langevin"};
134
135// In the following, 0 = no thermo, > 0 = thermo and num of opts + 1
136int md_ens_opt[DLP_ENS][DLP_ENS_TYPE] = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
137 {1, 2, 3, 2, 2, 3, 3, 0, 4, 4},
138 {0, 3, 0, 3, 3, 0, 0, 3, 0, 0},
139 {0, 3, 0, 3, 3, 0, 0, 3, 0, 0}};
140
141gchar * opts_nvt[9][3]={{NULL, NULL, NULL},
142 {"Relaxation speed constant (friction):", NULL, NULL},
143 {"Relaxation time:", "Softness [0.0 - 1.0]:", NULL},
144 {"Relaxation constant:", NULL, NULL},
145 {"Relaxation constant:", NULL, NULL},
146 {"Relaxation constant:", "Langevin friction:", NULL},
147 {"Shardlow's splitting order:", "Global drag coefficient:", NULL},
148 {"Relaxation constant:", "Enhancement of relaxation constant:", "Cut-off particle velocity for friction enhancement:"},
149 {"Relaxation constant:", "Enhancement of relaxation constant:", "Cut-off particle velocity for friction enhancement:"}};
150
151gchar * unit_nvt[9][3]={{NULL, NULL, NULL},
152 {"<b>ps<sup>-1</sup></b>", NULL, NULL},
153 {"<b>ps</b>", NULL, NULL},
154 {"<b>ps</b>", NULL, NULL},
155 {"<b>ps</b>", NULL, NULL},
156 {"<b>ps</b>", "<b>ps<sup>-1</sup></b>", NULL},
157 {NULL, "<b>Dalton ps<sup>-1</sup></b>", NULL},
158 {"<b>ps<sup>-1</sup></b>", "<b>ps<sup>-1</sup></b>", "<b>&#xC5; ps<sup>-1</sup></b>"},
159 {"<b>ps<sup>-1</sup></b>", "<b>ps<sup>-1</sup></b>", "<b>&#xC5; ps<sup>-1</sup></b>"}};
160
161gchar * opts_npt_nvs[2][3] = {{"Thermostat relaxation speed constant (friction):", "Barostat relaxation speed constant (friction):", NULL},
162 {"Thermostat relaxation time:", "Barostat relaxation time:", "Target surface tension:"}};
163
164gchar * unit_npt_nvs[2][3] = {{"<b>ps<sup>-1</sup></b>", "<b>ps<sup>-1</sup></b>", NULL}, {"<b>ps</b>", "<b>ps</b>", "<b>dyn cm<sup>-1</sup></b>"}};
165
166gchar * extra_nvs[4] = {"Standard", "Area", "Tension", "Orthorhombic"};
167
168GtkWidget * check_nvs_butt[4];
169GtkWidget * nvs_label;
170GtkWidget * nvs_entry;
171GtkWidget * nvs_unit;
172GtkWidget * nvs_check[2];
173GtkWidget * o_ent_vbox;
174GtkWidget * o_vbox;
175GtkWidget * e_vbox;
176GtkWidget * ens_box;
177GtkWidget * bath_box;
179
188G_MODULE_EXPORT void set_order (GtkComboBox * box, gpointer data)
189{
190 tmp_field -> thermo_opts[0] = gtk_combo_box_get_active (box);
191}
192
201G_MODULE_EXPORT void set_thermo_param (GtkEntry * res, gpointer data)
202{
203 int i;
204 i = GPOINTER_TO_INT(data);
205 const gchar * m = entry_get_text (res);
206 double v = string_to_double ((gpointer)m);
207 if (i == 9)
208 {
209 if ((v == 0.0 || v >= 1.0) && v != tmp_field -> thermo_opts[i])
210 {
211 tmp_field -> thermo_opts[i] = v;
212 }
213 else if (v < 1.0 && v != 0.0)
214 {
215 show_warning ("Target temperature for the pseudo bath must be &#8805; 1.0 K,\n"
216 "Alternatively set value to 0.0 K to system temperature.", field_assistant);
217 }
218 }
219 else if (v >= 0.0 && v != tmp_field -> thermo_opts[i])
220 {
221 tmp_field -> thermo_opts[i] = v;
222 }
223 update_entry_double(res, tmp_field -> thermo_opts[i]);
224}
225
226#ifdef GTK4
235G_MODULE_EXPORT void check_nvs (GtkCheckButton * but, gpointer data)
236#else
245G_MODULE_EXPORT void check_nvs (GtkToggleButton * but, gpointer data)
246#endif
247{
248 int i, j;
249 i = GPOINTER_TO_INT(data);
250 tmp_field -> thermo_opts[3] = (double) i;
251 for (j=0; j<2; j++)
252 {
254 }
255 for (j=0; j<4; j++)
256 {
257 if (j != i)
258 {
259 if (j == 2)
260 {
261 update_entry_text (GTK_ENTRY(nvs_entry), "");
265 }
266 }
267 else if (j == i && i == 2)
268 {
272 update_entry_double (GTK_ENTRY(nvs_entry), 0.0);
273 tmp_field -> thermo_opts[4] = 0.0;
275 }
276 else if (j == i && i == 3)
277 {
279 }
280 }
281}
282
283#ifdef GTK4
292G_MODULE_EXPORT void check_semi (GtkCheckButton * but, gpointer data)
293#else
302G_MODULE_EXPORT void check_semi (GtkToggleButton * but, gpointer data)
303#endif
304{
305 int i = GPOINTER_TO_INT(data);
306 gboolean j;
307#ifdef GTK4
308 j = gtk_check_button_get_active (but);
309#else
310 j = gtk_toggle_button_get_active (but);
311#endif
312 tmp_field -> thermo_opts[i] = j;
313 if (i == 6) widget_set_sensitive (bath_box, j);
314}
315
324GtkWidget * create_thermo_options (int ensemble, int thermo)
325{
326 GtkWidget * vbox = create_vbox (5);
327 GtkWidget * hbox;
328 GtkWidget * entry;
329 gboolean val;
330 int i, j;
331 switch (ensemble)
332 {
333 case 1:
334 for (i=0; i<3; i++)
335 {
336 if (opts_nvt[thermo][i] != NULL)
337 {
338 hbox = create_hbox (5);
339 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label(opts_nvt[thermo][i], 350, -1, 1.0, 0.5), FALSE, FALSE, 50);
340 if (thermo == 6 && i == 0)
341 {
342 GtkWidget * o_combo = create_combo();
343 combo_text_append (o_combo, "s1");
344 combo_text_append (o_combo, "s2");
345 gtk_combo_box_set_active (GTK_COMBO_BOX(o_combo), (int)tmp_field -> thermo_opts[i]);
346 g_signal_connect (G_OBJECT (o_combo), "changed", G_CALLBACK(set_order), NULL);
347 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, o_combo, FALSE, FALSE, 5);
348 }
349 else
350 {
351 entry = create_entry(G_CALLBACK(set_thermo_param), 100, 10, FALSE, GINT_TO_POINTER(i));
352 update_entry_double (GTK_ENTRY(entry), tmp_field -> thermo_opts[i]);
353 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, entry, FALSE, FALSE, 5);
354 }
355 if (unit_nvt[thermo][i] != NULL) add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label(unit_nvt[thermo][i], 20, -1, 0.0, 0.5), FALSE, FALSE, 10);
356 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 0);
357 }
358 }
359 break;
360 default:
361 for (i=0; i<2; i++)
362 {
363 hbox = create_hbox (5);
364 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label(opts_npt_nvs[(thermo) ? 1 : 0][i], 310, -1, 1.0, 0.5), FALSE, FALSE, 50);
365 entry = create_entry(G_CALLBACK(set_thermo_param), 100, 10, FALSE, GINT_TO_POINTER(i));
366 update_entry_double (GTK_ENTRY(entry), tmp_field -> thermo_opts[i]);
367 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, entry, FALSE, FALSE, 5);
368 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label(unit_npt_nvs[(thermo) ? 1 : 0][i], 20, -1, 0.0, 0.5), FALSE, FALSE, 0);
369 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 0);
370 }
371 if (ensemble == 3)
372 {
373 GtkWidget * hhbox = create_hbox (0);
374 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hhbox, FALSE, FALSE, 0);
375 GtkWidget * vvbox = create_vbox (5);
376 add_box_child_start (GTK_ORIENTATION_VERTICAL, hhbox, vvbox, FALSE, FALSE, 50);
377 gtk_box_set_homogeneous (GTK_BOX (vvbox), TRUE);
378 for (i=0; i<4; i++)
379 {
380 hbox = create_hbox (5);
381 val = ((int)tmp_field -> thermo_opts[3] == i) ? TRUE : FALSE;
382#ifdef GTK4
383 check_nvs_butt[i] = check_button (extra_nvs[i], 100, -1, val, G_CALLBACK(check_nvs), GINT_TO_POINTER(i));
384 if (i)
385 {
386 gtk_check_button_set_group ((GtkCheckButton *)extra_nvs[i], (GtkCheckButton *)extra_nvs[0]);
387 }
388#else
389 if (! i)
390 {
391 check_nvs_butt[i] = radio_button (extra_nvs[i], 100, -1, val, G_CALLBACK(check_nvs), GINT_TO_POINTER(i));
392 }
393 else
394 {
395 check_nvs_butt[i] = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON(check_nvs_butt[0]), extra_nvs[i]);
396 }
397#endif
398 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, check_nvs_butt[i], FALSE, FALSE, 20);
399 if (i == 2)
400 {
401 nvs_label = markup_label(opts_npt_nvs[1][2], 150, -1, 0.0, 0.5);
403 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, nvs_label, FALSE, FALSE, 0);
404 j = 4;
405 nvs_entry = create_entry(G_CALLBACK(set_thermo_param), 100, 10, FALSE, GINT_TO_POINTER(j));
407 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, nvs_entry, FALSE, FALSE, 10);
408 if (val) update_entry_double (GTK_ENTRY(nvs_entry), tmp_field -> thermo_opts[4]);
409 nvs_unit = markup_label(unit_npt_nvs[1][2], 50, -1, 0.0, 0.5);
411 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, nvs_unit, FALSE, FALSE, 0);
412 }
413 if (i > 1)
414 {
415 val = (((int)tmp_field -> thermo_opts[3] == i) && tmp_field -> thermo_opts[5] == 1.0) ? TRUE : FALSE;
416 nvs_check[i-2] = check_button("Semi-anisotropic constraint", 200, -1, val, G_CALLBACK(check_semi), GINT_TO_POINTER(5));
418 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, nvs_check[i-2], FALSE, FALSE, 10);
419 }
420 add_box_child_start (GTK_ORIENTATION_VERTICAL, vvbox, hbox, FALSE, FALSE, 0);
421 }
422 }
423 break;
424 }
425 return vbox;
426}
427
436G_MODULE_EXPORT void set_thermostat (GtkComboBox * box, gpointer data)
437{
438 int i, j;
439 i = GPOINTER_TO_INT(data);
440 switch (i)
441 {
442 case 0:
443 tmp_field -> thermostat = gtk_combo_box_get_active (box);
444 for (j=0; j<6; j++) tmp_field -> thermo_opts[j] = 0.0;
445 if (tmp_field -> ensemble)
446 {
449 add_box_child_start (GTK_ORIENTATION_VERTICAL, o_vbox, o_ent_vbox, FALSE, FALSE, 0);
451 }
452 break;
453 case 1:
454 tmp_field -> thermo_opts[7] = gtk_combo_box_get_active (box);
455 break;
456 }
457}
458
466GtkWidget * create_thermo_box (int ensemble)
467{
468 GtkWidget * vbox = create_vbox (5);
469 GtkWidget * hbox = create_hbox (5);
470 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 0);
471 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label("Thermostat:", 100, -1, 0.0, 0.5), FALSE, FALSE, 30);
472 GtkWidget * thermo_box = create_combo();
473 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, thermo_box, FALSE, FALSE, 0);
474 int i;
475 for (i=0; i<DLP_ENS_TYPE; i++)
476 {
477 if (md_ens_opt[ensemble][i]) combo_text_append (thermo_box, md_thermo[i]);
478 }
479 gtk_combo_box_set_active (GTK_COMBO_BOX(thermo_box), tmp_field -> thermostat);
480 g_signal_connect (G_OBJECT (thermo_box), "changed", G_CALLBACK(set_thermostat), GINT_TO_POINTER(0));
481 if (ensemble)
482 {
484 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, o_vbox, FALSE, FALSE, 0);
486 add_box_child_start (GTK_ORIENTATION_VERTICAL, o_vbox, o_ent_vbox, FALSE, FALSE, 0);
487 }
488 return vbox;
489}
490
499G_MODULE_EXPORT void set_ensemble (GtkComboBox * box, gpointer data)
500{
501 int i;
502 if (tmp_field -> ensemble)
503 {
504 for (i=0; i<4; i++)
505 {
507 }
509 }
510 tmp_field -> ensemble = gtk_combo_box_get_active (box);
511 tmp_field -> thermostat = 0;
512
513 for (i=0; i<6; i++) tmp_field -> thermo_opts[i] = 0.0;
514 if (tmp_field -> ensemble)
515 {
518 add_box_child_start (GTK_ORIENTATION_VERTICAL, ens_box, thermo_option_box, FALSE, FALSE, 0);
519 }
520}
521
528{
529 GtkWidget * vbox = create_vbox (5);
530 GtkWidget * hbox = create_hbox (5);
531 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 0);
532 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label("Ensemble:", 100, -1, 0.0, 0.5), FALSE, FALSE, 30);
533 GtkWidget * ensemble = create_combo ();
534 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, ensemble, FALSE, FALSE, 0);
535 int i;
536 for (i=0; i<DLP_ENS; i++)
537 {
538 combo_text_append (ensemble, md_ensemble[i]);
539 }
540 gtk_combo_box_set_active (GTK_COMBO_BOX(ensemble), tmp_field -> ensemble);
541 g_signal_connect (G_OBJECT (ensemble), "changed", G_CALLBACK(set_ensemble), NULL);
542
544 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, ens_box, FALSE, FALSE, 0);
545 if (tmp_field -> ensemble)
546 {
548 add_box_child_start (GTK_ORIENTATION_VERTICAL, ens_box, thermo_option_box, FALSE, FALSE, 0);
549 }
550 gtk_widget_set_size_request (vbox, -1, 390);
551
552 gboolean val = (tmp_field -> thermo_opts[6] == 1.0) ? TRUE : FALSE;
553 bath_box = create_hbox (5);
554 add_box_child_end (vbox, bath_box, FALSE, FALSE, 0);
555 add_box_child_end (vbox, check_button("Use pseudo thermal bath", 100, -1, val, G_CALLBACK(check_semi), GINT_TO_POINTER(6)), FALSE, FALSE, 5);
557 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, bath_box, markup_label("Thermostat type:", 150, -1, 0.0, 0.5), FALSE, FALSE, 0);
558 GtkWidget * combo = create_combo();
559 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, bath_box, combo, FALSE, FALSE, 00);
560 combo_text_append (combo, "Langevin + Direct");
561 combo_text_append (combo, "Langevin");
562 combo_text_append (combo, "Gauss");
563 combo_text_append (combo, "Direct");
564 gtk_combo_box_set_active (GTK_COMBO_BOX(combo), (int)tmp_field -> thermo_opts[7]);
565 g_signal_connect (G_OBJECT (combo), "changed", G_CALLBACK(set_thermostat), GINT_TO_POINTER(1));
566 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, bath_box, markup_label("Thickness:", 100, -1, 1.0, 0.5), FALSE, FALSE, 0);
567 GtkWidget * entry = create_entry(G_CALLBACK(set_thermo_param), 100, 10, FALSE, GINT_TO_POINTER(8));
568 update_entry_double (GTK_ENTRY(entry), tmp_field -> thermo_opts[8]);
569 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, bath_box, entry, FALSE, FALSE, 5);
570 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, bath_box, markup_label("<b>&#xC5;</b>", 30, -1, 0.0, 0.5), FALSE, FALSE, 5);
571 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, bath_box, markup_label("Target T°:", 100, -1, 1.0, 0.5), FALSE, FALSE, 0);
572 entry = create_entry (G_CALLBACK(set_thermo_param), 100, 10, FALSE, GINT_TO_POINTER(9));
573 update_entry_double (GTK_ENTRY(entry), tmp_field -> thermo_opts[9]);
574 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, bath_box, entry, FALSE, FALSE, 5);
575 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, bath_box, markup_label("<b>K</b>", 30, -1, 0.0, 0.5), FALSE, FALSE, 5);
576 return vbox;
577}
578
579GtkWidget * step_button;
580GtkWidget * extra_vbox[2];
581GtkWidget * extra_lab[4];
582gchar * md_data[6] = {"Target temperature:", "Verlet integrator:", "Number of steps:", "Time step δt:", "Target pressure:", ""};
583gchar * md_extra[2][4] = {{"Shake iterations limit:", "Shake tolerance:", "", ""},
584 {"Rattle iterations limit:", "Rattle tolerance:", "FIQA iterations limit:", "FIQA quaternions tolerance:"}};
585gchar * md_unit[6] = {"<b>K</b>", "", "", "<b>ps</b>", "<b>katms</b>", ""};
586gchar * extra_unit[4] = {"<b>cycle(s)</b>", "", "<b>cycle(s)</b>", ""};
587gchar * dt_data[3] = {"Maximum time step:", "Maximum distance allowed:", "Minimum distance allowed:"};
588gchar * dt_unit[3] = {"<b>ps</b>", "<b>&#xC5;</b>", "<b>&#xC5;</b>"};
589gchar * md_combo[2][2] = {{"Velocity", "Leapfrog"}, {"Fixed", "Variable"}};
590
599G_MODULE_EXPORT void set_md_param (GtkEntry * res, gpointer data)
600{
601 int i;
602 i = GPOINTER_TO_INT(data);
603 const gchar * m = entry_get_text (res);
604 double v = string_to_double ((gpointer)m);
605 if (i == 14)
606 {
607 if (v >= 1.0 && v <= tmp_proj -> natomes)
608 {
609 tmp_field -> md_opts[i] = v;
610 }
611 }
612 else if (v >= 0.0 && v != tmp_field -> md_opts[i])
613 {
614 tmp_field -> md_opts[i] = v;
615 }
616 if (i == 2 || i == 9 || i == 11 || i == 14 || i == 15)
617 {
618 update_entry_int (res, (int)tmp_field -> md_opts[i]);
619 }
620 else
621 {
622 update_entry_double (res, tmp_field -> md_opts[i]);
623 }
624}
625
634G_MODULE_EXPORT void show_advance_time_step (GtkButton * but, gpointer data)
635{
636 GtkWidget * dialog = dialogmodal ("Variable time step information", GTK_WINDOW(field_assistant));
637 GtkWidget * vbox = dialog_get_content_area (dialog);
638 GtkWidget * hbox;
639 GtkWidget * entry;
640 int i, j;
641 i = 6;
642 for (j=0; j<3; j++)
643 {
644 hbox = create_hbox (0);
645 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 2);
646 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label(dt_data[j], 250, -1, 1.0, 0.5), FALSE, FALSE, 5);
647 entry = create_entry (G_CALLBACK(set_md_param), 100, 10, FALSE, GINT_TO_POINTER(i+j));
648 update_entry_double (GTK_ENTRY(entry), tmp_field -> md_opts[i+j]);
649 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, entry, FALSE, FALSE, 5);
650 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label(dt_unit[j], 30, -1, 0.0, 0.5), FALSE, FALSE, 5);
651 }
652 run_this_gtk_dialog (dialog, G_CALLBACK(run_destroy_dialog), NULL);
653}
654
663G_MODULE_EXPORT void set_md_combo (GtkComboBox * box, gpointer data)
664{
665 int i, j;
666 i = GPOINTER_TO_INT(data);
667 tmp_field -> md_opts[i] = gtk_combo_box_get_active (box);
668 if (i == 3) widget_set_sensitive (step_button, (int)tmp_field -> md_opts[i]);
669 if (i == 3 && tmp_field -> md_opts[i] == 1.0) show_advance_time_step (NULL, NULL);
670 if (i == 1)
671 {
672 gtk_widget_set_visible (extra_vbox[1], (int)tmp_field -> md_opts[1]);
673 for (j=0 ;j<2; j++)
674 {
675 gtk_label_set_text (GTK_LABEL(extra_lab[2*j]), md_extra[(int)tmp_field -> md_opts[i]][2*j]);
676 gtk_label_set_text (GTK_LABEL(extra_lab[2*j+1]), md_extra[(int)tmp_field -> md_opts[i]][2*j+1]);
677 }
678 }
679}
680
681GtkWidget * impact_but;
682gchar * imp_dir[3] = {"on x:", "on y:", "on z:"};
683
684#ifdef GTK4
693G_MODULE_EXPORT void check_impact (GtkCheckButton * but, gpointer data)
694#else
703G_MODULE_EXPORT void check_impact (GtkToggleButton * but, gpointer data)
704#endif
705{
706 gboolean i;
707#ifdef GTK4
708 i = gtk_check_button_get_active (but);
709#else
710 i = gtk_toggle_button_get_active (but);
711#endif
712 tmp_field -> md_opts[13] = (i) ? 1.0 : 0.0;
714}
715
724G_MODULE_EXPORT void show_impact_dialog (GtkButton * but, gpointer data)
725{
726 GtkWidget * dialog = dialogmodal ("Initiate impact on particle", GTK_WINDOW(field_assistant));
727 GtkWidget * vbox = dialog_get_content_area (dialog);
728 GtkWidget * hbox, * hhbox;
729 GtkWidget * entry;
730 int i, j;
731 gchar * str;
732 gtk_box_set_homogeneous (GTK_BOX (vbox), TRUE);
733 gchar * imp_info[4] = {"Index of the particle to impact: ", "Time step of impact:", "Energy of impact:", "Direction (from center of mass):"};
734 gchar * imp_unit[2] = {"<b>n<sup>th</sup> step</b>", "<b>k eV</b>"};
735 gchar * imp_dir[3] = {"on x:", "on y:", "on z:"};
736 for (i=0; i<4; i++)
737 {
738 hbox = create_hbox (5);
739 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 2);
740 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label(imp_info[i], 200, -1, 1.0, 0.5), FALSE, FALSE, 5);
741 if (i < 3)
742 {
743 j = (i < 2) ? 5 : 10;
744 entry = create_entry (G_CALLBACK(set_md_param), j*10, j + j/6, FALSE, GINT_TO_POINTER(i+14));
745 if (i < 2)
746 {
747 update_entry_int (GTK_ENTRY(entry), (int)tmp_field -> md_opts[i+14]);
748 }
749 else
750 {
751 update_entry_double (GTK_ENTRY(entry), tmp_field -> md_opts[i+14]);
752 }
753 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, entry, FALSE, FALSE, 5);
754 if (! i)
755 {
756 str = g_strdup_printf ("<b>in [1-%d]</b>", tmp_proj -> natomes);
757 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label(str, 30, -1, 0.0, 0.5), FALSE, FALSE, 0);
758 g_free (str);
759 }
760 else
761 {
762 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label(imp_unit[i-1], 30, -1, 0.0, 0.5), FALSE, FALSE, 0);
763 }
764 }
765 else
766 {
767 hbox = create_hbox (5);
768 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 2);
769 hhbox = create_hbox (5);
770 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, hhbox, FALSE, FALSE, 50);
771 for (j=0; j<3; j++)
772 {
773 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hhbox, markup_label(imp_dir[j], 50, -1, 1.0, 0.5), FALSE, FALSE, 0);
774 entry = create_entry (G_CALLBACK(set_md_param), 100, 11, FALSE, GINT_TO_POINTER(j+17));
775 update_entry_double (GTK_ENTRY(entry), tmp_field -> md_opts[j+17]);
776 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hhbox, entry, FALSE, FALSE, 5);
777
778 }
779 }
780 }
781 run_this_gtk_dialog (dialog, G_CALLBACK(run_destroy_dialog), NULL);
782}
783
789GtkWidget * create_md_box ()
790{
791 GtkWidget * vbox = create_vbox (BSEP);
792 gtk_widget_set_size_request (vbox, -1, 450);
793 GtkWidget * hbox;
794 GtkWidget * combo;
795 GtkWidget * entry;
796 int i, j, k, l;
797 l = 0;
798 for (i=0; i<3; i++)
799 {
800 hbox = create_hbox (5);
801 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 5);
802 for (j=0; j<2; j++, l++)
803 {
804 k = (j) ? 110 : 150;
805 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label(md_data[2*i+j], k, -1, 1.0, 0.5), FALSE, FALSE, 5);
806 if (j)
807 {
808 if (i < 2)
809 {
810 combo = create_combo ();
811 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, combo, FALSE, FALSE, 0);
812 for (k=0; k<2; k++)
813 {
814 combo_text_append (combo, md_combo[i][k]);
815 }
816 gtk_combo_box_set_active (GTK_COMBO_BOX(combo), 0);
817 gtk_widget_set_size_request (combo, 100, -1);
818 g_signal_connect (G_OBJECT (combo), "changed", G_CALLBACK(set_md_combo), GINT_TO_POINTER(l));
819 if (i)
820 {
821 l ++;
822 entry = create_entry (G_CALLBACK(set_md_param), 100, 11, FALSE, GINT_TO_POINTER(l));
823 update_entry_double (GTK_ENTRY(entry), tmp_field -> md_opts[l]);
824 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, entry, FALSE, FALSE, 5);
825 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label(md_unit[l-1], 30, -1, 0.0, 0.5), FALSE, FALSE, 0);
826 }
827 }
828 else
829 {
830 step_button = create_button ("Time step details", IMG_NONE, NULL, 100, -1, GTK_RELIEF_NORMAL, G_CALLBACK(show_advance_time_step), NULL);
831 widget_set_sensitive (step_button, (int)tmp_field -> md_opts[3]);
832 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, step_button, FALSE, FALSE, 10);
833 }
834 }
835 else
836 {
837 entry = create_entry (G_CALLBACK(set_md_param), 100, 11, FALSE, GINT_TO_POINTER(l));
838 if (i == 1 && j == 0)
839 {
840 update_entry_int (GTK_ENTRY(entry), (int)tmp_field -> md_opts[l]);
841 }
842 else
843 {
844 update_entry_double (GTK_ENTRY(entry), tmp_field -> md_opts[l]);
845 }
846 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, entry, FALSE, FALSE, 5);
847 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label(md_unit[2*i+j], 60, -1, 0.0, 0.5), FALSE, FALSE, 0);
848 }
849 }
850 }
851
852 k = (int)tmp_field -> md_opts[1];
853 l = 9;
854 gchar * extra_info[2] = {"<b>Bond constraint(s) dynamics:</b>", "<b>Rotational motion of rigid body(ies):</b>"};
855 for (i=0; i<2; i++)
856 {
857 extra_vbox[i] = create_vbox (5);
858 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, extra_vbox[i], FALSE, FALSE, 20);
859 add_box_child_start (GTK_ORIENTATION_VERTICAL, extra_vbox[i], markup_label(extra_info[i], 250, -1, 0.0, 0.5), FALSE, FALSE, 5);
860 hbox = create_hbox (5);
861 add_box_child_start (GTK_ORIENTATION_VERTICAL, extra_vbox[i], hbox, FALSE, FALSE, 0);
862 for (j=0; j<2; j++, l++)
863 {
864 extra_lab[2*i+j] = markup_label(md_extra[k][2*i+j], 150+j*100, -1, 1.0, 0.5);
865 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, extra_lab[2*i+j], FALSE, FALSE, 5);
866 entry = create_entry (G_CALLBACK(set_md_param), 100, 11, FALSE, GINT_TO_POINTER(l));
867 if (j)
868 {
869 update_entry_double (GTK_ENTRY(entry), tmp_field -> md_opts[l]);
870 }
871 else
872 {
873 update_entry_int (GTK_ENTRY(entry), (int)tmp_field -> md_opts[l]);
874 }
875 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, entry, FALSE, FALSE, 5);
876 if (! j) add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label(extra_unit[2*i+j], 30, -1, 0.0, 0.5), FALSE, FALSE, 0);
877 }
878 }
879 gtk_widget_set_visible (extra_vbox[1], (int)tmp_field -> md_opts[1]);
880 for (i=0 ;i<2; i++)
881 {
882 gtk_label_set_text (GTK_LABEL(extra_lab[2*i]), md_extra[(int)tmp_field -> md_opts[1]][2*i]);
883 gtk_label_set_text (GTK_LABEL(extra_lab[2*i+1]), md_extra[(int)tmp_field -> md_opts[1]][2*i+1]);
884 }
885
886 hbox = create_hbox (5);
887 add_box_child_end (vbox, hbox, FALSE, FALSE, 0);
888 gboolean val = (tmp_field -> md_opts[13] == 1.0) ? TRUE : FALSE;
889 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, check_button("<b>Initiate impact on particle</b>", 100, -1, val, G_CALLBACK(check_impact), NULL), FALSE, FALSE, 10);
890 impact_but = create_button ("Impact details", IMG_NONE, NULL, 100, -1, GTK_RELIEF_NORMAL, G_CALLBACK(show_impact_dialog), NULL);
892 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, impact_but, FALSE, FALSE, 10);
893 return vbox;
894}
895
896GtkWidget * equi_lab[6];
897GtkWidget * equi_entry[3];
898GtkWidget * equi_box[9];
899
900gchar * equi_info[8]= {"Equilibrate for the first:", "Scale temperature:", "Cap forces:",
901 "Resample the momenta distribution:", "Minimize system configuration:",
902 "Optimize system configuration from start:", "Perform zero temperature (10 K) optimization", "Include equilibration data in statistics"};
903gchar * equi_data[5]= {"Every:", "f<sub>max</sub>=", "During:", "Minimize:", "Optimize"};
904gchar * equi_unit[3]= {"<b>step(s)</b>", "<b>k<sub><i>B</i></sub>T / &#xC5;</b>", "<b>step(s)</b>"};
905gchar * equi_min[3]= {"Force", "Energy", "Distance"};
906gchar * equi_minu[3]= {"<b>k<sub><i>B</i></sub>T / &#xC5;</b>", "", "<b>&#xC5;</b>"};
907
908double equi_lim[2][3] = {{1.0, 0.0, 0.000001}, {1000.0, 0.01, 0.1}};
909float init_minop[3]={50.0, 0.005, 0.005};
910
919G_MODULE_EXPORT void set_equi_combo (GtkComboBox * box, gpointer data)
920{
921 int i, j, k;
922 i = GPOINTER_TO_INT(data);
923 tmp_field -> equi_opts[i] = gtk_combo_box_get_active (box);
924 j = (i == 9) ? 11 : 14;
925 k = (i == 9) ? 0 : 1;
926 tmp_field -> equi_opts[j] = init_minop[(int)tmp_field -> equi_opts[i]];
927 update_entry_double (GTK_ENTRY(equi_entry[2*k]), tmp_field -> equi_opts[j]);
928 gtk_label_set_text (GTK_LABEL(equi_lab[4*k]), g_strdup_printf ("%s:", equi_min[(int)tmp_field -> equi_opts[i]]));
929 gtk_label_set_text (GTK_LABEL(equi_lab[4*k+1]), g_strdup_printf ("<b>%s</b>", equi_minu[(int)tmp_field -> equi_opts[i]]));
930 gtk_label_set_use_markup (GTK_LABEL(equi_lab[4*k+1]), TRUE);
931}
932
941G_MODULE_EXPORT void set_equi_param (GtkEntry * res, gpointer data)
942{
943 int i, j;
944 i = GPOINTER_TO_INT(data);
945 const gchar * m = entry_get_text (res);
946 double v = string_to_double ((gpointer)m);
947 if (i == 10 || i == 14)
948 {
949 j = (i == 10) ? 9 : 13;
950 if (v >= equi_lim[0][(int)tmp_field -> equi_opts[j]] && v <= equi_lim[1][(int)tmp_field -> equi_opts[j]])
951 {
952 tmp_field -> equi_opts[i] = v;
953 }
954 else
955 {
956 gchar * str = g_strdup_printf ("Minimization parameter must be in [ %f - %f ]",
957 equi_lim[0][(int)tmp_field -> equi_opts[j]], equi_lim[1][(int)tmp_field -> equi_opts[j]]);
959 g_free (str);
960 }
961 }
962 else if (v >= 0.0 && v != tmp_field -> equi_opts[i])
963 {
964 tmp_field -> equi_opts[i] = v;
965 }
966 if (i == 1 || i == 3 || i == 7 || i == 11)
967 {
968 update_entry_int (res, (int)tmp_field -> equi_opts[i]);
969 }
970 else
971 {
972 update_entry_double (res, tmp_field -> equi_opts[i]);
973 }
974}
975
976#ifdef GTK4
985G_MODULE_EXPORT void check_equi (GtkCheckButton * but, gpointer data)
986#else
995G_MODULE_EXPORT void check_equi (GtkToggleButton * but, gpointer data)
996#endif
997{
998 int i, k;
999 i = GPOINTER_TO_INT(data);
1000 gboolean j;
1001#ifdef GTK4
1002 j = gtk_check_button_get_active (but);
1003#else
1004 j = gtk_toggle_button_get_active (but);
1005#endif
1006 k = 2*i + 2*(i/5) + i/6 - i/7;
1007 tmp_field -> equi_opts[k] = (j) ? 1.0 : 0.0;
1008 if (i < 6) widget_set_sensitive (equi_box[i], j);
1009}
1010
1016GtkWidget * create_equi_box ()
1017{
1018 GtkWidget * vbox = create_vbox (5);
1019 GtkWidget * hbox, * hhbox;
1020 GtkWidget * entry;
1021 GtkWidget * combo;
1022 gboolean val;
1023 int i, j, k, l, m;
1024 hbox = create_hbox (5);
1025 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 0);
1026 val = (tmp_field -> equi_opts[0] == 1.0) ? TRUE : FALSE;
1027 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, check_button("Equilibrate", 100, -1, val, G_CALLBACK(check_equi), GINT_TO_POINTER(0)), FALSE, FALSE, 5);
1028 equi_box[0] = create_vbox (5);
1030 gtk_box_set_homogeneous (GTK_BOX (equi_box[0]), TRUE);
1031 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, equi_box[0], FALSE, FALSE, 0);
1032 for (i=0; i<8; i++)
1033 {
1034 hbox = create_hbox (5);
1035 j = 2*i + 2*(i/5) - i/7;
1036 k = (i != 2) ? 5 : 10;
1037 l = j + 1;
1038
1039 add_box_child_start (GTK_ORIENTATION_VERTICAL, equi_box[0], hbox, FALSE, FALSE, 0);
1040
1041 if (i < 4)
1042 {
1043 entry = create_entry (G_CALLBACK(set_equi_param), k*10, k + k/6, FALSE, GINT_TO_POINTER(l));
1044 if (i == 2)
1045 {
1046 update_entry_double (GTK_ENTRY(entry), tmp_field -> equi_opts[l]);
1047 }
1048 else
1049 {
1050 update_entry_int (GTK_ENTRY(entry), (int)tmp_field -> equi_opts[l]);
1051 }
1052 }
1053 if (i)
1054 {
1055 val = (tmp_field -> equi_opts[j] == 1.0) ? TRUE : FALSE;
1056 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, check_button(equi_info[i], 300, -1, val, G_CALLBACK(check_equi), GINT_TO_POINTER(i)), FALSE, FALSE, 5);
1057 if (i == 4 || i == 5)
1058 {
1059 hhbox = create_hbox (5);
1060 add_box_child_start (GTK_ORIENTATION_VERTICAL, equi_box[0], hhbox, FALSE, FALSE, 0);
1061 hbox = create_hbox (5);
1062 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hhbox, hbox, FALSE, FALSE, 50);
1063 }
1064 equi_box[i] = create_hbox (5);
1066 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, equi_box[i], FALSE, FALSE, 5);
1067 if (i < 6) add_box_child_start (GTK_ORIENTATION_HORIZONTAL, equi_box[i], markup_label(equi_data[i-1], 100, -1, 0.8, 0.5), FALSE, FALSE, 0);
1068 if (i < 4)
1069 {
1070 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, equi_box[i], entry, FALSE, FALSE, 5);
1071 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, equi_box[i], markup_label(equi_unit[i-1], 100, -1, 0.0, 0.5), FALSE, FALSE, 0);
1072 }
1073 else if (i < 6)
1074 {
1075 combo = create_combo();
1076 for (m=0; m<3; m++) combo_text_append (combo, equi_min[m]);
1077 gtk_combo_box_set_active (GTK_COMBO_BOX(combo), (int)tmp_field -> equi_opts[l]);
1078 gtk_widget_set_size_request (combo, 100, -1);
1079 g_signal_connect (G_OBJECT (combo), "changed", G_CALLBACK(set_equi_combo), GINT_TO_POINTER(l));
1080 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, equi_box[i], combo, FALSE, FALSE, 5);
1081 for (m=i-4; m<2; m++, l++)
1082 {
1083 equi_lab[(i-4)*2+2*m] = markup_label((i == 4 && m) ? equi_data[0] : g_strdup_printf ("%s:", equi_min[(int)tmp_field -> equi_opts[l]]), 75, -1, 0.8, 0.5);
1084 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, equi_box[i], equi_lab[(i-4)*2+2*m], FALSE, FALSE, 0);
1085 k = (i == 4 && m) ? 5 : 10;
1086 equi_entry[i-4+m] = create_entry (G_CALLBACK(set_equi_param), k*10, k + k/6, FALSE, GINT_TO_POINTER(l+1+m/2));
1087 if (i == 4 && m)
1088 {
1089 update_entry_int (GTK_ENTRY(equi_entry[i-4+m]), (int)tmp_field -> equi_opts[l+1+m/2]);
1090 }
1091 else
1092 {
1093 update_entry_double (GTK_ENTRY(equi_entry[i-4+m]), tmp_field -> equi_opts[l+1+m/2]);
1094 }
1095 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, equi_box[i], equi_entry[i-4+m], FALSE, FALSE, 5);
1096 equi_lab[(i-4)*2+2*m+1] = markup_label((i == 4 && m) ? equi_unit[0] : equi_minu[(int)tmp_field -> equi_opts[l]], 50, -1, 0.0, 0.5);
1097 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, equi_box[i], equi_lab[(i-4)*2+2*m+1], FALSE, FALSE, 0);
1098 }
1099 }
1100 }
1101 else
1102 {
1103 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label(equi_info[i], 250, -1, 0.8, 0.5), FALSE, FALSE, 0);
1104 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, entry, FALSE, FALSE, 5);
1105 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label(equi_unit[i], 100, -1, 0.0, 0.5), FALSE, FALSE, 0);
1106 }
1107 }
1108 return vbox;
1109}
1110
1111gchar * traj_data[4] = {"Defects:",
1112 "Displacements:",
1113 "History:",
1114 "Atom's MSD:"};
1115
1116gchar * traj_info[4][3] = {{"From step:", "Every:", "Site interstitial cutoff:"},
1117 {"From step:", "Every:", "Qualifying cutoff:"},
1118 {"From step:", "Every:", "Data level:"},
1119 {"From step:", "Every:", NULL}};
1120
1121gchar * traj_level[3]={"0", "1", "2"};
1122
1123gchar * out_print[3]={"Radial distribution functions (RDFs):",
1124 "Velocity autocorrelation functions (VAFs):",
1125 "Z density profile:"};
1126
1127GtkWidget * out_hbox[11];
1128GtkWidget * out_entry[3];
1129
1138G_MODULE_EXPORT void set_out_param (GtkEntry * res, gpointer data)
1139{
1140 int i;
1141 i = GPOINTER_TO_INT(data);
1142 const gchar * m = entry_get_text (res);
1143 double v = string_to_double ((gpointer)m);
1144 if (i == 3 || i == 7 || i == 23)
1145 {
1146 if (v >= 0.0 && v != tmp_field -> out_opts[i])
1147 {
1148 tmp_field -> out_opts[i] = v;
1149 }
1150 update_entry_double (res, tmp_field -> out_opts[i]);
1151 if (i == 23)
1152 {
1153 update_entry_double (GTK_ENTRY(out_entry[0]), tmp_field -> out_opts[i]);
1154 update_entry_double (GTK_ENTRY(out_entry[2]), tmp_field -> out_opts[i]);
1155 }
1156 }
1157 else
1158 {
1159 if ((int)v != (int)tmp_field -> out_opts[i])
1160 {
1161 tmp_field -> out_opts[i] = (int)v;
1162 }
1163 update_entry_int (res, (int)tmp_field -> out_opts[i]);
1164 }
1165}
1166
1167#ifdef GTK4
1176G_MODULE_EXPORT void check_out (GtkCheckButton * but, gpointer data)
1177#else
1186G_MODULE_EXPORT void check_out (GtkToggleButton * but, gpointer data)
1187#endif
1188{
1189 int i, k;
1190 i = GPOINTER_TO_INT(data);
1191 gboolean j;
1192#ifdef GTK4
1193 j = gtk_check_button_get_active (but);
1194#else
1195 j = gtk_toggle_button_get_active (but);
1196#endif
1197 if (i < 7)
1198 {
1199 k = 4*i - i/4 - 2*(i/5) - 2*(i/6);
1200 tmp_field -> out_opts[k] = (j) ? 1.0 : 0.0;
1202 }
1203 else
1204 {
1205 tmp_field -> out_opts[i] = (j) ? 1.0 : 0.0;
1206 if (i < 29)
1207 {
1208 k = (i == 21) ? 7 : (i == 24) ? 8 : 9;
1210 if (i == 24) widget_set_sensitive (out_hbox[10], j);
1211 }
1212 }
1213}
1214
1223G_MODULE_EXPORT void set_print_level (GtkComboBox * box, gpointer data)
1224{
1225 tmp_field -> out_opts[12] = gtk_combo_box_get_active (box);
1226}
1227
1233GtkWidget * create_traj_box ()
1234{
1235 GtkWidget * vbox = create_vbox (5);
1236 GtkWidget * hbox;
1237 GtkWidget * combo;
1238 GtkWidget * entry;
1239 gboolean val;
1240 int i, j, k, l;
1241 for (i=0; i<4; i++)
1242 {
1243 hbox = create_hbox (0);
1244 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 0);
1245 k = (i < 4) ? 4*i : 15;
1246 val = (tmp_field -> out_opts[k] == 1.0) ? TRUE : FALSE;
1247 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, check_button(traj_data[i], 150, -1, val, G_CALLBACK(check_out), GINT_TO_POINTER(i)), FALSE, FALSE, 5);
1248 out_hbox[i] = create_hbox (5);
1249 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, out_hbox[i], FALSE, FALSE, 0);
1251
1252 for (j=0; j<3-i/3; j++)
1253 {
1254 l = (j == 2) ? 150 : 50;
1255 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, out_hbox[i], markup_label(traj_info[i][j], l, -1, 1.0, 0.5), FALSE, FALSE, 5);
1256 if (i != 2 || j != 2)
1257 {
1258 l = (j<2) ? 50 : 100;
1259 entry = create_entry (G_CALLBACK(set_out_param), l, l/10, FALSE, GINT_TO_POINTER(k+j+1));
1260 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, out_hbox[i], entry, FALSE, FALSE, 0);
1261 if (j == 2)
1262 {
1263 update_entry_double (GTK_ENTRY(entry), tmp_field -> out_opts[k+j+1]);
1264 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, out_hbox[i], markup_label("<b>&#xC5;</b>", 50, -1, 0.0, 0.5), FALSE, FALSE, 0);
1265 }
1266 else
1267 {
1268 update_entry_int (GTK_ENTRY(entry), (int)tmp_field -> out_opts[k+j+1]);
1269 if (j) add_box_child_start (GTK_ORIENTATION_HORIZONTAL, out_hbox[i], markup_label("<b>step(s)</b>", 50, -1, 0.0, 0.5), FALSE, FALSE, 0);
1270 }
1271 }
1272 else
1273 {
1274 combo = create_combo();
1275 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, out_hbox[i], combo, FALSE, FALSE, 0);
1276 for (l=0; l<3; l++) combo_text_append (combo, traj_level[l]);
1277 gtk_combo_box_set_active (GTK_COMBO_BOX(combo), (int)tmp_field -> out_opts[k+j+1]);
1278 g_signal_connect (G_OBJECT (combo), "changed", G_CALLBACK(set_print_level), NULL);
1279 }
1280 }
1281 }
1282 return vbox;
1283}
1284
1290GtkWidget * create_dump_box ()
1291{
1292 GtkWidget * vbox = create_vbox (5);
1293 GtkWidget * hbox;
1294 GtkWidget * entry;
1295
1296 hbox = create_hbox (0);
1297 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 0);
1298 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label("Dump restart information every:", 250, -1, 0.0, 0.5), FALSE, FALSE, 5);
1299 entry = create_entry (G_CALLBACK(set_out_param), 50, 6, FALSE, GINT_TO_POINTER(30));
1300 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, entry, FALSE, FALSE, 10);
1301 update_entry_int (GTK_ENTRY(entry), (int)tmp_field -> out_opts[30]);
1302 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label("<b>step(s)</b>", 50, -1, 0.0, 0.5), FALSE, FALSE, 0);
1303
1304 return vbox;
1305}
1306
1307gchar * out_data[3] = {"Print system data:",
1308 "Accumulate statistics data:",
1309 "Rolling average stack:"};
1310
1311gchar * out_info[3] = {"Every:", "Every:", " "};
1312
1318GtkWidget * create_out_box ()
1319{
1320 GtkWidget * vbox = create_vbox (5);
1321 GtkWidget * hbox;
1322 GtkWidget * entry;
1323 gboolean val;
1324 int i, j;
1325 for (i=4; i<7; i++)
1326 {
1327 hbox = create_hbox (0);
1328 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 0);
1329 j = 2*(i-4)+15;
1330 val = (tmp_field -> out_opts[j] == 1.0) ? TRUE : FALSE;
1331 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, check_button(out_data[i-4], 200, -1, val, G_CALLBACK(check_out), GINT_TO_POINTER(i)), FALSE, FALSE, 5);
1332 out_hbox[i] = create_hbox (5);
1333 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, out_hbox[i], FALSE, FALSE, 0);
1335 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, out_hbox[i], markup_label(out_info[i-4], 50, -1, 1.0, 0.5), FALSE, FALSE, 5);
1336 entry = create_entry (G_CALLBACK(set_out_param), 50, 5, FALSE, GINT_TO_POINTER(j+1));
1337 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, out_hbox[i], entry, FALSE, FALSE, 0);
1338 update_entry_int (GTK_ENTRY(entry), (int)tmp_field -> out_opts[j+1]);
1339 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, out_hbox[i], markup_label("<b>step(s)</b>", 50, -1, 0.0, 0.5), FALSE, FALSE, 0);
1340 }
1341 return vbox;
1342}
1343
1350{
1351 GtkWidget * vbox = create_vbox (5);
1352 gtk_box_set_homogeneous (GTK_BOX (vbox), TRUE);
1353 GtkWidget * hbox, * hhbox;
1354 GtkWidget * entry;
1355 gboolean val;
1356 int i, k, l, m, n;
1357 i = 6;
1358 for (l=0; l<3; l++)
1359 {
1360 k = 21 + 3*l;
1361 hbox = create_hbox (5);
1362 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 0);
1363 val = (tmp_field -> out_opts[k] == 1.0) ? TRUE : FALSE;
1364 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, check_button(out_print[l], 300, -1, val, G_CALLBACK(check_out), GINT_TO_POINTER(k)), FALSE, FALSE, 5);
1365 out_hbox[i+l+1] = create_hbox (5);
1367 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, out_hbox[i+l+1], FALSE, FALSE, 5);
1368 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, out_hbox[i+l+1], markup_label("Every:", 50, -1, 1.0, 0.5), FALSE, FALSE, 5);
1369 entry = create_entry (G_CALLBACK(set_out_param), 50, 5, FALSE, GINT_TO_POINTER(k+1));
1370 update_entry_int (GTK_ENTRY(entry), (int)tmp_field -> out_opts[k+1]);
1371 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, out_hbox[i+l+1], entry, FALSE, FALSE, 0);
1372 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, out_hbox[i+l+1], markup_label("<b>step(s)</b>", 50, -1, 0.0, 0.5), FALSE, FALSE, 0);
1373 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, out_hbox[i+l+1], markup_label("Bin size:", 100, -1, 1.0, 0.5), FALSE, FALSE, 5);
1374 m = (l==1) ? k + 2 : 23;
1375 n = (l==1) ? 1 : 2;
1376 out_entry[l] = create_entry (G_CALLBACK(set_out_param), n*50, n*5, FALSE, GINT_TO_POINTER(m));
1377 if (l != 1)
1378 {
1379 update_entry_double (GTK_ENTRY(out_entry[l]), tmp_field -> out_opts[m]);
1380 }
1381 else
1382 {
1383 update_entry_int (GTK_ENTRY(out_entry[l]), (int)tmp_field -> out_opts[m]);
1384 }
1385 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, out_hbox[i+l+1], out_entry[l], FALSE, FALSE, 0);
1386 if (l != 1)
1387 {
1388 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, out_hbox[i+l+1], markup_label("<b>&#xC5;</b>", 50, -1, 0.0, 0.5), FALSE, FALSE, 0);
1389 }
1390 if (l == 1)
1391 {
1392 hbox = create_hbox (0);
1393 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 0);
1394 out_hbox[10] = create_hbox (0);
1395 hhbox = create_hbox (0);
1396 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, hhbox, FALSE, FALSE, 0);
1397 gtk_widget_set_size_request (hhbox, 330, -1);
1398 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, out_hbox[10], FALSE, FALSE, 0);
1399 val = (tmp_field -> out_opts[29] == 1.0) ? TRUE : FALSE;
1400 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, out_hbox[10], check_button("Ignore time-averaging for the VAFs", 100, -1, val, G_CALLBACK(check_out), GINT_TO_POINTER(29)), FALSE, FALSE, 5);
1402 }
1403 }
1404 return vbox;
1405}
1406
1407GtkWidget * ana_box[5];
1408gchar * ana_info[5]={"All:", "Bonds:", "Angles:", "Dihedrals:", "Inversions:"};
1409gchar * ana_param[3]={"Every:", "Num. δ", "Cutoff = "};
1410
1419G_MODULE_EXPORT void set_ana_param (GtkEntry * res, gpointer data)
1420{
1421 int i;
1422 i = GPOINTER_TO_INT(data);
1423 const gchar * m = entry_get_text (res);
1424 double v = string_to_double ((gpointer)m);
1425 if (v >= 0.0 && v != tmp_field -> ana_opts[i])
1426 {
1427 tmp_field -> ana_opts[i] = v;
1428 }
1429 if (i == 3 || i == 7)
1430 {
1431 update_entry_double (GTK_ENTRY(res), tmp_field -> ana_opts[i]);
1432 }
1433 else
1434 {
1435 update_entry_int (GTK_ENTRY(res), (int)tmp_field -> ana_opts[i]);
1436 }
1437}
1438
1439#ifdef GTK4
1448G_MODULE_EXPORT void check_ana (GtkCheckButton * but, gpointer data)
1449#else
1458G_MODULE_EXPORT void check_ana (GtkToggleButton * but, gpointer data)
1459#endif
1460{
1461 int i, k;
1462 i = GPOINTER_TO_INT(data);
1463 gboolean j;
1464#ifdef GTK4
1465 j = gtk_check_button_get_active (but);
1466#else
1467 j = gtk_toggle_button_get_active (but);
1468#endif
1469 tmp_field -> ana_opts[i] = (j) ? 1.0 : 0.0;
1470 switch (i)
1471 {
1472 case 14:
1473 k = 4;
1474 break;
1475 case 11:
1476 k = 3;
1477 break;
1478 default:
1479 k = i / 4;
1480 break;
1481 }
1483}
1484
1491{
1492 GtkWidget * vbox = create_vbox (5);
1493 GtkWidget * hbox;
1494 GtkWidget * entry;
1495 gboolean val;
1496 gchar * str;
1497
1498 int i, j;
1499 for (i=0; i<5; i++)
1500 {
1501 hbox = create_hbox (5);
1502 j = (i < 3) ? 4*i: 11 + 3*(i-3);
1503 val = (tmp_field -> ana_opts[j] == 1.0) ? TRUE : FALSE;
1504 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 0);
1505 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, check_button(ana_info[i], 100, -1, val, G_CALLBACK(check_ana), GINT_TO_POINTER(j)), FALSE, FALSE, 5);
1506 ana_box[i] = create_hbox (5);
1507
1509 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, ana_box[i], FALSE, FALSE, 0);
1510
1511 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, ana_box[i], markup_label(ana_param[0], 50, -1, 1.0, 0.5), FALSE, FALSE, 5);
1512 entry = create_entry (G_CALLBACK(set_ana_param), 50, 5, FALSE, GINT_TO_POINTER(j+1));
1513
1514 update_entry_int (GTK_ENTRY(entry), (int)tmp_field -> ana_opts[j+1]);
1515 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, ana_box[i], entry, FALSE, FALSE, 0);
1516 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, ana_box[i], markup_label("<b>step(s)</b>", 50, -1, 0.0, 0.5), FALSE, FALSE, 0);
1517 if (i < 2)
1518 {
1519 str = g_strdup_printf ("%sr in [0 : r]", ana_param[1]);
1520 }
1521 else if (i == 3)
1522 {
1523 str = g_strdup_printf ("%s° in [-180 : 180]", ana_param[1]);
1524 }
1525 else
1526 {
1527 str = g_strdup_printf ("%s° in [0 : 180]", ana_param[1]);
1528 }
1529 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, ana_box[i], markup_label(str, 160, -1, 1.0, 0.5), FALSE, FALSE, 5);
1530 g_free (str);
1531 entry = create_entry (G_CALLBACK(set_ana_param), 50, 5, FALSE, GINT_TO_POINTER(j+2));
1532 update_entry_int (GTK_ENTRY(entry), (int)tmp_field -> ana_opts[j+2]);
1533 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, ana_box[i], entry, FALSE, FALSE, 0);
1534 if (i < 2)
1535 {
1536 str = g_strdup_printf ("<b>δr</b>");
1537 }
1538 else
1539 {
1540 str = g_strdup_printf ("<b>δ°</b>");
1541 }
1542 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, ana_box[i], markup_label(str, 50, -1, 0.0, 0.5), FALSE, FALSE, 0);
1543 g_free (str);
1544 if (i < 2)
1545 {
1546 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, ana_box[i], markup_label(ana_param[2], 50, -1, 1.0, 0.5), FALSE, FALSE, 5);
1547 entry = create_entry (G_CALLBACK(set_ana_param), 100, 11, FALSE, GINT_TO_POINTER(j+3));
1548 update_entry_double (GTK_ENTRY(entry), tmp_field -> ana_opts[j+3]);
1549 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, ana_box[i], entry, FALSE, FALSE, 0);
1550 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, ana_box[i], markup_label("<b>&#xC5;</b>", 50, -1, 0.0, 0.5), FALSE, FALSE, 0);
1551 }
1552
1553 }
1554 return vbox;
1555}
1556
1557GtkWidget * time_box[2];
1558GtkWidget * io_box[2];
1559GtkWidget * io_pre;
1560GtkWidget * misc_box;
1561gchar * time_info[2]={"Set job time:", "Set job closure time:"};
1562gchar * tps_info[2]={"run time:", "closure time:"};
1563gchar * io_rw_m[4] = {"MPI I/O", "FORTRAN I/O", "Traditional master I/O", "netCDF I/O"};
1564gchar * io_info[2] = {"<b>General Input/Output (I/O) read interface:</b>", "<b>General Input/Output (I/O) write interface:</b>"};
1565gchar * io_para[4] = {"Reader count:", "Batch size:", "Buffer size:", "// error check"};
1566gchar * io_pres[2] = {"Float - 32 bit", "Double - 64 bit"};
1567gchar * io_type[2] = {"Sorted", "Unsorted"};
1568GtkWidget * io_hp[2][4];
1569GtkWidget * check_e[2];
1570
1579G_MODULE_EXPORT void set_io_param (GtkEntry * res, gpointer data)
1580{
1581 int i;
1582 i = GPOINTER_TO_INT(data);
1583 const gchar * m = entry_get_text (res);
1584 double v = string_to_double ((gpointer)m);
1585 if (i < 2)
1586 {
1587 if (v >= 0.0 && v != tmp_field -> io_opts[2*i+1])
1588 {
1589 tmp_field -> io_opts[2*i+1] = v;
1590 }
1591 update_entry_double (GTK_ENTRY(res), tmp_field -> io_opts[2*i+1]);
1592 }
1593 else
1594 {
1595 if (i == 7 || i == 15)
1596 {
1597 if (v >= 1.0 && v <= 100000000.0)
1598 {
1599 if (v != tmp_field -> io_opts[i])
1600 {
1601 tmp_field -> io_opts[i] = v;
1602 }
1603 }
1604 else
1605 {
1606 show_warning ("The batch size or max. number of particles by batch\n"
1607 "must be in [1 - 10 000 000]", field_assistant);
1608 }
1609 }
1610 else if (i == 8 || i == 16)
1611 {
1612 if (v >= 100.0 && v <= 100000.0)
1613 {
1614 if (v != tmp_field -> io_opts[i])
1615 {
1616 tmp_field -> io_opts[i] = v;
1617 }
1618 }
1619 else
1620 {
1621 show_warning ("The buffer size or max. number of ASCII line records by batch\n"
1622 "must be in [100 - 100 000]", field_assistant);
1623 }
1624 }
1625 else if (i == 19 || i == 20 || i == 21)
1626 {
1627 if (v != tmp_field -> io_opts[i])
1628 {
1629 tmp_field -> io_opts[i] = v;
1630 }
1631 }
1632 else if (v > 0.0 && v != tmp_field -> io_opts[i])
1633 {
1634 tmp_field -> io_opts[i] = v;
1635 }
1636 update_entry_int (GTK_ENTRY(res), (int)tmp_field -> io_opts[i]);
1637 }
1638}
1639
1640#ifdef GTK4
1649G_MODULE_EXPORT void check_io (GtkCheckButton * but, gpointer data)
1650#else
1659G_MODULE_EXPORT void check_io (GtkToggleButton * but, gpointer data)
1660#endif
1661{
1662 int i, k;
1663 i = GPOINTER_TO_INT(data);
1664 gboolean j;
1665#ifdef GTK4
1666 j = gtk_check_button_get_active (but);
1667#else
1668 j = gtk_toggle_button_get_active (but);
1669#endif
1670 if (i < 2)
1671 {
1672 tmp_field -> io_opts[2*i] = (j) ? 1.0 : 0.0;
1674 }
1675 else
1676 {
1677 tmp_field -> io_opts[i] = (j) ? 1.0 : 0.0;
1678 if (i < 18)
1679 {
1680 k = (i == 4) ? 0 : 1;
1682 }
1683 else if (i == 18)
1684 {
1686 }
1687 }
1688}
1689
1698G_MODULE_EXPORT void set_io_method (GtkComboBox * box, gpointer data)
1699{
1700 int i, j, k;
1701 gboolean l;
1702 i = GPOINTER_TO_INT(data);
1703 j = gtk_combo_box_get_active (box);
1704 tmp_field -> io_opts[i] = (double)j;
1705 if (i < 12)
1706 {
1707 k = (i == 5) ? 0 : 1;
1708 l = (j == 2) ? FALSE : TRUE;
1709 widget_set_sensitive (io_hp[k][0], l);
1710 widget_set_sensitive (io_hp[k][2], l);
1712 if (i == 11)
1713 {
1714 l = (j == 3) ? TRUE : FALSE;
1716 }
1717 }
1718}
1719
1725GtkWidget * create_job_box ()
1726{
1727 GtkWidget * vbox = create_vbox (BSEP);
1728 GtkWidget * hbox;
1729 GtkWidget * entry;
1730 gboolean val;
1731 int i;
1732 for (i=0; i<2; i++)
1733 {
1734 hbox = create_hbox (5);
1735 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 5);
1736 val = (tmp_field -> io_opts[2*i] == 1.0) ? TRUE : FALSE;
1737 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, check_button(time_info[i], 200, -1, val, G_CALLBACK(check_io), GINT_TO_POINTER(i)), FALSE, FALSE, 5);
1738 time_box[i] = create_hbox (5);
1740 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, time_box[i], FALSE, FALSE, 0);
1741 entry = create_entry (G_CALLBACK(set_io_param), 100, 11, FALSE, GINT_TO_POINTER(i));
1742 update_entry_double (GTK_ENTRY(entry), tmp_field -> io_opts[i*2+1]);
1743 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, time_box[i], entry, FALSE, FALSE, 5);
1744 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, time_box[i], markup_label("<b>s</b>", 50, -1, 0.0, 0.5), FALSE, FALSE, 0);
1745 }
1746 return vbox;
1747}
1748
1754GtkWidget * create_io_box ()
1755{
1756 GtkWidget * vbox = create_vbox (BSEP);
1757 GtkWidget * hbox;
1758 GtkWidget * combo;
1759 GtkWidget * entry;
1760 gboolean val;
1761 int i, j, k;
1762 gboolean l, m;
1763 k = 4;
1764 for (i=0; i<2; i++)
1765 {
1766 hbox = create_hbox (5);
1767 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 10);
1768 val = (tmp_field -> io_opts[k] == 1.0) ? TRUE : FALSE;
1769 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, check_button(io_info[i], 200, -1, val, G_CALLBACK(check_io), GINT_TO_POINTER(k)), FALSE, FALSE, 5);
1770 io_box[i] = create_vbox (5);
1772 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, io_box[i], FALSE, FALSE, 0);
1773 hbox = create_hbox (5);
1774 add_box_child_start (GTK_ORIENTATION_VERTICAL, io_box[i], hbox, FALSE, FALSE, 0);
1775 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label("Method:", 100, -1, 1.0, 0.5), FALSE, FALSE, 5);
1776 combo = create_combo();
1777 for (j=0; j<4; j++)
1778 {
1779 combo_text_append(combo, io_rw_m[j]);
1780 }
1781 k ++;
1782 gtk_combo_box_set_active (GTK_COMBO_BOX(combo), (int)tmp_field -> io_opts[k]);
1783 g_signal_connect (G_OBJECT (combo), "changed", G_CALLBACK(set_io_method), GINT_TO_POINTER(k));
1784 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, combo, FALSE, FALSE, 5);
1785 l = tmp_field -> io_opts[k] == 2.0 ? FALSE : TRUE;
1786 m = tmp_field -> io_opts[k] == 3.0 ? TRUE : FALSE;
1787 if (i)
1788 {
1789 io_pre = create_hbox(5);
1790 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, io_pre, FALSE, FALSE, 0);
1791 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, io_pre, markup_label("Real precision:", 150, -1, 1.0, 0.5), FALSE, FALSE, 5);
1792 combo = create_combo();
1793 for (j=0; j<2; j++) combo_text_append(combo, io_pres[j]);
1794 k ++;
1795 gtk_combo_box_set_active (GTK_COMBO_BOX(combo), (int)tmp_field -> io_opts[k]);
1796 g_signal_connect (G_OBJECT (combo), "changed", G_CALLBACK(set_io_method), GINT_TO_POINTER(k));
1797 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, io_pre, combo, FALSE, FALSE, 5);
1799 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label("Type:", 50, -1, 1.0, 0.5), FALSE, FALSE, 5);
1800 combo = create_combo();
1801 for (j=0; j<2; j++) combo_text_append(combo, io_type[j]);
1802 k ++;
1803 gtk_combo_box_set_active (GTK_COMBO_BOX(combo), (int)tmp_field -> io_opts[k]);
1804 g_signal_connect (G_OBJECT (combo), "changed", G_CALLBACK(set_io_method), GINT_TO_POINTER(k));
1805 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, combo, FALSE, FALSE, 5);
1806 }
1807 hbox = create_hbox (5);
1808 add_box_child_start (GTK_ORIENTATION_VERTICAL, io_box[i], hbox, FALSE, FALSE, 0);
1809 for (j=0; j<3; j++)
1810 {
1811 io_hp[i][j] = create_hbox (5);
1812 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, io_hp[i][j], FALSE, FALSE, 0);
1813 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, io_hp[i][j], markup_label(io_para[j], 100, -1, 1.0, 0.5), FALSE, FALSE, 5);
1814 k++;
1815 entry = create_entry (G_CALLBACK(set_io_param), 70, 8, FALSE, GINT_TO_POINTER(k));
1816 update_entry_int (GTK_ENTRY(entry), (int)tmp_field -> io_opts[k]);
1817 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, io_hp[i][j], entry, FALSE, FALSE, 5);
1818 if (j == 1) widget_set_sensitive (io_hp[i][j], l);
1819 }
1820 k++;
1821 check_e[i] = check_button(io_para[j], 50, -1, val, G_CALLBACK(check_io), GINT_TO_POINTER(k));
1822 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, check_e[i], FALSE, FALSE, 20);
1824 k ++;
1825 }
1826 return vbox;
1827}
1828
1834GtkWidget * create_misc_box ()
1835{
1836 GtkWidget * vbox = create_vbox (BSEP);
1837 GtkWidget * hbox;
1838 GtkWidget * entry;
1839 gchar * str;
1840 gboolean val;
1841 int i;
1842 hbox = create_hbox (5);
1843 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 5);
1844 val = (tmp_field -> io_opts[18] == 1.0) ? TRUE : FALSE;
1845 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, check_button("Random number generator seeds:", 200, -1, val, G_CALLBACK(check_io), GINT_TO_POINTER(18)), FALSE, FALSE, 5);
1846 misc_box = create_hbox (5);
1848 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, misc_box, FALSE, FALSE, 0);
1849 for (i=19; i<22; i++)
1850 {
1851 str = g_strdup_printf ("<i>n</i><sub>%d</sub>", i-18);
1852 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, misc_box, markup_label(str, 50, -1, 1.0, 0.5), FALSE, FALSE, 5);
1853 g_free (str);
1854 entry = create_entry (G_CALLBACK(set_io_param), 70, 10, FALSE, GINT_TO_POINTER(i));
1855 update_entry_int (GTK_ENTRY(entry), (int)tmp_field -> io_opts[i]);
1856 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, misc_box, entry, FALSE, FALSE, 5);
1857 }
1858 hbox = create_hbox (5);
1859 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 5);
1860 val = (tmp_field -> io_opts[22] == 1.0) ? TRUE : FALSE;
1861 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, check_button("Limits to 2 the number of processors in <i>z</i> direction for slab simulations", 200, -1, val, G_CALLBACK(check_io), GINT_TO_POINTER(22)), FALSE, FALSE, 5);
1862 return vbox;
1863}
1864
1865
1866GtkWidget * elec_box[4];
1867GtkWidget * pres_spin;
1868gchar * eval_m[10] = {"Direct Coulomb sum", "Distance dependent dielectric Coulomb sum",
1869 "Ewald sum (auto)", "Ewald sum",
1870 "Reaction field electrostatics", "Reaction field with Fennel damping",
1871 "Reaction field with Fennel damping (auto)",
1872 "Force-shifted Coulomb sum", "Force-shifted Coulomb sum with Fennel damping",
1873 "Force-shifted Coulomb sum with Fennel damping (auto)"};
1874
1883G_MODULE_EXPORT void set_elec_param (GtkEntry * res, gpointer data)
1884{
1885 int i;
1886 i = GPOINTER_TO_INT(data);
1887 const gchar * m = entry_get_text (res);
1888 double v = string_to_double ((gpointer)m);
1889 if (i == 1)
1890 {
1891 if (v > 0.0 && v != tmp_field -> elec_opts[i])
1892 {
1893 tmp_field -> elec_opts[i] = v;
1894 }
1895 else if (v < 0.0)
1896 {
1897 show_warning ("Cutoff must be > 0.0 &#xC5;", field_assistant);
1898 }
1899 }
1900 else if (i == 3)
1901 {
1902 if (v > 0.0 && v != tmp_field -> elec_opts[i])
1903 {
1904 if (v >= min(0.05, 0.5*tmp_field -> elec_opts[1]/100.0))
1905 {
1906 tmp_field -> elec_opts[i] = v;
1907 }
1908 else
1909 {
1910 show_warning ("Padding must be &#8805; min(0.05, 0.5%r<sub>cut</sub>) &#xC5;", field_assistant);
1911 }
1912 }
1913 else if (v < 0.0)
1914 {
1915 show_warning ("Padding must be > 0.0 &#xC5;", field_assistant);
1916 }
1917 }
1918 else
1919 {
1920 if (i != 6 && (v >= 0.0 && v != tmp_field -> elec_opts[i]))
1921 {
1922 tmp_field -> elec_opts[i] = v;
1923 }
1924 else if (i == 6)
1925 {
1926 if (tmp_field -> elec_opts[5] == 2.0 || tmp_field -> elec_opts[5] == 6.0 || tmp_field -> elec_opts[5] == 9.0)
1927 {
1928 int j = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(pres_spin));
1929 double w = v * pow (10, j);
1930 if ((w >= 1e-20 && w <= 0.5) && w != tmp_field -> elec_opts[i])
1931 {
1932 tmp_field -> elec_opts[i] = w;
1933 w = v;
1934 }
1935 else if (w < 1e-20 || w > 0.5)
1936 {
1937 show_warning ("Precision must be in [10<sup>-20</sup> - 0.5]", field_assistant);
1938 w = tmp_field -> elec_opts[i] / pow (10, j);
1939 }
1940 }
1941 else if (v >= 0.0 && v != tmp_field -> elec_opts[i])
1942 {
1943 tmp_field -> elec_opts[i] = v;
1944 }
1945 }
1946 }
1947 if (i == 10)
1948 {
1949 if (tmp_field -> elec_opts[i] == 0.0) tmp_field -> elec_opts[i] = 1.0;
1950 if (tmp_field -> elec_opts[i] > 10.0) tmp_field -> elec_opts[i] = 4.0;
1951 update_entry_int (GTK_ENTRY(res), (int)tmp_field -> elec_opts[i]);
1952 }
1953 else if (i == 7 || i == 8 || i == 9)
1954 {
1955 update_entry_int (GTK_ENTRY(res), (int)tmp_field -> elec_opts[i]);
1956 }
1957 else
1958 {
1959 if (i == 6)
1960 {
1961 update_entry_double (GTK_ENTRY(res), v);
1962 }
1963 else
1964 {
1965 update_entry_double (GTK_ENTRY(res), tmp_field -> elec_opts[i]);
1966 }
1967 }
1968}
1969
1978G_MODULE_EXPORT void adjust_precision (GtkSpinButton * res, gpointer data)
1979{
1980 int powa = gtk_spin_button_get_value_as_int(res);
1981 double v = tmp_field -> elec_opts[6];
1982 while (v < 0.1)
1983 {
1984 v = v*10;
1985 }
1986 v = v*10;
1987 tmp_field -> elec_opts[6] = v * pow(10, powa);
1988}
1989
1996{
1997 GtkWidget * vbox, * vvbox;
1998 GtkWidget * hbox, * hhbox;
1999 GtkWidget * entry;
2000 vvbox = create_hbox (5);
2001 vbox = create_vbox (5);
2002 gtk_box_set_homogeneous (GTK_BOX (vbox), TRUE);
2003 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, vvbox, vbox, FALSE, FALSE, 50);
2004 gchar * dir[3] = {"x:", "y:", "z:"};
2005 if (tmp_field -> elec_opts[5] == 2.0 || tmp_field -> elec_opts[5] == 6.0 || tmp_field -> elec_opts[5] == 9.0)
2006 {
2007 hbox = create_hbox (5);
2008 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 0);
2009 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label("Precision:", 180, -1, 0.0, 0.5), FALSE, FALSE, 0);
2010 // tmp_field -> elec_opts[6] = 1e-20;
2011 entry = create_entry (G_CALLBACK(set_elec_param), 100, 11, FALSE, GINT_TO_POINTER(6));
2012 double v = tmp_field -> elec_opts[6];
2013 int i = -1;
2014 while (v < 0.1)
2015 {
2016 v = v*10;
2017 i --;
2018 }
2019 update_entry_double (GTK_ENTRY(entry), tmp_field -> elec_opts[6] / pow(10,i));
2020 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, entry, FALSE, FALSE, 10);
2021 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label(" x 10<sup>-</sup>", 5, -1, 0.0, 0.5), FALSE, FALSE, 0);
2022 pres_spin = spin_button (G_CALLBACK(adjust_precision), i, -20, -1, 1, 0, 15, NULL);
2023 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, pres_spin, FALSE, FALSE, 5);
2024 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label("in [10<sup>-20</sup> - 0.5]", 50, -1, 0.0, 0.5), FALSE, FALSE, 5);
2025 }
2026 else if (tmp_field -> elec_opts[5] == 3.0)
2027 {
2028 hbox = create_hbox (5);
2029 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 0);
2030 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label("Ewald convergence parameter:", 200, -1, 0.0, 0.5), FALSE, FALSE, 0);
2031 // tmp_field -> elec_opts[6] = 1.0;
2032 entry = create_entry (G_CALLBACK(set_elec_param), 100, 11, FALSE, GINT_TO_POINTER(6));
2033 update_entry_double (GTK_ENTRY(entry), tmp_field -> elec_opts[6]);
2034 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, entry, FALSE, FALSE, 10);
2035 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label("<b>&#xC5;<sup>-1</sup></b>", 50, -1, 0.0, 0.5), FALSE, FALSE, 5);
2036 hbox = create_hbox (5);
2037 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 0);
2038 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label("Maximum k vector index in directions:", 200, -1, 0.0, 0.5), FALSE, FALSE, 0);
2039 hbox = create_hbox (5);
2040 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 0);
2041 int i;
2042 for (i=0; i<3; i++)
2043 {
2044 hhbox = create_hbox (5);
2045 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, hhbox, FALSE, FALSE, 40);
2046 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label(dir[i], 10, -1, 0.0, 0.5), FALSE, FALSE, 0);
2047 // tmp_field -> elec_opts[7+i] = 1.0;
2048 entry = create_entry (G_CALLBACK(set_elec_param), 50, 5, FALSE, GINT_TO_POINTER(7+i));
2049 update_entry_int (GTK_ENTRY(entry), (int)tmp_field -> elec_opts[7+i]);
2050 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, entry, FALSE, FALSE, 5);
2051 }
2052 }
2053 else if (tmp_field -> elec_opts[5] == 5.0 || tmp_field -> elec_opts[5] == 8.0)
2054 {
2055 hbox = create_hbox (5);
2056 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 0);
2057 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label("Fennell damping parameter (&#x3B1;):", 50, -1, 0.0, 0.5), FALSE, FALSE, 0);
2058 entry = create_entry (G_CALLBACK(set_elec_param), 100, 11, FALSE, GINT_TO_POINTER(6));
2059 update_entry_double (GTK_ENTRY(entry), tmp_field -> elec_opts[6]);
2060 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, entry, FALSE, FALSE, 10);
2061 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label("<b>&#xC5;<sup>-1</sup></b>", 50, -1, 0.0, 0.5), FALSE, FALSE, 5);
2062 }
2063 if (tmp_field -> elec_opts[5] == 2.0 || tmp_field -> elec_opts[5] == 3.0)
2064 {
2065 hbox = create_hbox (5);
2066 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 0);
2067 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label("Evaluate <i>k</i>-space contribution to the Ewald sum every:", -1, -1, 0.0, 0.5), FALSE, FALSE, 0);
2068 entry = create_entry (G_CALLBACK(set_elec_param), 50, 5, FALSE, GINT_TO_POINTER(10));
2069 update_entry_int (GTK_ENTRY(entry), (int)tmp_field -> elec_opts[10]);
2070 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, entry, FALSE, FALSE, 10);
2071 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label("<b>step(s)</b>", 50, -1, 0.0, 0.5), FALSE, FALSE, 5);
2072 }
2073 return vvbox;
2074}
2075
2084G_MODULE_EXPORT void set_elec_eval (GtkComboBox * box, gpointer data)
2085{
2086 tmp_field -> elec_opts[5] = gtk_combo_box_get_active (box);
2090 add_box_child_start (GTK_ORIENTATION_VERTICAL, elec_box[2], elec_box[3], FALSE, FALSE, 10);
2091}
2092
2093#ifdef GTK4
2102G_MODULE_EXPORT void check_elec (GtkCheckButton * but, gpointer data)
2103#else
2112G_MODULE_EXPORT void check_elec (GtkToggleButton * but, gpointer data)
2113#endif
2114{
2115 int i = GPOINTER_TO_INT(data);
2116 gboolean j;
2117#ifdef GTK4
2118 j = gtk_check_button_get_active (but);
2119#else
2120 j = gtk_toggle_button_get_active (but);
2121#endif
2122 tmp_field -> elec_opts[i] = (j) ? 1.0 : 0.0;
2123 if (! i) widget_set_sensitive (elec_box[j], j);
2124 if (i == 2) widget_set_sensitive (elec_box[1], j);
2125}
2126
2133{
2134 GtkWidget * vbox = create_vbox (BSEP);
2135 GtkWidget * hbox;
2136 gboolean val = (tmp_field -> elec_opts[0] == 1.0) ? TRUE : FALSE;
2137 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, check_button("Evaluate electrostatics interactions", -1, -1, val, G_CALLBACK(check_elec), GINT_TO_POINTER(0)), FALSE, FALSE, 5);
2138 hbox = create_hbox(0);
2139 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 0);
2140 elec_box[0] = create_vbox(5);
2142 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, elec_box[0], FALSE, FALSE, 50);
2143 hbox = create_hbox(5);
2144 add_box_child_start (GTK_ORIENTATION_VERTICAL, elec_box[0], hbox, FALSE, FALSE, 0);
2145 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label("Long range interaction cutoff [r<sub>cut</sub>]:", 200, -1, 0.0, 0.5), FALSE, FALSE, 0);
2146 GtkWidget * entry = create_entry (G_CALLBACK(set_elec_param), 100, 10, FALSE, GINT_TO_POINTER(1));
2147 update_entry_double (GTK_ENTRY(entry), tmp_field -> elec_opts[1]);
2148 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, entry, FALSE, FALSE, 10);
2149 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label("<b>&#xC5;</b>", 30, -1, 0.0, 0.5), FALSE, FALSE, 5);
2150 val = (tmp_field -> elec_opts[2] == 1.0) ? TRUE : FALSE;
2151 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, check_button("Add padding to r<sub>cut</sub>:", 150, -1, val, G_CALLBACK(check_elec), GINT_TO_POINTER(2)), FALSE, FALSE, 0);
2152 elec_box[1] = create_hbox(5);
2153 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, elec_box[1], FALSE, FALSE, 0);
2154 entry = create_entry (G_CALLBACK(set_elec_param), 100, 10, FALSE, GINT_TO_POINTER(3));
2155 update_entry_double (GTK_ENTRY(entry), tmp_field -> elec_opts[3]);
2156 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, elec_box[1], entry, FALSE, FALSE, 10);
2157 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, elec_box[1], markup_label("<b>&#xC5;</b>", 50, -1, 0.0, 0.5), FALSE, FALSE, 5);
2159 val = (tmp_field -> elec_opts[4] == 1.0) ? TRUE : FALSE;
2160 add_box_child_start (GTK_ORIENTATION_VERTICAL, elec_box[0], check_button("Use extended coulombic exclusion", -1, -1, val, G_CALLBACK(check_elec), GINT_TO_POINTER(4)), FALSE, FALSE, 5);
2161 hbox = create_hbox(5);
2162 add_box_child_start (GTK_ORIENTATION_VERTICAL, elec_box[0], hbox, FALSE, FALSE, 0);
2163 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label("Evaluation method:", 200, -1, 0.0, 0.5), FALSE, FALSE, 0);
2164 GtkWidget * combo = create_combo();
2165 int i;
2166 for (i=0; i<10; i++)
2167 {
2168 combo_text_append(combo, eval_m[i]);
2169 }
2170 gtk_combo_box_set_active (GTK_COMBO_BOX(combo), (int)tmp_field -> elec_opts[5]);
2171 g_signal_connect (G_OBJECT (combo), "changed", G_CALLBACK(set_elec_eval), NULL);
2172 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, combo, FALSE, FALSE, 10);
2173 elec_box[2] = create_vbox (BSEP);
2174 add_box_child_start (GTK_ORIENTATION_VERTICAL, elec_box[0], elec_box[2], FALSE, FALSE, 0);
2176 add_box_child_start (GTK_ORIENTATION_VERTICAL, elec_box[2], elec_box[3], FALSE, FALSE, 10);
2177 return vbox;
2178}
2179
2180GtkWidget * vdw_box[2];
2181gchar * eval_vdw[6] = {"Lorentz-Berthelot", "Fender-Halsey", "Hogervorst",
2182 "Halgren HHG", "Tang-Toennies", "Functional"};
2183
2192G_MODULE_EXPORT void set_vdw_param (GtkEntry * res, gpointer data)
2193{
2194 int i;
2195 i = GPOINTER_TO_INT(data);
2196 const gchar * m = entry_get_text (res);
2197 double v = string_to_double ((gpointer)m);
2198 if (i == 1)
2199 {
2200 if (v > 0.0 && v != tmp_field -> vdw_opts[i])
2201 {
2202 tmp_field -> vdw_opts[i] = v;
2203 }
2204 else if (v < 0.0)
2205 {
2206 show_warning ("Cutoff must be > 0.0 &#xC5;", field_assistant);
2207 }
2208 }
2209 update_entry_double (GTK_ENTRY(res), tmp_field -> vdw_opts[i]);
2210}
2211
2220G_MODULE_EXPORT void set_vdw_mix (GtkComboBox * box, gpointer data)
2221{
2222 tmp_field -> vdw_opts[5] = gtk_combo_box_get_active (box);
2223}
2224
2225#ifdef GTK4
2234G_MODULE_EXPORT void check_vdw (GtkCheckButton * but, gpointer data)
2235#else
2244G_MODULE_EXPORT void check_vdw (GtkToggleButton * but, gpointer data)
2245#endif
2246{
2247 int i, j;
2248 j = GPOINTER_TO_INT(data);
2249#ifdef GTK4
2250 i = gtk_check_button_get_active (but);
2251#else
2252 i = gtk_toggle_button_get_active (but);
2253#endif
2254 tmp_field -> vdw_opts[j] = (double)i;
2255 if (j == 0) widget_set_sensitive (vdw_box[0], i);
2256 if (j == 4) widget_set_sensitive (vdw_box[1], i);
2257}
2258
2264GtkWidget * create_vdws_box ()
2265{
2266 GtkWidget * vbox = create_vbox (BSEP);
2267 GtkWidget * hbox;
2268 gboolean val = (tmp_field -> vdw_opts[0] == 1.0) ? TRUE : FALSE;
2269 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, check_button("Evaluate Van der Waals interactions", -1, -1, val, G_CALLBACK(check_vdw), GINT_TO_POINTER(0)), FALSE, FALSE, 5);
2270 hbox = create_hbox(0);
2271 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 0);
2272 vdw_box[0] = create_vbox(5);
2273 gtk_box_set_homogeneous (GTK_BOX (vdw_box[0]), TRUE);
2275 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, vdw_box[0], FALSE, FALSE, 50);
2276 hbox = create_hbox(5);
2277 add_box_child_start (GTK_ORIENTATION_VERTICAL, vdw_box[0], hbox, FALSE, FALSE, 0);
2278 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label("Short range interaction cutoff:", 200, -1, 0.0, 0.5), FALSE, FALSE, 0);
2279 GtkWidget * entry = create_entry (G_CALLBACK(set_vdw_param), 100, 10, FALSE, GINT_TO_POINTER(1));
2280 update_entry_double (GTK_ENTRY(entry), tmp_field -> vdw_opts[1]);
2281 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, entry, FALSE, FALSE, 10);
2282 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label("<b>&#xC5;</b>", 50, -1, 0.0, 0.5), FALSE, FALSE, 5);
2283
2284 hbox = create_hbox(5);
2285 add_box_child_start (GTK_ORIENTATION_VERTICAL, vdw_box[0], hbox, FALSE, FALSE, 0);
2286 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, check_button("Enforce direct calculation of van der Waals interactions", -1, -1, val, G_CALLBACK(check_vdw), GINT_TO_POINTER(2)), FALSE, FALSE, 5);
2287
2288 hbox = create_hbox(5);
2289 add_box_child_start (GTK_ORIENTATION_VERTICAL, vdw_box[0], hbox, FALSE, FALSE, 0);
2290 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, check_button("Apply force-shifting (contributions smoothly fall to zero near r<sub>cut</sub>)", -1, -1, val, G_CALLBACK(check_vdw), GINT_TO_POINTER(3)), FALSE, FALSE, 5);
2291
2292 hbox = create_hbox(5);
2293 add_box_child_start (GTK_ORIENTATION_VERTICAL, vdw_box[0], hbox, FALSE, FALSE, 0);
2294 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, check_button("Apply mixing rule (when needed and if possible generate cross species interactions)", -1, -1, val, G_CALLBACK(check_vdw), GINT_TO_POINTER(4)), FALSE, FALSE, 5);
2295 vdw_box[1] = create_vbox(5);
2296 val = (tmp_field -> vdw_opts[4] == 1.0) ? TRUE : FALSE;
2298 add_box_child_start (GTK_ORIENTATION_VERTICAL, vdw_box[0], vdw_box[1], FALSE, FALSE, 0);
2299 hbox = create_hbox(5);
2300 add_box_child_start (GTK_ORIENTATION_VERTICAL, vdw_box[1], hbox, FALSE, FALSE, 0);
2301 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label("Mixing rule:", 200, -1, 0.0, 0.5), FALSE, FALSE, 0);
2302 GtkWidget * combo = create_combo();
2303 int i;
2304 for (i=0; i<6; i++)
2305 {
2306 combo_text_append(combo, eval_vdw[i]);
2307 }
2308 gtk_combo_box_set_active (GTK_COMBO_BOX(combo), (int)tmp_field -> vdw_opts[5]);
2309 g_signal_connect (G_OBJECT (combo), "changed", G_CALLBACK(set_vdw_mix), NULL);
2310 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, combo, FALSE, FALSE, 10);
2311
2312 return vbox;
2313}
2314
2315#ifdef GTK4
2324G_MODULE_EXPORT void check_met (GtkCheckButton * but, gpointer data)
2325#else
2334G_MODULE_EXPORT void check_met (GtkToggleButton * but, gpointer data)
2335#endif
2336{
2337 int i, j;
2338 j = GPOINTER_TO_INT(data);
2339#ifdef GTK4
2340 i = gtk_check_button_get_active (but);
2341#else
2342 i = gtk_toggle_button_get_active (but);
2343#endif
2344 tmp_field -> met_opts[j] = (double)i;
2345}
2346
2352GtkWidget * create_metal_box ()
2353{
2354 GtkWidget * vbox = create_vbox (BSEP);
2355 gtk_box_set_homogeneous (GTK_BOX (vbox), TRUE);
2356 GtkWidget * hbox;
2357 gboolean val = (tmp_field -> met_opts[0] == 1.0) ? TRUE : FALSE;
2358 hbox = create_hbox(5);
2359 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 0);
2360 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, check_button("Enforce direct calculation of metal interactions by explicit potentials, does not work with *EAM* potentials",
2361 -1, 25, val, G_CALLBACK(check_met), GINT_TO_POINTER(0)), FALSE, FALSE, 5);
2362 val = (tmp_field -> met_opts[1] == 1.0) ? TRUE : FALSE;
2363 hbox = create_hbox(5);
2364 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 0);
2365 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, check_button("Switch the default embedding functions, <i>F</i>, from <i>F(&#x3c1;)</i> to <i>F(√&#x3c1;)</i>",
2366 -1, 25, val, G_CALLBACK(check_met), GINT_TO_POINTER(1)), FALSE, FALSE, 5);
2367 return vbox;
2368}
2369
2378G_MODULE_EXPORT void set_sys_param (GtkEntry * res, gpointer data)
2379{
2380 int i;
2381 i = GPOINTER_TO_INT(data);
2382 const gchar * m = entry_get_text (res);
2383 double v = string_to_double ((gpointer)m);
2384 if (i == 9)
2385 {
2386 if (v >= 1.0 && v != tmp_field -> sys_opts[i])
2387 {
2388 tmp_field -> sys_opts[i] = v;
2389 }
2390 else if (v < 1.0)
2391 {
2392 show_warning ("Subcelling threshold density must be &#8805; 1.0", field_assistant);
2393 }
2394 }
2395 else if (v >= 0.0 && v != tmp_field -> sys_opts[i])
2396 {
2397 tmp_field -> sys_opts[i] = v;
2398 }
2399 if (i > 10)
2400 {
2401 update_entry_int (GTK_ENTRY(res), (int)tmp_field -> sys_opts[i]);
2402 }
2403 else
2404 {
2405 update_entry_double (GTK_ENTRY(res), tmp_field -> sys_opts[i]);
2406 }
2407}
2408
2409GtkWidget * sys_box[4];
2410gchar * sys_opts[10] = {"Relative dielectric constant &#949;<sub>r</sub>",
2411 "Allowed local variation of system density:",
2412 "Ignore the particle indices in CONFIG file",
2413 "Ignore strict checks, hide warnings and assume safe simulation parameters",
2414 "Skip detailed topology reporting during read of FIELD file in output",
2415 "Ignore center of mass removal during the calculation",
2416 "Set tolerance for relaxed shell model:",
2417 "Set the subcelling threshold density of particles per link cell:",
2418 "Create an expanded version of the current model:",
2419 "Restart calculation:"};
2420
2429G_MODULE_EXPORT void set_sys_restart (GtkComboBox * box, gpointer data)
2430{
2431 tmp_field -> sys_opts[15] = gtk_combo_box_get_active (box);
2432}
2433
2434#ifdef GTK4
2443G_MODULE_EXPORT void check_sys (GtkCheckButton * but, gpointer data)
2444#else
2453G_MODULE_EXPORT void check_sys (GtkToggleButton * but, gpointer data)
2454#endif
2455{
2456 int i, k;
2457 i = GPOINTER_TO_INT(data);
2458 gboolean j;
2459#ifdef GTK4
2460 j = gtk_check_button_get_active (but);
2461#else
2462 j = gtk_toggle_button_get_active (but);
2463#endif
2464 tmp_field -> sys_opts[i] = (j) ? 1.0 : 0.0;
2465 if (i > 5)
2466 {
2467 k = i - 6;
2468 if (i == 14) k = 3;
2470 }
2471}
2472
2478GtkWidget * create_sys_box ()
2479{
2480 GtkWidget * vbox;
2481 GtkWidget * hbox, * hhbox;
2482 GtkWidget * entry;
2483 gboolean val;
2484 hhbox = create_hbox (5);
2485 vbox = create_vbox (5);
2486 gtk_box_set_homogeneous (GTK_BOX (vbox), TRUE);
2487 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hhbox, vbox, FALSE, FALSE, 10);
2488 int i, j, k;
2489 for (i=0; i<9; i++)
2490 {
2491 hbox = create_hbox(5);
2492 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 0);
2493 if (i < 2)
2494 {
2495 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label(sys_opts[i], 300, -1, 0.0, 0.5), FALSE, FALSE, 5);
2496 entry = create_entry (G_CALLBACK(set_sys_param), 100, 10, FALSE, GINT_TO_POINTER(i));
2497 update_entry_double (GTK_ENTRY(entry), tmp_field -> sys_opts[i]);
2498 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, entry, FALSE, FALSE, 10);
2499 if (i) add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label("<b>%</b>", 50, -1, 0.0, 0.5), FALSE, FALSE, 0);
2500 }
2501 else
2502 {
2503 j = (i < 7) ? i : (i == 7) ? 8 : 10;
2504 val = (tmp_field -> sys_opts[j] == 1.0) ? TRUE : FALSE;
2505 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, check_button(sys_opts[i], -1, 25, val, G_CALLBACK(check_sys), GINT_TO_POINTER(i)), FALSE, FALSE, 5);
2506 if (i > 5)
2507 {
2508 sys_box[i-6] = create_hbox(5);
2509 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, sys_box[i-6], FALSE, FALSE, 0);
2511 if (i < 8)
2512 {
2513 entry = create_entry (G_CALLBACK(set_sys_param), 100, 10, FALSE, GINT_TO_POINTER(j+1));
2514 update_entry_double (GTK_ENTRY(entry), tmp_field -> sys_opts[j+1]);
2515 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, sys_box[i-6], entry, FALSE, FALSE, 10);
2516 if (i == 6) add_box_child_start (GTK_ORIENTATION_HORIZONTAL, sys_box[i-6], markup_label("<b>D &#xC5; ps<sup>-2</sup></b>", 50, -1, 0.0, 0.5), FALSE, FALSE, 0);
2517 }
2518 else
2519 {
2520 for (k=0; k<3; k++)
2521 {
2522 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, sys_box[i-6], markup_label(imp_dir[k], 50, -1, 1.0, 0.5), FALSE, FALSE, 0);
2523 entry = create_entry (G_CALLBACK(set_sys_param), 50, 5, FALSE, GINT_TO_POINTER(j+k+1));
2524 update_entry_int (GTK_ENTRY(entry), (int)tmp_field -> sys_opts[j+k+1]);
2525 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, sys_box[i-6], entry, FALSE, FALSE, 5);
2526 }
2527 }
2528 }
2529 }
2530 }
2531
2532 return hhbox;
2533}
2534
2541{
2542 GtkWidget * vbox = create_vbox (5);
2543 GtkWidget * hbox = create_hbox (0);
2544 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 0);
2545 gboolean val = (tmp_field -> sys_opts[14] == 1.0) ? TRUE : FALSE;
2546 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, check_button(sys_opts[9], -1, 25, val, G_CALLBACK(check_sys), GINT_TO_POINTER(14)), FALSE, FALSE, 5);
2547 sys_box[3] = create_hbox(5);
2548 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, sys_box[3], FALSE, FALSE, 0);
2550 gchar * rtype[3]={"Continue current simulation",
2551 "Start new simulation from older run without temperature reset",
2552 "Start new simulation from older run with temperature reset"};
2553 GtkWidget * combo = create_combo();
2554 int i;
2555 for (i=0; i<3; i++) combo_text_append(combo, rtype[i]);
2556 gtk_combo_box_set_active (GTK_COMBO_BOX(combo), (int)tmp_field -> sys_opts[15]);
2557 g_signal_connect (G_OBJECT (combo), "changed", G_CALLBACK(set_sys_restart), NULL);
2558 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, sys_box[3], combo, FALSE, FALSE, 20);
2559 return vbox;
2560}
2561
2562
2570GtkWidget * vbox_control (int f)
2571{
2572 GtkWidget * vbox;
2573 vbox = create_vbox (5);
2574 switch (f)
2575 {
2576 case 0:
2577 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, markup_label("<b>Global options:</b>", 250, -1, 0.0, 0.5), FALSE, FALSE, 5);
2578 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, create_sys_box(), FALSE, FALSE, 0);
2579 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, markup_label("<b>Restart options:</b>", 250, -1, 0.0, 0.5), FALSE, FALSE, 5);
2580 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, create_restart_box(), FALSE, FALSE, 0);
2581 break;
2582 case 1:
2583 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, markup_label("<b>Intra-molecular probability denisty function (PDF) analysis:</b>", 350, -1, 0.0, 0.5), FALSE, FALSE, 10);
2584 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, create_analyze_box(), FALSE, FALSE, 0);
2585 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, markup_label("<b>Overall analysis:</b>", 250, -1, 0.0, 0.5), FALSE, FALSE, 10);
2586 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, create_overall_box(), FALSE, FALSE, 0);
2587 break;
2588 case 2:
2589 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, markup_label("<b>Van der Waals (Non-bonded short range):</b>", 250, -1, 0.0, 0.5), FALSE, FALSE, 5);
2590 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, create_vdws_box(), FALSE, FALSE, 0);
2591 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, markup_label("<b>Electrostatics (Non-bonded long range):</b>", 250, -1, 0.0, 0.5), FALSE, FALSE, 5);
2592 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, create_electro_box(), FALSE, FALSE, 0);
2593 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, markup_label("<b>Metallic interactions:</b>", 250, -1, 0.0, 0.5), FALSE, FALSE, 5);
2594 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, create_metal_box(), FALSE, FALSE, 0);
2595 break;
2596 case 3:
2597 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, markup_label("<b>Equilibration:</b>", 250, -1, 0.0, 0.5), FALSE, FALSE, 5);
2598 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, create_equi_box(), FALSE, FALSE, 0);
2599 break;
2600 case 4:
2601 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, markup_label("<b>Thermodynamics:</b>", 250, -1, 0.0, 0.5), FALSE, FALSE, 5);
2602 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, create_ensemble_box(), FALSE, FALSE, 0);
2603 break;
2604 case 5:
2605 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, markup_label("<b>Molecular dynamics:</b>", 250, -1, 0.0, 0.5), FALSE, FALSE, 5);
2606 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, create_md_box(), FALSE, FALSE, 0);
2607 break;
2608 case 6:
2609 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, markup_label("<b>Output information:</b>", 250, -1, 0.0, 0.5), FALSE, FALSE, 5);
2610 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, create_out_box(), FALSE, FALSE, 10);
2611 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, markup_label("<b>Trajectory file(s):</b>", 250, -1, 0.0, 0.5), FALSE, FALSE, 5);
2612 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, create_traj_box(), FALSE, FALSE, 10);
2613 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, markup_label("<b>Restart file:</b>", 250, -1, 0.0, 0.5), FALSE, FALSE, 5);
2614 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, create_dump_box(), FALSE, FALSE, 10);
2615 break;
2616 case 7:
2617 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, markup_label("<b>Job options:</b>", 250, -1, 0.0, 0.5), FALSE, FALSE, 5);
2618 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, create_job_box(), FALSE, FALSE, 0);
2619 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, markup_label("<b>I/O options:</b>", 250, -1, 0.0, 0.5), FALSE, FALSE, 5);
2620 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, create_io_box(), FALSE, FALSE, 0);
2621 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, markup_label("<b>Other options:</b>", 250, -1, 0.0, 0.5), FALSE, FALSE, 5);
2622 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, create_misc_box(), FALSE, FALSE, 0);
2623 break;
2624 default:
2625 break;
2626 }
2627 return vbox;
2628}
2629
2630/*
2631 0: System options:
2632
2633 0 = Epsilon
2634 1 = Density variation
2635 2 = no index
2636 3 = no strict
2637 4 = no topology
2638 5 = no vafar
2639 6 = no vom
2640 7 = Set tolerance for rsm ...
2641 8 = ... rsm tolerance
2642 9 = Set subscelling threshold ...
2643 10 = ... subscelling threshold
2644 11 = Create expanded system ...
2645 12 = ... x ...
2646 13 = ... y ...
2647 14 = ... z
2648 15 = Restart calc ...
2649 16 = ... restart type
2650
2651
2652 1: Calc. options:
2653
2654 0 = All PDFs
2655 1 = All: every
2656 2 = All: ndelta
2657 3 = All: cutoff
2658 4 = Bonds PDFs
2659 5 = Bonds: every
2660 6 = Bonds: ndelta
2661 7 = Bonds: cutoff
2662 8 = Angles PDFs
2663 9 = Angles: every
2664 10 = Angles: ndelta
2665 11 = Dihedrals PDFs
2666 12 = Dihedrals: every
2667 13 = Dihedrals: ndelta
2668 14 = Inversions PDFs
2669 15 = Inversions: every
2670 16 = Inversions: ndelta
2671 17 = print pdfs
2672 18 = rdf
2673 19 = every n steps
2674 20 = bin size
2675 21 = print velocity autocorrelation functions
2676 22 = every n steps
2677 23 = print z-dens
2678 24 = every n steps
2679 25 = Job time
2680 26 = Job closure
2681
2682 2: Electro. stat options:
2683 0 = Evaluate (or not) electrostatics
2684 1 = Electrostatics evaluation method
2685 2 = Param 1
2686 3 = Param 2
2687 4 = Param 3
2688 5 = Param 4
2689
2690 3: Equil. options:
2691
2692 0 = Equil
2693 1 = Equi for n steps
2694 2 = Scale temp
2695 3 = Scale temp: every
2696 4 = cap forces
2697 5 = cap: force max
2698 6 = Resample
2699 7 = Resample: during
2700 8 = Minimize
2701 9 = Minimize: string
2702 10 = Minimize: target
2703 11 = Minimize: every
2704 12 = Optimize
2705 13 = Optimize: string
2706 14 = Optimize: target
2707 15 = zero temp MD
2708 16 = collect
2709
2710 4: Thermo options:
2711
2712 0 = Ensemble
2713 1 = Thermostat
2714 2 to 7 = Thermostat options
2715
2716 5: MD options
2717 0 = target temp
2718 1 = integrator
2719 2 = MD steps
2720 3 = Time step type
2721 4 = Time step
2722 5 = Max time step
2723 6 = Max dist. per time step
2724 7 = Min dist. per time step
2725 8 = Target pressure
2726 9 = shake limit
2727 10 = shake tol
2728 11 = FIQA lim
2729 12 = FIQA tol
2730
2731 17 = Initiate impact
2732 18 = particle index
2733 19 = MD step
2734 20 = impact energy
2735 21 = impact x direct
2736 22 = impact y direct
2737 23 = impact z direct
2738
2739 6: Output options:
2740
2741 0 = Write defects trajectory ...
2742 1 = ... start time to dump defects
2743 2 = ... time step to dump defects
2744 3 = ... site interstitial cutoff
2745 4 = write displacements trajectory ...
2746 5 = ... start time to dump displacements
2747 6 = ... time step to dump displacements
2748 7 = ... displacement qualifying cutoff
2749 8 = Write history/trajectory file ...
2750 9 = ... start time to dump trajectory
2751 10 = ... time step to dump trajectory
2752 11 = ... data level [0=coord, 1=0+velo, 2=1+forces]
2753 12 = Write MSDTMP file ...
2754 13 = ... start time to dump trajectory
2755 14 = ... time step to dump trajectory
2756 15 = print data ...
2757 16 = ... every n steps
2758 17 = accumulate stat ...
2759 18 = ... every n step(s)
2760 19 = set rolling avertage stack ...
2761 20 = ... to n time step(s)
2762 21 = Write RDFs ...
2763 22 = ... every n step(s)
2764 23 = ... bin size *
2765 24 = Write VAFs ...
2766 25 = ... every n step(s)
2767 26 = ... bin size
2768 27 = Write z-dens ...
2769 28 = ... every n step(s)
2770 29 = Ignore time average for VAFs
2771 30 = Dump restart every n step(s)
2772*/
2773
Binding to the Fortran90 subroutines.
Callback declarations for main window.
GtkWidget * thermo_box()
create the thermostat configuration widgets
Definition cpmd_nose.c:1888
float val
Definition dlp_init.c:117
gchar * eval_vdw[6]
GtkWidget * create_md_box()
CONTROL file create molecular dynamics parameter widgets.
GtkWidget * nvs_check[2]
GtkWidget * o_vbox
gchar * tps_info[2]
gchar * dt_unit[3]
GtkWidget * create_traj_box()
CONTROL file create MD trajectory parameter widgets.
GtkWidget * create_job_box()
CONTROL file create job parameter vidgets.
G_MODULE_EXPORT void set_out_param(GtkEntry *res, gpointer data)
CONTROL file update output information parameter entry callback.
#define DLP_ENS
gchar * equi_minu[3]
int md_ens_opt[DLP_ENS][DLP_ENS_TYPE]
GtkWidget * nvs_unit
GtkWidget * create_electro_box()
CONTROL file create electrostatic interactions parameter vidgets.
gchar * opts_nvt[9][3]
GtkWidget * out_hbox[11]
G_MODULE_EXPORT void set_md_combo(GtkComboBox *box, gpointer data)
CONTROL file change MD parameter.
GtkWidget * nvs_label
GtkWidget * o_ent_vbox
GtkWidget * e_vbox
gchar * io_para[4]
gchar * md_unit[6]
GtkWidget * time_box[2]
GtkWidget * create_vdws_box()
CONTROL file create VdW parameter vidgets.
G_MODULE_EXPORT void set_print_level(GtkComboBox *box, gpointer data)
CONTROL file change print level.
G_MODULE_EXPORT void set_io_method(GtkComboBox *box, gpointer data)
CONTROL file change I/O method.
gchar * traj_info[4][3]
gchar * md_data[6]
GtkWidget * io_hp[2][4]
GtkWidget * create_equi_box()
CONTROL file create equilibration parameter widgets.
G_MODULE_EXPORT void show_impact_dialog(GtkButton *but, gpointer data)
CONTROL file particle impact - creating the dialog.
gchar * out_print[3]
G_MODULE_EXPORT void set_elec_param(GtkEntry *res, gpointer data)
CONTROL file update electrostatic interactions parameter entry callback.
G_MODULE_EXPORT void set_vdw_param(GtkEntry *res, gpointer data)
CONTROL file udpate VdW parameter entry callback.
G_MODULE_EXPORT void check_sys(GtkToggleButton *but, gpointer data)
change CONTROL file system option toggle callback GTK3
GtkWidget * impact_but
GtkWidget * create_thermo_box(int ensemble)
CONTROL file create thermostat box parameters.
gchar * ana_param[3]
gchar * equi_data[5]
GtkWidget * check_nvs_butt[4]
GtkWidget * check_e[2]
gchar * equi_min[3]
GtkWidget * pres_spin
G_MODULE_EXPORT void set_thermo_param(GtkEntry *res, gpointer data)
CONTROL file thermostat update parameter entry callback.
gchar * io_pres[2]
gchar * io_type[2]
G_MODULE_EXPORT void check_elec(GtkToggleButton *but, gpointer data)
change CONTROL file electrostatics option toggle callback GTK3
G_MODULE_EXPORT void set_equi_param(GtkEntry *res, gpointer data)
CONTROL file update equilibration parameter entry callback.
GtkWidget * sys_box[4]
gchar * time_info[2]
gchar * unit_npt_nvs[2][3]
G_MODULE_EXPORT void set_md_param(GtkEntry *res, gpointer data)
CONTROL file update MD parameter entry callback.
gchar * extra_nvs[4]
gchar * io_rw_m[4]
gchar * celets[MAXDATC]
GtkWidget * create_dump_box()
CONTROL file create dump parameter widgets.
G_MODULE_EXPORT void check_semi(GtkToggleButton *but, gpointer data)
CONTROL file thermostat change parameter toggle callback GTK3.
GtkWidget * extra_lab[4]
G_MODULE_EXPORT void check_io(GtkToggleButton *but, gpointer data)
CONTROL file change I/O parameter toggle callback GTK3.
GtkWidget * io_box[2]
GtkWidget * create_elec_param_box()
CONTROL file create electrostatic interactions parameter box.
G_MODULE_EXPORT void check_ana(GtkToggleButton *but, gpointer data)
CONTROL file change analysis parameter toggle callback GTK3.
G_MODULE_EXPORT void set_elec_eval(GtkComboBox *box, gpointer data)
CONTROL file change electrostatics evaluation method.
GtkWidget * create_overall_box()
CONTROL file create overall parameter widgets.
gchar * md_extra[2][4]
ColRGBA init_color(int id, int numid)
initialize color based id number over total number of elements
Definition initcoord.c:81
gchar * traj_level[3]
G_MODULE_EXPORT void set_equi_combo(GtkComboBox *box, gpointer data)
CONTROL file change equilibration parameter.
G_MODULE_EXPORT void check_met(GtkToggleButton *but, gpointer data)
change CONTROL file metal interactions toggle callback GTK3
G_MODULE_EXPORT void check_nvs(GtkToggleButton *but, gpointer data)
CONTROL file thermostat change parameter toggle callback GTK3.
gchar * out_info[3]
GtkWidget * ens_box
gchar * out_data[3]
GtkWidget * create_out_box()
CONTROL file create output information widgets.
G_MODULE_EXPORT void set_vdw_mix(GtkComboBox *box, gpointer data)
CONTROL file change VdW mixing rule.
GtkWidget * out_entry[3]
gchar * md_thermo[DLP_ENS_TYPE]
gchar * sys_opts[10]
GtkWidget * bath_box
GtkWidget * equi_entry[3]
G_MODULE_EXPORT void set_io_param(GtkEntry *res, gpointer data)
CONTROL file update I/O parameter entry callback.
GtkWidget * extra_vbox[2]
GtkWidget * thermo_option_box
gchar * eval_m[10]
float init_minop[3]
gchar * imp_dir[3]
G_MODULE_EXPORT void check_equi(GtkToggleButton *but, gpointer data)
CONTROL file change equilibration parameter toggle callback GTK3.
G_MODULE_EXPORT void set_order(GtkComboBox *box, gpointer data)
CONTROL file change thermostat order.
GtkWidget * io_pre
GtkWidget * equi_lab[6]
GtkWidget * create_ensemble_box()
CONTROL file create thermodynamic ensemble parameter widgets.
GtkWidget * equi_box[9]
G_MODULE_EXPORT void check_impact(GtkToggleButton *but, gpointer data)
CONTROL file particle impact change parameter toggle callback GTK3.
GtkWidget * nvs_entry
GtkWidget * create_thermo_options(int ensemble, int thermo)
CONTROL file create thermostat option box.
GtkWidget * create_io_box()
CONTROL file create I/O parameter vidgets.
G_MODULE_EXPORT void check_vdw(GtkToggleButton *but, gpointer data)
change CONTROL file VdW option toggle callback GTK3
G_MODULE_EXPORT void set_thermostat(GtkComboBox *box, gpointer data)
CONTROL file change thermostat option.
gchar * dt_data[3]
G_MODULE_EXPORT void set_ana_param(GtkEntry *res, gpointer data)
CONTROL file update analysis parameter entry callback.
G_MODULE_EXPORT void set_sys_param(GtkEntry *res, gpointer data)
update CONTROL file system option parameter entry callback
GtkWidget * misc_box
gchar * celemts[MAXDATC]
gchar * equi_unit[3]
G_MODULE_EXPORT void adjust_precision(GtkSpinButton *res, gpointer data)
CONTROL file update electrostatic interactions precision spin callback.
double equi_lim[2][3]
GtkWidget * vbox_control(int f)
crerate DL-POLY option widgets
GtkWidget * elec_box[4]
gchar * extra_unit[4]
GtkWidget * create_sys_box()
prepare the DL-POLY CONTROL file system options widgets
gboolean print_ana()
determine if the analysis information section is required
Definition dlp_print.c:1674
gchar * unit_nvt[9][3]
G_MODULE_EXPORT void show_advance_time_step(GtkButton *but, gpointer data)
CONTROL file advanced time step - creating the dialog.
gchar * md_combo[2][2]
GtkWidget * vdw_box[2]
gchar * md_ensemble[DLP_ENS]
G_MODULE_EXPORT void set_sys_restart(GtkComboBox *box, gpointer data)
change CONTROL file system option
G_MODULE_EXPORT void set_ensemble(GtkComboBox *box, gpointer data)
CONTROL file change thermodynamic ensemble parameter.
GtkWidget * ana_box[5]
#define DLP_ENS_TYPE
gchar * traj_data[4]
gchar * equi_info[8]
GtkWidget * create_misc_box()
CONTROL file create miscalleanous parameter vidgets.
gchar * io_info[2]
GtkWidget * create_analyze_box()
CONTROL file create analysis parameter widgets.
gchar * opts_npt_nvs[2][3]
GtkWidget * create_metal_box()
create CONTROL file metal interaction widgets
GtkWidget * create_restart_box()
prepare the DL-POLY CONTROL file restart widgets
G_MODULE_EXPORT void check_out(GtkToggleButton *but, gpointer data)
CONTROL file change output information parameter toggle callback GTK3.
gchar * ana_info[5]
GtkWidget * step_button
project * tmp_proj
Definition dlp_field.c:953
GtkWidget * field_assistant
Definition dlp_field.c:940
classical_field * tmp_field
Definition dlp_field.c:951
Variable declarations for the creation of the DL_POLY input file(s)
double string_to_double(gpointer string)
convert string to double
Definition global.c:624
void run_this_gtk_dialog(GtkWidget *dial, GCallback handler, gpointer data)
run a GTK (3 and 4) basic GtkDialog
Definition gtk-misc.c:492
@ IMG_NONE
Definition global.h:260
GtkWidget * create_entry(GCallback handler, int dim, int cdim, gboolean key_release, gpointer data)
Create a GtkEntry.
Definition gtk-misc.c:1314
void update_entry_double(GtkEntry *entry, double doubleval)
update the content of a GtkEntry as double
Definition gtk-misc.c:633
GtkWidget * dialogmodal(gchar *str, GtkWindow *parent)
Create a new dialog modal window.
Definition gtk-misc.c:510
const gchar * entry_get_text(GtkEntry *entry)
get the text in a GtkEntry
Definition gtk-misc.c:597
#define BSEP
Definition global.h:245
void update_entry_int(GtkEntry *entry, int intval)
update the content of a GtkEntry as int
Definition gtk-misc.c:614
GtkWidget * radio_button(gchar *text, int dimx, int dimy, gboolean state, GCallback handler, gpointer data)
create a radio button
Definition gtk-misc.c:1834
GtkWidget * spin_button(GCallback handler, double value, double start, double end, double step, int digits, int dim, gpointer data)
create a spin button
Definition gtk-misc.c:1772
GtkWidget * check_button(gchar *text, int dimx, int dimy, gboolean state, GCallback handler, gpointer data)
create a check button
Definition gtk-misc.c:1799
GtkWidget * create_button(gchar *text, int image_format, gchar *image, int dimx, int dimy, int relief, GCallback handler, gpointer data)
create a simple button
Definition gtk-misc.c:1863
GtkWidget * create_combo()
create a GtkCombox widget, note deprecated in GTK4
Definition gtk-misc.c:923
GtkWidget * dialog_get_content_area(GtkWidget *widg)
prepare GtkWidget to insert content in a GtkDialog window
Definition gtk-misc.c:825
GtkWidget * markup_label(gchar *text, int dimx, int dimy, float ax, float ay)
Definition gtk-misc.c:1585
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.
Definition gtk-misc.c:299
void widget_set_sensitive(GtkWidget *widg, gboolean sensitive)
Set sensitivity for a GtkWidget, ensuring it is a GtkWidget.
Definition gtk-misc.c:206
GtkWidget * create_hbox(int spacing)
create a GtkBox with horizontal orientation
Definition gtk-misc.c:813
void combo_text_append(GtkWidget *combo, gchar *text)
append text in GtkComboBox widget
Definition gtk-misc.c:900
G_MODULE_EXPORT void run_destroy_dialog(GtkDialog *dialog, gint response_id, gpointer data)
to destroy a GtkDialog when the dialog emit the closing signal
Definition gtk-misc.c:2102
GtkWidget * destroy_this_widget(GtkWidget *widg)
destroy a GtkWidget
Definition gtk-misc.c:2034
void add_box_child_end(GtkWidget *widg, GtkWidget *child, gboolean expand, gboolean fill, int padding)
Add a GtkWidget in a GtkBox at the end position.
Definition gtk-misc.c:277
void update_entry_text(GtkEntry *entry, gchar *text)
update the content of a GtkEntry as string
Definition gtk-misc.c:671
#define min(a, b)
Definition global.h:81
#define MAXDATC
Number of tabs for the description of the classical calculation.
Definition global.h:693
GtkWidget * create_vbox(int spacing)
create a GtkBox with vertical orientation
Definition gtk-misc.c:801
void show_the_widgets(GtkWidget *widg)
show GtkWidget
Definition gtk-misc.c:173
Variable declarations related to the OpenGL window Function declarations related to the OpenGL wind...
Function declarations for the creation of the OpenGL window.
void show_warning(char *warning, GtkWidget *win)
show warning
Definition interface.c:260
Messaging function declarations.
Function declarations for reading atomes project file Function declarations for saving atomes proje...
GtkWidget * res[2]
Definition w_encode.c:212
GtkWidget * hbox
Definition workspace.c:71
GtkWidget * vbox
Definition workspace.c:72