86extern void print_cp2k (
int f, GtkTextBuffer * buffer);
97extern G_MODULE_EXPORT
void atom_button (GtkButton * but, gpointer data);
113gchar *
cdescr[
MAXDATAQM] = {
i18n(
"provides an informal description of the system and the calculation to be performed"),
114 i18n(
"provides the general control parameters for the calculation to be performed"),
115 i18n(
"provides the exchange and correlation functional (DFT) parameters"),
116 i18n(
"describes the implementation of the van der Waals interactions"),
117 i18n(
"provides details about the physical properties to be calculated"),
118 i18n(
"describes the symmetry and periodicity of the system"),
119 i18n(
"describes the atomic species, pseudo-potentials and coordinates")};
121double default_cpmd_options[17] = {400.0, 0.0, 0.0, 4.0, 0.000001, 0.0, 0.0, 0.0, 0.0, 0.0, 70.0, 0.0, -1.0, 0.0, 0.0, 1.0, 1.0};
124 {
i18n(
"DFT functional:"),
i18n(
"Density cutoff<sup>*</sup>:"),
" ",
" ",
" ",
" "},
125 {
" ",
" ",
" ",
" ",
" ",
" "},
126 {
" ",
" ",
" ",
" ",
" ",
" "},
127 {
i18n(
"Use Angströms (default a.u.)"),
i18n(
"Lattice:"),
i18n(
"Symmetry:"),
i18n(
"Parameters:"),
i18n(
"Angles:"),
i18n(
"Cutoff for the plane wave basis:")},
128 {
i18n(
"Use constraints"),
i18n(
"Freeze:"),
i18n(
"Use dummy atoms:"),
i18n(
"Atom type:"),
i18n(
"Maximum angular momentum <i>l</i>:"),
i18n(
"Local angular momentum <i>l</i>:")}};
140gchar *
default_keywords[9][
NDFT] = {{
"SONLY",
"LDA",
"BONLY",
"BP",
"BLYP",
"XLYP",
"PW91",
"PBE",
"PBES",
"REVPBE",
"HCTH",
"OPTX",
"OLYP",
"TPSS",
"PBE0",
"B1LYP",
"B3LYP",
"X3LYP",
"HSE06"},
141 {
" ",
" VECTORS",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "},
142 {
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "},
143 {
" ",
" ABSOLUTE",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "},
144 {
" ",
" DEGREE",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "},
145 {
"ALL",
"ATOMS",
"COORDINATES",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "},
146 {
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "},
147 {
"S",
"P",
"D",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "},
148 {
"S",
"P",
"D",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "}};
150gchar *
default_text[9][
NDFT] = {{
i18n(
"Slater Exchange Only"),
i18n(
"Local Density Approximation"),
"Becke 88",
"Becke + Perdew",
"Becke + Lee-Yang-Parr",
i18n(
"Extended B88+PW91+LYP88"),
"Perdew + Wang 91",
151 "Perdew + Burke-Ernzerhof",
i18n(
"PBE Revised for Solids"),
i18n(
"Revised - PBE"),
"Hamprecht-Cohen-Tozer-Handy",
i18n(
"Optimized Becke 88"),
"Handy-Cohen + LYP",
152 "Tao-Perdew-Staroverov-Scuseria",
i18n(
"Parameter-free PBE"),
i18n(
"Becke One-parameter Hybrid + LYP"),
i18n(
"Becke Three-parameters Hybrid + LYP"),
i18n(
"Extended Hybrid + LYP"),
"Heyd-Scuseria-Ernzerhof 06"},
153 {
i18n(
"Box Parameters (a,b,c and α,β,γ)"),
i18n(
"Lattice Vectors"),
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "},
154 {
i18n(
"Isolated"),
i18n(
"Cubic"),
i18n(
"Face Centered Cubic (FCC)"),
i18n(
"Body Centered Cubic (BCC)"),
i18n(
"Hexagonal"),
i18n(
"Trigonal"),
155 i18n(
"Tetragonal"),
i18n(
"Body Centered Tetragonal (BCT)"),
i18n(
"Orthorombic"),
i18n(
"Monoclinic"),
i18n(
"Triclinic"),
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "},
156 {
i18n(
"Default (a, b/a, c/a)"),
i18n(
"Absolute (a, b, c)"),
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "},
157 {
i18n(
"Default (cos α, cos β, cos γ)"),
i18n(
"Degrees (α, β, γ)"),
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "},
158 {
i18n(
"All Atoms"),
i18n(
"Some Atoms"),
i18n(
"Some Coordinates"),
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "},
159 {
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "},
160 {
"s",
"p",
"d",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "},
161 {
"s",
"p",
"d",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "}};
164 0.0005, 0.0, 10000.0, 3.0,
165 10000.0, 5.0, 0.0, 0.0, 0.9, 0.0, 0.9,
166 10000.0, 5.0, 0.0, 0.0, 0.9,
167 50.0, 0.0, 0.0, 0.0};
170 {
i18n(
"Convergence criteria<sup>*</sup>:"),
i18n(
"Optimizer:"),
i18n(
"Max steps:"),
i18n(
"Integration step:"),
" ",
" ",
" "},
171 {
i18n(
"Max MD steps: "),
i18n(
"Time step:"),
i18n(
"Barostat:"),
i18n(
"Ions"),
i18n(
"Factor:"),
i18n(
"Fictitious electrons"),
i18n(
"Factor:")},
172 {
i18n(
"Max MD steps: "),
i18n(
"Time step:"),
i18n(
"Barostat:"),
i18n(
"Ions"),
i18n(
"Factor:"),
" ",
" "},
173 {
i18n(
"Number of unoccupied states:"),
i18n(
"3D visualization<sup>*</sup>"),
i18n(
"Number of objects<sup>**</sup>:"),
" ",
" ",
" ",
" "},
174 {
i18n(
"Property to compute:"),
" ",
" ",
" ",
" ",
" ",
" "}};
177 {1, 2, 1, 1, 0, 0, 0},
178 {1, 1, 2, 3, 1, 3, 1},
179 {1, 1, 2, 3, 1, 0, 0},
180 {1, 3, 1, 0, 0, 0, 0},
181 {2, 0, 0, 0, 0, 0, 0},
182 {0, 0, 0, 0, 0, 0, 0}};
186 "MOLECULAR DYNAMICS",
187 "MOLECULAR DYNAMICS BO",
188 "KOHN-SHAM ENERGIES",
189 "VIBRATIONAL ANALYSIS",
193 i18n(
"Geometry Optimization"),
194 i18n(
"CPMD Molecular Dynamics"),
195 i18n(
"Born-Oppenheimer Molecular Dynamics"),
196 i18n(
"Kohn-Sham Eigen Values"),
197 i18n(
"Vibrational Analysis"),
198 i18n(
"Calculation of Physical Properties")};
203 {
i18n(
"Quasi-Newton method"),
i18n(
"Direct Inversion of Iterative Subspace"),
" "},
204 {
i18n(
"None"),
"Parrinello-Rahman",
"Parrinello-Rahman + NPT"},
205 {
i18n(
"None"),
"Parrinello-Rahman",
"Parrinello-Rahman + NPT"},
206 {
i18n(
"Finite differences of first derivatives"),
i18n(
"Linear response of ionic displacement"),
i18n(
"Precalculated Hessian")}};
209 {
"BFGS",
"GDIIS",
" "},
210 {
" ",
"PARRINELLO-RAHMAN",
"PARRINELLO-RAHMAN NPT"},
211 {
" ",
"PARRINELLO-RAHMAN",
"PARRINELLO-RAHMAN NPT"},
216 {
i18n(
"None"),
i18n(
"Adaptive Langevin"),
i18n(
"Canonical sampling through velocity rescaling"),
"GLE",
i18n(
"Nosé-Hoover chains")}};
244GtkWidget *
cpmd_box (GtkWidget *
box, gchar *
lab,
int v_space,
int h_space,
int dim)
264 if (i != 5 && i != 6)
270 else if (i == 0 || i > 2)
286 else if (i == 6 &&
tmp_cpmd -> calc_type == 4)
311 i = GPOINTER_TO_INT(data);
348 int i = GPOINTER_TO_INT(data);
369 j = GPOINTER_TO_INT(data);
432 if ((s == 0 && (i == 0 || i == 1 || i == 2))
433 || (s == 1 && (i == 0 || i == 1))
434 || (s == 4) || (s == 5))
489 if (k == 0 || k == 1 || k == 5 || k == 8 || k == 9 || k == 11 || k == 14 || k == 15 || k == 16 || k == 17)
524 g_signal_connect (G_OBJECT (widg),
"changed", G_CALLBACK(
changed_opt_box), GINT_TO_POINTER(j));
543 widg = gtk_label_new (
"a.u.");
547 widg = gtk_label_new (
"Ry");
559 k = (j==
DEFCO) ? 0 : 1;
591 i = GPOINTER_TO_INT(data);
626 j = GPOINTER_TO_INT(data);
657 int i = GPOINTER_TO_INT(data);
719 if ((
icalc == 0 && (k == 0 || k == 1))
720 || (
icalc == 1 && (k == 0 || k == 1))
721 || (
icalc == 2 && k == 0)
722 || (
icalc == 3 && k == 0)
735 g_signal_connect (G_OBJECT (widg),
"changed", G_CALLBACK(
changed_calc_opt_box), GINT_TO_POINTER(j));
748 gchar * ksout = _(
"\t * electronic density(ies) or/and wavefunction(s)\n"
749 "\t ** as many index(es) to be supplied on the next line:\n"
750 "\t\t > 0 for electronic density\n\t\t < 0 for wavefunction");
772 gtk_label_set_text (GTK_LABEL(
calc_label), g_strdup_printf (_(
"<u>%s option(s)</u>"), _(
calc_ds[i])));
773 gtk_label_set_use_markup (GTK_LABEL(
calc_label), TRUE);
797G_MODULE_EXPORT
void changed_info (GtkTextBuffer * textbuf, gpointer data)
801 gtk_text_buffer_get_start_iter (textbuf, & bStart);
802 gtk_text_buffer_get_end_iter (textbuf, & bEnd);
804 tmp_cpmd -> info = g_strdup_printf (
"%s", gtk_text_buffer_get_text (textbuf, & bStart, & bEnd, FALSE));
817 GtkWidget * scrollsets =
create_scroll (NULL, 355, 250, GTK_SHADOW_ETCHED_IN);
860 str = g_strdup_printf (_(
"<u>%s option(s)</u>"), _(
calc_ds[
tmp_cpmd -> calc_type]));
867 gtk_widget_set_size_request (
calc_box[i], -1, 200);
885 if (s > 0 && s != 2 && s != 3)
887 i = (s == 1) ? s : s - 2;
888 str = g_strdup_printf (_(
"<u>General %s section option(s)</u>"),
cpmd_elements[i]);
909 GtkWidget * scrollsets =
create_scroll (NULL, 250, (c) ? 280 : 410, GTK_SHADOW_ETCHED_IN);
911 qmbuffer[s] = gtk_text_view_get_buffer (GTK_TEXT_VIEW(
aview));
936 return g_strdup_printf (_(
"Details of the <b>%s</b> section that %s"),
cpmd_elements[1], _(
cdescr[1]));
940 return g_strdup_printf (_(
"Details of the <b>%s</b> section that %s"),
cpmd_elements[p], _(
cdescr[p]));
944 return g_strdup_printf (_(
"Details of the <b>%s</b> section that %s"),
cpmd_elements[p-2], _(
cdescr[p-2]));
984 return g_strdup_printf (_(
"The %s section - Calculation options"),
cpmd_elements[1]);
988 return g_strdup_printf (_(
"The %s section - Thermostat options"),
cpmd_elements[1]);
992 return g_strdup_printf (_(
"The %s section - RESTART options"),
cpmd_elements[1]);
997 return g_strdup_printf (_(
"The %s section"),
cpmd_elements[p]);
1001 return g_strdup_printf (_(
"The %s section"),
cpmd_elements[p-2]);
1019 gtk_assistant_append_page (assist, page);
1020 gtk_assistant_set_page_title (assist, page,
page_name(i));
1021 gtk_assistant_set_page_type (assist, page, GTK_ASSISTANT_PAGE_CONTENT);
1024 gtk_assistant_set_page_complete (assist, page, TRUE);
1033 info = g_strdup_printf (_(
"<b> Finalize the creation of the CPMD input file now !</b>"));
1036 add_box_child_start (GTK_ORIENTATION_VERTICAL, conclu,
markup_label(_(
"\n \t<b>Note: </b>You can re-open this assitant later if required to adjust your choices\n"), -1, -1, 0.0, 0.5), FALSE, FALSE, 0);
1037 gtk_assistant_append_page (assist, conclu);
1038 gtk_assistant_set_page_title (assist, conclu, _(
"Create the input file now !"));
1039 gtk_assistant_set_page_type (assist, conclu, GTK_ASSISTANT_PAGE_CONFIRM);
1040 gtk_assistant_set_page_complete (assist, conclu, TRUE);
1041 gtk_assistant_update_buttons_state (assist);
1052 for (i=0; i<
qm_proj -> natomes; i++)
1137 int i = GPOINTER_TO_INT(data);
1140 switch (current_page)
1158 return current_page+1;
1160 else if (
tmp_cpmd -> calc_type == 6)
1162 return current_page+2;
1166 return current_page+3;
1172 return current_page+1;
1176 return current_page+2;
1179 return current_page+1;
1185 switch (current_page)
1191 return current_page+1;
1208 int i = gtk_assistant_get_current_page (assistant);
1232 if (
tmp_cp2k -> input_type && i<=j-3)
return TRUE;
1233 if (i==0)
return TRUE;
1234 if (i==j-2 && print[0])
return TRUE;
1235 if (i==j-1 && print[1])
return TRUE;
1250 c = GPOINTER_TO_INT(data);
1251 gchar * ptitle[5] = {
i18n(
"CP2K input file"),
1252 "forces.inc",
"system.inc",
"motion.inc",
"coord.inc"};
1253 gchar * wtite[2] = {
i18n(
" input file preview"),
i18n(
" input files preview")};
1255 GtkWidget * scrollsets;
1257 GtkWidget * notebook;
1263 notebook = gtk_notebook_new ();
1265 str = g_strdup_printf (
"%s %s",
co_type[c], _(wtite[
tmp_cp2k -> input_type]));
1266 print[0] = print[1] = FALSE;
1267 for (i=0; i<
qm_proj -> nspec; i++)
1269 if (
tmp_cp2k -> spec_data[i][0] != -1)
1275 for (i=0; i<
qm_proj -> nspec; i++)
1277 if (
tmp_cp2k -> spec_data[i][1] != -1)
1287 str = g_strdup_printf (
"%s %s",
co_type[c], _(wtite[0]));
1299 for (i=0; i<j+k; i++)
1301 if (! c || (c &&
go_for_it(i, j+k, print)))
1306 scrollsets =
create_scroll (NULL, 700, 350, GTK_SHADOW_ETCHED_IN);
1310 str = g_strdup_printf (
"%s",
tmp_cp2k -> files[i-(j+k-3)]);
1314 l = (i == j-3+k) ? 4 : i;
1315 str = g_strdup_printf (
"%s", (l) ? ptitle[l] : _(ptitle[l]));
1317 gtk_notebook_append_page (GTK_NOTEBOOK(notebook), scrollsets, gtk_label_new (str));
1327 if (
tmp_cp2k -> input_type || i != j+k-3)
1329 print_cp2k ((i >= j+k-3) ? i+1-k: i, gtk_text_view_get_buffer(GTK_TEXT_VIEW(
aview)));
1350G_MODULE_EXPORT
void run_saving_qm (GtkNativeDialog * info, gint response_id, gpointer data)
1352 GtkFileChooser * chooser = GTK_FILE_CHOOSER((GtkFileChooserNative *)info);
1363G_MODULE_EXPORT
void run_saving_qm (GtkDialog * info, gint response_id, gpointer data)
1365 GtkFileChooser * chooser = GTK_FILE_CHOOSER((GtkWidget *)info);
1368 int c = GPOINTER_TO_INT(data);
1369 gboolean result = FALSE;
1370 gboolean done = FALSE;
1371 GtkTextBuffer * buffer = NULL;
1374 GError * err = NULL;
1378 gchar * cp2sp[2] = {
"basis.inc",
"pseudo.inc"};
1379 gchar * cp2file[4] = {
"forces.inc",
"system.inc",
"motion.inc",
"coord.inc"};
1380 switch (response_id)
1382 case GTK_RESPONSE_ACCEPT:
1385 if (filename != NULL)
1398 for (i=0; i<j+k; i++)
1400 if (i != j+k-3 ||
tmp_cp2k -> input_type)
1402 l = (i >= j+k-3) ? i+1-k: i;
1406 if (i > 0) filename = g_strdup_printf (
"%s/%s", direname, cp2file[l-1]);
1408 gtk_text_buffer_get_start_iter (buffer, & bStart);
1409 gtk_text_buffer_get_end_iter (buffer, & bEnd);
1410 text = gtk_text_buffer_get_text (buffer, & bStart, & bEnd, FALSE);
1411 gtk_text_buffer_set_modified (buffer, FALSE);
1412 result = g_file_set_contents (filename,
text, -1, & err);
1414 g_object_unref (buffer);
1415 if (! result && err)
1417 show_error (g_strdup_printf (_(
"Error while saving input file: %s\n Error: %s"), filename, err -> message), 0,
qm_assistant);
1422 else if (l != 5 && l != 6)
1430 if (! c || (c && !
tmp_cp2k -> input_type))
1432 gtk_text_buffer_get_start_iter (buffer, & bStart);
1433 gtk_text_buffer_get_end_iter (buffer, & bEnd);
1434 text = gtk_text_buffer_get_text (buffer, & bStart, & bEnd, FALSE);
1435 gtk_text_buffer_set_modified (buffer, FALSE);
1436 result = g_file_set_contents (filename,
text, -1, & err);
1438 g_object_unref (buffer);
1439 if (! result && err)
1442 show_error (g_strdup_printf (_(
"Error while saving input file: %s\n Error: %s"), filename, err -> message), 0,
qm_assistant);
1453 filename = g_strdup_printf (
"%s/%s", direname, cp2sp[i]);
1455 gtk_text_buffer_get_start_iter (buffer, & bStart);
1456 gtk_text_buffer_get_end_iter (buffer, & bEnd);
1457 text = gtk_text_buffer_get_text (buffer, & bStart, & bEnd, FALSE);
1458 result = g_file_set_contents (filename,
text, -1, & err);
1460 if (! result && err)
1463 show_error (g_strdup_printf (_(
"Error while saving file %s: %s"), cp2sp[i], err -> message), 0,
qm_assistant);
1468 g_object_unref (buffer);
1491 show_info (_(
"The input files 'forces.inc', 'system.inc', 'motion.inc' and 'coord.inc'\n"
1492 "as well as the files 'basis.inc' and 'pseudo.inc'\n"
1493 "for the atomic basis set and peudo-potentials\n"
1494 "were saved in the same directory as the main input file."),
1499 show_info (_(
"The input files 'forces.inc', 'system.inc', and 'coord.inc'\n"
1500 "as well as the files 'basis.inc' and 'pseudo.inc'\n"
1501 "for the atomic basis set and peudo-potentials\n"
1502 "were saved in the same directory as the main input file."),
1508 show_info (_(
"The files 'basis.inc' and 'pseudo.inc'\n"
1509 "for the atomic basis set and peudo-potentials\n"
1510 "were saved in the same directory as the main input file."),
1526 int c = GPOINTER_TO_INT(data);
1529 GtkFileChooserNative * info;
1534 gchar * qm_type[2] = {
"CPMD",
"CP2K"};
1535 const gchar * qm_name[2] = {
i18n(
"CPMD input file (*.in)"),
i18n(
"CP2K input file (*.inp)")};
1536 const gchar * qm_ext[2] = {
".in",
".inp"};
1538 text = g_strdup_printf (_(
"Saving %s input file(s)"), qm_type[c]);
1540 GTK_WINDOW(assistant),
1541 GTK_FILE_CHOOSER_ACTION_SAVE,
1543 GtkFileChooser * chooser = GTK_FILE_CHOOSER(info);
1546 gtk_file_chooser_set_do_overwrite_confirmation (chooser, TRUE);
1549 filter1 = gtk_file_filter_new();
1550 gtk_file_filter_set_name (GTK_FILE_FILTER(
filter1), _(qm_name[c]));
1551 text = g_strdup_printf (
"*%s", qm_ext[c]);
1552 gtk_file_filter_add_pattern (GTK_FILE_FILTER(
filter1),
text);
1554 gtk_file_chooser_add_filter (chooser,
filter1);
1555 filter2 = gtk_file_filter_new();
1556 gtk_file_filter_set_name (GTK_FILE_FILTER(
filter2), _(
"All files (*)"));
1557 gtk_file_filter_add_pattern (GTK_FILE_FILTER(
filter2),
"*");
1558 gtk_file_chooser_add_filter (chooser,
filter2);
1561 gtk_file_chooser_set_current_name (chooser,
text);
1564 run_this_gtk_native_dialog ((GtkNativeDialog *)info, G_CALLBACK(
run_saving_qm), NULL);
1581 gchar * qm_type[2] = {
i18n(
"first-principles"),
"QM-MM"};
1594 if (
qm_proj -> cpmd_input[s] == NULL)
1596 qm_proj -> cpmd_input[s] = g_malloc0(
sizeof*
qm_proj -> cpmd_input[s]);
1597 qm_proj -> cpmd_input[s] -> calc_type = 0;
1598 qm_proj -> cpmd_input[s] -> thermostats = 0;
1599 qm_proj -> cpmd_input[s] -> ions_thermostat = NULL;
1600 qm_proj -> cpmd_input[s] -> elec_thermostat = NULL;
1601 qm_proj -> cpmd_input[s] -> dummies = 0;
1603 qm_proj -> cpmd_input[s] -> fixat = 0;
1604 qm_proj -> cpmd_input[s] -> fixlist = NULL;
1605 qm_proj -> cpmd_input[s] -> fixcoord = NULL;
1606 qm_proj -> cpmd_input[s] -> restart[0] = 0;
1607 qm_proj -> cpmd_input[s] -> restart[1] = 100;
1608 qm_proj -> cpmd_input[s] -> restart[2] = 2;
1609 qm_proj -> cpmd_input[s] -> restart[3] = 0;
1610 qm_proj -> cpmd_input[s] -> restart[4] = 1;
1611 for (i=5; i<9; i++)
qm_proj -> cpmd_input[s] -> restart[i] = 0;
1612 qm_proj -> cpmd_input[s] -> restart[9] = 0;
1616 for (i=0; i<
qm_proj -> nspec; i++)
qm_proj -> cpmd_input[s] -> pp[i][0] =
qm_proj -> cpmd_input[s] -> pp[i][1] = 1;
1617 qm_proj -> cpmd_input[s] -> info = g_strdup_printf (_(
" Project name: %s\n"
1618 " Total number of atoms: %d\n"
1619 " Number of chemical species: %d"),
1627 if (
qm_proj -> cp2k_input[s] == NULL)
1629 qm_proj -> cp2k_input[s] = g_malloc0(
sizeof*
qm_proj -> cp2k_input[s]);
1630 qm_proj -> cp2k_input[s] -> input_type = 0;
1633 qm_proj -> cp2k_input[s] -> fixat[i] = 0;
1634 qm_proj -> cp2k_input[s] -> fixlist[i] = NULL;
1635 qm_proj -> cp2k_input[s] -> fixcoord[i] = NULL;
1637 qm_proj -> cp2k_input[s] -> thermostats = 0;
1638 qm_proj -> cp2k_input[s] -> ions_thermostat = NULL;
1639 for (i=0; i<5; i++)
qm_proj -> cp2k_input[s] -> files[i] = NULL;
1648 qm_proj -> cp2k_input[s] -> spec_files = g_malloc0(
qm_proj -> nspec*
sizeof*
qm_proj -> cp2k_input[s] -> spec_files);
1649 for (i=0; i<
qm_proj -> nspec; i++)
1653 qm_proj -> cp2k_input[s] -> spec_files[i] = g_malloc0(2*
sizeof*
qm_proj -> cp2k_input[s] -> spec_files[i]);
1654 qm_proj -> cp2k_input[s] -> spec_files[i][0] = NULL;
1655 qm_proj -> cp2k_input[s] -> spec_files[i][1] = NULL;
1657 gchar * defname[2]={
"basis.inc",
"pseudo.inc"};
1660 for (i=0; i<
qm_proj -> nspec; i++)
1662 if (
qm_proj -> cp2k_input[s] -> spec_data[i][j] > -1)
1664 qm_proj -> cp2k_input[s] -> files[1+j] = g_strdup_printf (
"%s", defname[j]);
1669 qm_proj -> cp2k_input[s] -> info = g_strdup_printf (_(
" Project name: %s\n"
1670 " Total number of atoms: %d\n"
1671 " Number of chemical species: %d"),
1679 gtk_window_set_resizable (GTK_WINDOW (
qm_assistant), FALSE);
1680 gtk_window_set_modal (GTK_WINDOW (
qm_assistant), TRUE);
1681 gchar * str = g_strdup_printf (_(
"Basic %s - %s - calculation assistant"),
co_type[c], (s) ? qm_type[s] : _(qm_type[s]));
1686 gchar * info = g_strdup_printf (_(
"\t<b>This assistant will help you to setup a %s %s\n"
1687 "\tcalculation using <i>%s</i> 3D model as starting point</b>\n"
1688 "\nPlease note that the %s code offers so many calculation options that it is not possible\n"
1689 "to provide a description and offer a comprehensive usage guide for each of them. \n"
1690 "Therefore this assistant only provides help towards basics and / or frequently used %s instructions. \n\n"
1691 "<b>In any case if you intent to use the %s code please refer to the user manual.</b>"),
1697 markup_label(_(
"\n \t<b>Note: </b>You can re-open this assistant later if required to adjust your choices\n"), -1, -1, 0.0, 0.5),
1699 gtk_assistant_append_page (GTK_ASSISTANT (
qm_assistant), intro);
1700 str = g_strdup_printf (
"%s calculation set-up",
co_type[c]);
1701 gtk_assistant_set_page_title (GTK_ASSISTANT (
qm_assistant), intro, str);
1703 gtk_assistant_set_page_type (GTK_ASSISTANT (
qm_assistant), intro, GTK_ASSISTANT_PAGE_INTRO);
1722 gtk_assistant_set_page_complete (GTK_ASSISTANT (
qm_assistant),
1723 gtk_assistant_get_nth_page(GTK_ASSISTANT (
qm_assistant), 0), TRUE);
GtkTextBuffer * qmbuffer[MAXDATAQM+2]
Variable declarations for the MD input preparation assistants.
Callback declarations for main window.
integer(kind=c_int) function chemistry()
Variable declarations for the creation of the CP2K input file(s).
int cp2k_is_pseudo_in_database(int sp)
does this chemical species have pseudopotential(s) in store ?
double default_cp2k_extra[3][4]
int cp2k_is_basis_in_database(int sp)
does this chemical species have basis set(s) in store ?
int find_cp2k_sym()
find the CP2K symmetry parameter based on the cell properties
double default_vdw_cut[2]
double default_cp2k_options[41]
GtkWidget * qm_preview_box(int c, int s, int l)
prepare preview section widgets
Variable declarations for the creation of the CPMD input file.
double default_calc_options[24]
gchar * thermo_name[2][5]
gchar * calc_ds[NCPMDCALC]
gchar * default_text[9][NDFT]
gchar * calc_box_name[NCACOMBO][3]
gchar * cdescr[MAXDATAQM]
double default_cpmd_options[17]
gchar * calc_opts[NCPMDCALC][NOPTPC]
int calc_box_num[NCACOMBO]
gchar * default_keywords[9][NDFT]
gchar * cpmd_elements[MAXDATAQM]
int default_opts_type[MAXDATAQM-1][NSECOP]
gchar * default_opts[MAXDATAQM-1][NSECOP]
int default_type[NCPMDCALC][NOPTPC]
gchar * calc_kw[NCPMDCALC]
gchar * calc_box_keys[NCACOMBO][3]
void print_the_section(int s, int p, GtkTextBuffer *buffer)
print CPMD input section
G_MODULE_EXPORT void atom_button(GtkWidget *but, gpointer data)
CPMD input file, add constraint(s) or dummy atom(s) - creating the dialog.
G_MODULE_EXPORT void changed_opt_box(GtkComboBox *box, gpointer data)
change CPMD QM option
GtkWidget * calc_qm_option_box(int c)
CPMD input assistant prepare the calculation option widgets.
void print_cp2k(int f, GtkTextBuffer *buffer)
print the CP2K input file section
GtkWidget * qm_option_box[MAXDATAQM-1]
void field_unselect_all()
unselect all atoms
G_MODULE_EXPORT void update_calc_check(GtkToggleButton *but, gpointer data)
update CPMD calculation option toggle callback GTK3
GtkWidget * info_box()
create CPMD input file information widgets
GtkWidget * prepare_qm_option_box(int s)
CPM input file creation prepare section general options widgets.
gchar * cpmd_calc_opts[NCPMDCALC][NOPTPC]
GtkWidget * section_box(int s)
create CPMD section box
G_MODULE_EXPORT void changed_calc_opt_box(GtkComboBox *box, gpointer data)
change CPMD calculation option
GtkWidget * cpmd_box(GtkWidget *box, gchar *lab, int v_space, int h_space, int dim)
prepare a labelled box widget for the CPMD input creation assistant
G_MODULE_EXPORT void changed_info(GtkTextBuffer *textbuf, gpointer data)
update CPMD input file preview
G_MODULE_EXPORT void on_qm_assistant_cancel(GtkAssistant *assistant, gpointer data)
cancel QM / QM-MM input file creation
gchar * page_name(int p)
get CPMD input creation assistant page name
gboolean are_all_atoms_thermostated()
are all atom(s) in the model thermostated ?
void create_selection_combo(int id, int num, int type, GCallback handler)
create thermostat selection combo box
G_MODULE_EXPORT gint on_qm_assistant_go_forward(gint current_page, gpointer data)
QM / QM-MM assistant go to the next page.
G_MODULE_EXPORT void update_cpmd_check(GtkToggleButton *but, gpointer data)
update CPMD QM option toggle callback GTK3
void add_cp2k_pages()
add pages to the CP2 assistant
G_MODULE_EXPORT void changed_calc_box(GtkComboBox *box, gpointer data)
change CPMD calculation type
G_MODULE_EXPORT void run_saving_qm(GtkDialog *info, gint response_id, gpointer data)
apply QM / QM-MM assistant and create input file(s) - running the dialog GTK3
G_MODULE_EXPORT void show_qm_file_preview(GtkButton *but, gpointer data)
show QM / QM-MM input file preview
GtkWidget * restart_box()
prepare the CPMD input preparation assistant restart widgets
ColRGBA init_color(int id, int numid)
initialize color based id number over total number of elements
gchar * section_name(int p)
get CPMD input creation section name
void print_the_section(int s, int p, GtkTextBuffer *buffer)
print CPMD input section
GtkWidget * qm_preview_box(int c, int s, int l)
prepare preview section widgets
int qm_saved_label_format[2]
GtkWidget * calc_box[NCPMDCALC]
GtkWidget * vbox_cpmd(int s)
create CPMD input creation section widgets
GtkWidget * qm_preview_but
void restore_ogl_selection(glwin *view)
restore a saved atom selection
G_MODULE_EXPORT gboolean on_qm_assistant_cancel_event(GtkWidget *assistant, GdkEvent *event, gpointer data)
QM / QM-MM input file creation cancel event GTK3.
void proj_unselect_all_atoms()
unselect all atom(s) in the target project of the assistant
G_MODULE_EXPORT void on_qm_assistant_apply(GtkAssistant *assistant, gpointer data)
apply QM / QM-MM assistant and create input file(s) - creating the dialog
G_MODULE_EXPORT void update_calc_parameter(GtkEntry *res, gpointer data)
update CPMD calculation option value entry callback
void print_all_sections(GtkTextBuffer *buf)
print all sections of the CPMD input file
void create_qm_input_file(int c, int p, int s)
initialize an ab-initio MD input file creation assistant
GtkWidget * thermo_box()
create the thermostat configuration widgets
G_MODULE_EXPORT void on_qm_assistant_close(GtkAssistant *assistant, gpointer data)
close QM / QM-MM input creation assistant
G_MODULE_EXPORT void on_qm_assistant_prepare(GtkAssistant *assistant, GtkWidget *page, gpointer data)
prepare QM / QM-MM assistant pages before display
G_MODULE_EXPORT void changed_opt_box(GtkComboBox *box, gpointer data)
change CPMD QM option
void add_cpmd_pages()
add pages to the CPMD input file creation assistant
gboolean go_for_it(int i, int j, gboolean print[2])
add tab to the QM / QM-MM file preview window notebook
G_MODULE_EXPORT void update_cpmd_parameter(GtkEntry *res, gpointer data)
update CPMD QM option value entry callback
G_MODULE_EXPORT void atom_button(GtkButton *but, gpointer data)
void init_default_shaders(glwin *view)
re-initialize the default OpenGL shaders
int ** allocdint(int xal, int yal)
allocate an int ** pointer
double string_to_double(gpointer string)
convert string to double
Global variable declarations Global convenience function declarations Global data structure defin...
void run_this_gtk_dialog(GtkWidget *dial, GCallback handler, gpointer data)
run a GTK (3 and 4) basic GtkDialog
void file_chooser_set_current_folder(GtkFileChooser *chooser)
set current folder in a GtkFilechooser
int combo_get_active(GtkWidget *combo)
retrieve the active item's position
GtkWidget * create_entry(GCallback handler, int dim, int cdim, gboolean key_release, gpointer data)
Create a GtkEntry.
void update_entry_double(GtkEntry *entry, double doubleval)
update the content of a GtkEntry as double
GtkWidget * create_text_view(int dimx, int dimy, int edit, int mono, GCallback handler, gpointer data, gchar *text)
create a GtkTextView and display some text
GtkTextBuffer * add_buffer(GCallback handler, gpointer data, gchar *text)
create a GtkTextBuffer
GtkWidget * create_scroll(GtkWidget *box, int dimx, int dimy, int shadow)
create a scroll window
GtkWidget * dialogmodal(gchar *str, GtkWindow *parent)
Create a new dialog modal window.
void combo_set_active(GtkWidget *combo, int pos)
set the active item's position
gchar * file_chooser_get_file_name(GtkFileChooser *chooser)
get a file name from a GtkFileChooser (single file selected)
const gchar * entry_get_text(GtkEntry *entry)
get the text in a GtkEntry
void opengl_project_changed(int id)
change the OpenGL project
void update_entry_int(GtkEntry *entry, int intval)
update the content of a GtkEntry as int
void add_gtk_close_event(GtkWidget *widg, GCallback handler, gpointer data)
add a close event signal and callback to a GtkWidget
gchar * file_chooser_get_current_folder(GtkFileChooser *chooser)
get the current folder for a GtkFileChooser
GtkWidget * check_button(gchar *text, int dimx, int dimy, gboolean state, GCallback handler, gpointer data)
create a check button
GtkWidget * create_button(gchar *text, int image_format, gchar *image, int dimx, int dimy, int relief, GCallback handler, gpointer data)
create a simple button
GtkWidget * create_combo()
create a GtkCombox widget, note deprecated in GTK4
GtkWidget * dialog_get_content_area(GtkWidget *widg)
prepare GtkWidget to insert content in a GtkDialog window
GtkWidget * markup_label(gchar *text, int dimx, int dimy, float ax, float ay)
create a GtkLabel with pango markup
void add_box_child_start(int orientation, GtkWidget *widg, GtkWidget *child, gboolean expand, gboolean fill, int padding)
Add a GtkWidget in a GtkBox at the initial position.
void widget_set_sensitive(GtkWidget *widg, gboolean sensitive)
Set sensitivity for a GtkWidget, ensuring it is a GtkWidget.
void destroy_this_dialog(GtkDialog *dialog)
destroy a GtkDialog
GtkWidget * create_hbox(int spacing)
create a GtkBox with horizontal orientation
void combo_text_append(GtkWidget *combo, gchar *text)
append text in GtkComboBox widget
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
GtkWidget * destroy_this_widget(GtkWidget *widg)
destroy a GtkWidget
gchar * prepare_for_title(gchar *init)
prepare a string for a window title, getting rid of all markup
void add_container_child(int type, GtkWidget *widg, GtkWidget *child)
Add a GtkWidget into another GtkWidget.
void hide_the_widgets(GtkWidget *widg)
hide GtkWidget
GtkWidget * create_vbox(int spacing)
create a GtkBox with vertical orientation
int button_get_status(GtkWidget *button)
get status of check / toggle button
GtkWidget * create_file_chooser(const gchar *title, GtkWindow *parent, GtkFileChooserAction act, const gchar *act_name)
create a GtkFileChooser, utility to select file(s)
void destroy_this_native_dialog(GtkNativeDialog *dialog)
destroy a GtkNativeDialog
void show_the_widgets(GtkWidget *widg)
show GtkWidget
project * get_project_by_id(int p)
get project pointer using id number
void update_entry_long_double(GtkEntry *entry, double doubleval)
update the content of a GtkEntry as long double
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_info(char *information, int val, GtkWidget *win)
add / show information message to widget
void show_error(char *error, int val, GtkWidget *win)
show error message
void print_info(gchar *str, gchar *stag, GtkTextBuffer *buffer)
print information in GtkTextBuffer
Messaging function declarations.
Function declarations for reading atomes project file Function declarations for saving atomes proje...