99extern G_MODULE_EXPORT
void run_add_atom_dialog (GtkDialog * add_dialog, gint response_id, gpointer data);
137 if (pro_a -> key != pro_b -> key)
return FALSE;
138 if (pro_a -> use != pro_b -> use)
return FALSE;
139 if (pro_a -> show != pro_b -> show)
return FALSE;
147 if (pro_a ->
val[i] != pro_b ->
val[i])
return FALSE;
223 else if (key != pro -> key)
242 for (i=0; i<sti; i++)
tmp_fstr -> other -> aid[i] = ids[i];
245 else if (pro == NULL)
248 while (pro -> next != NULL) pro = pro -> next;
257 for (i=0; i<sti; i++) pro -> aid[i] = ids[i];
265 pro -> key = tmp -> key;
271 pro -> show = tmp -> show;
272 pro -> use = tmp -> use;
291 if (ptmp -> next != NULL)
293 if (ptmp -> prev != NULL)
295 ptmp -> prev -> next = ptmp -> next;
296 ptmp -> next -> prev = ptmp -> prev;
300 ptmp -> next -> prev = NULL;
303 else if (ptmp -> prev != NULL)
305 ptmp -> prev -> next = NULL;
314 if (ptmp) ptmp = ptmp -> next;
321 while (ptmp -> next != NULL)
323 ptmp -> next -> pid = ptmp -> pid + 1;
339 int i = GPOINTER_TO_INT(data);
350 tmp_fat -> name = g_strdup_printf (
"%s", m);
391 int i = GPOINTER_TO_INT(data);
433 k = GPOINTER_TO_INT(data);
479 obody = obody -> next;
495 str = g_strdup_printf (
"<i>U</i>(r<sub>ij</sub>) = <b>Ɛ<sub>ij</sub></b> x [ (<b>r0<sub>ij</sub></b>/r<sub>ij</sub>)<sup>12</sup> - 2.0 (<b>r0<sub>ij</sub></b>/r<sub>ij</sub>)<sup>6</sup> ]\n"
496 "\t\twith <b>Ɛ<sub>ij</sub></b> = sqrt (Ɛ<sub>i</sub> x Ɛ<sub>j</sub>)\n"
497 "\t\tand <b>r0<sub>ij</sub></b> = r0<sub>i</sub>/2.0 + r0<sub>j</sub>/2.0");
501 str = g_strdup_printf (
"<i>U</i>(r<sub>ij</sub>) = (<b>A<sub>ij</sub></b>/r<sub>ij</sub>)<sup>12</sup> - 2.0 (<b>B<sub>ij</sub></b>/r<sub>ij</sub>)<sup>6</sup>\n"
502 "\t\twith <b>A<sub>ij</sub></b> = sqrt (A<sub>i</sub> x A<sub>j</sub>)\n"
503 "\t\tand <b>B<sub>ij</sub></b> = sqrt (B<sub>i</sub> x B<sub>j</sub>)");
507 str = g_strdup_printf (
"<i>U</i>(r<sub>ij</sub>) = <b>Ɛ<sub>ij</sub></b> x [ 2.0 (<b>r0<sub>ij</sub></b>/r<sub>ij</sub>)<sup>9</sup> - 3.0 (<b>r0<sub>ij</sub></b>/r<sub>ij</sub>)<sup>6</sup> ]\n"
508 "\t\twith <b>Ɛ<sub>ij</sub></b> = 2.0 sqrt (Ɛ<sub>i</sub> x Ɛ<sub>j</sub>) x (r0<sub>i</sub><sup>3</sup> r0<sub>j</sub><sup>3</sup>) / (r0<sub>i</sub><sup>6</sup> + r0<sub>j</sub><sup>6</sup>)\n"
509 "\t\tand <b>r0<sub>ij</sub></b> = [(r0<sub>i</sub><sup>6</sup> + r0<sub>j</sub><sup>6</sup>)/2.0] <sup>1/6</sup>");
534 if (obj > -1 && key > -1)
540 if (obj == 11 && key == 0 && i == 0)
543 lab =
markup_label (_(
"<u><i>Single terms:</i></u>"), 100, 50, 0.0, 0.5);
550 if (((obj == 1 || obj == 2) && key ==
FBONDS-1 && (i == 0 || i == 1))
551 || ((obj == 3 || obj == 4) && key ==
FANGLES-1 && (i == 0 || i == 1))
552 || ((obj == 5 || obj == 6) && (key ==
FDIHEDRAL-2 || key ==
FDIHEDRAL-1) && (i == 0 || i == 1))
553 || ((obj == 5 || obj == 6) && (key == 1 || key == 2) && i ==3))
555 str = g_strdup_printf (
" <b><i>%s</i></b>", _(words[i]));
559 str = g_strdup_printf (
" <b><i>%s</i></b>", words[i]);
564 str = g_strdup_printf (
" <b><i>%s</i></b>", words[i]);
574 if (obj == 11 && key == 0)
579 lab =
markup_label (_(
"<u><i>Cross terms with atom:</i></u>"), 160, -1, 0.0, 0.5);
584 for (i=11; i< 14; i++)
587 str = g_strdup_printf (
" <b><i>%s</i></b>", words[i]);
609 str = g_strdup_printf (_(
"<i>Tabulated</i>"));
617 str = g_strdup_printf (_(
"In %s, non-bonded interactions are evaluated using: \n%s\n"
618 "Therefore the parameters provided by the force field are incompatible with the DL-POLY options."),
625 else if (obj == 9 && key == 0 && (
tmp_field -> type <= CVFF_AUG || tmp_field -> type >
COMPASS))
629 str = g_strdup_printf (_(
"In %s, 12-6 non-bonded interactions are evaluated using: \n%s\n<i><b>A</b></i> and <i><b>B</b></i>"
630 " are calculated using Ɛ<sub>i/j</sub> and r0<sub>i/j</sub> provided by the force field parameters."),
634 str = g_strdup_printf (_(
"%s\nScaled 1-4 exclusion parameters, provided by the %s force field, are ignored."), str,
field_acro[
tmp_field -> type]);
639 str = g_strdup_printf (_(
"In %s, 12-6 non-bonded interactions are evaluated using: \n%s\n<i><b>A</b></i> and <i><b>B</b></i>"
640 " are calculated using A<sub>i/j</sub> and B<sub>i/j</sub> provided by the force field parameters."),
651 str = g_strdup_printf (_(
"Urey-Bradley terms provided by the %s force field are ignored.\n"),
field_acro[
tmp_field -> type]);
669 gchar * str = g_strdup_printf (_(
"External field"));
684 gchar *
text = _(
"Are you sure to change the type of Tersoff potential ?\n"
685 "<i>Tersoff (ter)</i> and <i>KIHS (kihs)</i> forms cannot be mixed\n"
686 "Therefore this choice will affect <b>all</b> Tersoff potential(s).\n"
687 "Any previous parameters will be erased !");
762 gboolean changeit = FALSE;
763 i = GPOINTER_TO_INT(data);
793 gtk_label_set_use_markup (GTK_LABEL(
body_lab), TRUE);
813 else if (j == 1 &&
cross != NULL)
848G_MODULE_EXPORT
void visualize_it (GtkCheckButton * but, gpointer data)
858G_MODULE_EXPORT
void visualize_it (GtkToggleButton * but, gpointer data)
862 i = GPOINTER_TO_INT (data);
897G_MODULE_EXPORT
void select_it (GtkCheckButton * but, gpointer data)
907G_MODULE_EXPORT
void select_it (GtkToggleButton * but, gpointer data)
911 i = GPOINTER_TO_INT (data);
943 GtkTreeStore **
model = (GtkTreeStore **)data;
945 int h, i, j, k, l, m, n;
946 GtkTreePath *
path = gtk_tree_path_new_from_string (string_path);
947 gtk_tree_model_get_iter (GTK_TREE_MODEL(*
model), & iter,
path);
948 gtk_tree_model_get (GTK_TREE_MODEL(*
model), & iter, 0, & i, -1);
949 if (gtk_cell_renderer_toggle_get_active(cell_renderer))
1015 if (tmp_fbo ->
id == h)
1020 else if (tmp_fbo -> next != NULL)
1022 tmp_fbo = tmp_fbo -> next;
1028 gtk_tree_store_set (*
model, & iter, 3+j,
toviz.c, -1);
1057void select_atom_set_cmv (GtkTreeViewColumn *
col, GtkCellRenderer * renderer, GtkTreeModel * mod, GtkTreeIter * iter, gpointer data)
1060 gtk_tree_model_get (mod, iter, 0, & h, -1);
1063 gtk_tree_model_get (mod, iter, 1, & i, -1);
1069 j = GPOINTER_TO_INT(data);
1073 gtk_cell_renderer_set_visible (renderer, ! i);
1081 gtk_cell_renderer_set_visible (renderer, i);
1085 gtk_cell_renderer_set_visible (renderer, i);
1088 gtk_cell_renderer_set_visible (renderer, ! i);
1095 gtk_tree_model_get (mod, iter, 3, & k, -1);
1103 gtk_cell_renderer_set_visible (renderer, TRUE);
1107 gtk_cell_renderer_set_visible (renderer, !
a_ato);
1112 gtk_cell_renderer_set_visible (renderer, ! i);
1120 if (
sel_at[0][i]+1 == abs(h))
break;
1136 k = (
sel_at[0][h-1]) ? h : 0;
1140 gtk_tree_model_get (mod, iter, 3, & k, -1);
1158G_MODULE_EXPORT
void edit_unit_weight (GtkCellRendererText * cell, gchar * path_string, gchar * new_text, gpointer data)
1160 GtkTreeStore **
model = (GtkTreeStore **)data;
1163 GtkTreePath *
path = gtk_tree_path_new_from_string (path_string);
1164 gtk_tree_model_get_iter (GTK_TREE_MODEL(*
model), & iter,
path);
1165 gtk_tree_model_get (GTK_TREE_MODEL(*
model), & iter, 0, & i, -1);
1179 int i, j, k, l, m, n, o, p, q;
1180 GtkTreeIter id_level;
1181 GtkTreeIter atom_level;
1182 GtkTreeViewColumn *
ato_col[5];
1184 gchar * ato_title[5] = {
i18n(
"Atom Id."),
i18n(
"Fragment"),
i18n(
"Atom"),
i18n(
"Weight (1)"),
i18n(
"Viz.3D & Select")};
1185 gchar * nbd_title[5] = {
i18n(
"Atom Id."),
i18n(
"Field atom"),
i18n(
"Field molecule(s)"),
" ",
i18n(
"Viz.3D & Select")};
1186 gchar * ctype[5]={
"text",
"text",
"text",
"text",
"active"};
1187 GType
col_type[2][5] = {{G_TYPE_INT, G_TYPE_INT, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_FLOAT},
1188 {G_TYPE_INT, G_TYPE_INT, G_TYPE_STRING, G_TYPE_FLOAT, G_TYPE_BOOLEAN}};
1189 GType cbl_type[4] = {G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN};
1198 str = g_strdup_printf (_(
"Please select the new atom(s)"));
1203 str = g_strdup_printf (_(
"Please select the atom(s) to freeze / unfreeze"));
1208 str = g_strdup_printf (_(
"Please select the core atom"));
1213 str = g_strdup_printf (_(
"Please select the atom(s) to shell"));
1218 str = g_strdup_printf (_(
"Please select the first atom"));
1223 str = g_strdup_printf (_(
"Please select the second atom"));
1228 str = g_strdup_printf (_(
"Please select the atom(s) in the first unit"));
1231 str = g_strdup_printf (_(
"Please select the atom(s) in the second unit"));
1234 str = g_strdup_printf (_(
"Please select the atom(s) in the rigid unit"));
1238 str = g_strdup_printf (_(
"Please select the tethered atom"));
1245 str = g_strdup_printf (_(
"Please select the type of field atom"));
1249 str = g_strdup_printf (_(
"Please select the first type of field atom"));
1253 str = g_strdup_printf (_(
"Please select the second type of field atom"));
1256 str = g_strdup_printf (_(
"Please select the third type of field atom"));
1259 str = g_strdup_printf (_(
"Please select the fourth type of field atom"));
1264 gtk_dialog_add_button (GTK_DIALOG(amol), _(
"Apply"), GTK_RESPONSE_APPLY);
1273 add_model = gtk_tree_store_newv (4, cbl_type);
1281 for (i=0; i<4+q; i++)
1286 ato_cell[i] = gtk_cell_renderer_text_new ();
1291 ato_cell[i] = gtk_cell_renderer_toggle_new ();
1292 if (
active_sel > 1) gtk_cell_renderer_toggle_set_radio (GTK_CELL_RENDERER_TOGGLE(
ato_cell[i]), TRUE);
1297 ato_col[i] = gtk_tree_view_column_new_with_attributes (_(ato_title[k]),
ato_cell[i], ctype[k], i, NULL);
1301 ato_col[i] = gtk_tree_view_column_new_with_attributes ((k != 3) ? _(nbd_title[k]) : nbd_title[k],
ato_cell[i], ctype[k], i, NULL);
1304 gtk_tree_view_column_set_alignment (
ato_col[i], 0.5);
1308 g_object_set (
ato_cell[i],
"editable", TRUE, NULL);
1329 if (g_strcmp0 (
get_active_atom (tmp_fbo -> ma[0][0], tmp_fbo -> a[0][0]) -> name,
1330 get_active_atom (tmp_fbo -> ma[1][0], tmp_fbo -> a[1][0]) -> name) == 0) k ++;
1331 if (tmp_fbo -> next != NULL) tmp_fbo = tmp_fbo -> next;
1360 gtk_tree_store_append (
add_model, & id_level, NULL);
1361 gtk_tree_store_set (
add_model, & id_level, 0,
sel_at[0][i]+1, 1, 0, 3, 0, -1);
1365 gtk_tree_path_to_string(gtk_tree_model_get_path(GTK_TREE_MODEL(
add_model), & id_level)),
1370 gtk_tree_store_append (
add_model, & atom_level, & id_level);
1375 gtk_tree_store_set (
add_model, & atom_level, 0, -(
sel_at[0][i]+1), 1,
tmp_fmol -> fragments[j]+1, 2, str, -1);
1386 gtk_tree_store_append (
add_model, & id_level, NULL);
1387 gtk_tree_store_set (
add_model, & id_level, 0, i+1, 1, 0, 3, 0, -1);
1391 gtk_tree_store_append (
add_model, & atom_level, & id_level);
1394 gtk_tree_store_set (
add_model, & atom_level, 0, -(i+1), 1,
tmp_fmol -> fragments[j]+1, 2, str, -1);
1407 gtk_tree_store_append (
add_model, & id_level, NULL);
1435 gtk_tree_store_set (
add_model, & id_level, 0, i+1, 1, 0, 3, 0, -1);
1439 gtk_tree_path_to_string(gtk_tree_model_get_path(GTK_TREE_MODEL(
add_model), & id_level)),
1444 gtk_tree_store_append (
add_model, & atom_level, & id_level);
1447 gtk_tree_store_set (
add_model, & atom_level, 0, -(i+1), 1,
tmp_fmol -> fragments[j]+1, 2, str, -1);
1461 if (g_strcmp0 (
get_active_atom (tmp_fbo -> ma[0][0], tmp_fbo -> a[0][0]) -> name,
1462 get_active_atom (tmp_fbo -> ma[1][0], tmp_fbo -> a[1][0]) -> name) == 0)
1469 if (g_strcmp0 (
get_active_atom (tmp_fbo -> ma[0][0], tmp_fbo -> a[0][0]) -> name,
1475 gtk_tree_store_append (
add_model, & id_level, NULL);
1479 if (g_strcmp0 (
get_active_atom (tmp_fbo -> ma[0][0], tmp_fbo -> a[0][0]) -> name,
1487 gtk_tree_store_set (
add_model, & id_level, 0, k+1, 1,
1489 sel_at[0][k] = tmp_fbo -> id;
1490 for (j=0; j<tmp_fbo -> na[0]; j++)
1492 gtk_tree_store_append (
add_model, & atom_level, & id_level);
1498 if (tmp_fbo -> next != NULL) tmp_fbo = tmp_fbo -> next;
1519 for (l=0; l<
tmp_fpmf -> num[k]; l++)
1531 gtk_tree_store_append (
add_model, & id_level, NULL);
1535 for (l=0; l<
tmp_fpmf -> num[m]; l++)
1546 gtk_tree_store_set (
add_model, & id_level, 0, i+1, 1, 0, 3,
val_at[i], 4, 0, -1);
1550 gtk_tree_path_to_string(gtk_tree_model_get_path(GTK_TREE_MODEL(
add_model), & id_level)),
1555 gtk_tree_store_append (
add_model, & atom_level, & id_level);
1558 gtk_tree_store_set (
add_model, & atom_level, 0, -(i+1), 1,
tmp_fmol -> fragments[l]+1, 2, str, -1);
1574 i = ((j+1)*37 < 500) ? (j+1)*37 : 500;
1577 GtkWidget * scrollsets =
create_scroll (
vbox, 320+q*100, i, GTK_SHADOW_ETCHED_IN);
1582 str = g_strdup_printf (_(
" <b>(1)</b> if all 0.0 then atomic weight(s) will be used by DL-POLY"));
1588 str = g_strdup_printf (_(
"The atom(s) above will be described\n"
1589 "in the force field using the parameters\n"
1590 "of the <b>%s</b> field atom.\n"),
1605 str = g_strdup_printf (_(
"%d atom(s)"),
tmp_fat -> frozen);
1606 if (but) gtk_button_set_label (but, str);
1628 str = g_strdup_printf (
" ");
1632 str = g_strdup_printf (
"<b>%8.3f</b>", v);
1634 gtk_label_set_text (GTK_LABEL(
av_lgt), str);
1635 gtk_label_set_use_markup (GTK_LABEL(
av_lgt), TRUE);
1649 gchar * str = g_strdup_printf (
"%s <b>", _(
felemt[a+
MOLIMIT+1]));
1656 if (i < j-1 && j > 1) str = g_strdup_printf (
"%s - ", str);
1658 str = g_strdup_printf (
"%s</b>", str);
1673 int i, j, k, l, m, n, o, p, q, r;
1674 i = GPOINTER_TO_INT(data);
1675 gchar * stra = NULL;
1676 gchar * strb = NULL;
1677 if (i == 2 || i == 3)
1682 stra = g_strdup_printf (_(
"Not picked yet !"));
1683 strb = g_strdup_printf (
DELETEB);
1690 strb = g_strdup_printf (
APPLY);
1693 else if (i == 4 || i == 5)
1698 stra = g_strdup_printf (_(
"Not picked yet !"));
1699 strb = g_strdup_printf (
DELETEB);
1706 strb = g_strdup_printf (
APPLY);
1709 else if (i == 6 || i == 7)
1714 stra = g_strdup_printf (_(
"Not picked yet !"));
1715 strb = g_strdup_printf (
DELETEB);
1719 stra = g_strdup_printf (_(
"%d atom(s)"),
tmp_fpmf -> num[j]);
1720 strb = g_strdup_printf (
APPLY);
1728 stra = g_strdup_printf (_(
"Not picked yet !"));
1729 strb = g_strdup_printf (
DELETEB);
1733 stra = g_strdup_printf (_(
"%d atom(s)"),
tmp_frig -> num);
1734 strb = g_strdup_printf (
APPLY);
1742 stra = g_strdup_printf (_(
"Not picked yet !"));
1743 strb = g_strdup_printf (
DELETEB);
1749 strb = g_strdup_printf (
APPLY);
1752 else if (i == 11 || i == 12 || i == 13 || i == 14)
1757 stra = g_strdup_printf (_(
"Not picked yet !"));
1758 strb = g_strdup_printf (
DELETEB);
1763 strb = g_strdup_printf (
APPLY);
1782 gtk_label_set_use_markup (GTK_LABEL(
body_lab), TRUE);
1786 if (i == 4 || i == 5)
1806 else if (i == 6 || i == 7)
1812 gboolean all_zero = TRUE;
1816 for (l=0; l<
tmp_fpmf -> num[k]; l++)
1818 if (
tmp_fpmf -> weight[k][l] != 0.0)
1824 if (! all_zero)
break;
1838 for (l=0; l<
tmp_fpmf -> num[k]; l++)
1867 at[k][n].
x /= ma[k][n];
1868 at[k][n].
y /= ma[k][n];
1869 at[k][n].
z /= ma[k][n];
1877 gtk_button_set_label (but, stra);
1878 gtk_widget_set_size_request ((GtkWidget *)but, 150, -1);
1893 i = GPOINTER_TO_INT(data);
1944 i = body -> ma[aid][0];
1947 return g_strdup_printf (
"%s",
get_active_atom (i, body -> a[aid][0]) -> name);
1969 gchar * stra, * strb, * strc, * strd;
1993 gboolean
res = FALSE;
1994 if (g_strcmp0(stra, strc) == 0 && g_strcmp0(strb, strd) == 0)
res = TRUE;
1995 if (g_strcmp0(stra, strd) == 0 && g_strcmp0(strb, strc) == 0)
res = TRUE;
2018 i += molff ->
atoms;
2019 shellff = molff -> first_shell;
2022 if (shellff -> use && shellff -> vdw && shellff -> ia[0] > -1) i ++;
2023 shellff = shellff -> next;
2025 molff = molff -> next;
2039 int i, j, k, l, m, n;
2047 n = (add_shell) ? i * (i-1) / 2 : (i+1) * (i+2) / 2;
2053 k = bodyff -> ma[j][0];
2054 if (bodyff -> a[j][0] >= n)
2056 bodyff -> a[j][0] -= n;
2057 bodyff -> a[j][0] += m;
2060 bodyff = bodyff -> next;
2066 gchar ** to_be_vdw = g_malloc0(i*
sizeof*to_be_vdw);
2071 int * vdw_a[2], * vdw_ma[2];
2077 atff = molff -> first_atom;
2083 if (g_strcmp0 (to_be_vdw[k], atff -> name) == 0)
2087 vdw_mids[k][vdw_mlist[k]] = molff -> id;
2088 vdw_aids[k][vdw_mlist[k]] = atff -> id;
2094 to_be_vdw[k] = g_strdup_printf (
"%s", atff -> name);
2095 vdw_mids[k][0] = molff -> id;
2096 vdw_aids[k][0] = atff -> id;
2099 atff = atff -> next;
2101 shellff = molff -> first_shell;
2104 if (shellff -> use && shellff -> vdw && shellff -> ia[0] > -1)
2108 str = g_strdup_printf (
"%s_sh", atff -> name);
2111 if (g_strcmp0 (to_be_vdw[k], str) == 0)
2115 vdw_mids[k][vdw_mlist[k]] = molff -> id;
2116 vdw_aids[k][vdw_mlist[k]] = shellff ->
id + nbd;
2122 to_be_vdw[k] = g_strdup_printf (
"%s", str);
2123 vdw_mids[k][0] = molff -> id;
2124 vdw_aids[k][0] = shellff ->
id + nbd;
2129 shellff = shellff -> next;
2131 molff = molff -> next;
2140 vdw_na[0] = vdw_na[1] = vdw_mlist[k]+1;
2141 vdw_a[0] = vdw_a[1] =
duplicate_int (vdw_na[0], vdw_aids[k]);
2142 vdw_ma[0] = vdw_ma[1] =
duplicate_int (vdw_na[0], vdw_mids[k]);
2144 bodyff = bodyff -> next;
2150 bodyff -> next -> prev = bodyff;
2154 for (m=0; m<l-1; m++)
2156 for (n=m+1; n<l; n++)
2161 vdw_na[0] = vdw_mlist[m]+1;
2162 vdw_na[1] = vdw_mlist[n]+1;
2168 bodyff = bodyff -> next;
2174 bodyff -> next -> prev = bodyff;
2184 gchar * str = g_strdup_printf (
"%s_sh", atff -> name);
2185 gchar * stra, * strb;
2192 if (g_strcmp0(str,stra) == 0 || g_strcmp0(str,strb) == 0)
2196 bodyff -> prev -> next = bodyff -> next;
2197 bodyff -> next -> prev = bodyff -> prev;
2201 bodyff = bodyff -> prev;
2202 g_free (bodyff -> next);
2203 bodyff -> next = NULL;
2209 bodyff = bodyff -> next;
2225G_MODULE_EXPORT
void shell_in_vdw (GtkCheckButton * but, gpointer data)
2260 else if (
rep.a == 1)
2283 gchar * str = g_strdup_printf (_(
"%s parameter(s)"), _(
felemt[f+1]));
2293 gchar * cs_name[3]={
i18n(
"Core atom: "),
i18n(
"Shell atom: "),
i18n(
"Selection: ")};
2294 gchar * cs_param[4]={
i18n(
"Mass:"),
i18n(
"Charge:"),
"<i>k<sub>2</sub></i> ",
"<i>k<sub>4</sub></i> "};
2295 gchar * cs_unit[4]={
"g mol<sup>-1</sup>",
" ",
"Å<sup>-2</sup>",
"Å<sup>-4</sup>"};
2296 gchar * co_name[4]={
i18n(
"First atom: "),
i18n(
"Second atom: "),
i18n(
"Third atom: "),
i18n(
"Fourth atom: ")};
2297 gchar * pm_name[2]={
i18n(
"First unit: "),
i18n(
"Second unit: ")};
2302 show_it = use_it = FALSE;
2320 str = g_strdup_printf (_(
"Element:"));
2330 str = g_strdup_printf (_(
"Field parameters:"));
2339 g_signal_connect (G_OBJECT(combo),
"changed", G_CALLBACK(
changed_atom_combo), GINT_TO_POINTER(0));
2343 str = g_strdup_printf (_(
"Force field type <sup>*</sup>:"));
2354 if (g_strcmp0 (
ff_atoms[j][3],
" ") != 0) str = g_strdup_printf (
"%s : %s", str,
ff_atoms[j][3]);
2365 str = g_strdup_printf (_(
"Name: "));
2374 str = g_strdup_printf (_(
"Mass: "));
2383 str = g_strdup_printf (_(
"Charge: "));
2392 str = g_strdup_printf (_(
"Frozen: "));
2396 str = g_strdup_printf (_(
"%d atom(s)"),
tmp_fat -> frozen);
2404 str = g_strdup_printf (_(
"\tCore-Shell N°<b>%d</b>"),
tmp_fshell ->
id+1);
2414 str = g_strdup_printf (_(
"Not picked yet !"));
2491 lab =
markup_label ((k < 2) ? _(cs_param[k]) : cs_param[k], 100, -1, 0.0, 0.5);
2499 str = g_strdup_printf (
"%s", cs_unit[k]);
2513 add_box_child_start (GTK_ORIENTATION_HORIZONTAL,
hbox,
check_button (NULL, -1, -1,
tmp_fshell -> vdw, G_CALLBACK(
shell_in_vdw), NULL), FALSE, FALSE, 30);
2521 str = g_strdup_printf (_(
"\tBond constraint N°<b>%d</b>"),
tmp_fcons ->
id+1);
2531 str = g_strdup_printf (_(
"Not picked yet !"));
2547 str = g_strdup_printf (_(
"Av. distance (1): "));
2553 str = g_strdup_printf (
"[Å]");
2558 str = g_strdup_printf (_(
"Length: "));
2565 str = g_strdup_printf (
"[Å]");
2576 str = g_strdup_printf (_(
"\tMean force potential N°<b>%d</b>"),
tmp_fpmf ->
id+1);
2586 str = g_strdup_printf (_(
"Not picked yet !"));
2591 str = g_strdup_printf (_(
"%d atom(s)"),
tmp_fpmf -> num[k]);
2602 str = g_strdup_printf (_(
"Av. d<sub>1-2</sub> (1): "));
2608 str = g_strdup_printf (
"[Å]");
2614 str = g_strdup_printf (_(
"Length: "));
2621 str = g_strdup_printf (
"[Å]");
2632 str = g_strdup_printf (_(
"\tRigid unit N°<b>%d</b>"),
id+1);
2638 str = g_strdup_printf (_(
"Atom(s): "));
2644 str = g_strdup_printf (_(
"Not picked yet !"));
2649 str = g_strdup_printf (_(
"%d atom(s)"),
tmp_frig -> num);
2663 str = g_strdup_printf (_(
"\tTethered atom N°<b>%d</b>"),
id+1);
2669 str = g_strdup_printf (_(
"Atom: "));
2675 str = g_strdup_printf (_(
"Not picked yet !"));
2704 str = g_strdup_printf (_(
"\t%s type N°<b>%d</b>\n\tField atoms: <b>"),
mo_title[f-7],
id+1);
2707 if (k == m-1) str = g_strdup_printf (_(
"%s</b> and <b>"), str);
2709 if (m > 2 && k < m-1) str = g_strdup_printf (
"%s</b>, <b>", str);
2711 str = g_strdup_printf (
"%s</b>", str);
2716 str = g_strdup_printf (_(
"%s\n\tBetween atoms: <b>"), str);
2721 if (k == m-1) str = g_strdup_printf (_(
"%s</b> and <b>"), str);
2722 str = g_strdup_printf (
"%s%s", str, ba);
2723 if (m > 2 && k < m-1) str = g_strdup_printf (
"%s</b>, <b>", str);
2725 str = g_strdup_printf (
"%s</b>", str);
2777 str = g_strdup_printf (_(
"Not picked yet !"));
2800 lab =
markup_label(_(
"Visualize in the model: "), (f == 1) ? 150 : 185, 40, 0.0, 0.5);
2802 add_box_child_start (GTK_ORIENTATION_HORIZONTAL,
hbox,
check_button (NULL, -1, -1, show_it, G_CALLBACK(
visualize_it), GINT_TO_POINTER(f)), FALSE, FALSE, 30);
2807 str = g_strdup_printf (_(
"<sup>*</sup> this will be used to adjust bonding, angles, etc ... accordingly,\n"
2808 " providing that some parameters can be found in the force field data.\n"
2809 " Please note that comments are directly imported from the force field file."));
2816 lab =
markup_label(_(
"Use to create force field: "), 185, 40, 0.0, 0.5);
2818 add_box_child_start (GTK_ORIENTATION_HORIZONTAL,
hbox,
check_button (NULL, -1, -1, use_it, G_CALLBACK(
select_it), GINT_TO_POINTER(f)), FALSE, FALSE, 30);
2822 if (f > 6 && f < 16)
2827 gchar * funits[5] ={
"Ev",
"kcal mol<sup>-1</sup>",
"kJ mol<sup>-1</sup>",
"K B<sup>-1</sup>", _(
"DL_POLY internal units")};
2828 str = g_strdup_printf (_(
"Field parameters <sup>*</sup>:"));
2834 str = g_strdup_printf (_(
"<sup>*</sup> Available parameters with matching chemical species,\n"
2835 " %s force field energy related parameters in: %s \n"
2836 " if required conversion to FIELD file energy unit will be performed upon selection.\n"
2837 " Please note that comments are directly imported from the force field file.\n"),
2844 str = g_strdup_printf (_(
"Potential: "));
2887 str = g_strdup_printf (_(
" <b>(1)</b> average distance between the 2 atoms\n\tas measured in the 3D model"));
2896 str = g_strdup_printf (_(
" <b>(1)</b> average distance between the barycenters\n\tof units 1 and 2 as measured in the model"));
2934 if (bod -> key != key)
2941 if (bod -> next != NULL) bod = bod -> next;
2997 i = GPOINTER_TO_INT (data);
3005 tmp = g_strdup_printf (_(
"Please enter name for new molecule N°%d"),
tmp_field ->
molecules);
3006 tmp_fmol -> name = g_strdup_printf(
"MOL-%d", i);
3010 tmp_fmol -> name = g_strdup_printf (
"%s", tmp);
3017 tmp = g_strdup_printf (_(
"Please enter name for molecule N°%d"),
row_id+1);
3021 tmp_fmol -> name = g_strdup_printf (
"%s", tmp);
3063 i = GPOINTER_TO_INT (data);
3072 if (fmol -> first_shell == NULL)
3094 if (fmol -> shells == 0) fmol -> first_shell = NULL;
3099 if (fmol -> first_constraint == NULL)
3110 row_id = fmol -> constraints;
3114 fmol -> constraints ++;
3121 if (fmol -> constraints == 0) fmol -> first_constraint = NULL;
3126 if (fmol -> first_pmf == NULL)
3128 fmol -> first_pmf =
init_field_pmf (fmol -> pmfs, NULL, NULL, NULL);
3153 if (fmol -> pmfs == 0) fmol -> first_pmf = NULL;
3158 if (fmol -> first_rigid == NULL)
3180 if (fmol -> rigids == 0) fmol -> first_rigid = NULL;
3185 if (fmol -> first_tethered == NULL)
3196 row_id = fmol -> tethered;
3200 fmol -> tethered ++;
3207 if (fmol -> tethered == 0) fmol -> first_tethered = NULL;
3212 if (
tmp_field -> first_external == NULL)
3273 for (l=0; l<k; l++)
if (
tmp_fbody -> na[l] > -1) save_it = TRUE;
3301 int i, j, k, l, m, n, o;
3302 i = GPOINTER_TO_INT (data);
3308 str = g_strdup_printf (_(
"Delete %s N°%d from molecule %s, is this correct ?"), _(
elemts[i]),
row_id+1,
tmp_fmol -> name);
3312 str = g_strdup_printf (_(
"Delete %s, is this correct ?"), _(
elemts[i]));
3327 tmp_fmol -> first_shell -> prev = NULL;
3346 for (j=0; j<
tmp_fmol -> shells; j++)
3360 tmp_fmol -> first_constraint -> prev = NULL;
3364 tmp_fmol -> first_constraint = NULL;
3379 for (j=0; j<
tmp_fmol -> constraints; j++)
3393 tmp_fmol -> first_pmf -> prev = NULL;
3426 tmp_fmol -> first_rigid -> prev = NULL;
3445 for (j=0; j<
tmp_fmol -> rigids; j++)
3459 tmp_fmol -> first_tethered -> prev = NULL;
3478 for (j=0; j<
tmp_fmol -> tethered; j++)
3492 tmp_field -> first_external -> prev = NULL;
3511 for (k=0; k<
tmp_field -> extern_fields; k++)
3551 tmp_field -> first_body[j] -> prev = NULL;
void field_question(gchar *question, GCallback handler, gpointer data)
ask the use to confirm something
gboolean selection_confirmed
G_MODULE_EXPORT void confirm_selection(GtkDialog *dialog, gint response_id, gpointer data)
confirm that the selection is good
Variable declarations for the MD input preparation assistants.
integer(kind=c_int) function chemistry()
ColRGBA init_color(int id, int numid)
initialize color based id number over total number of elements
field_constraint * get_active_constraint(int a, int b)
retrieve constraint property
field_molecule * get_active_field_molecule(int a)
retrieve field molecule
field_rigid * get_active_rigid(int a, int b)
retrieve rigid property
field_prop * get_active_prop_using_atoms(struct field_prop *pr, int ti, int *ids)
retrieve field molecule structural property using atoms
field_struct * get_active_struct(int s, int a, int b)
retrieve field structural property
field_shell * get_active_shell(int a, int b)
retrieve shell property
field_atom * get_active_atom(int a, int b)
retrieve field atom
field_external * get_active_external(int a)
retrieve external field property
field_nth_body * get_active_body(int a, int b)
retrieve field nth body interaction
field_pmf * get_active_pmf(int a, int b)
retrieve PMF property
field_tethered * get_active_tethered(int a, int b)
retrieve tethered property
GtkTreeViewColumn * ato_col[4]
G_MODULE_EXPORT void run_add_atom_dialog(GtkDialog *add_dialog, gint response_id, gpointer data)
DL-POLY force field atom selection - running the dialog.
G_MODULE_EXPORT void run_select_atom_dialog(GtkDialog *select_dialog, gint response_id, gpointer data)
DL-POLY force field atom selection - creating the dialog.
GtkCellRenderer * ato_cell[4]
field_prop * duplicate_field_prop(field_prop *old_prop, int ti)
create a copy of a field property
GtkWidget * combo_cross(field_nth_body *body)
create field cross configuration widgets
void select_object(int id, int jd, int kd)
select structural element
void field_unselect_all()
unselect all atoms
void run_select_atom_dialog(GtkDialog *select_dialog, gint response_id, gpointer data)
DL-POLY force field atom selection - creating the dialog.
gchar * felemt[MAXDATA+1]
GtkWidget * parameters_box(int obj, int key, gchar **words, float *data)
pepare field property edition parameters
G_MODULE_EXPORT void edit_unit_weight(GtkCellRendererText *cell, gchar *path_string, gchar *new_text, gpointer data)
gchar * body_str(int a)
get body potential string name
void visualize_single_struct(int id, int jd, int kd, int *ids)
visualize single structural element
GtkWidget * shell_hbox[3]
void update_field_dist(float v)
update field distance widget
G_MODULE_EXPORT void add_field_prop(GSimpleAction *action, GVariant *parameter, gpointer data)
add field property callback
G_MODULE_EXPORT void update_field_parameter(GtkEntry *res, gpointer data)
update field parameter entry callback
void update_tersoffs(int id, int key)
update non bonded potential
gboolean are_identical_prop(int ti, int ai, field_prop *pro_a, field_prop *pro_b)
are the 2 field property identicals ?
void select_atom_set_color(GtkCellRenderer *renderer, int i)
set cell renderer color
void check_tersoffs(int id, int key)
check non bonded potential
G_MODULE_EXPORT void run_add_atom_dialog(GtkDialog *add_dialog, gint response_id, gpointer data)
DL-POLY force field atom selection - running the dialog.
G_MODULE_EXPORT void changed_atom_combo(GtkComboBox *box, gpointer data)
change atom
G_MODULE_EXPORT void update_atom_parameter(GtkEntry *res, gpointer data)
update field atom parameter entry callback
void select_atom_set_cmv(GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *mod, GtkTreeIter *iter, gpointer data)
field atom set renderer color, markup and visibility in the property edition atom(s) selection tree s...
GtkWidget * shell_cbox[2]
gchar * get_this_vdw_string()
get VdW formalism description string
ColRGBA init_color(int id, int numid)
initialize color based id number over total number of elements
gboolean tersoff_question()
change Tersoff potential ?
int get_num_vdw_max()
Get the number of field shell interactions.
void compare_non_bonded(gchar *fatom)
compare non bond interaction parameters
void adjust_field_prop(int fil, int sti, field_prop *tmp, int *ids, int key)
adjust field property
G_MODULE_EXPORT void select_atom_id_from_fied_molecule(GtkButton *but, gpointer data)
select atom id from field molecule - creating the dialog
G_MODULE_EXPORT void edit_field_prop(GSimpleAction *action, GVariant *parameter, gpointer data)
edit field property callback
void check_to_visualize_properties_for_this_field_mol(int pid, int mol)
check if rendering is required for object in molecule
GtkWidget * create_field_prop_combo(int f, int is_moy)
create field parameter selection combo box
void adjust_vdw_interactions(gboolean add_shell)
adjust VdW interactions
G_MODULE_EXPORT void select_it(GtkToggleButton *but, gpointer data)
select object toggle callback GTK3
GtkWidget * param_prop_param_box(int pid)
prepare field parameter edition widgets
void field_selection(int i, int viz, int lab, int aid)
select / unselect atom
GtkWidget * field_key_combo
G_MODULE_EXPORT void selection_button(GtkButton *but, gpointer data)
select field object callback
G_MODULE_EXPORT void remove_field_prop(GSimpleAction *action, GVariant *parameter, gpointer data)
remove field property callback
G_MODULE_EXPORT void changed_cross_combo(GtkComboBox *box, gpointer data)
change field cross combo
G_MODULE_EXPORT void field_molecule_select_atom_id(GtkCellRendererToggle *cell_renderer, gchar *string_path, gpointer data)
on select atom in field molecule toggle callback
gboolean body_identicals(field_nth_body *body, int nbd, int *na, int **ma, int **ba)
are these non bonded potentials identicals ?
void check_atom_for_updates()
check for parameters in the database to be used in the force field - creating the dialog
G_MODULE_EXPORT void shell_in_vdw(GtkToggleButton *but, gpointer data)
VdW in shell toggle callback GTK3.
gchar * field_str(int a)
get field external name
G_MODULE_EXPORT void run_edit_parameters(GtkDialog *dialog, gint response_id, gpointer data)
edit field parameter - running the dialog
G_MODULE_EXPORT void visualize_it(GtkToggleButton *but, gpointer data)
visualize object toggle callback GTK3
void visualize_body(int viz, int bd, field_nth_body *body)
show / hide non bonded interaction
GtkWidget * ff_p_combo[2]
void init_default_shaders(glwin *view)
re-initialize the default OpenGL shaders
G_MODULE_EXPORT void changed_field_key_combo(GtkComboBox *box, gpointer data)
change field key
void clean_up_molecules_info(gboolean usel)
prepare molecule related widgets in the assistant
void edit_parameters(int f, int id)
edit field parameter - creating the dialog
gchar * get_body_element_name(field_nth_body *body, int aid, int nbd)
get field body potential element name
G_MODULE_EXPORT void update_cross_parameter(GtkEntry *res, gpointer data)
update field cross parameter entry callback
char * fvars_bond[2][FBONDS][FBONDS_P]
char * fvars_inversion[2][FINVERS][FINVERS_P]
char * fvars_dihedral[2][FDIHEDRAL][FDIHEDRAL_P]
char * fvars_angle[2][FANGLES][FANGLES_P]
char * fvars_vdw[2][FVDW][FVDW_P]
char * fvars_fbd[2][FFOURBODY][FFOURBODY_P]
field_constraint * tmp_fcons
field_nth_body * tmp_fbody
int body_at(int b)
find the number of atom(s) in a non bonded interaction
gchar * fnames[2][16][21]
field_external * tmp_fext
GtkTreeStore * field_model[MAXDATA]
char * fvars_ters[2][FTERSOFFS][FTERSOFFS_P]
int struct_id(int f)
number of atoms in a structural element
void update_field_trees()
classical force field assistant update all tree models
field_molecule * tmp_fmol
char * fvars_tbd[2][FTHREEBODY][FTHREEBODY_P]
field_tethered * tmp_ftet
GType col_type[MAXDATA][12]
GtkWidget * field_assistant
gchar * fkeysw[2][16][21]
gboolean dlp_to_translate(int fid, int obj, int key)
test if fnames text is to be translated or not
classical_field * tmp_field
char * fvars_fext[2][FEXTERNAL][FEXTERNAL_P]
GtkWidget * combo_mol[MOLIMIT-1]
char * fvars_met[2][FMETALS][FMETALS_P]
char * fvars_teth[2][FTETH][FTETH_P]
Variable declarations for the creation of the DL_POLY input file(s).
field_shell * init_field_shell(int id, int ia, int ib)
initialize field core shell interaction
field_tethered * init_field_tethered(int id, int num)
initialize new field tethered potential
int * duplicate_int(int num, int *old_val)
copy a list of int
float get_force_field_atom_mass(int sp, int num)
get force field atomic mass
field_prop * init_field_prop(int ti, int key, gboolean show, gboolean use)
initialize new field molecule structural property
char * field_acro[N_FIELDS]
field_pmf * init_field_pmf(int id, int num[2], int *list[2], float *w[2])
initialize new field mean force potential
float * duplicate_float(int num, float *old_val)
copy a list of float
void visualize_object(int id, int jd, int kd)
visualize object and update OpenGL rendering
field_external * init_field_external(int bi)
initialize new field external potential
field_constraint * init_field_constraint(int id, int ia, int ib)
initialize field bond constraint
field_nth_body * init_field_nth_body(int bi, int bd, int *na, int **ma, int **ba)
initialize new field non bonded interaction
field_rigid * init_field_rigid(int id, int num, int *list)
initialize new field rigid constraint
distance distance_3d(cell_info *cell, int mdstep, atom *at, atom *bt)
distance between atom a and b in 3D
int ** allocdint(int xal, int yal)
allocate an int ** pointer
double * duplicate_double(int num, double *old_val)
copy a list of double
GMainLoop * Event_loop[5]
double *** alloctdouble(int xal, int yal, int zal)
allocate a double *** pointer
int * allocint(int val)
allocate an int * pointer
float * allocfloat(int val)
allocate a float * 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
int combo_get_active(GtkWidget *combo)
retrieve the active item's position
GtkWidget * create_entry(GCallback handler, int dim, int cdim, gboolean key_release, gpointer data)
Create a GtkEntry.
void update_entry_double(GtkEntry *entry, double doubleval)
update the content of a GtkEntry as double
void set_renderer_color(int tocol, GtkCellRenderer *renderer, ColRGBA col)
set the color of a GtkCellRenderer
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
const gchar * entry_get_text(GtkEntry *entry)
get the text in a GtkEntry
GtkWidget * stock_image(const gchar *stock_id)
create a GtkImage for the Gtk database
void set_renderer_markup(GtkTreeModel *mod, GtkTreeIter *iter, GtkCellRenderer *renderer, int col)
set Pango text markup for a GtkCellRenderer
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
GtkWidget * destroy_this_widget(GtkWidget *widg)
destroy a GtkWidget
void update_entry_text(GtkEntry *entry, gchar *text)
update the content of a GtkEntry as string
void add_container_child(int type, GtkWidget *widg, GtkWidget *child)
Add a GtkWidget into another GtkWidget.
void set_image_from_icon_name(GtkWidget *widg, gchar *icon)
set a image from a stock icon name
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
#define MAXDATA
Number of tabs for the description of the classical force field.
void show_the_widgets(GtkWidget *widg)
show GtkWidget
Variable declarations related to the OpenGL window Function declarations related to the OpenGL wind...
Function declarations for the creation of the OpenGL window.
gchar * cask(char *question, char *lab, int id, char *old, GtkWidget *win)
enter a string - prepare the dialog
gboolean ask_yes_no(gchar *title, gchar *text, int type, GtkWidget *widg)
ask yes or no for something: prepare dialog
gchar * exact_name(gchar *name)
short cut to print string without spaces
Messaging function declarations.
integer(kind=c_int) function molecules(frag_and_mol, allbonds)