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)
548 str = g_strdup_printf (
" <b><i>%s</i></b>", words[i]);
557 if (obj == 11 && key == 0)
562 lab =
markup_label (
"<u><i>Cross terms with atom:</i></u>", 160, -1, 0.0, 0.5);
567 for (i=11; i< 14; i++)
570 str = g_strdup_printf (
" <b><i>%s</i></b>", words[i]);
592 str = g_strdup_printf (
"<i>Tabulated</i>");
600 str = g_strdup_printf (
"In %s, non-bonded interactions are evaluated using: \n%s\nTherefore the parameters provided by the force field are incompatible with the DL-POLY options.",
field_acro[
tmp_field -> type],
get_this_vdw_string());
606 else if (obj == 9 && key == 0 && (
tmp_field -> type <= CVFF_AUG || tmp_field -> type >
COMPASS))
610 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>"
611 " are calculated using Ɛ<sub>i/j</sub> and r0<sub>i/j</sub> provided by the force field parameters.",
615 str = g_strdup_printf (
"%s\nScaled 1-4 exclusion parameters, provided by the %s force field, are ignored.", str,
field_acro[
tmp_field -> type]);
620 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>"
621 " are calculated using A<sub>i/j</sub> and B<sub>i/j</sub> provided by the force field parameters.",
632 str = g_strdup_printf (
"Urey-Bradley terms provided by the %s force field are ignored.\n",
field_acro[
tmp_field -> type]);
650 gchar * str = g_strdup_printf (
"External field");
653 str = g_strdup_printf (
"%s: <b>%s</b>", str,
fnames[
activef][15][
a]);
665 gchar *
text =
"Are you sure to want to change the type of Tersoff potential ?\n"
666 "<i>Tersoff (ter)</i> and <i>KIHS (kihs)</i> forms cannot be mixed\n"
667 "Therefore this choice will affect <b>all</b> Tersoff potential(s)"
668 "Any previous parameters will be erased !";
743 gboolean changeit = FALSE;
744 i = GPOINTER_TO_INT(data);
774 gtk_label_set_use_markup (GTK_LABEL(
body_lab), TRUE);
794 else if (j == 1 &&
cross != NULL)
829G_MODULE_EXPORT
void visualize_it (GtkCheckButton * but, gpointer data)
839G_MODULE_EXPORT
void visualize_it (GtkToggleButton * but, gpointer data)
843 i = GPOINTER_TO_INT (data);
878G_MODULE_EXPORT
void select_it (GtkCheckButton * but, gpointer data)
888G_MODULE_EXPORT
void select_it (GtkToggleButton * but, gpointer data)
892 i = GPOINTER_TO_INT (data);
924 GtkTreeStore **
model = (GtkTreeStore **)data;
926 int h, i, j, k, l, m, n;
927 GtkTreePath *
path = gtk_tree_path_new_from_string (string_path);
928 gtk_tree_model_get_iter (GTK_TREE_MODEL(*
model), & iter,
path);
929 gtk_tree_model_get (GTK_TREE_MODEL(*
model), & iter, 0, & i, -1);
930 if (gtk_cell_renderer_toggle_get_active(cell_renderer))
996 if (tmp_fbo ->
id == h)
1001 else if (tmp_fbo -> next != NULL)
1003 tmp_fbo = tmp_fbo -> next;
1009 gtk_tree_store_set (*
model, & iter, 3+j,
toviz.
c, -1);
1038void select_atom_set_cmv (GtkTreeViewColumn *
col, GtkCellRenderer * renderer, GtkTreeModel * mod, GtkTreeIter * iter, gpointer data)
1042 gtk_tree_model_get (mod, iter, 0, & h, -1);
1045 gtk_tree_model_get (mod, iter, 1, & i, -1);
1051 j = GPOINTER_TO_INT(data);
1055 gtk_cell_renderer_set_visible (renderer, ! i);
1060 gtk_tree_model_get (mod, iter, 1, & str, -1);
1061 g_object_set (renderer,
"markup", str, NULL, NULL);
1065 gtk_cell_renderer_set_visible (renderer, i);
1068 gtk_tree_model_get (mod, iter, 2, & str, -1);
1069 g_object_set (renderer,
"markup", str, NULL, NULL);
1071 gtk_cell_renderer_set_visible (renderer, i);
1074 gtk_cell_renderer_set_visible (renderer, ! i);
1081 gtk_tree_model_get (mod, iter, 3, & k, -1);
1089 gtk_cell_renderer_set_visible (renderer, TRUE);
1093 gtk_cell_renderer_set_visible (renderer, !
a_ato);
1098 gtk_cell_renderer_set_visible (renderer, ! i);
1106 if (
sel_at[0][i]+1 == abs(h))
break;
1122 k = (
sel_at[0][h-1]) ? h : 0;
1126 gtk_tree_model_get (mod, iter, 3, & k, -1);
1144G_MODULE_EXPORT
void edit_unit_weight (GtkCellRendererText * cell, gchar * path_string, gchar * new_text, gpointer data)
1146 GtkTreeStore **
model = (GtkTreeStore **)data;
1149 GtkTreePath *
path = gtk_tree_path_new_from_string (path_string);
1150 gtk_tree_model_get_iter (GTK_TREE_MODEL(*
model), & iter,
path);
1151 gtk_tree_model_get (GTK_TREE_MODEL(*
model), & iter, 0, & i, -1);
1165 int i, j, k, l, m, n, o, p, q;
1166 GtkTreeIter id_level;
1167 GtkTreeIter atom_level;
1168 GtkTreeViewColumn *
ato_col[5];
1170 gchar * ato_title[5] = {
"Atom Id",
"Fragment",
"Atom",
"Weight (1)",
"Viz.3D & Select"};
1171 gchar * nbd_title[5] = {
"Atom Id",
"Field atom",
"Field molecule(s)",
" ",
"Viz.3D & Select"};
1172 gchar * ctype[5]={
"text",
"text",
"text",
"text",
"active"};
1173 GType
col_type[2][5] = {{G_TYPE_INT, G_TYPE_INT, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_FLOAT},
1174 {G_TYPE_INT, G_TYPE_INT, G_TYPE_STRING, G_TYPE_FLOAT, G_TYPE_BOOLEAN}};
1175 GType cbl_type[4] = {G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN};
1184 str = g_strdup_printf (
"Please select the new atom(s)");
1189 str = g_strdup_printf (
"Please select the atom(s) to freeze / unfreeze");
1194 str = g_strdup_printf (
"Please select the core atom");
1199 str = g_strdup_printf (
"Please select the atom(s) to shell");
1204 str = g_strdup_printf (
"Please select the first atom");
1209 str = g_strdup_printf (
"Please select the second atom");
1214 str = g_strdup_printf (
"Please select the atom(s) in the first unit");
1217 str = g_strdup_printf (
"Please select the atom(s) in the second unit");
1220 str = g_strdup_printf (
"Please select the atom(s) in the rigid unit");
1224 str = g_strdup_printf (
"Please select the tethered atom");
1231 str = g_strdup_printf (
"Please select the type of field atom");
1235 str = g_strdup_printf (
"Please select the first type of field atom");
1239 str = g_strdup_printf (
"Please select the second type of field atom");
1242 str = g_strdup_printf (
"Please select the third type of field atom");
1245 str = g_strdup_printf (
"Please select the fourth type of field atom");
1250 gtk_dialog_add_button (GTK_DIALOG(amol),
"Apply", GTK_RESPONSE_APPLY);
1259 add_model = gtk_tree_store_newv (4, cbl_type);
1267 for (i=0; i<4+q; i++)
1272 ato_cell[i] = gtk_cell_renderer_text_new ();
1277 ato_cell[i] = gtk_cell_renderer_toggle_new ();
1278 if (
active_sel > 1) gtk_cell_renderer_toggle_set_radio (GTK_CELL_RENDERER_TOGGLE(
ato_cell[i]), TRUE);
1283 ato_col[i] = gtk_tree_view_column_new_with_attributes (ato_title[k],
ato_cell[i], ctype[k], i, NULL);
1287 ato_col[i] = gtk_tree_view_column_new_with_attributes (nbd_title[k],
ato_cell[i], ctype[k], i, NULL);
1290 gtk_tree_view_column_set_alignment (
ato_col[i], 0.5);
1294 g_object_set (
ato_cell[i],
"editable", TRUE, NULL);
1315 if (g_strcmp0 (
get_active_atom (tmp_fbo -> ma[0][0], tmp_fbo ->
a[0][0]) -> name,
1316 get_active_atom (tmp_fbo -> ma[1][0], tmp_fbo ->
a[1][0]) -> name) == 0) k ++;
1317 if (tmp_fbo -> next != NULL) tmp_fbo = tmp_fbo -> next;
1346 gtk_tree_store_append (
add_model, & id_level, NULL);
1347 gtk_tree_store_set (
add_model, & id_level, 0,
sel_at[0][i]+1, 1, 0, 3, 0, -1);
1351 gtk_tree_path_to_string(gtk_tree_model_get_path(GTK_TREE_MODEL(
add_model), & id_level)),
1356 gtk_tree_store_append (
add_model, & atom_level, & id_level);
1361 gtk_tree_store_set (
add_model, & atom_level, 0, -(
sel_at[0][i]+1), 1,
tmp_fmol -> fragments[j]+1, 2, str, -1);
1372 gtk_tree_store_append (
add_model, & id_level, NULL);
1373 gtk_tree_store_set (
add_model, & id_level, 0, i+1, 1, 0, 3, 0, -1);
1377 gtk_tree_store_append (
add_model, & atom_level, & id_level);
1380 gtk_tree_store_set (
add_model, & atom_level, 0, -(i+1), 1,
tmp_fmol -> fragments[j]+1, 2, str, -1);
1393 gtk_tree_store_append (
add_model, & id_level, NULL);
1421 gtk_tree_store_set (
add_model, & id_level, 0, i+1, 1, 0, 3, 0, -1);
1425 gtk_tree_path_to_string(gtk_tree_model_get_path(GTK_TREE_MODEL(
add_model), & id_level)),
1430 gtk_tree_store_append (
add_model, & atom_level, & id_level);
1433 gtk_tree_store_set (
add_model, & atom_level, 0, -(i+1), 1,
tmp_fmol -> fragments[j]+1, 2, str, -1);
1447 if (g_strcmp0 (
get_active_atom (tmp_fbo -> ma[0][0], tmp_fbo ->
a[0][0]) -> name,
1455 if (g_strcmp0 (
get_active_atom (tmp_fbo -> ma[0][0], tmp_fbo ->
a[0][0]) -> name,
1461 gtk_tree_store_append (
add_model, & id_level, NULL);
1465 if (g_strcmp0 (
get_active_atom (tmp_fbo -> ma[0][0], tmp_fbo ->
a[0][0]) -> name,
1473 gtk_tree_store_set (
add_model, & id_level, 0, k+1, 1,
1475 sel_at[0][k] = tmp_fbo -> id;
1476 for (j=0; j<tmp_fbo -> na[0]; j++)
1478 gtk_tree_store_append (
add_model, & atom_level, & id_level);
1484 if (tmp_fbo -> next != NULL) tmp_fbo = tmp_fbo -> next;
1505 for (l=0; l<
tmp_fpmf -> num[k]; l++)
1517 gtk_tree_store_append (
add_model, & id_level, NULL);
1521 for (l=0; l<
tmp_fpmf -> num[m]; l++)
1532 gtk_tree_store_set (
add_model, & id_level, 0, i+1, 1, 0, 3,
val_at[i], 4, 0, -1);
1536 gtk_tree_path_to_string(gtk_tree_model_get_path(GTK_TREE_MODEL(
add_model), & id_level)),
1541 gtk_tree_store_append (
add_model, & atom_level, & id_level);
1544 gtk_tree_store_set (
add_model, & atom_level, 0, -(i+1), 1,
tmp_fmol -> fragments[l]+1, 2, str, -1);
1560 i = ((j+1)*37 < 500) ? (j+1)*37 : 500;
1563 GtkWidget * scrollsets =
create_scroll (
vbox, 320+q*100, i, GTK_SHADOW_ETCHED_IN);
1568 str = g_strdup_printf (
" <b>(1)</b> if all 0.0 then atomic weight(s) will be used by DL-POLY");
1574 str = g_strdup_printf (
"The atom(s) above will be described\n"
1575 "in the force field using the parameters\n"
1576 "of the <b>%s</b> field atom.\n",
tmp_fat -> name);
1590 str = g_strdup_printf (
"%d atom(s)",
tmp_fat -> frozen);
1591 if (but) gtk_button_set_label (but, str);
1613 str = g_strdup_printf (
" ");
1617 str = g_strdup_printf (
"<b>%8.3f</b>", v);
1619 gtk_label_set_text (GTK_LABEL(
av_lgt), str);
1620 gtk_label_set_use_markup (GTK_LABEL(
av_lgt), TRUE);
1641 if (i < j-1 && j > 1) str = g_strdup_printf (
"%s - ", str);
1643 str = g_strdup_printf (
"%s</b>", str);
1658 int i, j, k, l, m, n, o, p, q, r;
1659 i = GPOINTER_TO_INT(data);
1660 gchar * stra = NULL;
1661 gchar * strb = NULL;
1662 if (i == 2 || i == 3)
1667 stra = g_strdup_printf (
"Not picked yet !");
1668 strb = g_strdup_printf (
DELETEB);
1675 strb = g_strdup_printf (
APPLY);
1678 else if (i == 4 || i == 5)
1683 stra = g_strdup_printf (
"Not picked yet !");
1684 strb = g_strdup_printf (
DELETEB);
1691 strb = g_strdup_printf (
APPLY);
1694 else if (i == 6 || i == 7)
1699 stra = g_strdup_printf (
"Not picked yet !");
1700 strb = g_strdup_printf (
DELETEB);
1704 stra = g_strdup_printf (
"%d atom(s)",
tmp_fpmf -> num[j]);
1705 strb = g_strdup_printf (
APPLY);
1713 stra = g_strdup_printf (
"Not picked yet !");
1714 strb = g_strdup_printf (
DELETEB);
1718 stra = g_strdup_printf (
"%d atom(s)",
tmp_frig -> num);
1719 strb = g_strdup_printf (
APPLY);
1727 stra = g_strdup_printf (
"Not picked yet !");
1728 strb = g_strdup_printf (
DELETEB);
1734 strb = g_strdup_printf (
APPLY);
1737 else if (i == 11 || i == 12 || i == 13 || i == 14)
1742 stra = g_strdup_printf (
"Not picked yet !");
1743 strb = g_strdup_printf (
DELETEB);
1748 strb = g_strdup_printf (
APPLY);
1767 gtk_label_set_use_markup (GTK_LABEL(
body_lab), TRUE);
1771 if (i == 4 || i == 5)
1791 else if (i == 6 || i == 7)
1797 gboolean all_zero = TRUE;
1801 for (l=0; l<
tmp_fpmf -> num[k]; l++)
1803 if (
tmp_fpmf -> weight[k][l] != 0.0)
1809 if (! all_zero)
break;
1823 for (l=0; l<
tmp_fpmf -> num[k]; l++)
1852 at[k][n].
x /= ma[k][n];
1853 at[k][n].
y /= ma[k][n];
1854 at[k][n].
z /= ma[k][n];
1862 gtk_button_set_label (but, stra);
1863 gtk_widget_set_size_request ((GtkWidget *)but, 150, -1);
1878 i = GPOINTER_TO_INT(data);
1929 i = body -> ma[aid][0];
1932 return g_strdup_printf (
"%s",
get_active_atom (i, body ->
a[aid][0]) -> name);
1954 gchar * stra, * strb, * strc, * strd;
1978 gboolean
res = FALSE;
1979 if (g_strcmp0(stra, strc) == 0 && g_strcmp0(strb, strd) == 0)
res = TRUE;
1980 if (g_strcmp0(stra, strd) == 0 && g_strcmp0(strb, strc) == 0)
res = TRUE;
2003 i += molff ->
atoms;
2004 shellff = molff -> first_shell;
2007 if (shellff -> use && shellff -> vdw && shellff -> ia[0] > -1) i ++;
2008 shellff = shellff -> next;
2010 molff = molff -> next;
2024 int i, j, k, l, m, n;
2032 n = (add_shell) ? i * (i-1) / 2 : (i+1) * (i+2) / 2;
2038 k = bodyff -> ma[j][0];
2039 if (bodyff ->
a[j][0] >= n)
2041 bodyff ->
a[j][0] -= n;
2042 bodyff ->
a[j][0] += m;
2045 bodyff = bodyff -> next;
2051 gchar ** to_be_vdw = g_malloc (i*
sizeof*to_be_vdw);
2056 int * vdw_a[2], * vdw_ma[2];
2062 atff = molff -> first_atom;
2068 if (g_strcmp0 (to_be_vdw[k], atff -> name) == 0)
2072 vdw_mids[k][vdw_mlist[k]] = molff -> id;
2073 vdw_aids[k][vdw_mlist[k]] = atff -> id;
2079 to_be_vdw[k] = g_strdup_printf (
"%s", atff -> name);
2080 vdw_mids[k][0] = molff -> id;
2081 vdw_aids[k][0] = atff -> id;
2084 atff = atff -> next;
2086 shellff = molff -> first_shell;
2089 if (shellff -> use && shellff -> vdw && shellff -> ia[0] > -1)
2093 str = g_strdup_printf (
"%s_sh", atff -> name);
2096 if (g_strcmp0 (to_be_vdw[k], str) == 0)
2100 vdw_mids[k][vdw_mlist[k]] = molff -> id;
2101 vdw_aids[k][vdw_mlist[k]] = shellff ->
id + nbd;
2107 to_be_vdw[k] = g_strdup_printf (
"%s", str);
2108 vdw_mids[k][0] = molff -> id;
2109 vdw_aids[k][0] = shellff ->
id + nbd;
2114 shellff = shellff -> next;
2116 molff = molff -> next;
2125 vdw_na[0] = vdw_na[1] = vdw_mlist[k]+1;
2126 vdw_a[0] = vdw_a[1] =
duplicate_int (vdw_na[0], vdw_aids[k]);
2127 vdw_ma[0] = vdw_ma[1] =
duplicate_int (vdw_na[0], vdw_mids[k]);
2129 bodyff = bodyff -> next;
2135 bodyff -> next -> prev = bodyff;
2139 for (m=0; m<l-1; m++)
2141 for (n=m+1; n<l; n++)
2146 vdw_na[0] = vdw_mlist[m]+1;
2147 vdw_na[1] = vdw_mlist[n]+1;
2153 bodyff = bodyff -> next;
2159 bodyff -> next -> prev = bodyff;
2169 gchar * str = g_strdup_printf (
"%s_sh", atff -> name);
2170 gchar * stra, * strb;
2177 if (g_strcmp0(str,stra) == 0 || g_strcmp0(str,strb) == 0)
2181 bodyff -> prev -> next = bodyff -> next;
2182 bodyff -> next -> prev = bodyff -> prev;
2186 bodyff = bodyff -> prev;
2187 g_free (bodyff -> next);
2188 bodyff -> next = NULL;
2194 bodyff = bodyff -> next;
2210G_MODULE_EXPORT
void shell_in_vdw (GtkCheckButton * but, gpointer data)
2245 else if (
rep.
a == 1)
2268 gchar * str = g_strdup_printf (
"%s parameter(s)",
felemts[f+1]);
2278 gchar * cs_name[3]={
"Core atom: ",
"Shell atom: ",
"Selection: "};
2279 gchar * cs_param[4]={
"Mass:",
"Charge:",
"<i>k<sub>2</sub></i> ",
"<i>k<sub>4</sub></i> "};
2280 gchar * cs_unit[4]={
"g mol<sup>-1</sup>",
" ",
"Å<sup>-2</sup>",
"Å<sup>-4</sup>"};
2281 gchar * co_name[4]={
"First atom: ",
"Second atom: ",
"Third atom: ",
"Fourth atom: "};
2282 gchar * pm_name[2]={
"First unit: ",
"Second unit: "};
2287 show_it = use_it = FALSE;
2305 str = g_strdup_printf (
"Element:");
2315 str = g_strdup_printf (
"Field parameters:");
2324 g_signal_connect (G_OBJECT(combo),
"changed", G_CALLBACK(
changed_atom_combo), GINT_TO_POINTER(0));
2328 str = g_strdup_printf (
"Force field type <sup>*</sup>:");
2339 if (g_strcmp0 (
ff_atoms[j][3],
" ") != 0) str = g_strdup_printf (
"%s : %s", str,
ff_atoms[j][3]);
2350 str = g_strdup_printf (
"Name: ");
2359 str = g_strdup_printf (
"Mass: ");
2368 str = g_strdup_printf (
"Charge: ");
2377 str = g_strdup_printf (
"Frozen: ");
2381 str = g_strdup_printf (
"%d atom(s)",
tmp_fat -> frozen);
2389 str = g_strdup_printf (
"\tCore-Shell N°<b>%d</b>",
tmp_fshell ->
id+1);
2399 str = g_strdup_printf (
"Not picked yet !");
2484 str = g_strdup_printf (
"%s", cs_unit[k]);
2498 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);
2506 str = g_strdup_printf (
"\tBond constraint N°<b>%d</b>",
tmp_fcons ->
id+1);
2516 str = g_strdup_printf (
"Not picked yet !");
2532 str = g_strdup_printf (
"Av. distance (1): ");
2538 str = g_strdup_printf (
"[Å]");
2543 str = g_strdup_printf (
"Length: ");
2550 str = g_strdup_printf (
"[Å]");
2561 str = g_strdup_printf (
"\tMean force potential N°<b>%d</b>",
tmp_fpmf ->
id+1);
2571 str = g_strdup_printf (
"Not picked yet !");
2576 str = g_strdup_printf (
"%d atom(s)",
tmp_fpmf -> num[k]);
2587 str = g_strdup_printf (
"Av. d<sub>1-2</sub> (1): ");
2593 str = g_strdup_printf (
"[Å]");
2599 str = g_strdup_printf (
"Length: ");
2606 str = g_strdup_printf (
"[Å]");
2617 str = g_strdup_printf (
"\tRigid unit N°<b>%d</b>",
id+1);
2623 str = g_strdup_printf (
"Atom(s): ");
2629 str = g_strdup_printf (
"Not picked yet !");
2634 str = g_strdup_printf (
"%d atom(s)",
tmp_frig -> num);
2648 str = g_strdup_printf (
"\tTethered atom N°<b>%d</b>",
id+1);
2654 str = g_strdup_printf (
"Atom: ");
2660 str = g_strdup_printf (
"Not picked yet !");
2689 str = g_strdup_printf (
"\t%s type N°<b>%d</b>\n\tField atoms: <b>",
mo_title[f-7],
id+1);
2692 if (k == m-1) str = g_strdup_printf (
"%s</b> and <b>", str);
2694 if (m > 2 && k < m-1) str = g_strdup_printf (
"%s</b>, <b>", str);
2696 str = g_strdup_printf (
"%s</b>", str);
2701 str = g_strdup_printf (
"%s\n\tBetween atoms: <b>", str);
2706 if (k == m-1) str = g_strdup_printf (
"%s</b> and <b>", str);
2707 str = g_strdup_printf (
"%s%s", str, ba);
2708 if (m > 2 && k < m-1) str = g_strdup_printf (
"%s</b>, <b>", str);
2710 str = g_strdup_printf (
"%s</b>", str);
2762 str = g_strdup_printf (
"Not picked yet !");
2785 lab =
markup_label(
"Visualize in the model: ", (f == 1) ? 150 : 185, 40, 0.0, 0.5);
2787 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);
2792 str = g_strdup_printf (
"<sup>*</sup> this will be used to adjust bonding, angles, etc ... accordingly,\n"
2793 " providing that some parameters can be found in the force field data.\n"
2794 " Please note that comments are directly imported from the force field file.");
2803 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);
2807 if (f > 6 && f < 16)
2812 gchar * funits[5] ={
"Ev",
"kcal mol<sup>-1</sup>",
"kJ mol<sup>-1</sup>",
"K B<sup>-1</sup>",
"DL_POLY internal units"};
2813 str = g_strdup_printf (
"Field parameters <sup>*</sup>:");
2819 str = g_strdup_printf (
"<sup>*</sup> Available parameters with matching chemical species,\n"
2820 " %s force field energy related parameters in: %s \n"
2821 " if required conversion to FIELD file energy unit will be performed upon selection.\n"
2822 " Please note that comments are directly imported from the force field file.\n",
2829 str = g_strdup_printf (
"Potential: ");
2872 str = g_strdup_printf (
" <b>(1)</b> average distance between the 2 atoms\n"
2873 "\tas measured in the 3D model");
2882 str = g_strdup_printf (
" <b>(1)</b> average distance between the barycenters\n"
2883 "\tof units 1 and 2 as measured in the model");
2921 if (bod -> key != key)
2928 if (bod -> next != NULL) bod = bod -> next;
2984 i = GPOINTER_TO_INT (data);
2992 tmp = g_strdup_printf (
"Please enter name for new molecule N°%d",
tmp_field ->
molecules);
2993 tmp_fmol -> name = g_strdup_printf(
"MOL-%d", i);
2997 tmp_fmol -> name = g_strdup_printf (
"%s", tmp);
3004 tmp = g_strdup_printf (
"Please enter name for molecule N°%d",
row_id+1);
3008 tmp_fmol -> name = g_strdup_printf (
"%s", tmp);
3050 i = GPOINTER_TO_INT (data);
3059 if (fmol -> first_shell == NULL)
3081 if (fmol -> shells == 0) fmol -> first_shell = NULL;
3086 if (fmol -> first_constraint == NULL)
3097 row_id = fmol -> constraints;
3101 fmol -> constraints ++;
3108 if (fmol -> constraints == 0) fmol -> first_constraint = NULL;
3113 if (fmol -> first_pmf == NULL)
3115 fmol -> first_pmf =
init_field_pmf (fmol -> pmfs, NULL, NULL, NULL);
3140 if (fmol -> pmfs == 0) fmol -> first_pmf = NULL;
3145 if (fmol -> first_rigid == NULL)
3167 if (fmol -> rigids == 0) fmol -> first_rigid = NULL;
3172 if (fmol -> first_tethered == NULL)
3183 row_id = fmol -> tethered;
3187 fmol -> tethered ++;
3194 if (fmol -> tethered == 0) fmol -> first_tethered = NULL;
3199 if (
tmp_field -> first_external == NULL)
3260 for (l=0; l<k; l++)
if (
tmp_fbody -> na[l] > -1) save_it = TRUE;
3288 int i, j, k, l, m, n, o;
3289 i = GPOINTER_TO_INT (data);
3295 str = g_strdup_printf (
"Delete %s N°%d from molecule %s, is this correct ?",
elemts[i],
row_id+1,
tmp_fmol -> name);
3299 str = g_strdup_printf (
"Delete %s, is this correct ?",
elemts[i]);
3314 tmp_fmol -> first_shell -> prev = NULL;
3333 for (j=0; j<
tmp_fmol -> shells; j++)
3347 tmp_fmol -> first_constraint -> prev = NULL;
3351 tmp_fmol -> first_constraint = NULL;
3366 for (j=0; j<
tmp_fmol -> constraints; j++)
3380 tmp_fmol -> first_pmf -> prev = NULL;
3413 tmp_fmol -> first_rigid -> prev = NULL;
3432 for (j=0; j<
tmp_fmol -> rigids; j++)
3446 tmp_fmol -> first_tethered -> prev = NULL;
3465 for (j=0; j<
tmp_fmol -> tethered; j++)
3479 tmp_field -> first_external -> prev = NULL;
3498 for (k=0; k<
tmp_field -> extern_fields; k++)
3538 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()
void label(cairo_t *cr, double val, int axe, int p, project *this_proj)
draw axis label
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]
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.
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
gchar * felemts[MAXDATA+1]
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]
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
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)