86extern void print_cp2k (
int f, GtkTextBuffer * buffer);
97extern G_MODULE_EXPORT
void atom_button (GtkButton * but, gpointer data);
113gchar *
cdescr[
MAXDATAQM] = {
"provides an informal description of the system and the calculation to be performed",
114 "provides the general control parameters for the calculation to be performed",
115 "provides the exchange and correlation functional (DFT) parameters",
116 "describes the implementation of the van der Waals interactions",
117 "provides details about the physical properties to be calculated",
118 "describes the symmetry and periodicity of the system",
119 "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 {
"DFT functional:",
"Density cutoff<sup>*</sup>:",
" ",
" ",
" ",
" "},
125 {
" ",
" ",
" ",
" ",
" ",
" "},
126 {
" ",
" ",
" ",
" ",
" ",
" "},
127 {
"Use Angströms (default a.u.)",
"Lattice:",
"Symmetry:",
"Parameters:",
"Angles:",
"Cutoff for the plane wave basis:"},
128 {
"Use constraints",
"Fix:",
"Use dummy atoms:",
"Atom type:",
"Maximum angular momentum <i>l</i>:",
"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] = {{
"Slater exchange only",
"Local Density Approximation",
"Becke 88",
"Becke + Perdew",
"Becke + Lee-Yang-Parr",
"Extended B88+PW91+LYP88",
"Perdew + Wang 91",
151 "Perdew + Burke-Ernzerhof",
"PBE revised for solids",
"Revised - PBE",
"Hamprecht-Cohen-Tozer-Handy",
"Optimized Becke 88",
"Handy-Cohen + LYP",
152 "Tao-Perdew-Staroverov-Scuseria",
"Parameter-free PBE",
"Becke one-parameter hybrid + LYP",
"Becke three-parameters hybrid + LYP",
"Extend hybrid + LYP",
"Heyd-Scuseria-Ernzerhof 06"},
153 {
"Box parameters (a,b,c and α,β,γ)",
"Lattice vectors",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "},
154 {
"Isolated",
"Cubic",
"Face centered cubic (FCC)",
"Body centered cubic (BCC)",
"Hexagonal",
"Trigonal",
155 "Tetragonal",
"Body centered tetragonal (BCT)",
"Orthorombic",
"Monoclinic",
"Triclinic",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "},
156 {
"Default (a, b/a, c/a)",
"Absolute (a, b, c)",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "},
157 {
"Default (cos α, cos β, cos γ)",
"Degrees (α, β, γ)",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "},
158 {
"All atoms",
"Some atoms",
"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};
169gchar *
calc_opts[
NCPMDCALC][
NOPTPC]={{
"Convergence criteria<sup>*</sup>:",
"Optimizer:",
"Max steps:",
"Integration step:",
" ",
" ",
" "},
170 {
"Convergence criteria<sup>*</sup>:",
"Optimizer:",
"Max steps:",
"Integration step:",
" ",
" ",
" "},
171 {
"Max MD steps: ",
"Time step:",
"Barostat:",
"Ions",
"Factor:",
"Fictitious electrons",
"Factor:"},
172 {
"Max MD steps: ",
"Time step:",
"Barostat:",
"Ions",
"Factor:",
" ",
" "},
173 {
"Number of unoccupied states:",
"3D visualization<sup>*</sup>",
"Number of objects<sup>**</sup>:",
" ",
" ",
" ",
" "},
174 {
"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 "Geometry optimization",
194 "CPMD Molecular Dynamics",
195 "Born-Oppenheimer Molecular Dynamics",
196 "Kohn-Sham eigen values",
197 "Vibrational analysis",
198 "Calculation of physical properties"};
203 {
"Quasi-Newton method",
"Direct Inversion of Iterative Subspace",
" "},
204 {
"None",
"Parrinello-Rahman",
"Parrinello-Rahman + NPT"},
205 {
"None",
"Parrinello-Rahman",
"Parrinello-Rahman + NPT"},
206 {
"Finite differences of first derivatives",
"Linear response of ionic displacement",
"Precalculated Hessian"}};
209 {
"BFGS",
"GDIIS",
" "},
210 {
" ",
"PARRINELLO-RAHMAN",
"PARRINELLO-RAHMAN NPT"},
211 {
" ",
"PARRINELLO-RAHMAN",
"PARRINELLO-RAHMAN NPT"},
215gchar *
rest_opts[3] = {
"Random",
"Atomic pseudo wavefunctions",
"Use a RESTART.* file"};
216gchar *
nosetype[3] = {
"Gobal",
"Local",
"Molecule"};
218gchar *
thermo_name[2][5] = {{
"None",
"Controlled",
"Nosé-Hoover chains",
" ",
" "},
219 {
"None",
"Adaptive Langevin",
"Canonical sampling through velocity rescaling",
"GLE",
"Nosé-Hoover chains"}};
248GtkWidget *
cpmd_box (GtkWidget * box, gchar *
lab,
int v_space,
int h_space,
int dim)
268 if (i != 5 && i != 6)
274 else if (i == 0 || i > 2)
290 else if (i == 6 &&
tmp_cpmd -> calc_type == 4)
315 i = GPOINTER_TO_INT(data);
352 int i = GPOINTER_TO_INT(data);
355 j = gtk_check_button_get_active (but);
357 j = gtk_toggle_button_get_active (but);
378 j = GPOINTER_TO_INT(data);
379 i = gtk_combo_box_get_active (box);
388 gtk_combo_box_set_active (GTK_COMBO_BOX(
ppbox[0]),
tmp_cpmd -> pp[k][0]);
389 gtk_combo_box_set_active (GTK_COMBO_BOX(
ppbox[1]),
tmp_cpmd -> pp[k][1]);
436 gchar * atom_but[2] = {
"Configure constraints",
"Configure dummy atoms"};
516 g_signal_connect (G_OBJECT (widg),
"changed", G_CALLBACK(
changed_opt_box), GINT_TO_POINTER(j));
535 widg = gtk_label_new (
"a.u.");
539 widg = gtk_label_new (
"Ry");
551 k = (j==
DEFCO) ? 0 : 1;
582 i = GPOINTER_TO_INT(data);
617 j = GPOINTER_TO_INT(data);
618 i = gtk_combo_box_get_active (box);
648 int i = GPOINTER_TO_INT(data);
719 g_signal_connect (G_OBJECT (widg),
"changed", G_CALLBACK(
changed_calc_opt_box), GINT_TO_POINTER(j));
732 gchar * ksout =
"\t * electronic density(ies) or/and wavefunction(s)\n"
733 "\t ** as many index(es) to be supplied on the next line:\n"
734 "\t\t > 0 for electronic density\n\t\t < 0 for wavefunction";
753 i = gtk_combo_box_get_active (box);
756 gtk_label_set_text (GTK_LABEL(
calc_label), g_strdup_printf (
"<u>%s option(s)</u>",
calc_ds[i]));
757 gtk_label_set_use_markup (GTK_LABEL(
calc_label), TRUE);
781G_MODULE_EXPORT
void changed_info (GtkTextBuffer * textbuf, gpointer data)
785 gtk_text_buffer_get_start_iter (textbuf, & bStart);
786 gtk_text_buffer_get_end_iter (textbuf, & bEnd);
788 tmp_cpmd -> info = g_strdup_printf (
"%s", gtk_text_buffer_get_text (textbuf, & bStart, & bEnd, FALSE));
801 GtkWidget * scrollsets =
create_scroll (NULL, 355, 250, GTK_SHADOW_ETCHED_IN);
844 str = g_strdup_printf (
"<u>%s option(s)</u>",
calc_ds[
tmp_cpmd -> calc_type]);
851 gtk_widget_set_size_request (
calc_box[i], -1, 200);
869 if (s > 0 && s != 2 && s != 3)
871 i = (s == 1) ? s : s - 2;
872 str = g_strdup_printf (
"<u>General %s section option(s)</u>",
cpmd_elements[i]);
893 GtkWidget * scrollsets =
create_scroll (NULL, 250, (
c) ? 280 : 410, GTK_SHADOW_ETCHED_IN);
895 qmbuffer[s] = gtk_text_view_get_buffer (GTK_TEXT_VIEW(
aview));
920 return g_strdup_printf (
"Details of the <b>%s</b> section that %s",
cpmd_elements[1],
cdescr[1]);
924 return g_strdup_printf (
"Details of the <b>%s</b> section that %s",
cpmd_elements[p],
cdescr[p]);
928 return g_strdup_printf (
"Details of the <b>%s</b> section that %s",
cpmd_elements[p-2],
cdescr[p-2]);
968 return g_strdup_printf (
"The %s section - Calculation options",
cpmd_elements[1]);
972 return g_strdup_printf (
"The %s section - Thermostat options",
cpmd_elements[1]);
976 return g_strdup_printf (
"The %s section - RESTART options",
cpmd_elements[1]);
985 return g_strdup_printf (
"The %s section",
cpmd_elements[p-2]);
1003 gtk_assistant_append_page (assist, page);
1004 gtk_assistant_set_page_title (assist, page,
page_name(i));
1005 gtk_assistant_set_page_type (assist, page, GTK_ASSISTANT_PAGE_CONTENT);
1008 gtk_assistant_set_page_complete (assist, page, TRUE);
1017 info = g_strdup_printf (
"<b> Finalize the creation of the CPMD input file now !</b>");
1020 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);
1021 gtk_assistant_append_page (assist, conclu);
1022 gtk_assistant_set_page_title (assist, conclu,
"Create the input file now !");
1023 gtk_assistant_set_page_type (assist, conclu, GTK_ASSISTANT_PAGE_CONFIRM);
1024 gtk_assistant_set_page_complete (assist, conclu, TRUE);
1025 gtk_assistant_update_buttons_state (assist);
1036 for (i=0; i<
qm_proj -> natomes; i++)
1121 int i = GPOINTER_TO_INT(data);
1124 switch (current_page)
1142 return current_page+1;
1144 else if (
tmp_cpmd -> calc_type == 6)
1146 return current_page+2;
1150 return current_page+3;
1156 return current_page+1;
1160 return current_page+2;
1163 return current_page+1;
1169 switch (current_page)
1175 return current_page+1;
1192 int i = gtk_assistant_get_current_page (assistant);
1216 if (
tmp_cp2k -> input_type && i<=j-3)
return TRUE;
1217 if (i==0)
return TRUE;
1218 if (i==j-2 && print[0])
return TRUE;
1219 if (i==j-1 && print[1])
return TRUE;
1234 c = GPOINTER_TO_INT(data);
1235 gchar * ptitle[5] = {
"CP2K input file",
"forces.inc",
"system.inc",
"motion.inc",
"coord.inc"};
1236 gchar * wtite[2] = {
" input file preview",
" input files preview"};
1238 GtkWidget * scrollsets;
1240 GtkWidget * notebook;
1246 notebook = gtk_notebook_new ();
1250 str = g_strdup_printf (
"%s %s",
co_type[
c], wtite[1]);
1254 str = g_strdup_printf (
"%s %s",
co_type[
c], wtite[0]);
1256 print[0] = print[1] = FALSE;
1257 for (i=0; i<
qm_proj -> nspec; i++)
1259 if (
tmp_cp2k -> spec_data[i][0] != -1)
1265 for (i=0; i<
qm_proj -> nspec; i++)
1267 if (
tmp_cp2k -> spec_data[i][1] != -1)
1277 str = g_strdup_printf (
"%s %s",
co_type[
c], wtite[0]);
1290 for (i=0; i<j+l; i++)
1298 scrollsets =
create_scroll (NULL, 700, 350, GTK_SHADOW_ETCHED_IN);
1302 str = g_strdup_printf (
"%s",
tmp_cp2k -> files[i-(j+l-3)]);
1306 str = g_strdup_printf (
"%s", ptitle[(i == j-3+l) ? 4 : i]);
1308 gtk_notebook_append_page (GTK_NOTEBOOK(notebook), scrollsets, gtk_label_new (str));
1318 if (
tmp_cp2k -> input_type || i != j+l-3)
1320 print_cp2k ((i >= j+l-3) ? i+1-l: i, gtk_text_view_get_buffer(GTK_TEXT_VIEW(
aview)));
1341G_MODULE_EXPORT
void run_saving_qm (GtkNativeDialog * info, gint response_id, gpointer data)
1343 GtkFileChooser * chooser = GTK_FILE_CHOOSER((GtkFileChooserNative *)info);
1354G_MODULE_EXPORT
void run_saving_qm (GtkDialog * info, gint response_id, gpointer data)
1356 GtkFileChooser * chooser = GTK_FILE_CHOOSER((GtkWidget *)info);
1359 int c = GPOINTER_TO_INT(data);
1360 gboolean result = FALSE;
1361 gboolean done = FALSE;
1362 GtkTextBuffer * buffer = NULL;
1365 GError * err = NULL;
1369 gchar * cp2sp[2] = {
"basis.inc",
"pseudo.inc"};
1370 gchar * cp2file[4] = {
"forces.inc",
"system.inc",
"motion.inc",
"coord.inc"};
1371 switch (response_id)
1373 case GTK_RESPONSE_ACCEPT:
1376 if (filename != NULL)
1389 for (i=0; i<j+k; i++)
1391 if (i != j+k-3 ||
tmp_cp2k -> input_type)
1393 l = (i >= j+k-3) ? i+1-k: i;
1397 if (i > 0) filename = g_strdup_printf (
"%s/%s", direname, cp2file[l-1]);
1399 gtk_text_buffer_get_start_iter (buffer, & bStart);
1400 gtk_text_buffer_get_end_iter (buffer, & bEnd);
1401 text = gtk_text_buffer_get_text (buffer, & bStart, & bEnd, FALSE);
1402 gtk_text_buffer_set_modified (buffer, FALSE);
1403 result = g_file_set_contents (filename,
text, -1, & err);
1405 g_object_unref (buffer);
1406 if (! result && err)
1408 show_error (g_strdup_printf (
"Error while saving input file: %s\n Error: %s", filename, err -> message), 0,
qm_assistant);
1413 else if (l != 5 && l != 6)
1423 gtk_text_buffer_get_start_iter (buffer, & bStart);
1424 gtk_text_buffer_get_end_iter (buffer, & bEnd);
1425 text = gtk_text_buffer_get_text (buffer, & bStart, & bEnd, FALSE);
1426 gtk_text_buffer_set_modified (buffer, FALSE);
1427 result = g_file_set_contents (filename,
text, -1, & err);
1429 g_object_unref (buffer);
1430 if (! result && err)
1433 show_error (g_strdup_printf (
"Error while saving input file: %s\n Error: %s", filename, err -> message), 0,
qm_assistant);
1444 filename = g_strdup_printf (
"%s/%s", direname, cp2sp[i]);
1446 gtk_text_buffer_get_start_iter (buffer, & bStart);
1447 gtk_text_buffer_get_end_iter (buffer, & bEnd);
1448 text = gtk_text_buffer_get_text (buffer, & bStart, & bEnd, FALSE);
1449 result = g_file_set_contents (filename,
text, -1, & err);
1451 if (! result && err)
1454 show_error (g_strdup_printf (
"Error while saving file %s: %s", cp2sp[i], err -> message), 0,
qm_assistant);
1459 g_object_unref (buffer);
1482 show_info (
"The input files 'forces.inc', 'system.inc', 'motion.inc' and 'coord.inc'\n"
1483 "as well as the files 'basis.inc' and 'pseudo.inc'\n"
1484 "for the atomic basis set and peudo-potentials\n"
1485 "were saved in the same directory as the main input file.", 0,
qm_assistant);
1489 show_info (
"The input files 'forces.inc', 'system.inc', and 'coord.inc'\n"
1490 "as well as the files 'basis.inc' and 'pseudo.inc'\n"
1491 "for the atomic basis set and peudo-potentials\n"
1492 "were saved in the same directory as the main input file.", 0,
qm_assistant);
1497 show_info (
"The files 'basis.inc' and 'pseudo.inc'\n"
1498 "for the atomic basis set and peudo-potentials\n"
1499 "were saved in the same directory as the main input file.", 0,
qm_assistant);
1514 int c = GPOINTER_TO_INT(data);
1517 GtkFileChooserNative * info;
1522 gchar * qm_type[2] = {
"CPMD",
"CP2K"};
1523 const gchar * qm_name[2] = {
"CPMD input file (*.in)",
"CP2K input file (*.inp)"};
1524 const gchar * qm_ext[2] = {
".in",
".inp"};
1526 text = g_strdup_printf (
"Saving %s input file(s)", qm_type[
c]);
1528 GTK_WINDOW(assistant),
1529 GTK_FILE_CHOOSER_ACTION_SAVE,
1531 GtkFileChooser * chooser = GTK_FILE_CHOOSER(info);
1534 gtk_file_chooser_set_do_overwrite_confirmation (chooser, TRUE);
1537 filter1 = gtk_file_filter_new();
1538 gtk_file_filter_set_name (GTK_FILE_FILTER(
filter1), qm_name[
c]);
1539 text = g_strdup_printf (
"*%s", qm_ext[
c]);
1540 gtk_file_filter_add_pattern (GTK_FILE_FILTER(
filter1),
text);
1542 gtk_file_chooser_add_filter (chooser,
filter1);
1543 filter2 = gtk_file_filter_new();
1544 gtk_file_filter_set_name (GTK_FILE_FILTER(
filter2),
"All files (*)");
1545 gtk_file_filter_add_pattern (GTK_FILE_FILTER(
filter2),
"*");
1546 gtk_file_chooser_add_filter (chooser,
filter2);
1549 gtk_file_chooser_set_current_name (chooser,
text);
1552 run_this_gtk_native_dialog ((GtkNativeDialog *)info, G_CALLBACK(
run_saving_qm), NULL);
1569 gchar * qm_type[2] = {
"first-principles",
"QM-MM"};
1582 if (
qm_proj -> cpmd_input[s] == NULL)
1584 qm_proj -> cpmd_input[s] = g_malloc0 (
sizeof*
qm_proj -> cpmd_input[s]);
1585 qm_proj -> cpmd_input[s] -> calc_type = 0;
1586 qm_proj -> cpmd_input[s] -> thermostats = 0;
1587 qm_proj -> cpmd_input[s] -> ions_thermostat = NULL;
1588 qm_proj -> cpmd_input[s] -> elec_thermostat = NULL;
1589 qm_proj -> cpmd_input[s] -> dummies = 0;
1591 qm_proj -> cpmd_input[s] -> fixat = 0;
1592 qm_proj -> cpmd_input[s] -> fixlist = NULL;
1593 qm_proj -> cpmd_input[s] -> fixcoord = NULL;
1594 qm_proj -> cpmd_input[s] -> restart[0] = 0;
1595 qm_proj -> cpmd_input[s] -> restart[1] = 100;
1596 qm_proj -> cpmd_input[s] -> restart[2] = 2;
1597 qm_proj -> cpmd_input[s] -> restart[3] = 0;
1598 qm_proj -> cpmd_input[s] -> restart[4] = 1;
1599 for (i=5; i<9; i++)
qm_proj -> cpmd_input[s] -> restart[i] = 0;
1600 qm_proj -> cpmd_input[s] -> restart[9] = 0;
1604 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;
1605 qm_proj -> cpmd_input[s] -> info = g_strdup_printf (
" Project name: %s\n"
1606 " Total number of atoms: %d\n"
1607 " Number of chemical species: %d",
1615 if (
qm_proj -> cp2k_input[s] == NULL)
1617 qm_proj -> cp2k_input[s] = g_malloc0 (
sizeof*
qm_proj -> cp2k_input[s]);
1618 qm_proj -> cp2k_input[s] -> input_type = 0;
1621 qm_proj -> cp2k_input[s] -> fixat[i] = 0;
1622 qm_proj -> cp2k_input[s] -> fixlist[i] = NULL;
1623 qm_proj -> cp2k_input[s] -> fixcoord[i] = NULL;
1625 qm_proj -> cp2k_input[s] -> thermostats = 0;
1626 qm_proj -> cp2k_input[s] -> ions_thermostat = NULL;
1627 for (i=0; i<5; i++)
qm_proj -> cp2k_input[s] -> files[i] = NULL;
1636 qm_proj -> cp2k_input[s] -> spec_files = g_malloc (
qm_proj -> nspec*
sizeof*
qm_proj -> cp2k_input[s] -> spec_files);
1637 for (i=0; i<
qm_proj -> nspec; i++)
1641 qm_proj -> cp2k_input[s] -> spec_files[i] = g_malloc0 (2*
sizeof*
qm_proj -> cp2k_input[s] -> spec_files[i]);
1642 qm_proj -> cp2k_input[s] -> spec_files[i][0] = NULL;
1643 qm_proj -> cp2k_input[s] -> spec_files[i][1] = NULL;
1645 gchar * defname[2]={
"basis.inc",
"pseudo.inc"};
1648 for (i=0; i<
qm_proj -> nspec; i++)
1650 if (
qm_proj -> cp2k_input[s] -> spec_data[i][j] > -1)
1652 qm_proj -> cp2k_input[s] -> files[1+j] = g_strdup_printf (
"%s", defname[j]);
1657 qm_proj -> cp2k_input[s] -> info = g_strdup_printf (
" Project name: %s\n"
1658 " Total number of atoms: %d\n"
1659 " Number of chemical species: %d",
1667 gtk_window_set_resizable (GTK_WINDOW (
qm_assistant), FALSE);
1668 gtk_window_set_modal (GTK_WINDOW (
qm_assistant), TRUE);
1669 gchar * str = g_strdup_printf (
"Basic %s - %s - calculation assistant",
co_type[
c], qm_type[s]);
1674 gchar * info = g_strdup_printf (
"\t<b>This assistant will help you to setup a %s %s\n"
1675 "\tcalculation using <i>%s</i> 3D model as starting point</b>\n"
1676 "\nPlease note that the %s code offers so many calculation options that it is not possible\n"
1677 "to provide a description and offer a comprehensive usage guide for each of them. \n"
1678 "Therefore this assistant only provides help towards basics and / or frequently used %s instructions. \n\n"
1679 "<b>In any case if you intent to use the %s code please refer to the user manual.</b>",
1685 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),
1687 gtk_assistant_append_page (GTK_ASSISTANT (
qm_assistant), intro);
1688 str = g_strdup_printf (
"%s calculation set-up",
co_type[
c]);
1689 gtk_assistant_set_page_title (GTK_ASSISTANT (
qm_assistant), intro, str);
1691 gtk_assistant_set_page_type (GTK_ASSISTANT (
qm_assistant), intro, GTK_ASSISTANT_PAGE_INTRO);
1710 gtk_assistant_set_page_complete (GTK_ASSISTANT (
qm_assistant),
1711 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]
Variable declarations for the creation of the CPMD input file.
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
double default_calc_options[24]
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 * thermo_name[2][5]
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
gchar * calc_ds[NCPMDCALC]
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.
gchar * default_text[9][NDFT]
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
gchar * calc_box_name[NCACOMBO][3]
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
gchar * cdescr[MAXDATAQM]
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]
double default_cpmd_options[17]
GtkWidget * calc_box[NCPMDCALC]
GtkWidget * vbox_cpmd(int s)
create CPMD input creation section widgets
gchar * calc_opts[NCPMDCALC][NOPTPC]
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
int calc_box_num[NCACOMBO]
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
gchar * default_keywords[9][NDFT]
gchar * cpmd_elements[MAXDATAQM]
void print_all_sections(GtkTextBuffer *buf)
print all sections of the CPMD input file
int default_opts_type[MAXDATAQM-1][NSECOP]
gchar * default_opts[MAXDATAQM-1][NSECOP]
void create_qm_input_file(int c, int p, int s)
initialize an ab-initio MD input file creation assistant
int default_type[NCPMDCALC][NOPTPC]
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
gchar * calc_kw[NCPMDCALC]
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)
gchar * calc_box_keys[NCACOMBO][3]
void label(cairo_t *cr, double val, int axe, int p, project *this_proj)
draw axis label
void init_default_shaders(glwin *view)
re-initialize the default OpenGL shaders
int ** allocdint(int xal, int yal)
allocate an int ** pointer
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
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.
gboolean is_the_widget_visible(GtkWidget *widg)
test if a GtkWidget exist, then return if it is visible or not
gchar * file_chooser_get_file_name(GtkFileChooser *chooser)
get a file name from a GtkFileChooser (single file selected)
const gchar * entry_get_text(GtkEntry *entry)
get the text in a GtkEntry
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)
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.
GtkWidget * create_vbox(int spacing)
create a GtkBox with vertical orientation
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...