atomes 1.3.1
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
dlp_field.c
Go to the documentation of this file.
1/* This file is part of the 'atomes' software
2
3'atomes' is free software: you can redistribute it and/or modify it under the terms
4of the GNU Affero General Public License as published by the Free Software Foundation,
5either version 3 of the License, or (at your option) any later version.
6
7'atomes' is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
8without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9See the GNU General Public License for more details.
10
11You should have received a copy of the GNU Affero General Public License along with 'atomes'.
12If not, see <https://www.gnu.org/licenses/>
13
14Copyright (C) 2022-2026 by CNRS and University of Strasbourg */
15
22
23/*
24* This file: 'dlp_field.c'
25*
26* Contains:
27*
28
29 - The functions to prepare the DL-POLY / LAMMPS input preparation assistant
30 - The functions to design a classical force field
31
32*
33* List of functions:
34
35 int struct_id (int f);
36 int body_at (int b);
37 int get_field_tree_data (GtkWidget * tree, int treeid, GtkTreePath * path);
38 int get_field_data_id (int k, gchar * data);
39
40 G_MODULE_EXPORT gint on_assistant_go_forward (gint current_page, gpointer data);
41
42 gboolean dlp_to_translate (int fid, int obj, int key);
43 gboolean set_nbd_but_sensitive (int nbid);
44 gboolean field_file_has_energy_parameters (gboolean scale, int sca, int scb);
45
46 G_MODULE_EXPORT gboolean on_pop_up_field (GtkWidget * widget, gpointer data);
47 G_MODULE_EXPORT gboolean on_field_button_event (GtkWidget * widget, GdkEvent * event, gpointer data);
48 G_MODULE_EXPORT gboolean on_assistant_cancel_event (GtkWindow * assistant, gpointer data);
49 G_MODULE_EXPORT gboolean on_assistant_cancel_event (GtkWidget * assistant, GdkEvent * event, gpointer data);
50
51 gchar * parameters_info (int obj, int key, gchar ** words, float * data);
52 gchar * set_field_label (int f, int m);
53 gchar * pop_info (int i, int id);
54 gchar * pop_edit (int i);
55 gchar * pop_add (int i);
56 gchar * pop_remove (int i);
57
58 void set_mol_num_label ();
59 void setup_cs_labels (int i);
60 void fill_field_struct (GtkTreeStore * store, int id, int mo);
61 void fill_field_body (GtkTreeStore * store, int id);
62 void fill_field_model (GtkTreeStore * store, int f, int m);
63 void update_field_trees ();
64 void get_is_energy (int i, int l);
65 void append_field_item (GMenu * menu, const gchar * name, const gchar * key, int item_id,
66 gchar * accel, int image_format, gpointer icon,
67 gboolean custom, GCallback handler, gpointer data,
68 gboolean check, gboolean status, gboolean radio, gboolean sensitive);
69 void pop_up_field_context_menu (int row_id, GtkWidget * widget, double event_x, double event_y, gpointer data);
70 void pop_up_field_context_menu (int row_id, GtkWidget * widget, GdkEvent * event, gpointer data);
71 void field_button_event (double event_x, double event_y, guint event_button, guint event_type, guint32 event_time, gpointer data);
72 void field_button_event (GdkEvent * event, double event_x, double event_y, guint event_button, guint event_type, guint32 event_time, gpointer data);
73 void field_set_color (GtkTreeViewColumn * col, GtkCellRenderer * renderer, GtkTreeModel * mod, GtkTreeIter * iter, gpointer data);
74 void field_set_markup_box (GtkTreeViewColumn * col, GtkCellRenderer * renderer, GtkTreeModel * mod, GtkTreeIter * iter, gpointer data);
75 void field_set_markup (GtkTreeViewColumn * col, GtkCellRenderer * renderer, GtkTreeModel * mod, GtkTreeIter * iter, gpointer data);
76 void field_set_visible (GtkTreeViewColumn * col, GtkCellRenderer * renderer, GtkTreeModel * mod, GtkTreeIter * iter, gpointer data);
77 void field_set_color_and_markup (GtkTreeViewColumn * col, GtkCellRenderer * renderer, GtkTreeModel * mod, GtkTreeIter * iter, gpointer data);
78 void field_set_color_and_visible (GtkTreeViewColumn * col, GtkCellRenderer * renderer, GtkTreeModel * mod, GtkTreeIter * iter, gpointer data);
79 void prop_set_color_and_visible (GtkTreeViewColumn * col, GtkCellRenderer * renderer, GtkTreeModel * mod, GtkTreeIter * iter, gpointer data);
80 void pmf_set_color_and_visible (GtkTreeViewColumn * col, GtkCellRenderer * renderer, GtkTreeModel * mod, GtkTreeIter * iter, gpointer data);
81 void rig_set_color_and_visible (GtkTreeViewColumn * col, GtkCellRenderer * renderer, GtkTreeModel * mod, GtkTreeIter * iter, gpointer data);
82 void field_set_color_markup_and_visible (GtkTreeViewColumn * col, GtkCellRenderer * renderer, GtkTreeModel * mod, GtkTreeIter * iter, gpointer data);
83 void field_set_color_markup_and_visible_box (GtkTreeViewColumn * col, GtkCellRenderer * renderer, GtkTreeModel * mod, GtkTreeIter * iter, gpointer data);
84 void get_field_iter_and_edit (gchar * path_string, gpointer data);
85 void create_field_list (GtkWidget * vbx, int f);
86 void close_the_assistant (GtkAssistant * assistant);
87 void hide_show_this_pages (int start, int end, int status, int delta);
88 void remove_classical_assistant_pages ();
89 void add_classical_assistant_pages (int p);
90 void create_ff_structure (int ai, int type);
91 void on_assistant_apply (GtkAssistant * assistant, gpointer data);
92 void create_classical_force_field (int p, int f);
93
94 G_MODULE_EXPORT void toggle_field_params (GtkCheckButton * but, gpointer data);
95 G_MODULE_EXPORT void toggle_field_params (GtkToggleButton * but, gpointer data);
96 G_MODULE_EXPORT void changed_mol_box (GtkComboBox * box, gpointer data);
97 G_MODULE_EXPORT void run_changed_energy_unit (GtkDialog * dialog, gint response_id, gpointer data);
98 G_MODULE_EXPORT void changed_energy_unit (GtkComboBox * box, gpointer data);
99 G_MODULE_EXPORT void changed_field_key_renderer (GtkCellRendererCombo * combo, gchar * path_string, GtkTreeIter * iter, gpointer data);
100 G_MODULE_EXPORT void to_select_atom_id_from_fied_molecule (GSimpleAction * action, GVariant * parameter, gpointer data);
101 G_MODULE_EXPORT void on_field_button_pressed (GtkGesture * gesture, int n_press, double x, double y, gpointer data);
102 G_MODULE_EXPORT void on_field_button_released (GtkGesture * gesture, int n_press, double x, double y, gpointer data);
103 G_MODULE_EXPORT void edit_field_cell (GtkCellRendererText * cell, gchar * path_string, gchar * new_text, gpointer data);
104 G_MODULE_EXPORT void to_edit_field_prop (GtkCellRenderer * cell, GtkCellEditable * editable, gchar * path_string, gpointer data);
105 G_MODULE_EXPORT void on_field_row_activated (GtkTreeView * treeview, GtkTreePath * path, GtkTreeViewColumn * col, gpointer data);
106 G_MODULE_EXPORT void on_assistant_cancel (GtkAssistant * assistant, gpointer data);
107 G_MODULE_EXPORT void on_assistant_close (GtkAssistant * assistant, gpointer data);
108 G_MODULE_EXPORT void on_assistant_prepare (GtkAssistant * assistant, GtkWidget * page, gpointer data);
109 G_MODULE_EXPORT void run_clean_field (GtkDialog * dial, gint response_id, gpointer data);
110 G_MODULE_EXPORT void clean_field (GtkCheckButton * but, gpointer data);
111 G_MODULE_EXPORT void clean_field (GtkToggleButton * but, gpointer data);
112 G_MODULE_EXPORT void select_field_action (GtkCheckButton * but, gpointer data);
113 G_MODULE_EXPORT void select_field_action (GtkToggleButton * but, gpointer data);
114 G_MODULE_EXPORT void changed_init_box (GtkComboBox * box, gpointer data);
115 G_MODULE_EXPORT void show_force_field_preview (GtkButton * but, gpointer data);
116 G_MODULE_EXPORT void run_on_assistant_apply (GtkNativeDialog * info, gint response_id, gpointer data);
117 G_MODULE_EXPORT void run_on_assistant_apply (GtkDialog * info, gint response_id, gpointer data);
118
119 GtkWidget * vbox_init (int p);
120 GtkWidget * create_combo_mol (int f);
121 GtkWidget * create_field_tree (int f);
122 GtkWidget * create_mol_box (int f);
123 GtkWidget * vbox_field (int f);
124
125*/
126
127#include "dlp_field.h"
128#include "calc.h"
129#include "callbacks.h"
130#include "interface.h"
131#include "project.h"
132#include "glwindow.h"
133#include "glview.h"
134#include "bind.h"
135
137extern GtkWidget * extra_vbox[2];
138extern ColRGBA init_color (int id, int numid);
139extern void restore_ogl_selection (glwin * view);
140
141gchar * felemts[MAXDATA+1] = {i18n("Energy unit"),
142 i18n("Molecule(s)"),
143 i18n("Atom(s)"),
144 i18n("Core-shell unit(s)"),
145 i18n("Constraint bond(s)"),
146 i18n("Mean force potential(s)"),
147 i18n("Rigid unit(s)"),
148 i18n("Tethering potential(s)"),
149 i18n("Flexible chemical bond(s)"),
150 i18n("Bond restraint(s)"),
151 i18n("Bond angle(s)"),
152 i18n("Angular restraint(s)"),
153 i18n("Dihedral angle(s)"),
154 i18n("Torsional restraint(s)"),
155 i18n("Improper angle(s)"),
156 i18n("Inversion angle(s)"),
157 i18n("van der Waals potential(s)"),
158 i18n("Metal potential(s)"),
159 i18n("Tersoff Potential(s)"),
160 i18n("Three-body potential(s)"),
161 i18n("Four-body potential(s)"),
162 i18n("External field(s)")};
163
164gchar * felemt[MAXDATA+1] = {i18n("Energy unit"),
165 i18n("Molecule"),
166 i18n("Atom"),
167 i18n("Core-shell unit"),
168 i18n("Constraint bond"),
169 i18n("Mean force potential"),
170 i18n("Rigid unit"),
171 i18n("Tethering potential"),
172 i18n("Flexible chemical bond"),
173 i18n("Bond restraint"),
174 i18n("Bond angle"),
175 i18n("Angular restraint"),
176 i18n("Dihedral angle"),
177 i18n("Torsional restraint"),
178 i18n("Improper angle"),
179 i18n("Inversion angle"),
180 i18n("van der Waals potential"),
181 i18n("Metal potential"),
182 i18n("Tersoff Potential"),
183 i18n("Three-body potential"),
184 i18n("Four-body potential"),
185 i18n("External field")};
186
187gchar * elemts[MAXDATA] = {i18n("molecule(s)"),
188 i18n("atom(s)"),
189 i18n("core-shell unit(s)"),
190 i18n("constraint bond(s)"),
191 i18n("mean force potential(s)"),
192 i18n("rigid unit(s)"),
193 i18n("tethering potential(s)"),
194 i18n("flexible chemical bond(s)"),
195 i18n("bond restraint(s)"),
196 i18n("bond angle(s)"),
197 i18n("angular restraint(s)"),
198 i18n("dihedral angle(s)"),
199 i18n("torsional restraint(s)"),
200 i18n("improper angle(s)"),
201 i18n("inversion angle(s)"),
202 i18n("van der Waals potential(s)"),
203 i18n("metal potential(s)"),
204 i18n("Tersoff Potential(s)"),
205 i18n("three-body potential(s)"),
206 i18n("four-body potential(s)"),
207 i18n("external field(s)")};
208
209gchar * elemt[MAXDATA] = {i18n("molecule"),
210 i18n("atom"),
211 i18n("core-shell unit"),
212 i18n("constraint bond"),
213 i18n("mean force potential"),
214 i18n("rigid unit"),
215 i18n("tethering potential"),
216 i18n("flexible chemical bond"),
217 i18n("bond restraint"),
218 i18n("bond angle"),
219 i18n("angular restraint"),
220 i18n("dihedral angle"),
221 i18n("torsional restraint"),
222 i18n("improper angle"),
223 i18n("inversion angle"),
224 i18n("van der Waals potential"),
225 i18n("metal potential"),
226 i18n("Tersoff Potential"),
227 i18n("three-body potential"),
228 i18n("four-body potential"),
229 i18n("external field")};
230
231gchar * intelemts[MAXDATA] = {i18n("of molecule(s)"),
232 i18n("of atom(s)"),
233 i18n("of core-shell unit(s)"),
234 i18n("of constraint bond(s)"),
235 i18n("of mean force potential(s)"),
236 i18n("of rigid unit(s)"),
237 i18n("of tethering potential(s)"),
238 i18n("of flexible chemical bond(s)"),
239 i18n("of bond restraint(s)"),
240 i18n("of bond angle(s)"),
241 i18n("of angular restraint(s)"),
242 i18n("of dihedral angle(s)"),
243 i18n("of torsional restraint(s)"),
244 i18n("of improper angle(s)"),
245 i18n("of inversion angle(s)"),
246 i18n("of van der Waals potential(s)"),
247 i18n("of metal potential(s)"),
248 i18n("of Tersoff Potential(s)"),
249 i18n("of three-body potential(s)"),
250 i18n("of four-body potential(s)"),
251 i18n("of external field(s)")};
252
253gchar * intelemt[MAXDATA] = {i18n("of the molecule"),
254 i18n("of the atom"),
255 i18n("of the core-shell unit"),
256 i18n("of the constraint bond"),
257 i18n("of the mean force potential"),
258 i18n("of the rigid unit)"),
259 i18n("of the tethering potential"),
260 i18n("of the flexible chemical bond"),
261 i18n("of the bond restraint"),
262 i18n("of the bond angle"),
263 i18n("of the angular restraint"),
264 i18n("of the dihedral angle"),
265 i18n("of the torsional restraint"),
266 i18n("of the improper angle"),
267 i18n("of the inversion angle"),
268 i18n("of the van der Waals potential"),
269 i18n("of the metal potential"),
270 i18n("of the Tersoff Potential"),
271 i18n("of the three-body potential"),
272 i18n("of the four-body potential"),
273 i18n("of the external field")};
274
275gchar * fkeysw[2][16][21] = {{{"eV", "kcal", "kJ", "K", "internal", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "}, // 0 - Energy unit(s)
276 {"harm", "rhrm", "quar", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "}, // 1 - Tethering pot.
277 {"harm", "mors", "12-6", "lj ", "rhrm", "quar", "buck", "coul", "fene", "mmst", "tab ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "}, // 2 - Bond pot.
278 {"-hrm", "-mrs", "-126", "-lj ", "-rhm", "-qur", "-bck", "-cul", "-fne", "-mst", "-tab", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "}, // 3 - Bond rest.
279 {"harm", "quar", "thrm", "shrm", "bvs1", "bvs2", "hcos", "cos ", "mmsb", "stst", "stbe", "cmps", "mmbd", "kky ", "tab ", " ", " ", " ", " ", " ", " "}, // 4 - Angles pot.
280 {"-hrm", "-qur", "-thm", "-shm", "-bv1", "-bv2", "-hcs", "-cos", "-msb", "-sts", "-stb", "-cmp", "-mbd", "-kky", "-tab", " ", " ", " ", " ", " ", " "}, // 5 - Angles rest.
281 {"cos ", "harm", "hcos", "cos3", "ryck", "rbf ", "opls", "tab ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "}, // 6 - Dihedral pot.
282 {"-cos", "-hrm", "-hcs", "-cs3", "-rck", "-rbf", "-opl", "-tab", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "}, // 8 - Torsion pot.
283 {"cos ", "harm", "hcos", "cos3", "ryck", "rbf ", "opls", "tab ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "}, // 7 - Improper pot.
284 {"harm", "hcos", "plan", "xpln", "calc", "tab ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "}, // 9 - Inversion pot.
285 {"12-6", "lj ", "ljc", "nm ", "buck", "bhm ", "hbnd", "snm ", "mors", "wca ", "dpd", "14-7", "mstw", "ryb", "zbl", "zbls", "zblb", "mlj", "mbuc", "m126", "tab "}, // 10 - Vdw pot.
286 {"eam ", "eeam", "2bea", "2bee", "fnsc", "exfs", "stch", "gupt", "mbpc", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "}, // 11 - Metal pot.
287 {"ters", "kihs", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "}, // 12 - Tersoff pot.
288 {"harm", "thrm", "shrm", "bvs1", "bvs2", "hbnd", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "}, // 13 - Three-body pot.
289 {"harm", "hcos", "plan", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "}, // 14 - Four-body pot.
290 {"elec", "oshr", "shrx", "grav", "magn", "sphr", "zbnd", "xpis", "zres", "zrs-", "zrs+", "osel", "ushr", " ", " ", " ", " ", " ", " ", " ", " "}}, // 15 - External fields.
291 {{"lj", "real", "metal", "si", "cgs", "electron", "micro", "nano", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
292 {" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
293 {"harmonic", "class2", "fene", "fene/expand", "gromos", "harmonic/shift", "harmonic/shift/cut", "mm3", "morse", "nonlinear", "oxdna/fene", "oxdna2/fene", "oxrna2/fene", "quartic", "special", "table", " ", " ", " ", " ", " "},
294 {" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
295 {"harmonic", "charmm", "class2", "class2/p6", "cosine", "cosine/buck6d", "cosine/delta", "cosine/periodic", "cosine/shift", "cosine/shift/exp", "cosine/squared", "cross", "dipole", "fourier", "fourier/simple", "mm3", "quartic", "sdk", "table", " ", " "},
296 {" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
297 {"cosine/shift/exp", "charmm", "charmmfsw", "class2", "fourier", "harmonic", "helix", "multi/harmonic", "nharmonic", "opls", "quadratic","spherical", "table", "table/cut", " ", " ", " ", " ", " ", " ", " "},
298 {" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
299 {"harmonic", "class2", "cossq", "cvff", "distance", "distharm", "fourier", "ring", "sqdistharm", "umbrella", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
300 {"inversion/harmonic", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
301 {" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
302 {" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
303 {" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
304 {" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
305 {" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
306 {" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "}}};
307
308gchar * fnames[2][16][21] = {{{i18n("Electron-Volts"), i18n("k-calories per mol"), i18n("k-Joules per mol"), i18n("Kelvin per Boltzmann"), i18n("DL_POLY internal units"), " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
309 {i18n("Harmonic"), i18n("Restraint"), i18n("Quartic"), " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
310 {i18n("Harmonic"), "Morse", "12-6", "Lennard-Jones", i18n("Restraint"), i18n("Quartic"), "Buckingham", "Coulomb", i18n("Shifted FENE"), i18n("MM3 bond stretch"), i18n("Tabulated"), " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
311 {i18n("Harmonic"), "Morse", "12-6", "Lennard-Jones", i18n("Restraint"), i18n("Quartic"), "Buckingham", "Coulomb", i18n("Shifted FENE"), i18n("MM3 bond stretch"), i18n("Tabulated"), " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
312 {i18n("Harmonic"), i18n("Quartic"), i18n("Truncated harmonic"), i18n("Screened harmonic"), i18n("Screened Vessal"), i18n("Truncated Vessal"), i18n("Harmonic cosine"), i18n("Cosine"), i18n("MM3 stretch-bend"), i18n("Compass stretch-stretch"), i18n("Compass stretch-bend"), i18n("Compass all terms"), i18n("MM3 angle bend"), "KKY", i18n("Tabulated"), " ", " ", " ", " ", " ", " "},
313 {i18n("Harmonic"), i18n("Quartic"), i18n("Truncated harmonic"), i18n("Screened harmonic"), i18n("Screened Vessal"), i18n("Truncated Vessal"), i18n("Harmonic cosine"), i18n("Cosine"), i18n("MM3 stretch-bend"), i18n("Compass stretch-stretch"), i18n("Compass stretch-bend"), i18n("Compass all terms"), i18n("MM3 angle bend"), "KKY", i18n("Tabulated"), " ", " ", " ", " ", " ", " "},
314 {i18n("Cosine"), i18n("Harmonic"), i18n("Harmonic cosine"), i18n("Triple cosine"), "Ryckaert-Bellemans", i18n("Fluorinated Ryckaert-Bellemans"), i18n("OPLS torsion"), i18n("Tabulated"), " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
315 {i18n("Cosine"), i18n("Harmonic"), i18n("Harmonic cosine"), i18n("Triple cosine"), "Ryckaert-Bellemans", i18n("Fluorinated Ryckaert-Bellemans"), i18n("OPLS torsion"), i18n("Tabulated"), " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
316 {i18n("Cosine"), i18n("Harmonic"), i18n("Harmonic cosine"), i18n("Triple cosine"), "Ryckaert-Bellemans", i18n("Fluorinated Ryckaert-Bellemans"), i18n("OPLS torsion"), i18n("Tabulated"), " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
317 {i18n("Harmonic"), i18n("Harmonic cosine"), i18n("Planar"), i18n("Extended Planar"), i18n("Calcite"), i18n("Tabulated"), " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
318 {"12-6", "Lennard-Jones", i18n("LJ cohesive"), "n-m", "Buckingham", "Born-Huggins-Meyer", i18n("12-10 H-bond"), i18n("Shifted force n-m"), "Morse", i18n("Shifted Weeks-Chandler-Anderson"), i18n("Standard DPD"), i18n("14-7 buffered AMOEBA FF"),
319 i18n("Morse modified"), "Rydberg", "ZBL", i18n("ZBL mixed with Morse"), i18n("ZBL mixed with Buckingham"), i18n("Lennard-Jones tapered with MDF"), i18n("Buckingham tapered with MDF"), i18n("12-6 Lennard-Jones tapered with MDF"), i18n("Tabulated")},
320 {"EAM", "EEAM", "2BEAM", "2BEEAM", "Finis-Sinclair", i18n("Extended Finis-Sinclair"), "Sutton-Chen", "Gupta", "MBPC", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
321 {"Tersoff", "KIHS", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
322 {i18n("Harmonic"), i18n("Truncated harmonic"), i18n("Screened harmonic"), i18n("Screened Vessal"), i18n("Truncated Vessal"), i18n("H-bond"), " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
323 {i18n("Harmonic"), i18n("Harmonic cosine"), i18n("Planar"), " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
324 {i18n("Electric field"), i18n("Oscillating Shear"), i18n("Continuous Shear"), i18n("Gravitational field"), i18n("Magnetic field"), i18n("Containing Sphere"), i18n("Repulsive Wall"), i18n("X-Piston"), i18n("Molecule in HR Zone"), i18n("HR Zone (pull out)"), i18n("HR Zone (pull in)"), i18n("Osc. Electric Field"), i18n("Umbrella sampling, harm. constant"), " ", " ", " ", " ", " ", " ", " ", " "}},
325 {{"lj", i18n("k-calories per mol"), i18n("Electron-Volts"), i18n("k-Joules per mol"), "cgs", i18n("electron"), "micro", "nano", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
326 {" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
327 {i18n("Harmonic"),i18n("COMPASS class2 force field"), i18n("Finite extensible nonlinear elastic (FENE)"), i18n("FENE with variable size particles"), i18n("GROMOS force field"), i18n("Shifted harmonic"), i18n("Shifted truncated harmonic"), i18n("MM3 anharmonic"), "Morse", i18n("Nonlinear"), i18n("Finite extensible nonlinear elastic DNA"),
328 i18n("Finite extensible nonlinear elastic DNA (2)"), i18n("Finite extensible nonlinear elastic RNA"), i18n("Breakable quartic"), i18n("Special bond exclusions for 1-5 pairs and beyond"), i18n("Tabulated"), " ", " ", " ", " ", " "},
329 {" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
330 {i18n("Harmonic"), i18n("CHARMM force field"), i18n("COMPASS class2 force field"), i18n("COMPASS class2 force field - 6th order"), i18n("Cosine"), i18n("Cosine with Buckingham term between 1-3"), i18n("Difference of cosines"), i18n("DREIDING force field"), i18n("Cosine with a shift"), i18n("Cosine with a shift and exponential term in spring"),
331 i18n("Cosine with squared term"), i18n("Cross term coupling angle and bond length"), i18n("Dipole orientation"), i18n("Fourier (multiple cosines)"), i18n("Fourier (single cosine)"), "MM3", i18n("Quartic"), i18n("Combination of the harmonic (SDK)"), i18n("Tabulated"), " ", " "},
332 {" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
333 {i18n("Cosine with a shift and exponential term in spring"), i18n("CHARMM force field"), i18n("CHARMM force field with force switching"), i18n("COMPASS class2 force field"), i18n("Fourier (multiple cosines)"), i18n("Harmonic"), i18n("Helix"), i18n("Harmonic with 5 terms"),
334 i18n("Harmonic with N terms"), i18n("OPLS force field"), i18n("Quadratic"), i18n("Spherical"), i18n("Tabulated"), i18n("Tabulated with analytic cutoff"), " ", " ", " ", " ", " ", " ", " "},
335 {" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
336 {i18n("Harmonic"), i18n("COMPASS class2 force field"), i18n("Cosine squared"), i18n("CVFF force field"), i18n("Distance between atom planes"), i18n("Out-of-the plane distance"), i18n("Fourier (multiple cosines)"), i18n("Planar conformation"), i18n("Squared distance harmonic"), i18n("DREIDING force field"), " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
337 {i18n("Harmonic with Wilson Decius out-of-plane"), " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
338 {" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
339 {" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
340 {" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
341 {" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
342 {" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
343 {" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "}}};
344
345int fvalues[2][15][21] = {{{ 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // 0 - Tethered
346 { 2, 3, 2, 2, 3, 4, 3, 1, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // 1 - Bond(s)
347 { 2, 3, 2, 2, 3, 4, 3, 1, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // 2 - Bond restraint(s)
348 { 2, 4, 3, 4, 4, 4, 2, 3, 4, 3, 3, 6, 2, 4, 0, 0, 0, 0, 0, 0, 0}, // 3 - Angle(s)
349 { 2, 4, 3, 4, 4, 4, 2, 3, 4, 3, 3, 6, 2, 4, 0, 0, 0, 0, 0, 0, 0}, // 4 - Angle restraint(s)
350 { 3, 2, 2, 3, 1, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // 5 - Dihedral(s)
351 { 3, 2, 2, 3, 1, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // 6 - Torsional restraint(s)
352 { 3, 2, 2, 3, 1, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // 7 - Improper(s)
353 { 2, 2, 1, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // 8 - Inversion(s)
354 { 2, 2, 3, 4, 3, 5, 2, 5, 3, 3, 2, 2, 4, 3, 2, 7, 7, 3, 4, 3, 0}, // 9 - vdW
355 { 0, 0, 0, 0, 7, 9, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // 10 - Metal(s)
356 {11,16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // 11 - Tersoff(s)
357 { 2, 3, 4, 4, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // 12 - 3-body
358 { 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // 13 - 4-body
359 { 3, 2, 2, 3, 3, 4, 3, 3, 5, 5, 5, 4, 6, 0, 0, 0, 0, 0, 0, 0, 0}}, // 14 - External(s)
360 {{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // 0 - Tethered
361 { 2, 4, 4, 5, 2, 3, 3, 2, 3, 3, 3, 3, 3, 5, 2, 2, 0, 0, 0, 0, 0}, // 1 - Bond(s)
362 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // 2 - Bond restraint(s)
363 { 2, 4, 4, 4, 1, 3, 2, 3, 2, 3, 2, 6, 2, 4, 3, 2, 4, 2, 2, 0, 0}, // 3 - Angle(s)
364 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // 4 - Angle restraint(s)
365 { 3, 4, 4, 6, 4, 3, 3, 5, 2, 4, 2,11, 2, 2, 0, 0, 0, 0, 0, 0, 0}, // 5 - Dihedral(s)
366 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // 6 - Torsional restraint(s)
367 { 2, 2, 2, 3, 2, 2, 5, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // 7 - Improper(s)
368 { 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // 8 - Inversion(s)
369 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // 9 - vdW
370 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // 10 - Metal(s)
371 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // 11 - Tersoff(s)
372 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // 12 - 3-body
373 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // 13 - 4-body
374 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}};// 14 - External(s)
375
378
381
382char * fvars_teth[2][FTETH][FTETH_P] = {{{"k", " ", " "},
383 {"k", "r<sub>c</sub>", " "},
384 {"k", "k'", "k''"}},
385 {{" ", " ", " "},
386 {" ", " ", " "},
387 {" ", " ", " "}}};
388
389int feunit_teth[2][FTETH][FTETH_P] = {{{1, 0, 0},
390 {1, 0, 0},
391 {1, 0, 0}},
392 {{0, 0, 0},
393 {0, 0, 0},
394 {0, 0, 0}}};
395
396char * fvars_bond[2][FBONDS][FBONDS_P] = {{{"k", "r<sub>0</sub>", " ", " ", " "},
397 {"E<sub>0</sub>", "r<sub>0</sub>", "k", " ", " "},
398 {"A", "B", " ", " ", " "},
399 {"ϵ", "σ", " ", " ", " "},
400 {"k", "r<sub>0</sub>", "r<sub>c</sub>", " ", " "},
401 {"k", "r<sub>0</sub>", "k'", "k''", " "},
402 {"A", "ρ", "C", " ", " "},
403 {"k", " ", " ", " ", " "},
404 {"k", "R<sub>0</sub>", "Δ", " ", " "},
405 {"k", "r<sub>o</sub>", " ", " ", " "},
406 {" ", " ", " ", " ", " "},
407 {" ", " ", " ", " ", " "},
408 {" ", " ", " ", " ", " "},
409 {" ", " ", " ", " ", " "},
410 {" ", " ", " ", " ", " "},
411 {" ", " ", " ", " ", " "}},
412 {{"K", "r<sub>0</sub>", " ", " ", " "},
413 {"r<sub>0</sub>", "K<sub>2</sub>", "K<sub>3</sub>", "K<sub>4</sub>", " "},
414 {"K", "R<sub>0</sub>", "ϵ", "σ", " "},
415 {"K", "R<sub>0</sub>", "ϵ", "σ", "Δ"},
416 {"K", "r<sub>0</sub>", " ", " ", " "},
417 {"K", "r<sub>0</sub>", "r<sub>c</sub>", " ", " "},
418 {"U<sub>min</sub>", "r<sub>0</sub>", "r<sub>c</sub>", " ", " "},
419 {"K", "r<sub>0</sub>", " ", " ", " "},
420 {"D", "α", "r<sub>0</sub>", " ", " "},
421 {"ϵ", "r<sub>0</sub>", "λ", " ", " "},
422 {"ϵ", "Δ", "r<sub>0</sub>", " ", " "},
423 {"ϵ", "Δ", "r<sub>0</sub>", " ", " "},
424 {"ϵ", "Δ", "r<sub>0</sub>", " ", " "},
425 {"K", "B<sub>1</sub>", "B<sub>2</sub>", "R<sub>c</sub>", "U<sub>0</sub>"},
426 {"w<sub>LJ</sub>", "w<sub>Coul</sub>", " ", " ", " "},
427 {i18n("Interpolation style"), i18n("Distances"), " ", " ", " "}}};
428
429int feunit_bond[2][FBONDS][FBONDS_P] = {{{1, 0, 0, 0, 0},
430 {1, 0, 1, 0, 0},
431 {1, 1, 0, 0, 0},
432 {1, 0, 0, 0, 0},
433 {1, 0, 0, 0, 0},
434 {1, 0, 1, 1, 0},
435 {1, 0, 1, 0, 0},
436 {1, 0, 0, 0, 0},
437 {1, 0, 0, 0, 0},
438 {1, 0, 0, 0, 0},
439 {0, 0, 0, 0, 0},
440 {0, 0, 0, 0, 0},
441 {0, 0, 0, 0, 0},
442 {0, 0, 0, 0, 0},
443 {0, 0, 0, 0, 0},
444 {0, 0, 0, 0, 0}},
445 {{1, 0, 0, 0, 0},
446 {0, 1, 1, 1, 0},
447 {1, 0, 1, 0, 0},
448 {1, 0, 1, 0, 0},
449 {1, 0, 0, 0, 0},
450 {1, 0, 0, 0, 0},
451 {1, 0, 0, 0, 0},
452 {1, 0, 0, 0, 0},
453 {1, 0, 0, 0, 0},
454 {1, 0, 0, 0, 0},
455 {1, 0, 0, 0, 0},
456 {1, 0, 0, 0, 0},
457 {1, 0, 0, 0, 0},
458 {1, 0, 0, 0, 1},
459 {0, 0, 0, 0, 0},
460 {0, 0, 0, 0, 0}}};
461
462char * fvars_angle[2][FANGLES][FANGLES_P] = {{{"k", "θ<sub>0</sub>", " ", " ", " ", " "},
463 {"k", "θ<sub>0</sub>", "k'", "k''", " ", " "},
464 {"k", "θ<sub>0</sub>", "ρ", " ", " ", " "},
465 {"k", "θ<sub>0</sub>", "ρ<sub>1</sub>", "ρ<sub>2</sub>", " ", " "},
466 {"k", "θ<sub>0</sub>", "ρ<sub>1</sub>", "ρ<sub>2</sub>", " ", " "},
467 {"k", "θ<sub>0</sub>", "a", "ρ", " ", " "},
468 {"k", "θ<sub>0</sub>", " ", " ", " ", " "},
469 {"A", "δ", "m", " ", " ", " "},
470 {"A", "θ<sub>0</sub>", "r<sup>o</sup><sub>ij</sub>", "r<sup>o</sup><sub>jk</sub>", " ", " "},
471 {"A", "r<sup>o</sup><sub>ij</sub>", "r<sup>o</sup><sub>jk</sub>", " ", " ", " "},
472 {"A", "θ<sub>0</sub>", "r<sup>o</sup><sub>ij</sub>", " ", " ", " "},
473 {"A", "B", "C", "θ<sub>0</sub>", "r<sup>o</sup><sub>ij</sub>", "r<sup>o</sup><sub>jk</sub>"},
474 {"k", "θ<sub>0</sub>", " ", " ", " ", " "},
475 {"f<sub>k</sub>", "θ<sub>0</sub>", "g<sub>r</sub>", "r<sub>o</sub>", " ", " "},
476 {" ", " ", " ", " ", " ", " "},
477 {" ", " ", " ", " ", " ", " "},
478 {" ", " ", " ", " ", " ", " "},
479 {" ", " ", " ", " ", " ", " "},
480 {" ", " ", " ", " ", " ", " "}},
481 {{"K", "θ<sub>0</sub>", " ", " ", " ", " "},
482 {"K", "θ<sub>0</sub>", "K<sub>ub</sub>", "r<sub>ub</sub>", " ", " "},
483 {"θ<sub>0</sub>", "K<sub>2</sub>", "K<sub>3</sub>", "K<sub>4</sub>", " ", " "},
484 {"θ<sub>0</sub>", "K<sub>2</sub>", "K<sub>3</sub>", "K<sub>4</sub>", " ", " "},
485 {"K", " ", " ", " ", " ", " "},
486 {"K", "n", "θ<sub>0</sub>", " ", " ", " "},
487 {"K", "θ<sub>0</sub>", " ", " ", " ", " "},
488 {"C", "B", "n", " ", " ", " "},
489 {"U<sub>min</sub>", "θ<sub>0</sub>", " ", " ", " ", " "},
490 {"U<sub>min</sub>", "θ<sub>0</sub>", "A", " ", " ", " "},
491 {"K", "θ<sub>0</sub>", " ", " ", " ", " "},
492 {"K<sub>SS</sub>", "K<sub>BS0</sub>", "K<sub>BS1</sub>", "r<sub>12,0</sub>", "r<sub>32,0</sub>", "θ<sub>0</sub>"},
493 {"K", "λ<sub>0</sub>", " ", " ", " ", " "},
494 {"K", "C<sub>0</sub>", "C<sub>1</sub>", "C<sub>2</sub>", " ", " "},
495 {"K", "c", "n", "", " ", " "},
496 {"K", "θ<sub>0</sub>", " ", " ", " ", " "},
497 {"θ<sub>0</sub>", "K<sub>2</sub>", "K<sub>3</sub>", "K<sub>4</sub>", " ", " "},
498 {"K", "θ<sub>0</sub>", " ", " ", " ", " "},
499 {i18n("Interpolation style"), i18n("Angles"), " ", " ", " ", " "}}};
500
501int feunit_angle[2][FANGLES][FANGLES_P] = {{{1, 0, 0, 0, 0, 0},
502 {1, 0, 1, 1, 0, 0},
503 {1, 0, 0, 0, 0, 0},
504 {1, 0, 0, 0, 0, 0},
505 {1, 0, 0, 0, 0, 0},
506 {1, 0, 0, 0, 0, 0},
507 {1, 0, 0, 0, 0, 0},
508 {1, 0, 0, 0, 0, 0},
509 {1, 0, 0, 0, 0, 0},
510 {1, 0, 0, 0, 0, 0},
511 {1, 0, 0, 0, 0, 0},
512 {1, 1, 1, 0, 0, 0},
513 {1, 0, 0, 0, 0, 0},
514 {1, 0, 0, 0, 0, 0},
515 {0, 0, 0, 0, 0, 0},
516 {0, 0, 0, 0, 0, 0},
517 {0, 0, 0, 0, 0, 0},
518 {0, 0, 0, 0, 0, 0},
519 {0, 0, 0, 0, 0, 0}},
520 {{1, 0, 0, 0, 0, 0},
521 {1, 0, 1, 0, 0, 0},
522 {0, 1, 1, 1, 0, 0},
523 {0, 1, 1, 1, 0, 0},
524 {1, 0, 0, 0, 0, 0},
525 {1, 0, 0, 0, 0, 0},
526 {1, 0, 0, 0, 0, 0},
527 {1, 0, 0, 0, 0, 0},
528 {1, 0, 0, 0, 0, 0},
529 {1, 0, 0, 0, 0, 0},
530 {1, 0, 0, 0, 0, 0},
531 {1, 1, 1, 0, 0, 0},
532 {1, 0, 0, 0, 0, 0},
533 {1, 0, 0, 0, 0, 0},
534 {1, 0, 0, 0, 0, 0},
535 {1, 0, 0, 0, 0, 0},
536 {0, 1, 1, 1, 0, 0},
537 {1, 0, 0, 0, 0, 0},
538 {0, 0, 0, 0, 0, 0}}};
539
540char * fvars_dihedral[2][FDIHEDRAL][FDIHEDRAL_P] = {{{"A", "δ", "m", " ", " ", " ", " ", " ", " ", " ", " "},
541 {"k", "ϕ<sub>0</sub>", " ", " ", " ", " ", " ", " ", " ", " ", " "},
542 {"k", "ϕ<sub>0</sub>", " ", " ", " ", " ", " ", " ", " ", " ", " "},
543 {"A<sub>1</sub>", "A<sub>2</sub>", "A<sub>3</sub>", " ", " ", " ", " ", " ", " ", " ", " "},
544 {"A", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
545 {"A", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
546 {"A<sub>0</sub>", "A<sub>1</sub>", "A<sub>2</sub>", "A<sub>3</sub>", "ϕ<sub>0</sub>", " ", " ", " ", " ", " ", " "},
547 {" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
548 {" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
549 {" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
550 {" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
551 {" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
552 {" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "},
553 {" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "}},
554 {{"U<sub>min</sub>", "θ<sub>0</sub>", "a", " ", " ", " ", " ", " ", " ", " ", " "},
555 {"K", "n", "d", i18n("weighting factor"), " ", " ", " ", " ", " ", " ", " "},
556 {"K", "n", "d", i18n("weighting factor"), " ", " ", " ", " ", " ", " ", " "},
557 {"E<sub>d</sub>", "E<sub>mbt</sub>", "E<sub>ebt</sub>", "E<sub>at</sub>", "E<sub>aat</sub>", "E<sub>bb13</sub>", " ", " ", " ", " ", " "},
558 {"m", "K", "n", "d", " ", " ", " ", " ", " ", " ", " "},
559 {"K", "d", "n", " ", " ", " ", " ", " ", " ", " ", " "},
560 {"A", "B", "C", " ", " ", " ", " ", " ", " ", " ", " "},
561 {"A<sub>1</sub>", "A<sub>2</sub>", "A<sub>3</sub>", "A<sub>4</sub>", "A<sub>5</sub>", " ", " ", " ", " ", " ", " "},
562 {"n", "A", " ", " ", " ", " ", " ", " ", " ", " ", " "},
563 {"K<sub>1</sub>", "K<sub>2</sub>", "K<sub>3</sub>", "K<sub>4</sub>", " ", " ", " ", " ", " ", " ", " "},
564 {"K", "ϕ<sub>0</sub>", " ", " ", " ", " ", " ", " ", " ", " ", " "},
565 {"n", "C", "K", "a", "u", "L", "b", "v", "M", "c", "w"},
566 {i18n("Interpolation style"), i18n("Dihedrals"), " ", " ", " ", " ", " ", " ", " ", " ", " "},
567 {i18n("Interpolation style"), i18n("Dihedrals"), " ", " ", " ", " ", " ", " ", " ", " ", " "}}};
568
569int feunit_dihedral[2][FDIHEDRAL][FDIHEDRAL_P] = {{{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
570 {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
571 {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
572 {1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0},
573 {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
574 {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
575 {1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0},
576 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
577 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
578 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
579 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
580 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
581 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
582 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}},
583 {{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
584 {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
585 {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
586 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
587 {0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0},
588 {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
589 {1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0},
590 {1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0},
591 {0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0},
592 {1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0},
593 {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
594 {0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0},
595 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
596 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}};
597
598/*gchar la_dih_class2[6][9] = {{"K<sub>1</sub>", "ϕ<sub>1</sub>", "K<sub>2</sub>", "ϕ<sub>2</sub>", "K<sub>3</sub>", "ϕ<sub>3</sub>", " ", " ", " "},
599 {"mbt", "A<sub>1</sub>", "A<sub>2</sub>", "A<sub>3</sub>", "r<sub>2</sub>", " ", " ", " ", " "},
600 {"ebt", "B<sub>1</sub>", "B<sub>2</sub>", "B<sub>3</sub>", "C<sub>1</sub>", "C<sub>2</sub>", "C<sub>3</sub>", "r<sub>1</sub>", "r<sub>3</sub>"},
601 {"at", "D<sub>1</sub>", "D<sub>2</sub>", "D<sub>3</sub>", "E<sub>1</sub>", "E<sub>2</sub>", "E<sub>3</sub>", "θ<sub>1</sub>", "θ<sub>2</sub>"},
602 {"aat", "M", "θ<sub>1</sub>", "θ<sub>2</sub>", " ", " ", " ", " ", " "},
603 {"bb13", "N", "r<sub>1</sub>", "r<sub>3</sub>", " ", " ", " ", " ", " "}};
604
605int feu_la_dih_class2[6][9] = {{1, 0, 1, 0, 1, 0, 0, 0, 0},
606 {0, 1, 1, 1, 0, 0, 0, 0, 0},
607 {0, 1, 1, 1, 1, 1, 1, 0, 0},
608 {0, 1, 1, 1, 1, 1, 1, 0, 0},
609 {0, 1, 0, 0, 0, 0, 0, 0, 0},
610 {0, 1, 0, 0, 0, 0, 0, 0, 0}};*/
611
612char * fvars_inversion[2][FINVERS][FINVERS_P] = {{{"k", "ϕ<sub>0</sub>", " "},
613 {"k", "ϕ<sub>0</sub>", " "},
614 {"A", " ", " "},
615 {"k", "m", "ϕ<sub>0</sub>"},
616 {"A", "B", " "},
617 {" ", " ", " "}},
618 {{" ", " ", " "},
619 {" ", " ", " "},
620 {" ", " ", " "},
621 {" ", " ", " "},
622 {" ", " ", " "},
623 {" ", " ", " "}}};
624
625int feunit_inversion[2][FINVERS][FINVERS_P] = {{{1, 0, 0},
626 {1, 0, 0},
627 {1, 0, 0},
628 {1, 0, 0},
629 {1, 1, 0},
630 {0, 0, 0}},
631 {{1, 0, 0},
632 {1, 0, 0},
633 {1, 0, 0},
634 {1, 0, 0},
635 {1, 1, 0},
636 {0, 0, 0}}};
637
638// LAMMPS Impropers
639gchar * la_improper_style_keyw[11] = {"class2",
640 "cossq",
641 "cvff",
642 "distance",
643 "distharm",
644 "fourier",
645 "harmonic",
646 "inversion/harmonic",
647 "ring",
648 "sqdistharm",
649 "umbrella"};
650
651/*gchar * la_improper_style_info[11] = {i18n("COMPASS class2 force field"),
652 i18n("Cosine squared"),
653 i18n("CVFF force field"),
654 i18n("Distance between atom planes"),
655 i18n("Out-of-the plane distance"),
656 i18n("Fourier (multiple cosines)"),
657 i18n("Harmonic"),
658 i18n("Harmonic with Wilson Decius out-of-plane"),
659 i18n("Planar conformation"),
660 i18n("Squared distance harmonic"),
661 i18n("DREIDING force field")};
662
663gchar la_improper_var[11][LIMPROPERS] = {{"E<sub>i</sub>", "E<sub>aa</sub>", " ", " ", " "},
664 {"K", "χ<sub>0</sub>", " ", " ", " "},
665 {"K", "d", "n", " ", " "},
666 {"K<sub>2</sub>", "K<sub>4</sub>", " ", " ", " "}
667 {"K", "d<sub>0</sub>", " ", " ", " "},
668 {"K", "C<sub>0</sub>", "C<sub>1</sub>", "C<sub>2</sub>", "all"},
669 {"K", "χ<sub>0</sub>", " ", " ", " "},
670 {"K", "ω<sub>0</sub>", " ", " ", " "},
671 {"K", "θ<sub>0</sub>", " ", " ", " "},
672 {"K", "d<sub>0</sub><sup>2</sup>", " ", " ", " "},
673 {"K", "ω<sub>0</sub>", " ", " ", " "}};
674
675gchar la_imp_class2[2][7] = {{"K", "χ<sub>0</sub>", " ", " ", " ", " ", " "},
676 {"aa", "M<sub>1</sub>", "M<sub>2</sub>", "M<sub>3</sub>", "θ<sub>1</sub>", "θ<sub>2</sub>", "θ<sub>3</sub>"}};
677
678int feu_la_imp_class2[2][7] = {{1, 0, 0, 0, 0, 0, 0},
679 {0, 1, 1, 1, 0, 0, 0}};
680
681int feu_la_improper[15][LIMPROPERS] = {{0, 0, 0, 0, 0},
682 {1, 0, 0, 0, 0},
683 {1, 0, 0, 0, 0},
684 {1, 1, 0, 0, 0},
685 {1, 0, 0, 0, 0},
686 {1, 0, 0, 0, 0},
687 {1, 0, 0, 0, 0},
688 {1, 0, 0, 0, 0},
689 {1, 0, 0, 0, 0},
690 {1, 0, 0, 0, 0}};*/
691
692char * fvars_vdw[2][FVDW][FVDW_P] = {{{"A", "B", " ", " ", " ", " ", " "},
693 {"ϵ", "ρ", " ", " ", " ", " ", " "},
694 {"ϵ", "ρ", "c", " ", " ", " ", " "},
695 {"E<sub>0</sub>", "n", "m", "r<sub>0</sub>", " ", " ", " "},
696 {"A", "ρ", "C", " ", " ", " ", " "},
697 {"A", "B", "σ", "C", "D", " ", " "},
698 {"A", "B", " ", " ", " ", " ", " "},
699 {"E<sub>0</sub>", "n", "m", "r<sub>0</sub>", "r<sub>c</sub>", " ", " "},
700 {"E<sub>0</sub>", "r<sub>0</sub>", "k", " ", " ", " ", " "},
701 {"ϵ", "σ", "Δ", " ", " ", " ", " "},
702 {"A", "r<sub>c</sub>", " ", " ", " ", " ", " "},
703 {"ϵ", "r<sub>o</sub>", " ", " ", " ", " ", " "},
704 {"E<sub>0</sub>", "r<sub>0</sub>", "k", "c", " ", " ", " "},
705 {"a", "b", "σ", " ", " ", " ", " "},
706 {"Z<sub>1</sub>", "Z<sub>2</sub>", " ", " ", " ", " ", " "},
707 {"Z<sub>1</sub>", "Z<sub>2</sub>", "r<sub>m</sub>", "ξ", "E<sub>0</sub>", "r<sub>0</sub>", "k"},
708 {"Z<sub>1</sub>", "Z<sub>2</sub>", "r<sub>m</sub>", "ξ", "A", "ρ", "C"},
709 {"ϵ", "ρ", "r<sub>i</sub>", " ", " ", " ", " "},
710 {"A", "ρ", "C", "r<sub>i</sub>", " ", " ", " "},
711 {"A", "B", "r<sub>i</sub>", " ", " ", " ", " "},
712 {" ", " ", " ", " ", " ", " ", " "}},
713 {{"A", "B", " ", " ", " ", " ", " "},
714 {"A", "B", " ", " ", " ", " ", " "},
715 {"ϵ", "ρ", " ", " ", " ", " ", " "},
716 {"ϵ", "ρ", "c", " ", " ", " ", " "},
717 {"E<sub>0</sub>", "n", "m", "r<sub>0</sub>", " ", " ", " "},
718 {"A", "ρ", "C", " ", " ", " ", " "},
719 {"A", "B", "σ", "C", "D", " ", " "},
720 {"E<sub>0</sub>", "n", "m", "r<sub>0</sub>", "r<sub>c</sub>", " ", " "},
721 {"E<sub>0</sub>", "r<sub>0</sub>", "k", " ", " ", " ", " "},
722 {"ϵ", "σ", "Δ", " ", " ", " ", " "},
723 {"A", "r<sub>c</sub>", " ", " ", " ", " ", " "},
724 {"ϵ", "r<sub>o</sub>", " ", " ", " ", " ", " "},
725 {"E<sub>0</sub>", "r<sub>0</sub>", "k", "c", " ", " ", " "},
726 {"a", "b", "σ", " ", " ", " ", " "},
727 {"Z<sub>1</sub>", "Z<sub>2</sub>", " ", " ", " ", " ", " "},
728 {"Z<sub>1</sub>", "Z<sub>2</sub>", "r<sub>m</sub>", "ξ", "E<sub>0</sub>", "r<sub>0</sub>", "k"},
729 {"Z<sub>1</sub>", "Z<sub>2</sub>", "r<sub>m</sub>", "ξ", "A", "ρ", "C"},
730 {"ϵ", "ρ", "r<sub>i</sub>", " ", " ", " ", " "},
731 {"A", "ρ", "C", "r<sub>i</sub>", " ", " ", " "},
732 {"A", "B", "r<sub>i</sub>", " ", " ", " ", " "},
733 {" ", " ", " ", " ", " ", " ", " "}}};
734
735int feunit_vdw[2][FVDW][FVDW_P] = {{{1, 1, 0, 0, 0, 0, 0},
736 {1, 0, 0, 0, 0, 0, 0},
737 {1, 0, 0, 0, 0, 0, 0},
738 {1, 0, 0, 0, 0, 0, 0},
739 {1, 0, 1, 0, 0, 0, 0},
740 {1, 0, 0, 1, 1, 0, 0},
741 {1, 1, 0, 0, 0, 0, 0},
742 {1, 0, 0, 0, 0, 0, 0},
743 {1, 0, 0, 0, 0, 0, 0},
744 {1, 0, 0, 0, 0, 0, 0},
745 {1, 0, 0, 0, 0, 0, 0},
746 {1, 0, 0, 0, 0, 0, 0},
747 {1, 0, 0, 0, 0, 0, 0},
748 {1, 1, 0, 0, 0, 0, 0},
749 {1, 1, 0, 0, 0, 0, 0},
750 {1, 1, 0, 0, 1, 0, 0},
751 {1, 1, 0, 0, 1, 0, 0},
752 {1, 0, 0, 0, 0, 0, 0},
753 {1, 0, 0, 0, 0, 0, 0},
754 {1, 1, 0, 0, 0, 0, 0},
755 {0, 0, 0, 0, 0, 0, 0}},
756 {{1, 1, 0, 0, 0, 0, 0},
757 {1, 0, 0, 0, 0, 0, 0},
758 {1, 0, 0, 0, 0, 0, 0},
759 {1, 0, 0, 0, 0, 0, 0},
760 {1, 0, 1, 0, 0, 0, 0},
761 {1, 0, 0, 1, 1, 0, 0},
762 {1, 1, 0, 0, 0, 0, 0},
763 {1, 0, 0, 0, 0, 0, 0},
764 {1, 0, 0, 0, 0, 0, 0},
765 {1, 0, 0, 0, 0, 0, 0},
766 {1, 0, 0, 0, 0, 0, 0},
767 {1, 0, 0, 0, 0, 0, 0},
768 {1, 0, 0, 0, 0, 0, 0},
769 {1, 1, 0, 0, 0, 0, 0},
770 {1, 1, 0, 0, 0, 0, 0},
771 {1, 1, 0, 0, 1, 0, 0},
772 {1, 1, 0, 0, 1, 0, 0},
773 {1, 0, 0, 0, 0, 0, 0},
774 {1, 0, 0, 0, 0, 0, 0},
775 {1, 1, 0, 0, 0, 0, 0},
776 {0, 0, 0, 0, 0, 0, 0}}};
777
778char * fvars_met[2][FMETALS][FMETALS_P] = {{{" ", " ", " ", " ", " ", " ", " ", " ", " "},
779 {" ", " ", " ", " ", " ", " ", " ", " ", " "},
780 {" ", " ", " ", " ", " ", " ", " ", " ", " "},
781 {" ", " ", " ", " ", " ", " ", " ", " ", " "},
782 {"c<sub>0</sub>", "c<sub>1</sub>", "c<sub>2</sub>", "c", "A", "d", "β", " ", " "},
783 {"c<sub>0</sub>", "c<sub>1</sub>", "c<sub>2</sub>", "c<sub>3</sub>", "c<sub>4</sub>", "c", "A", "d", "B"},
784 {"ϵ", "a", "n", "m", "c", " ", " ", " ", " "},
785 {"A", "r<sub>0</sub>", "p", "B", "q<sub>ij</sub>", " ", " ", " ", " "},
786 {"ϵ", "a", "m", "α", "r<sub>o</sub>", " ", " ", " ", " "}},
787 {{" ", " ", " ", " ", " ", " ", " ", " ", " "},
788 {" ", " ", " ", " ", " ", " ", " ", " ", " "},
789 {" ", " ", " ", " ", " ", " ", " ", " ", " "},
790 {" ", " ", " ", " ", " ", " ", " ", " ", " "},
791 {"c<sub>0</sub>", "c<sub>1</sub>", "c<sub>2</sub>", "c", "A", "d", "β", " ", " "},
792 {"c<sub>0</sub>", "c<sub>1</sub>", "c<sub>2</sub>", "c<sub>3</sub>", "c<sub>4</sub>", "c", "A", "d", "B"},
793 {"ϵ", "a", "n", "m", "c", " ", " ", " ", " "},
794 {"A", "r<sub>0</sub>", "p", "B", "q<sub>ij</sub>", " ", " ", " ", " "},
795 {"ϵ", "a", "m", "α", "r<sub>o</sub>", " ", " ", " ", " "}}};
796
797int feunit_met[2][FMETALS][FMETALS_P] = {{{0, 0, 0, 0, 0, 0, 0, 0, 0},
798 {0, 0, 0, 0, 0, 0, 0, 0, 0},
799 {0, 0, 0, 0, 0, 0, 0, 0, 0},
800 {0, 0, 0, 0, 0, 0, 0, 0, 0},
801 {0, 0, 0, 0, 1, 0, 1, 0, 0},
802 {0, 0, 0, 0, 0, 0, 1, 0, 1},
803 {1, 0, 0, 0, 0, 0, 0, 0, 0},
804 {1, 0, 0, 1, 0, 0, 0, 0, 0},
805 {1, 0, 0, 0, 0, 0, 0, 0, 0}},
806 {{0, 0, 0, 0, 0, 0, 0, 0, 0},
807 {0, 0, 0, 0, 0, 0, 0, 0, 0},
808 {0, 0, 0, 0, 0, 0, 0, 0, 0},
809 {0, 0, 0, 0, 0, 0, 0, 0, 0},
810 {0, 0, 0, 0, 1, 0, 1, 0, 0},
811 {0, 0, 0, 0, 0, 0, 1, 0, 1},
812 {1, 0, 0, 0, 0, 0, 0, 0, 0},
813 {1, 0, 0, 1, 0, 0, 0, 0, 0},
814 {1, 0, 0, 0, 0, 0, 0, 0, 0}}};
815
816char * fvars_ters[2][FTERSOFFS][FTERSOFFS_P] = {{{"A", "a", "B", "b", "R", "S", "β", "η", "c", "d", "h", "χ", "ω", "δ", " ", " "},
817 {"A", "a", "B", "b", "R", "S", "η", "δ", "c<sub>1</sub>", "c<sub>2</sub>", "c<sub>3</sub>", "c<sub>4</sub>", "c<sub>5</sub>", "h", "α", "β"}},
818 {{"A", "a", "B", "b", "R", "S", "β", "η", "c", "d", "h", "χ", "ω", "δ", " ", " "},
819 {"A", "a", "B", "b", "R", "S", "η", "δ", "c<sub>1</sub>", "c<sub>2</sub>", "c<sub>3</sub>", "c<sub>4</sub>", "c<sub>5</sub>", "h", "α", "β"}}};
820
821int feunit_ters[2][FTERSOFFS][FTERSOFFS_P] = {{{1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
822 {1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}},
823 {{1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
824 {1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}};
825
826char * fvars_tbd[2][FTHREEBODY][FTHREEBODY_P] = {{{"k", "θ<sub>0</sub>", " ", " ", " "},
827 {"k", "θ<sub>0</sub>", "ρ", " ", " "},
828 {"k", "θ<sub>0</sub>", "ρ<sub>1</sub>", "ρ<sub>2</sub>", " "},
829 {"k", "θ<sub>0</sub>", "ρ<sub>1</sub>", "ρ<sub>2</sub>", " "},
830 {"k", "θ<sub>0</sub>", "a", "ρ", " "},
831 {"D<sub>hb</sub>", "R<sub>hb</sub>", " ", " ", " "}},
832 {{"k", "θ<sub>0</sub>", " ", " ", " "},
833 {"k", "θ<sub>0</sub>", "ρ", " ", " "},
834 {"k", "θ<sub>0</sub>", "ρ<sub>1</sub>", "ρ<sub>2</sub>", " "},
835 {"k", "θ<sub>0</sub>", "ρ<sub>1</sub>", "ρ<sub>2</sub>", " "},
836 {"k", "θ<sub>0</sub>", "a", "ρ", " "},
837 {"D<sub>hb</sub>", "R<sub>hb</sub>", " ", " ", " "}}};
838
839int feunit_tbd[2][FTHREEBODY][FTHREEBODY_P] = {{{1, 0, 0, 0, 0},
840 {1, 0, 0, 0, 0},
841 {1, 0, 0, 0, 0},
842 {1, 0, 0, 0, 0},
843 {1, 0, 0, 0, 0},
844 {1, 0, 0, 0, 0}},
845 {{1, 0, 0, 0, 0},
846 {1, 0, 0, 0, 0},
847 {1, 0, 0, 0, 0},
848 {1, 0, 0, 0, 0},
849 {1, 0, 0, 0, 0},
850 {1, 0, 0, 0, 0}}};
851
852char * fvars_fbd[2][FFOURBODY][FFOURBODY_P] = {{{"k", "ϕ<sub>0</sub>", " "},
853 {"k", "ϕ<sub>0</sub>", " "},
854 {"A", " ", " "}},
855 {{"k", "ϕ<sub>0</sub>", " "},
856 {"k", "ϕ<sub>0</sub>", " "},
857 {"A", " ", " "}}};
858
859int feunit_fbd[2][FFOURBODY][FFOURBODY_P] = {{{1, 0, 0},
860 {1, 0, 0},
861 {1, 0, 0}},
862 {{1, 0, 0},
863 {1, 0, 0},
864 {1, 0, 0}}};
865
866char * fvars_fext[2][FEXTERNAL][FEXTERNAL_P] = {{{"E<sub>x</sub>", "E<sub>y</sub>", "E<sub>z</sub>", " ", " ", " "},
867 {"A", "n", " ", " ", " ", " "},
868 {"A", "z<sub>0</sub>", " ", " ", " ", " "},
869 {"G<sub>x</sub>", "G<sub>y</sub>", "G<sub>z</sub>", " ", " ", " "},
870 {"H<sub>x</sub>", "H<sub>y</sub>", "H<sub>z</sub>", " ", " ", " "},
871 {"A", "R<sub>0</sub>", "n", "R<sub>cut</sub>", " ", " "},
872 {"A", "z<sub>0</sub>", "p", " ", " ", " "},
873 {"i<sub>ind</sub><sup>glob</sup>", "j<sub>ind</sub><sup>glob</sup>", "P<sup>in</sup><sub>k-atom</sub>", " ", " ", " "},
874 {"i<sub>ind</sub><sup>glob</sup>", "j<sub>ind</sub><sup>glob</sup>", "k", "z<sub>mn</sub>", "z<sub>mx</sub>", " "},
875 {"i<sub>ind</sub><sup>glob</sup>", "j<sub>ind</sub><sup>glob</sup>", "k", "z<sub>mn</sub>", "z<sub>mx</sub>", " "},
876 {"i<sub>ind</sub><sup>glob</sup>", "j<sub>ind</sub><sup>glob</sup>", "k", "z<sub>mn</sub>", "z<sub>mx</sub>", " "},
877 {"E<sub>x</sub>", "E<sub>y</sub>", "E<sub>z</sub>", "&omega;<sup>in</sup><sub>ps<sup>-1</sup></sub>", " ", " "},
878 {"i<sub>gid</sub><sup>A</sup>", "j<sub>gid</sub><sup>A</sup>", "k", "i<sub>gid</sub><sup>B</sup>", "j<sub>gid</sub><sup>B</sup>", "R<sub>0</sub>"}},
879 {{"E<sub>x</sub>", "E<sub>y</sub>", "E<sub>z</sub>", " ", " ", " "},
880 {"A", "n", " ", " ", " ", " "},
881 {"A", "z<sub>0</sub>", " ", " ", " ", " "},
882 {"G<sub>x</sub>", "G<sub>y</sub>", "G<sub>z</sub>", " ", " ", " "},
883 {"H<sub>x</sub>", "H<sub>y</sub>", "H<sub>z</sub>", " ", " ", " "},
884 {"A", "R<sub>0</sub>", "n", "R<sub>cut</sub>", " ", " "},
885 {"A", "z<sub>0</sub>", "p", " ", " ", " "},
886 {"i<sub>ind</sub><sup>glob</sup>", "j<sub>ind</sub><sup>glob</sup>", "P<sup>in</sup><sub>k-atom</sub>", " ", " ", " "},
887 {"i<sub>ind</sub><sup>glob</sup>", "j<sub>ind</sub><sup>glob</sup>", "k", "z<sub>mn</sub>", "z<sub>mx</sub>", " "},
888 {"i<sub>ind</sub><sup>glob</sup>", "j<sub>ind</sub><sup>glob</sup>", "k", "z<sub>mn</sub>", "z<sub>mx</sub>", " "},
889 {"i<sub>ind</sub><sup>glob</sup>", "j<sub>ind</sub><sup>glob</sup>", "k", "z<sub>mn</sub>", "z<sub>mx</sub>", " "},
890 {"E<sub>x</sub>", "E<sub>y</sub>", "E<sub>z</sub>", "&omega;<sup>in</sup><sub>ps<sup>-1</sup></sub>", " ", " "},
891 {"i<sub>gid</sub><sup>A</sup>", "j<sub>gid</sub><sup>A</sup>", "k", "i<sub>gid</sub><sup>B</sup>", "j<sub>gid</sub><sup>B</sup>", "R<sub>0</sub>"}}};
892
893int feunit_fext[2][FEXTERNAL][FEXTERNAL_P] = {{{1, 1, 1, 0, 0, 0},
894 {1, 0, 0, 0, 0, 0},
895 {1, 0, 0, 0, 0, 0},
896 {1, 1, 1, 0, 0, 0},
897 {1, 1, 1, 0, 0, 0},
898 {1, 0, 0, 0, 0, 0},
899 {1, 0, 0, 0, 0, 0},
900 {0, 0, 1, 0, 0, 0},
901 {0, 0, 1, 0, 0, 0},
902 {0, 0, 1, 0, 0, 0},
903 {0, 0, 1, 0, 0, 0},
904 {1, 1, 1, 0, 0, 0},
905 {0, 0, 0, 0, 1, 0}},
906 {{1, 1, 1, 0, 0, 0},
907 {1, 0, 0, 0, 0, 0},
908 {1, 0, 0, 0, 0, 0},
909 {1, 1, 1, 0, 0, 0},
910 {1, 1, 1, 0, 0, 0},
911 {1, 0, 0, 0, 0, 0},
912 {1, 0, 0, 0, 0, 0},
913 {0, 0, 1, 0, 0, 0},
914 {0, 0, 1, 0, 0, 0},
915 {0, 0, 1, 0, 0, 0},
916 {0, 0, 1, 0, 0, 0},
917 {1, 1, 1, 0, 0, 0},
918 {0, 0, 0, 0, 1, 0}}};
919
920int field_v[MAXDATA] = { 8, 8, 9, 7, 8, 5, 5, 8, 8, 9, 9, 10, 10, 10, 10, 6, 6, 5, 7, 8, 3};
921int field_s[MAXDATA] = {650, 520, 520, 500, 600, 450, 600, 720, 720, 720, 720, 720, 720, 720, 720, 720, 720, 720, 720, 720, 720};
922int field_a[MAXDATA] = { 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0};
923
924gchar * ctitle[MAXDATA][12] ={{i18n("Id."), i18n("Name"), i18n("Multiplicity"), i18n("Chemistry"), i18n("Atom(s)"), i18n("Species"), i18n("Viz. 3D"), i18n("Viz. Atom num.")}, // Molecule(s)
925 {i18n("Id."), i18n("Name"), i18n("Element"), i18n("Mass"), i18n("Charge"), i18n("Frozen"), i18n("Atom(s)"), i18n("Viz. 3D")}, // Atom(s)
926 {i18n("Id."), i18n("Core Id"), i18n("Shell"), i18n("Mass"), i18n("Charge"), "k2 (1)", "k4 (2)", i18n("Viz. 3D"), i18n("Use (3)")}, // Core-shell unit(s)
927 {i18n("Id."), i18n("At.1 Id"), i18n("At.2 Id"), i18n("Length [Å]"), i18n("av. d [Å] (1)"), i18n("Viz. 3D"), i18n("Use (2)")}, // Constraint(s)
928 {i18n("Id."), i18n("Length [Å]"), i18n("av. d12 [Å] (1)"), i18n("Unit Id"), i18n("At. Id"), i18n("Weight (2)"), i18n("Viz. 3D"), i18n("Use (3)")}, // Mean force potential(s)
929 {i18n("Id."), i18n("Atom(s) in unit"), i18n("List of atom(s)"), i18n("Viz. 3D"), i18n("Use (1)")}, // Rigid unit(s)
930 {i18n("Id."), i18n("Atom Id."), i18n("Viz. 3D"), i18n("Use (1)"), i18n("Potential")}, // Tethering potential(s)
931 {i18n("Id."), i18n("At.1"), i18n("At.2"), i18n("Bond(s)"), i18n("av. d [Å] (1)"), i18n("Viz. 3D"), i18n("Use (2)"), i18n("Potential (3)")}, // Bond(s)
932 {i18n("Id."), i18n("At.1"), i18n("At.2"), i18n("Bond restraint(s)"), i18n("av. d [Å] (1)"), i18n("Viz. 3D"), i18n("Use (2)"), i18n("Potential (3)")}, // Bond restraint(s)
933 {i18n("Id."), i18n("At.1"), i18n("At.2"), i18n("At.3"), i18n("Angle(s)"), i18n("av. θ [°] (1)"), i18n("Viz. 3D"), i18n("Use (2)"), i18n("Potential (3)")}, // Angle(s)
934 {i18n("Id."), i18n("At.1"), i18n("At.2"), i18n("At.3"), i18n("Angular restraint(s)"), i18n("av. θ [°] (1)"), i18n("Viz. 3D"), i18n("Use (2)"), i18n("Potential (3)")}, // Angle restraint(s)
935 {i18n("Id."), i18n("At.1"), i18n("At.2"), i18n("At.3"), i18n("At.4"), i18n("Dihedral(s)"), i18n("av. ϕ [°] (1)"), i18n("Viz. 3D"), i18n("Use (2)"), i18n("Potential (3)")}, // Dihedrals
936 {i18n("Id."), i18n("At.1"), i18n("At.2"), i18n("At.3"), i18n("At.4"), i18n("Torsional restraint(s)"), i18n("av. ϕ [°] (1)"), i18n("Viz. 3D"), i18n("Use (2)"), i18n("Potential (3)")}, // Torsions
937 {i18n("Id."), i18n("At.1"), i18n("At.2"), i18n("At.3"), i18n("At.4"), i18n("Improper(s)"), i18n("av. ϕ [°] (1)"), i18n("Viz. 3D"), i18n("Use (2)"), i18n("Potential (3)")}, // Impropers
938 {i18n("Id."), i18n("At.1"), i18n("At.2"), i18n("At.3"), i18n("At.4"), i18n("Inversion(s)"), i18n("av. ϕ [°] (1)"), i18n("Viz. 3D"), i18n("Use (2)"), i18n("Potential (3)")}, // Inversion(s)
939 {i18n("Id."), i18n("Spec.1"), i18n("Spec.2"), i18n("Viz. 3D"), i18n("Use (1)"), i18n("VdW potential")}, // VdW(s)
940 {i18n("Id."), i18n("At.1"), i18n("At.2"), i18n("Viz. 3D"), i18n("Use (1)"), i18n("Metal potential")}, // Metal(s)
941 {i18n("Id."), i18n("At."), i18n("Viz. 3D"), i18n("Use (1)"), i18n("Tersoff Pot.")}, // Tersoff potential(s)
942 {i18n("Id."), i18n("At.1"), i18n("At.2*"), i18n("At.3"), i18n("Viz. 3D"), i18n("Use (1)"), i18n("Three-body Pot.")}, // Three-body potential(s)
943 {i18n("Id."), i18n("At.1*"), i18n("At.2"), i18n("At.3"), i18n("At.4"), i18n("Viz. 3D"), i18n("Use (1)"), i18n("Four-body Pot.")}, // Four-body potential(s)
944 {i18n("Id."), i18n("Use (1)"), i18n("Field type")}}; // External field(s)
945
946GType col_type[MAXDATA][12] = {{G_TYPE_INT, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT}, // 0 - Molecule(s)
947 {G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT, G_TYPE_BOOLEAN, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT}, // 1 - Atom(s)
948 {G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_FLOAT, G_TYPE_FLOAT, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT}, // 2 - Core-shell unit(s)
949 {G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_FLOAT, G_TYPE_FLOAT, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT}, // 3 - Constraint(s)
950 {G_TYPE_INT, G_TYPE_FLOAT, G_TYPE_FLOAT, G_TYPE_INT, G_TYPE_INT, G_TYPE_FLOAT, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT}, // 4 - Mean force potential(s)
951 {G_TYPE_INT, G_TYPE_INT, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT}, // 5 - Rigid unit(s)
952 {G_TYPE_INT, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT}, // 6 - Tethering potential(s)
953 {G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT}, // 7 - Bond(s)
954 {G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT}, // 8 - Bond restraint(s)
955 {G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT}, // 9 - Angle(s)
956 {G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT}, // 10 - Angle restraint(s)
957 {G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT}, // 11 - Dihedral(s)
958 {G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT}, // 12 - Improper(s)
959 {G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT}, // 13 - Torsion(s)
960 {G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT}, // 14 - Inversion(s)
961 {G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT}, // 15 - vdW(s)
962 {G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT}, // 16 - Metal(s)
963 {G_TYPE_INT, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT}, // 17 - Tersoff potential(s)
964 {G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT}, // 18 - Three-body potential(s)
965 {G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT}, // 19 - Four-body potential(s)
966 {G_TYPE_INT, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT}}; // 20 - External field(s)
967
968// 0 - nothing
969// 1 - combo box
970// 2 - viz3D bool
971// 3 - pick bool
972// 4 - editable
973int is_special[MAXDATA][11] ={{0, 0, 0, 0, 0, 0, 2, 3, 0, 0, 0}, // Molecule(s)
974 {0, 0, 0, 4, 4, 0, 0, 2, 0, 0, 0}, // Atom(s)
975 {0, 0, 0, 4, 4, 4, 4, 2, 3, 0, 0}, // Core-shell unit(s)
976 {0, 0, 0, 4, 0, 2, 3, 0, 0, 0, 0}, // Constraint(s)
977 {0, 4, 0, 0, 0, 4, 2, 3, 0, 0, 0}, // Mean force potential(s)
978 {0, 0, 0, 2, 3, 0, 0, 0, 0, 0, 0}, // Rigid unit(s)
979 {0, 0, 2, 3, 1, 0, 0, 0, 0, 0, 0}, // Tethering potential(s)
980 {0, 0, 0, 0, 0, 2, 3, 1, 0, 0, 0}, // Bond(s)
981 {0, 0, 0, 0, 0, 2, 3, 1, 0, 0, 0}, // Bond restrain(s)
982 {0, 0, 0, 0, 0, 0, 2, 3, 1, 0, 0}, // Angle(s)
983 {0, 0, 0, 0, 0, 0, 2, 3, 1, 0, 0}, // Angle restraint(s)
984 {0, 0, 0, 0, 0, 0, 0, 2, 3, 1, 0}, // Dihedral(s)
985 {0, 0, 0, 0, 0, 0, 0, 2, 3, 1, 0}, // Torsional restraint(s)
986 {0, 0, 0, 0, 0, 0, 0, 2, 3, 1, 0}, // Improper(s)
987 {0, 0, 0, 0, 0, 0, 0, 2, 3, 1, 0}, // Inversion(s)
988 {0, 0, 0, 2, 3, 1, 0, 0, 0, 0, 0}, // vdW(s)
989 {0, 0, 0, 2, 3, 1, 0, 0, 0, 0, 0}, // Metal(s)
990 {0, 0, 2, 3, 1, 0, 0, 0, 0, 0, 0}, // Tersoff potential(s)
991 {0, 0, 0, 0, 2, 3, 1, 0, 0, 0, 0}, // Three-body potential(s)
992 {0, 0, 0, 0, 0, 2, 3, 1, 0, 0, 0}, // Four-body potential(s)
993 {0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0}}; // External field(s)
994
995gboolean afp_init[MAXDATC+MAXDATA] = {TRUE, // 0 - System
996 TRUE, // 1 - Analysis
997 TRUE, // 2 - Electrostatics
998 TRUE, // 3 - Equilibration
999 TRUE, // 4 - Thermodynamics
1000 TRUE, // 5 - Molecular dynamics
1001 TRUE, // 6 - Output
1002 TRUE, // 7 - Computational
1003 TRUE, // 8 - Molecule(s)
1004 TRUE, // 9 - Atom(s)
1005 FALSE, // 10 - Shell(s)
1006 FALSE, // 11 - Constraint(s)
1007 FALSE, // 12 - Mean force potential(s)
1008 FALSE, // 13 - Rigid unit(s)
1009 FALSE, // 14 - Tethering potential(s)
1010 TRUE, // 15 - Bond(s)
1011 FALSE, // 16 - Bond restraint(s)
1012 TRUE, // 17 - Angle(s)
1013 FALSE, // 18 _ Angle restraint(s)
1014 TRUE, // 19 - Dihedral(s)
1015 FALSE, // 20 - Torsional restraint(s)
1016 FALSE, // 21 - Improper(s)
1017 FALSE, // 22 - Inversion(s)
1018 TRUE, // 23 - Vdw(s)
1019 FALSE, // 24 - Metal(s)
1020 FALSE, // 25 - Tersoff potential(s)
1021 FALSE, // 26 - Three-body potential(s)
1022 FALSE, // 27 - Four-body potential(s)
1023 FALSE};// 28 - External field(s)
1024
1025gchar * mo_title[8]={i18n("Bond"), i18n("Bond restraint"), i18n("Angle"), i18n("Angle restraint"), i18n("Dihedral"), i18n("Torsional restraint"), i18n("Improper"), i18n("Inversion")};
1026
1027// Energy converter, values taken from DL_POLY 'read_file.f90' and 'setup_module.f90'
1028float internal_to_other[5] = {9648.530821, 418.4, 100.0, 0.831451115, 1.0};
1029
1031GtkTreeViewColumn * field_col[MAXDATA][11];
1032GtkCellRenderer * field_renderer[MAXDATA][11];
1033GtkWidget * mol_box[MOLIMIT-1];
1034GtkWidget * combo_mol[MOLIMIT-1];
1035GtkWidget * field_tree[MAXDATA];
1037GtkTreeStore * field_model[MAXDATA];
1038GtkTreeIter field_iter;
1039
1058
1059//GtkWidget * view[13];
1060GtkWidget * aview;
1061GtkWidget * cs_label[2];
1062GtkWidget * fwin = NULL;
1063GtkWidget * cwin = NULL;
1064GtkWidget * mol_num_label = NULL;
1065GtkWidget * fibox[MAXDATC+MAXDATA+2];
1066GtkWidget * enbox;
1067GtkWidget * ff_but[19];
1068
1069int field_object = FALSE;
1070gboolean field_color = FALSE;
1073
1074extern void field_unselect_all ();
1075extern gboolean tersoff_question ();
1076extern void check_tersoffs (int id, int key);
1077extern void check_to_visualize_properties (int id);
1078extern int get_num_vdw_max ();
1079extern gchar * get_body_element_name (field_nth_body * body, int aid, int nbd);
1080extern void print_lammps_atom_file (GtkTextBuffer * buf);
1081
1089int struct_id (int f)
1090{
1091 if (f < 9)
1092 {
1093 return 2;
1094 }
1095 else if (f < 11)
1096 {
1097 return 3;
1098 }
1099 else
1100 {
1101 return 4;
1102 }
1103}
1104
1112int body_at (int b)
1113{
1114 if (b < 2)
1115 {
1116 return 2;
1117 }
1118 else if (b == 2)
1119 {
1120 return 1;
1121 }
1122 else
1123 {
1124 return b;
1125 }
1126}
1127
1129
1136{
1137 gchar * str;
1138 str = g_strdup_printf ("<b>%d</b>", tmp_field -> molecules);
1139 if (mol_num_label == NULL)
1140 {
1141 mol_num_label = markup_label(str, -1, -1, 0.0, 0.5);
1142 }
1143 else
1144 {
1145 gtk_label_set_text (GTK_LABEL(mol_num_label), str);
1146 gtk_label_set_use_markup (GTK_LABEL(mol_num_label), TRUE);
1147 }
1148}
1149
1158{
1159 gchar * str;
1160 str = g_strdup_printf (_("\t <b>(1)</b> Force constant of the core-shell spring in [<b>%s &#xC5;<sup>-2</sup></b>]"), exact_name(fkeysw[activef][0][i]));
1161 gtk_label_set_text (GTK_LABEL(cs_label[0]), str);
1162 gtk_label_set_use_markup (GTK_LABEL(cs_label[0]), TRUE);
1163 g_free (str);
1164
1165 str = g_strdup_printf (_("\t <b>(2)</b> Quartic (anharmonic) force constant of the core-shell spring in [<b>%s &#xC5;<sup>-4</sup></b>]"
1166 " usually <i>k<sub>2</sub></i> >> <i>k<sub>4</sub></i>"), exact_name(fkeysw[activef][0][i]));
1167 gtk_label_set_text (GTK_LABEL(cs_label[1]), str);
1168 gtk_label_set_use_markup (GTK_LABEL(cs_label[1]), TRUE);
1169 g_free (str);
1170}
1171
1175gchar *** is_var;
1176
1187gchar * parameters_info (int obj, int key, gchar ** words, float * data)
1188{
1189 int i;
1190 gchar * str = NULL;
1191 if (fvalues[activef][obj][key] > 0)
1192 {
1193 // float v = internal_to_other[tmp_field -> energy_unit] / internal_to_other[ff_unit];
1194 str = g_strdup_printf (" <b><i>%s</i>=</b> %.3f", words[0], data[0]);
1195 for (i=1; i< fvalues[activef][obj][key]; i++) str = g_strdup_printf ("%s, <b><i>%s</i>=</b> %.3f", str, words[i], data[i]);
1196 }
1197 else
1198 {
1199 str = g_strdup_printf (_("<i>Tabulated</i>"));
1200 }
1201 return str;
1202}
1203
1204extern void print_all_field_struct (field_molecule * mol, int str);
1205
1215gboolean dlp_to_translate (int fid, int obj, int key)
1216{
1217 switch (fid)
1218 {
1219 case 0:
1220 if (obj == 0 || obj == 1 || obj == 9 || obj == 13 || obj == 14 || obj == 15) return TRUE;
1221 if ((obj == 2 || obj == 3) && (key == 0 || key == 3 || key == 4 || key == 7 || key == 8 || key == 9)) return TRUE;
1222 if ((obj == 4 || obj == 5) && key != 13) return TRUE;
1223 if ((obj == 6 || obj == 7 || obj == 8) && key != 4) return TRUE;
1224 if (obj == 10 && (key == 2 || key == 6 || key == 7 || key == 8 || key == 9 || key == 10)) return TRUE;
1225 if (obj == 11 && key == 5) return TRUE;
1226 break;
1227 case 1:
1228 if (obj == 0 && (key == 1 || key == 2 || key == 3 || key == 5)) return TRUE;
1229 if (obj == 2 && key != 7) return TRUE;
1230 if (obj == 4 && key != 16) return TRUE;
1231 if (obj == 6 || obj == 8 || obj == 10) return TRUE;
1232 break;
1233 }
1234 return FALSE;
1235}
1236
1246void fill_field_struct (GtkTreeStore * store, int id, int mo)
1247{
1248 int j, k, l;
1249 char ** vars;
1250 gchar * stra, * strb, * strc;
1251 GtkTreeIter field_level;
1252 if (tmp_field -> afp[MAXDATC])
1253 {
1254 for (j=0; j<mo; j++) tmp_fmol = tmp_fmol -> next;
1255 }
1256#ifdef DEBUG
1257 //g_debug ("id= %d, mo= %d", id, mo);
1258 //if (id > 5) print_all_field_struct (tmp_fmol, id);
1259#endif
1260 tmp_fstr = tmp_fmol -> first_struct[id];
1261 l = id + 2;
1262 while (tmp_fstr)
1263 {
1264 gtk_tree_store_append (store, & field_level, NULL);
1265 tmp_fprop = tmp_fstr -> def;
1266 stra = g_strdup_printf ("%.3f", tmp_fstr -> av);
1267 strb = g_strdup_printf (_("<b>Default</b>: %s (%s)"),
1268 dlp_to_translate(activef,l,tmp_fprop -> key) ? _(fnames[activef][l][tmp_fprop -> key]) : fnames[activef][l][tmp_fprop -> key],
1269 exact_name(fkeysw[activef][l][tmp_fprop -> key]));
1270 if (id < 2)
1271 {
1272 vars = (char **)fvars_bond[activef][tmp_fprop -> key];
1273 }
1274 else if (id < 4)
1275 {
1276 vars = (char **)fvars_angle[activef][tmp_fprop -> key];
1277 }
1278 else if (id < 7)
1279 {
1280 vars = (char **)fvars_dihedral[activef][tmp_fprop -> key];
1281 }
1282 else
1283 {
1284 vars = (char **)fvars_inversion[activef][tmp_fprop -> key];
1285 }
1286
1287 strc = parameters_info (l-1, tmp_fprop -> key, vars, tmp_fprop -> val);
1288 for (k=0; k<struct_id(id+7); k++) gtk_tree_store_set (store, & field_level, k+1, get_active_atom (mo, tmp_fstr -> aid[k]) -> name, -1);
1289 gtk_tree_store_set (store, & field_level, 0, tmp_fstr -> id+1,
1290 k+1, tmp_fstr -> num,
1291 k+2, stra,
1292 k+3, tmp_fstr -> def -> show,
1293 k+4, tmp_fstr -> def -> use,
1294 k+5, strb,
1295 k+6, strc,
1296 k+7, tmp_fstr -> id, -1);
1297 g_free (stra);
1298 g_free (strb);
1299 g_free (strc);
1300 tmp_fat = get_active_atom (mo, tmp_fstr -> aid[0]);
1301 tmp_fbt = get_active_atom (mo, tmp_fstr -> aid[1]);
1302 if (id > 1) tmp_fct = get_active_atom (mo, tmp_fstr -> aid[2]);
1303 if (id > 3) tmp_fdt = get_active_atom (mo, tmp_fstr -> aid[3]);
1304 if (id < 2)
1305 {
1306 print_dlp_bond (id, NULL, tmp_fstr, tmp_fmol -> fragments[0], store, & field_level);
1307 }
1308 else if (id < 4)
1309 {
1310 print_dlp_angle (id, NULL, tmp_fstr, tmp_fmol -> fragments[0], store, & field_level);
1311 }
1312 else if (id < 6)
1313 {
1314 print_dlp_dihedral (id, NULL, tmp_fstr, tmp_fmol -> fragments[0], store, & field_level);
1315 }
1316 else if (id < 8)
1317 {
1318 print_dlp_improper_inversion (id, NULL, tmp_fstr, tmp_fmol -> fragments[0], store, & field_level);
1319 }
1320 tmp_fstr = tmp_fstr -> next;
1321 }
1322}
1323
1332void fill_field_body (GtkTreeStore * store, int id)
1333{
1334 int i, j, k, l;
1335 gchar * stra, * strb;
1336 GtkTreeIter field_level;
1337 if (! id)
1338 {
1339 i = get_num_vdw_max ();
1340 }
1341 tmp_fbody = tmp_field -> first_body[id];
1342 k = body_at(id);
1343 for (i=0; i < tmp_field -> nbody[id]; i++)
1344 {
1345 gtk_tree_store_append (store, & field_level, NULL);
1346 for (j=0; j<k ; j++)
1347 {
1348 if (tmp_fbody -> na[j] > 0)
1349 {
1350 if (! id)
1351 {
1352 gtk_tree_store_set (store, & field_level, j+1, get_body_element_name (tmp_fbody, j, 0), -1);
1353 }
1354 else
1355 {
1356 l = tmp_fbody -> ma[j][0];
1357 gtk_tree_store_set (store, & field_level, j+1, get_active_atom (l, tmp_fbody -> a[j][0]) -> name, -1);
1358 }
1359 }
1360 }
1361 stra = g_strdup_printf ("%s (%s)",
1362 dlp_to_translate(activef,10+id,tmp_fbody -> key) ? _(fnames[activef][10+id][tmp_fbody -> key]) : fnames[activef][10+id][tmp_fbody -> key],
1363 exact_name(fkeysw[activef][10+id][tmp_fbody -> key]));
1364 if (id == 0) strb = parameters_info (9+id, tmp_fbody -> key, fvars_vdw[activef][tmp_fbody -> key], tmp_fbody -> val);
1365 if (id == 1) strb = parameters_info (9+id, tmp_fbody -> key, fvars_met[activef][tmp_fbody -> key], tmp_fbody -> val);
1366 if (id == 2) strb = parameters_info (9+id, tmp_fbody -> key, fvars_ters[activef][tmp_fbody -> key], tmp_fbody -> val);
1367 if (id == 3) strb = parameters_info (9+id, tmp_fbody -> key, fvars_tbd[activef][tmp_fbody -> key], tmp_fbody -> val);
1368 if (id == 4) strb = parameters_info (9+id, tmp_fbody -> key, fvars_fbd[activef][tmp_fbody -> key], tmp_fbody -> val);
1369 gtk_tree_store_set (store, & field_level, 0, tmp_fbody -> id+1,
1370 k+1, tmp_fbody -> show,
1371 k+2, tmp_fbody -> use,
1372 k+3, stra,
1373 k+4, strb, -1);
1374 g_free (stra);
1375 g_free (strb);
1376 if (tmp_fbody -> next != NULL) tmp_fbody = tmp_fbody -> next;
1377 }
1378}
1379
1389void fill_field_model (GtkTreeStore * store, int f, int m)
1390{
1391 GtkTreeIter field_level, unit_level, site_level;
1392 int i, j, k, l;
1393 gchar * stra, * strb, * strc, * strd;
1394
1395 tmp_fmol = tmp_field -> first_molecule;
1396
1397 //if (get_active_field_elements(f) >= GTK_LIMIT && ! tmp_field -> show_all[f])
1398 {
1399
1400 }
1401 //else
1402 {
1403 switch (f)
1404 {
1405 case 0:
1406 stra = NULL;
1407 for (i=0; i< tmp_field -> molecules; i++)
1408 {
1409 tmp_mol = tmp_fmol -> mol;
1410 for (j=0; j < tmp_proj -> nspec; j++)
1411 {
1412 if (tmp_mol -> species[j] > 0)
1413 {
1414 if (tmp_mol -> species[j] == 1)
1415 {
1416 if (stra == NULL)
1417 {
1418 stra = g_strdup_printf ("%s ", exact_name(tmp_proj -> chemistry -> label[j]));
1419 }
1420 else
1421 {
1422 stra = g_strdup_printf ("%s%s ", stra, exact_name(tmp_proj -> chemistry -> label[j]));
1423 }
1424 }
1425 else
1426 {
1427 if (stra == NULL)
1428 {
1429 stra = g_strdup_printf ("%s<sub>%d</sub> ", exact_name(tmp_proj -> chemistry -> label[j]), tmp_mol -> species[j]);
1430 }
1431 else
1432 {
1433 stra = g_strdup_printf ("%s%s<sub>%d</sub> ", stra, exact_name(tmp_proj -> chemistry -> label[j]), tmp_mol -> species[j]);
1434 }
1435 }
1436 }
1437 }
1438 gtk_tree_store_append (store, & field_level, NULL);
1439 gtk_tree_store_set (store, & field_level, 0, i+1,
1440 1, tmp_fmol -> name,
1441 2, tmp_fmol -> multi,
1442 3, stra,
1443 4, tmp_mol -> natoms,
1444 5, tmp_mol -> nspec,
1445 6, tmp_fmol -> show,
1446 7, tmp_fmol -> show_id, -1);
1447 g_free (stra);
1448 stra = NULL;
1449 if (tmp_fmol -> next != NULL) tmp_fmol = tmp_fmol -> next;
1450 }
1451 break;
1452 case 1:
1453 if (tmp_field -> afp[MAXDATC])
1454 {
1455 for (j=0; j<m; j++) tmp_fmol = tmp_fmol -> next;
1456 }
1457 tmp_fat = tmp_fmol -> first_atom;
1458 for (i=0; i < tmp_fmol -> atoms; i++)
1459 {
1460 gtk_tree_store_append (store, & field_level, NULL);
1461 stra = g_strdup_printf ("%.3f", tmp_fat -> mass);
1462 strb = g_strdup_printf ("%.2f", tmp_fat -> charge);
1463 gtk_tree_store_set (store, & field_level, 0, i+1,
1464 1, tmp_fat -> name,
1465 2, tmp_proj -> chemistry -> label[tmp_fat -> sp],
1466 3, stra,
1467 4, strb,
1468 5, tmp_fat -> frozen,
1469 6, tmp_fat -> num / tmp_fmol -> multi,
1470 7, tmp_fat -> show, -1);
1471 g_free (stra);
1472 g_free (strb);
1473 if (tmp_fat -> next != NULL) tmp_fat = tmp_fat -> next;
1474 }
1475 break;
1476 case 2:
1477 if (tmp_field -> afp[MAXDATC])
1478 {
1479 for (j=0; j<m; j++) tmp_fmol = tmp_fmol -> next;
1480 }
1481 tmp_fshell = tmp_fmol -> first_shell;
1482 for (i=0; i < tmp_fmol -> shells; i++)
1483 {
1484 gtk_tree_store_append (store, & field_level, NULL);
1485 if (tmp_fshell -> ia[0])
1486 {
1487 l = tmp_fmol -> atoms_id[tmp_fshell -> ia[0]-1][0].a;
1488 tmp_fat = get_active_atom (tmp_fmol -> id, l);
1489 stra = g_strdup_printf ("%d (%s)", tmp_fshell -> ia[0], exact_name(tmp_proj -> chemistry -> label[tmp_fat -> sp]));
1490 }
1491 else
1492 {
1493 stra = g_strdup_printf ("<i>%s</i>", _("None"));
1494 }
1495 if (tmp_fshell -> ia[1])
1496 {
1497 l = tmp_fmol -> atoms_id[tmp_fshell -> ia[1]-1][0].a;
1498 tmp_fat = get_active_atom (tmp_fmol -> id, l);
1499 strb = g_strdup_printf ("%d (%s)", tmp_fshell -> ia[1], exact_name(tmp_proj -> chemistry -> label[tmp_fat -> sp]));
1500 }
1501 else
1502 {
1503 strb = g_strdup_printf ("<i>%s</i>", _("None"));
1504 }
1505 strc = g_strdup_printf ("%.3f", tmp_fshell -> m);
1506 strd = g_strdup_printf ("%.2f", tmp_fshell -> z);
1507 gtk_tree_store_set (store, & field_level, 0, i+1,
1508 1, stra,
1509 2, strb,
1510 3, strc,
1511 4, strd,
1512 5, tmp_fshell -> k2,
1513 6, tmp_fshell -> k4,
1514 7, tmp_fshell -> show,
1515 8, tmp_fshell -> use, -1);
1516 g_free (stra);
1517 g_free (strb);
1518 g_free (strc);
1519 g_free (strd);
1520 if (tmp_fshell -> next != NULL) tmp_fshell = tmp_fshell -> next;
1521 }
1522 break;
1523 case 3:
1524 if (tmp_field -> afp[MAXDATC])
1525 {
1526 for (j=0; j<m; j++) tmp_fmol = tmp_fmol -> next;
1527 }
1528 tmp_fcons = tmp_fmol -> first_constraint;
1529 for (i=0; i < tmp_fmol -> constraints; i++)
1530 {
1531 gtk_tree_store_append (store, & field_level, NULL);
1532 if (tmp_fcons -> ia[0])
1533 {
1534 k = tmp_fmol -> atoms_id[tmp_fcons -> ia[0]-1][0].a;
1535 l = get_active_atom (m, k) -> sp;
1536 stra = g_strdup_printf ("%d (%s)", tmp_fcons -> ia[0], exact_name(tmp_proj -> chemistry -> label[l]));
1537 }
1538 else
1539 {
1540 stra = g_strdup_printf ("<i>%s</i>", _("None"));
1541 }
1542 if (tmp_fcons -> ia[1])
1543 {
1544 k = tmp_fmol -> atoms_id[tmp_fcons -> ia[1]-1][0].a;
1545 l = get_active_atom (m, k) -> sp;
1546 strb = g_strdup_printf ("%d (%s)", tmp_fcons -> ia[1], exact_name(tmp_proj -> chemistry -> label[l]));
1547 }
1548 else
1549 {
1550 strb = g_strdup_printf ("<i>%s</i>", _("None"));
1551 }
1552 gtk_tree_store_set (store, & field_level, 0, i+1,
1553 1, stra,
1554 2, strb,
1555 3, tmp_fcons -> length,
1556 4, tmp_fcons -> av,
1557 5, tmp_fcons -> show,
1558 6, tmp_fcons -> use, -1);
1559 g_free (stra);
1560 g_free (strb);
1561 if (tmp_fcons -> next != NULL) tmp_fcons = tmp_fcons -> next;
1562 }
1563 break;
1564 case 4:
1565 if (tmp_field -> afp[MAXDATC])
1566 {
1567 for (j=0; j<m; j++) tmp_fmol = tmp_fmol -> next;
1568 }
1569 tmp_fpmf = tmp_fmol -> first_pmf;
1570 for (i=0; i < tmp_fmol -> pmfs; i++)
1571 {
1572 gtk_tree_store_append (store, & field_level, NULL);
1573 gtk_tree_store_set (store, & field_level, 0, i+1,
1574 1, tmp_fpmf -> length,
1575 2, tmp_fpmf -> av,
1576 3, 0, 4, 0, 5, 0.0,
1577 6, tmp_fpmf -> show,
1578 7, tmp_fpmf -> use, -1);
1579 for (j=0; j<2; j++)
1580 {
1581 gtk_tree_store_append (store, & unit_level, & field_level);
1582 gtk_tree_store_set (store, & unit_level, 0, -(i+1), 1, 0.0, 2, 0.0, 3, j+1, 4, 0, 5, 0.0, 6, tmp_fpmf -> show, 7, FALSE, -1);
1583 if (tmp_fpmf -> num[j] > 0)
1584 {
1585 for (k=0; k<tmp_fpmf -> num[j]; k++)
1586 {
1587 gtk_tree_store_append (store, & site_level, & unit_level);
1588 gtk_tree_store_set (store, & site_level, 0, -(i+1), 1, 0.0, 2, 0.0, 3, -(j+1),
1589 4, tmp_fpmf -> list[j][k]+1,
1590 5, tmp_fpmf -> weight[j][k], 6, tmp_fpmf -> show, 7, FALSE, -1);
1591 }
1592 }
1593 }
1594 if (tmp_fpmf -> next != NULL) tmp_fpmf = tmp_fpmf -> next;
1595 }
1596 break;
1597 case 5:
1598 if (tmp_field -> afp[MAXDATC])
1599 {
1600 for (j=0; j<m; j++) tmp_fmol = tmp_fmol -> next;
1601 }
1602 tmp_frig = tmp_fmol -> first_rigid;
1603 for (i=0; i < tmp_fmol -> rigids; i++)
1604 {
1605 gtk_tree_store_append (store, & field_level, NULL);
1606 gtk_tree_store_set (store, & field_level, 0, i+1,
1607 1, tmp_frig -> num,
1608 2, NULL,
1609 3, tmp_frig -> show,
1610 4, tmp_frig -> use, -1);
1611 if (tmp_frig -> num > 0)
1612 {
1613 for (j=0; j<tmp_frig -> num; j++)
1614 {
1615 l = tmp_fmol -> atoms_id[tmp_frig -> list[j]][0].a;
1616 k = get_active_atom (m, l) -> sp;
1617 stra = g_strdup_printf ("%d (%s)", tmp_frig -> list[j]+1, exact_name(tmp_proj -> chemistry -> label[k]));
1618 gtk_tree_store_append (store, & unit_level, & field_level);
1619 gtk_tree_store_set (store, & unit_level, 0, -(i+1), 1, 0, 2, stra, 3, FALSE, 4, FALSE, -1);
1620 g_free (stra);
1621 }
1622 }
1623 if (tmp_frig -> next != NULL) tmp_frig = tmp_frig -> next;
1624 }
1625 break;
1626 case 6:
1627 if (tmp_field -> afp[MAXDATC])
1628 {
1629 for (j=0; j<m; j++) tmp_fmol = tmp_fmol -> next;
1630 }
1631 tmp_ftet = tmp_fmol -> first_tethered;
1632 for (i=0; i < tmp_fmol -> tethered; i++)
1633 {
1634 j = tmp_fmol -> atoms_id[tmp_ftet -> num-1][0].a;
1635 k = get_active_atom (m, j) -> sp;
1636 stra = g_strdup_printf ("%d (%s)", tmp_ftet -> num, exact_name(tmp_proj -> chemistry -> label[k]));
1637 strb = g_strdup_printf ("%s (%s)", (activef) ? fnames[activef][1][tmp_ftet -> key] : _(fnames[activef][1][tmp_ftet -> key]), exact_name(fkeysw[activef][1][tmp_ftet -> key]));
1638 strc = parameters_info (0, tmp_ftet -> key, fvars_teth[activef][tmp_ftet -> key], tmp_ftet -> val);
1639 gtk_tree_store_append (store, & field_level, NULL);
1640 gtk_tree_store_set (store, & field_level, 0, i+1,
1641 1, stra,
1642 2, tmp_ftet -> show,
1643 3, tmp_ftet -> use,
1644 4, strb,
1645 5, strc, -1);
1646 g_free (stra);
1647 g_free (strb);
1648 g_free (strc);
1649 if (tmp_ftet -> next != NULL) tmp_ftet = tmp_ftet -> next;
1650 }
1651 break;
1652 case SEXTERN:
1653 // External field
1654 tmp_fext = tmp_field -> first_external;
1655 for (i=0; i < tmp_field -> extern_fields; i++)
1656 {
1657 gtk_tree_store_append (store, & field_level, NULL);
1658 stra = g_strdup_printf ("%s (%s)", (activef) ? fnames[activef][15][tmp_fext -> key] : _(fnames[activef][15][tmp_fext -> key]), exact_name(fkeysw[activef][15][tmp_fext -> key]));
1659 gtk_tree_store_set (store, & field_level, 0, tmp_fext -> id+1,
1660 1, tmp_fext -> use,
1661 2, stra,
1662 3, parameters_info (14, tmp_fext -> key, fvars_fext[activef][tmp_fext -> key], tmp_fext -> val), -1);
1663 g_free (stra);
1664 if (tmp_fext -> next != NULL) tmp_fext = tmp_fext -> next;
1665 }
1666 break;
1667 default:
1668 if (f < MOLIMIT)
1669 {
1670 fill_field_struct (store, f-7, m);
1671 }
1672 else
1673 {
1674 fill_field_body (store, f - MOLIMIT);
1675 }
1676 break;
1677 }
1678 }
1679}
1680
1681#ifdef GTK4
1690G_MODULE_EXPORT void toggle_field_params (GtkCheckButton * but, gpointer data)
1691#else
1700G_MODULE_EXPORT void toggle_field_params (GtkToggleButton * but, gpointer data)
1701#endif
1702{
1703 int i, j;
1704 i = GPOINTER_TO_INT (data);
1705 tmp_field -> afp[i] = button_get_status ((GtkWidget *)but);
1706 if (i == MAXDATC)
1707 {
1708 for (j=0; j<MOLIMIT-1; j++)
1709 {
1712 }
1713 }
1714 else if (i > MAXDATC)
1715 {
1716 gtk_widget_set_visible (fibox[i+1], tmp_field -> afp[i]);
1717 }
1718}
1719
1727gboolean set_nbd_but_sensitive (int nbid)
1728{
1729 if (nbid == 0 || nbid == 2 || nbid == 5)
1730 {
1731 return TRUE;
1732 }
1733 else
1734 {
1735 int i, j;
1736 i = (nbid == 1) ? 2 : nbid;
1737 j = 0;
1738 field_molecule * ftmp = tmp_field -> first_molecule;
1739 while (ftmp)
1740 {
1741 j += ftmp -> atoms;
1742 ftmp = ftmp -> next;
1743 }
1744 gboolean res = (j >= i) ? TRUE : FALSE;
1745 return res;
1746 }
1747}
1748
1757gchar * set_field_label (int f, int m)
1758{
1759 gchar * lab;
1760 int k;
1761 if (f < MOLIMIT)
1762 {
1763 if (tmp_field -> afp[MAXDATC])
1764 {
1766 lab = g_strdup_printf (_("the <b>%d</b> different fragment(s) in molecule <b>%s</b>\n"),
1767 tmp_fmol -> multi, tmp_fmol -> name);
1768 }
1769 else
1770 {
1771 lab = g_strdup_printf (_("the system\n"));
1772 }
1773 }
1774 switch (f)
1775 {
1776 case 1:
1777 lab = g_strdup_printf (_("%seach contains the following <b>%d</b> type(s) of atom"), lab, tmp_fmol -> atoms);
1778 break;
1779 case 2:
1780 if (tmp_fmol -> shells == 0)
1781 {
1782 lab = g_strdup_printf (_("%sdo not contains any core-shell unit"), lab);
1783 }
1784 else
1785 {
1786 lab = g_strdup_printf (_("%seach contains the following <b>%d</b> core-shell unit"), lab, tmp_fmol -> shells);
1787 }
1788 break;
1789 case 3:
1790 if (tmp_fmol -> constraints == 0)
1791 {
1792 lab = g_strdup_printf (_("%sdo not contains any constraint"), lab);
1793 }
1794 else
1795 {
1796 lab = g_strdup_printf (_("%seach contains the following <b>%d</b> constraint(s)"), lab, tmp_fmol -> constraints);
1797 }
1798 break;
1799 case 4:
1800 if (tmp_fmol -> pmfs == 0)
1801 {
1802 lab = g_strdup_printf (_("%sdo not contains any mean force potential"), lab);
1803 }
1804 else
1805 {
1806 lab = g_strdup_printf (_("%seach contains the following <b>%d</b> type(s) of mean force potential(s)"), lab, tmp_fmol -> pmfs);
1807 }
1808 break;
1809 case 5:
1810 if (tmp_fmol -> rigids == 0)
1811 {
1812 lab = g_strdup_printf (_("%sdo not contains any rigid unit"), lab);
1813 }
1814 else
1815 {
1816 lab = g_strdup_printf (_("%seach contains the following <b>%d</b> rigid unit(s)"), lab, tmp_fmol -> rigids);
1817 }
1818 break;
1819 case 6:
1820 if (tmp_fmol -> tethered == 0)
1821 {
1822 lab = g_strdup_printf (_("%sdo not contains any tethering potential(s)"), lab);
1823 }
1824 else
1825 {
1826 lab = g_strdup_printf (_("%seach contains the following <b>%d</b> tethering potential(s)"), lab, tmp_fmol -> tethered);
1827 }
1828 break;
1829 case SEXTERN:
1830 if (tmp_field -> extern_fields == 0)
1831 {
1832 lab = g_strdup_printf (_("the force field do not contains any external field(s)"));
1833 }
1834 else
1835 {
1836 lab = g_strdup_printf (_("the force field contains the following <b>%d</b> external field(s)"), tmp_field -> extern_fields);
1837 }
1838 break;
1839 default:
1840 if (f < MOLIMIT)
1841 {
1842 if (f == 14)
1843 {
1844 if (tmp_fmol -> nstruct[f-7] == 0)
1845 {
1846 lab = g_strdup_printf (_("%sdo not contains any %s <sup>*</sup>"), lab, _(mo_title[f-7]));
1847 }
1848 else
1849 {
1850 lab = g_strdup_printf (_("%s contains the following <b>%d</b> type(s) %s <sup>*</sup>"), lab, tmp_fmol -> nstruct[f-7], _(intelemts[f]));
1851 }
1852 }
1853 else
1854 {
1855 if (tmp_fmol -> nstruct[f-7] == 0)
1856 {
1857 lab = g_strdup_printf (_("%sdo not contains any %s"), lab, _(mo_title[f-7]));
1858 }
1859 else
1860 {
1861 lab = g_strdup_printf (_("%s contains the following <b>%d</b> type(s) %s"), lab, tmp_fmol -> nstruct[f-7], _(intelemts[f]));
1862 }
1863 }
1864 break;
1865 }
1866 else
1867 {
1868 k = f - MOLIMIT;
1869 if (tmp_field -> nbody[k] == 0)
1870 {
1871 lab = g_strdup_printf (_("the force field do not contains any %s"), _(elemt[f]));
1872 }
1873 else
1874 {
1875 lab = g_strdup_printf (_("the force field contains the following <b>%d</b> %s"), tmp_field -> nbody[k], _(elemts[f]));
1876 }
1877 break;
1878 }
1879 }
1880 return lab;
1881}
1882
1891G_MODULE_EXPORT void changed_mol_box (GtkComboBox * box, gpointer data)
1892{
1893 int i, j;
1894 i = GPOINTER_TO_INT(data);
1895 j = combo_get_active ((GtkWidget *)box);
1896 gtk_label_set_text (GTK_LABEL(field_label[i]), set_field_label(i, j));
1897 gtk_label_set_use_markup (GTK_LABEL(field_label[i]), TRUE);
1898 gtk_tree_store_clear (field_model[i]);
1899 fill_field_model (field_model[i], i, j);
1900}
1901
1908{
1909 int i;
1910 for (i=0; i<MAXDATA; i++)
1911 {
1912 if (i > 0 && i < MOLIMIT)
1913 {
1914 changed_mol_box (GTK_COMBO_BOX (combo_mol[i-1]), GINT_TO_POINTER(i));
1915 }
1916 else
1917 {
1918 if (i > 0)
1919 {
1920 gtk_label_set_text (GTK_LABEL(field_label[i]), set_field_label(i, 0));
1921 gtk_label_set_use_markup(GTK_LABEL(field_label[i]), TRUE);
1922 }
1923 gtk_tree_store_clear (field_model[i]);
1924 fill_field_model (field_model[i], i, -1);
1925 }
1926 }
1927}
1928
1937void get_is_energy (int i, int l)
1938{
1939 int j, k;
1940 j = (i > 1 && i < 8) ? (i-1)/2 + 1 - i/7 : i;
1941 is_energy = g_malloc0(fetypes[activef][i+1]*sizeof*is_energy);
1942 if (l)
1943 {
1944 is_var = g_malloc0(fetypes[activef][i+1]*sizeof*is_var);
1945 }
1946 switch (j)
1947 {
1948 case 0:
1949 for (k=0; k<fetypes[activef][i+1]; k++)
1950 {
1953 }
1954 break;
1955 case 1:
1956 // Bonds
1957 for (k=0; k<fetypes[activef][i+1]; k++)
1958 {
1961 }
1962 break;
1963 case 2:
1964 // Angles
1965 for (k=0; k<fetypes[activef][i+1]; k++)
1966 {
1969 }
1970 break;
1971 case 3:
1972 // Dihedrals / Impropers
1973 for (k=0; k<fetypes[activef][i+1]; k++)
1974 {
1977 }
1978 break;
1979 case 8:
1980 // Inversions
1981 for (k=0; k<fetypes[activef][i+1]; k++)
1982 {
1985 }
1986 break;
1987 case 9:
1988 for (k=0; k<fetypes[activef][i+1]; k++)
1989 {
1991 if (l) is_var[k] = duplicate_strings (FVDW_P, fvars_vdw[activef][k]);
1992 }
1993 break;
1994 case 10:
1995 for (k=0; k<fetypes[activef][i+1]; k++)
1996 {
1999 }
2000 break;
2001 case 11:
2002 for (k=0; k<fetypes[activef][i+1]; k++)
2003 {
2006 }
2007 break;
2008 case 12:
2009 for (k=0; k<fetypes[activef][i+1]; k++)
2010 {
2013 }
2014 break;
2015 case 13:
2016 for (k=0; k<fetypes[activef][i+1]; k++)
2017 {
2020 }
2021 break;
2022 case 14:
2023 for (k=0; k<fetypes[activef][i+1]; k++)
2024 {
2027 }
2028 break;
2029 }
2030}
2031
2041gboolean field_file_has_energy_parameters (gboolean scale, int sca, int scb)
2042{
2043 int i, j, k, l;
2044 is_param = allocdint (15, 21);
2045 has_energy = allocint (15);
2046 i = 0;
2047 tmp_fmol = tmp_field -> first_molecule;
2048 while (tmp_fmol)
2049 {
2051 while (tmp_fshell)
2052 {
2053 if (! scale)
2054 {
2055 i =1;
2056 break;
2057 }
2058 else
2059 {
2062 tmp_fshell = tmp_fshell -> next;
2063 }
2064 }
2065 tmp_fmol = tmp_fmol -> next;
2066 }
2067 for (j=0; j<15; j++)
2068 {
2069 get_is_energy (j, 0);
2070 l = 0;
2071 if (j == 0)
2072 {
2073 tmp_fmol = tmp_field -> first_molecule;
2074 while (tmp_fmol)
2075 {
2077 while (tmp_ftet)
2078 {
2079 for (k=0; k<fvalues[activef][j][tmp_ftet -> key]; k++)
2080 {
2081 if (is_energy[tmp_ftet -> key][k])
2082 {
2083 is_param[j][tmp_ftet -> key] ++;
2084 if (scale) tmp_ftet -> val[k]= (tmp_ftet -> val[k] * internal_to_other[sca]) / internal_to_other[scb];
2085 l ++;
2086 }
2087 }
2088 tmp_ftet = tmp_ftet -> next;
2089 }
2090 tmp_fmol = tmp_fmol -> next;
2091 }
2092 }
2093 else if (j>0 && j<9)
2094 {
2095 tmp_fmol = tmp_field -> first_molecule;
2096 while (tmp_fmol)
2097 {
2098 tmp_fstr = tmp_fmol -> first_struct[j-1];
2099 //get_active_struct (j-1, tmp_fmol -> id, 0);
2100 while (tmp_fstr)
2101 {
2102 for (k=0; k<fvalues[activef][j][tmp_fstr -> def -> key]; k++)
2103 {
2104 if (is_energy[tmp_fstr -> def -> key][k])
2105 {
2106 is_param[j][tmp_fstr -> def -> key] ++;
2107 if (scale) tmp_fstr -> def -> val[k] = (tmp_fstr -> def -> val[k] * internal_to_other[sca]) / internal_to_other[scb];
2108 l ++;
2109 }
2110 }
2111 tmp_fprop = tmp_fstr -> other;
2112 while (tmp_fprop)
2113 {
2114 for (k=0; k<fvalues[activef][j][tmp_fprop -> key]; k++)
2115 {
2116 if (is_energy[tmp_fprop -> key][k])
2117 {
2118 is_param[j][tmp_fprop -> key] ++;
2119 if (scale) tmp_fprop -> val[k] = (tmp_fprop -> val[k] * internal_to_other[sca]) / internal_to_other[scb];
2120 l ++;
2121 }
2122 }
2123 tmp_fprop = tmp_fprop -> next;
2124 }
2125 tmp_fstr = tmp_fstr -> next;
2126 }
2127 tmp_fmol = tmp_fmol -> next;
2128 }
2129 }
2130 else
2131 {
2132 tmp_fbody = get_active_body (0, j-9);
2133 while (tmp_fbody)
2134 {
2135 for (k=0; k<fvalues[activef][j][tmp_fbody -> key]; k++)
2136 {
2137 if (is_energy[tmp_fbody -> key][k])
2138 {
2139 is_param[j][tmp_fbody -> key] ++;
2140 if (scale) tmp_fbody -> val[k] = (tmp_fbody -> val[k] * internal_to_other[sca]) / internal_to_other[scb];
2141 l ++;
2142 }
2143 }
2144 tmp_fbody = tmp_fbody -> next;
2145 }
2146 }
2147 has_energy[j] = l;
2148 i += l;
2149 for (k=0; k<fetypes[activef][j+1]; k++) g_free (is_energy[k]);
2150 g_free (is_energy);
2151 }
2152 if (i)
2153 {
2154 return TRUE;
2155 }
2156 else
2157 {
2158 g_free (is_param);
2159 return FALSE;
2160 }
2161}
2162
2172G_MODULE_EXPORT void run_changed_energy_unit (GtkDialog * dialog, gint response_id, gpointer data)
2173{
2174 if (response_id == GTK_RESPONSE_YES)
2175 {
2176 int i = GPOINTER_TO_INT(data);
2177 setup_cs_labels (i);
2178 // Correct all parameters
2179 field_file_has_energy_parameters (TRUE, tmp_field -> energy_unit, i);
2180 tmp_field -> energy_unit = i;
2181 }
2182 g_free (is_param);
2183 destroy_this_dialog (dialog);
2184}
2185
2194G_MODULE_EXPORT void changed_energy_unit (GtkComboBox * box, gpointer data)
2195{
2196 int i, j, k, l;
2197 i = combo_get_active ((GtkWidget *)box);
2198 if (i != tmp_field -> energy_unit)
2199 {
2200 if (field_file_has_energy_parameters(FALSE, 0, 0))
2201 {
2202 GtkWidget * dialog = gtk_dialog_new_with_buttons (_("Change energy unit ?"), GTK_WINDOW(field_assistant),
2203 GTK_DIALOG_MODAL, _("Yes"), GTK_RESPONSE_YES, "No", GTK_RESPONSE_NO, NULL);
2204 gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
2205 GtkWidget * vbox = dialog_get_content_area (dialog);
2206 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, markup_label(_("Change the energy unit ?\nThe value of all field parameters that are energy related (listed below) will be scaled accordingly."), -1, -1, 0.5, 0.5), FALSE, FALSE, 0);
2207 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, markup_label(_("List of energy related parameters in your FIELD file:\n"), -1, -1, 0.5, 0.5), FALSE, FALSE, 0);
2208 GtkWidget * hbox;
2209 GtkWidget * vbax, * vbbx;
2210 GtkWidget * hax, * hbx;
2211 gchar * str;
2212 // Core-Shell
2213 tmp_fmol = tmp_field -> first_molecule;
2214 while (tmp_fmol)
2215 {
2217 if (tmp_fshell)
2218 {
2219 hbox = create_hbox (0);
2220 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 0);
2221 vbax = create_vbox (BSEP);
2222 vbbx = create_vbox (BSEP);
2223 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, vbax, FALSE, FALSE, 0);
2224 hax = create_hbox (0);
2225 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbax, hax, FALSE, FALSE, 0);
2226 str = g_strdup_printf ("\t<b>%s:</b>", _(felemts[3]));
2227 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hax, markup_label(str, 250, -1, 0.0, 0.5), FALSE, FALSE, 0);
2228 g_free (str);
2229 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, vbbx, FALSE, FALSE, 0);
2230 hbx = create_hbox (0);
2231 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbbx, hbx, FALSE, FALSE, 0);
2232 str = g_strdup_printf ("k<sub>2</sub> %s k<sub>4</sub>", _("and"));
2233 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbx, markup_label(str, 250, -1, 0.0, 0.5), FALSE, FALSE, 0);
2234 g_free (str);
2235 break;
2236 }
2237 tmp_fmol = tmp_fmol -> next;
2238 }
2239 for (j=0; j<15; j++)
2240 {
2241 if (has_energy[j])
2242 {
2243 hbox = create_hbox (0);
2244 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 0);
2245 vbax = create_vbox (BSEP);
2246 vbbx = create_vbox (BSEP);
2247 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, vbax, FALSE, FALSE, 0);
2248 hax = create_hbox (0);
2249 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbax, hax, FALSE, FALSE, 0);
2250 str = g_strdup_printf ("\t<b>%s:</b>", _(felemt[j+7]));
2251 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hax, markup_label(str, 250, -1, 0.0, 0.5), FALSE, FALSE, 0);
2252 g_free (str);
2253 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, vbbx, FALSE, FALSE, 0);
2254 get_is_energy (j, 1);
2255 for (k=0; k<fetypes[activef][j+1]; k++)
2256 {
2257 if (is_param[j][k])
2258 {
2259 hbx = create_hbox (0);
2260 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbbx, hbx, FALSE, FALSE, 0);
2261 str = g_strdup_printf ("%s %s:", dlp_to_translate(activef,j+1,k) ? _(fnames[activef][j+1][k]) : fnames[activef][j+1][k], _(elemts[j+6]));
2262 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbx, markup_label(str, 250, -1, 0.0, 0.5), FALSE, FALSE, 0);
2263 g_free (str);
2264 str = NULL;
2265 for (l=0; l<fntypes[activef][j]; l++)
2266 {
2267 if (is_energy[k][l])
2268 {
2269 if (str)
2270 {
2271 str = g_strdup_printf ("%s, %s", str, is_var[k][l]);
2272 }
2273 else
2274 {
2275 str = g_strdup_printf ("%s", is_var[k][l]);
2276 }
2277 }
2278 }
2279 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbx, markup_label(str, 250, -1, 0.0, 0.5), FALSE, FALSE, 0);
2280 g_free (str);
2281 }
2282 }
2283 for (k=0; k<fetypes[activef][j+1]; k++)
2284 {
2285 g_free (is_energy[k]);
2286 g_free (is_var[k]);
2287 }
2288 g_free (is_energy);
2289 g_free (is_var);
2290 }
2291 }
2292 run_this_gtk_dialog (dialog, G_CALLBACK(run_changed_energy_unit), GINT_TO_POINTER(i));
2293 }
2294 else
2295 {
2296 setup_cs_labels (i);
2297 tmp_field -> energy_unit = i;
2298 }
2299 }
2300 combo_set_active ((GtkWidget *)box, tmp_field -> energy_unit);
2302}
2303
2311GtkWidget * vbox_init (int p)
2312{
2313 int i, j, k, l;
2314 int col[3]={5, 4, 4};
2315 gchar * str;
2316 GtkWidget * vbox;
2317 GtkWidget * hbox;
2318 GtkWidget * ebox;
2319
2320 vbox = create_vbox (BSEP);
2321 hbox = create_hbox (0);
2322 str = g_strdup_printf (_("<b>Please select the %s:</b>"), _(felemt[0]));
2323 ebox = fbox (hbox, str);
2324 g_free (str);
2325 enbox = create_combo ();
2326 for (j=0; j<fetypes[activef][0]; j++)
2327 {
2328 str = g_strdup_printf ("%s (%s)", dlp_to_translate(activef,0,j) ? _(fnames[activef][0][j]) : fnames[activef][0][j], fkeysw[activef][0][j]);
2329 combo_text_append (enbox, str);
2330 g_free (str);
2331 }
2332 combo_set_active (enbox, tmp_field -> energy_unit);
2333 g_signal_connect (G_OBJECT (enbox), "changed", G_CALLBACK(changed_energy_unit), GINT_TO_POINTER(0));
2334 gtk_widget_set_size_request (enbox, 250, 30);
2336 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, ebox, enbox, FALSE, FALSE, 60);
2337 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 10);
2338
2339 hbox = create_hbox (0);
2340 ebox = fbox (hbox, _("<b>Please select the component(s) of the force field:</b>"));
2341 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 5);
2342 hbox = create_hbox (0);
2343 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label(_("<u> Intra-molecular interaction(s):</u>"), 200, 20, 0.0, 0.5), FALSE, FALSE, 10);
2344
2345 //str = g_strdup_printf (_("Use multiple molecule(s)"));
2346 //but = check_button (str, 225, 40, tmp_field -> afp[MAXDATC], G_CALLBACK(toggle_field_params), GINT_TO_POINTER(MAXDATC));
2347 //g_free (str);
2348 //add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, but, FALSE, FALSE, 30);
2349
2350 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 10);
2351 hbox = create_hbox (0);
2352 k = 2+MAXDATC;
2353 l = 0;
2354 for (i=0; i<3; i++)
2355 {
2356 ebox = create_vbox (BSEP);
2357 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, ebox, FALSE, FALSE, 20);
2358 for (j=0; j<col[i]; j++)
2359 {
2360 str = g_strdup_printf (_("Use %s"), _(elemts[k-MAXDATC]));
2361 ff_but[l] = check_button (str, 225, 40, tmp_field -> afp[k], G_CALLBACK(toggle_field_params), GINT_TO_POINTER(k));
2362 g_free (str);
2364 add_box_child_start (GTK_ORIENTATION_VERTICAL, ebox, ff_but[l], FALSE, FALSE, 0);
2365 k ++;
2366 l ++;
2367 }
2368 }
2369 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 0);
2370 hbox = create_hbox (0);
2371 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label(_("<u>Non-bonded interaction(s)</u>"), 200, 20, 0.0, 0.5), FALSE, FALSE, 10);
2372 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 10);
2373 hbox = create_hbox (0);
2374 for (i=0; i<3; i++)
2375 {
2376 ebox = create_vbox (BSEP);
2377 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, ebox, FALSE, FALSE, 20);
2378 for (j=0; j<2; j++)
2379 {
2380 str = g_strdup_printf (_("Use %s"), _(elemts[k-MAXDATC]));
2381 if (activef) tmp_field -> afp[k] = FALSE;
2382 ff_but[l] = check_button (str, 225, 40, tmp_field -> afp[k], G_CALLBACK(toggle_field_params), GINT_TO_POINTER(k));
2383 k ++;
2384 g_free (str);
2387 add_box_child_start (GTK_ORIENTATION_VERTICAL, ebox, ff_but[l], FALSE, FALSE, 0);
2388 l ++;
2389 }
2390 }
2391 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 0);
2392 return vbox;
2393}
2394
2404int get_field_tree_data (GtkWidget * tree, int treeid, GtkTreePath * path)
2405{
2406 int res = -1;
2407 GtkTreeModel * tmodel = gtk_tree_view_get_model (GTK_TREE_VIEW(tree));
2408 if (gtk_tree_model_get_iter (tmodel, & field_iter, path))
2409 {
2410 gtk_tree_model_get (tmodel, & field_iter, 0, & res, -1);
2411 if (res == 0)
2412 {
2413 gtk_tree_model_get (tmodel, & field_iter, field_v[treeid]+1, & res, -1);
2414 }
2415 else
2416 {
2417 res --;
2418 }
2419 }
2420 return res;
2421}
2422
2431int get_field_data_id (int k, gchar * data)
2432{
2433 int i, j;
2434 gchar * str;
2435 i = -1;
2436 for (j=0; j<fetypes[activef][k]; j++)
2437 {
2438 str = g_strdup_printf ("%s (%s)", dlp_to_translate(activef,k,j) ? _(fnames[activef][k][j]) : fnames[activef][k][j], exact_name(fkeysw[activef][k][j]));
2439 if (g_strcmp0 (data, str) == 0)
2440 {
2441 i = j;
2442 g_free (str);
2443 break;
2444 }
2445 g_free (str);
2446 }
2447 return i;
2448}
2449
2460G_MODULE_EXPORT void changed_field_key_renderer (GtkCellRendererCombo * combo, gchar * path_string, GtkTreeIter * iter, gpointer data)
2461{
2462 GValue val = {0, };
2463 int i, j, k, l, m, n, o;
2464 gboolean changeit = TRUE;
2465 char ** vars;
2466 int * ids;
2467 i = GPOINTER_TO_INT(data);
2468 GObject * cmodel;
2469 g_object_get (combo, "model", & cmodel, NULL);
2470 gtk_tree_model_get_value ((GtkTreeModel *)cmodel, iter, 0, & val);
2471 if (gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL(field_model[i]), iter, path_string))
2472 {
2473 GValue vbl = {0, };
2474 gtk_tree_model_get_value (GTK_TREE_MODEL(field_model[i]), iter, field_v[i]+1, & vbl);
2475 j = (int) g_value_get_int (& vbl);
2476 gchar * str = g_strdup_printf ("%s", (char *)g_value_get_string (& val));
2477 l = get_field_data_id (i-5, str);
2478 if (l > -1)
2479 {
2480 if (i < MOLIMIT) k = combo_get_active (combo_mol[i-1]);
2481 if (i > 6 && i < MOLIMIT)
2482 {
2483 tmp_fstr = get_active_struct (i-7, k, j);
2484 o = struct_id (i);
2485 ids = allocint (o);
2486 if (i < 9)
2487 {
2488 vars = (char **)fvars_bond[activef][l];
2489 }
2490 else if (i < 11)
2491 {
2492 vars = (char **)fvars_angle[activef][l];
2493 }
2494 else if (i < 14)
2495 {
2496 vars = (char **)fvars_dihedral[activef][l];
2497 }
2498 else
2499 {
2500 vars = (char **)fvars_inversion[activef][l];
2501 }
2502 gtk_tree_model_get (GTK_TREE_MODEL(field_model[i]), iter, 0, & m, -1);
2503 if (m)
2504 {
2505 // Default prop
2506 for (n=0; n<o; n++) ids[n] = -1;
2507 if (l != tmp_fstr -> def -> key)
2508 {
2509 adjust_field_prop (i-7, o, NULL, ids, l);
2510 // print status of field prop
2511 str = g_strdup_printf (_("<b>Default</b>: %s"), str);
2512 gtk_tree_store_set (field_model[i], iter, field_v[i]-1, str, -1);
2513 gtk_tree_store_set (field_model[i], iter, field_v[i], parameters_info (i-6, l, vars, tmp_fstr -> def -> val), -1);
2515 }
2516 }
2517 else
2518 {
2519 // Other prop
2520 gtk_tree_store_set_value (field_model[i], iter, field_v[i]-1, & val);
2521 for (n=1; n<o+1; n++)
2522 {
2523 gtk_tree_model_get (GTK_TREE_MODEL(field_model[i]), iter, n, & str, -1);
2524 ids[n-1] = (int) string_to_double ((gpointer)str) - 1;
2525 }
2526 adjust_field_prop (i-7, o, NULL, ids, l);
2527 gtk_tree_store_set (field_model[i], iter, field_v[i], parameters_info (i-6, l, vars, get_active_prop_using_atoms(tmp_fstr -> other, o, ids) -> val), -1);
2528 }
2529 g_free (ids);
2530 }
2531 else
2532 {
2533 switch (i)
2534 {
2535 case 6:
2536 tmp_ftet = get_active_tethered (k, j-1);
2537 tmp_ftet -> key = l;
2538 tmp_ftet -> val = NULL;
2539 tmp_ftet -> val = allocfloat (fvalues[activef][i-6][l]);
2540 gtk_tree_store_set_value (field_model[i], iter, field_v[i]-1, & val);
2541 gtk_tree_store_set (field_model[i], iter, field_v[i], parameters_info (0, l, fvars_teth[activef][l], tmp_ftet-> val), -1);
2542 break;
2543 case SEXTERN:
2545 tmp_fext -> key = l;
2546 tmp_fext -> val = NULL;
2547 tmp_fext -> val = allocfloat (fvalues[activef][i-6][l]);
2548 gtk_tree_store_set_value (field_model[i], iter, 2, & val);
2549 gtk_tree_store_set (field_model[i], iter, 3, parameters_info (i-6, l, fvars_fext[activef][l], tmp_fext -> val), -1);
2550 break;
2551 default:
2552 k = i - MOLIMIT;
2553 tmp_fbody = get_active_body (j-1, k);
2554 if (k == 2)
2555 {
2556 changeit = tersoff_question ();
2557 }
2558 if (changeit)
2559 {
2560 if (k == 2)
2561 {
2562 check_tersoffs (-1, l);
2563 gtk_tree_store_clear (field_model[i]);
2564 fill_field_model (field_model[i], i, -1);
2565 }
2566 else
2567 {
2568 tmp_fbody -> key = l;
2569 tmp_fbody -> val = NULL;
2570 tmp_fbody -> val = allocfloat (fvalues[activef][i-6][l]);
2571 gtk_tree_store_set_value (field_model[i], iter, field_v[i]-1, & val);
2572 }
2573 }
2574 else if (i == 17)
2575 {
2576 gtk_tree_store_set (field_model[i], iter, field_v[i], parameters_info (i-6, l, fvars_ters[activef][l], tmp_fbody -> val), -1);
2577 }
2578
2579 if (i == 15) gtk_tree_store_set (field_model[i], iter, field_v[i], parameters_info (i-6, l, fvars_vdw[activef][l], tmp_fbody -> val), -1);
2580 if (i == 16) gtk_tree_store_set (field_model[i], iter, field_v[i], parameters_info (i-6, l, fvars_met[activef][l], tmp_fbody -> val), -1);
2581 if (i == 18) gtk_tree_store_set (field_model[i], iter, field_v[i], parameters_info (i-6, l, fvars_tbd[activef][l], tmp_fbody -> val), -1);
2582 if (i == 19) gtk_tree_store_set (field_model[i], iter, field_v[i], parameters_info (i-6, l, fvars_fbd[activef][l], tmp_fbody -> val), -1);
2583 break;
2584 }
2585 }
2586 }
2587 g_free (str);
2588 g_value_unset(& vbl);
2589 }
2590 g_value_unset(& val);
2591}
2592
2600GtkWidget * create_combo_mol (int f)
2601{
2602 int i;
2603 gchar * str;
2604
2605 GtkWidget * combo = create_combo ();
2606 tmp_fmol = tmp_field -> first_molecule;
2607 for (i=0; i<tmp_field -> molecules; i++)
2608 {
2609 str = g_strdup_printf ("%d: %s", i+1, tmp_fmol -> name);
2610 combo_text_append (combo, str);
2611 g_free (str);
2612 if (tmp_fmol -> next != NULL) tmp_fmol = tmp_fmol -> next;
2613 }
2614 widget_set_sensitive (combo, (tmp_field -> molecules > 1) ? TRUE : FALSE);
2615 combo_set_active (combo, 0);
2616 g_signal_connect (G_OBJECT (combo), "changed", G_CALLBACK(changed_mol_box), GINT_TO_POINTER(f+1));
2617 return combo;
2618}
2619
2621
2630gchar * pop_info (int i, int id)
2631{
2632 int j, k, l;
2633 gchar * str = NULL;
2634
2635 actel = 0;
2636 switch (i)
2637 {
2638 case 0:
2640 str = g_strdup_printf (_("Molecule N°%d"), id+1);
2641 actel = 1;
2642 break;
2643 default:
2644 if (i < MOLIMIT)
2645 {
2646 j = combo_get_active (combo_mol[i-1]);
2648 }
2649 switch (i)
2650 {
2651 case 1:
2652 tmp_fat = get_active_atom (j, id);
2653 str = g_strdup_printf (_("Atom N°%d: \"%s\""), tmp_fat -> id+1, tmp_fat -> name);
2654 actel = tmp_fat -> num;
2655 break;
2656 case 2:
2657 if (tmp_fmol -> shells > 0)
2658 {
2659 tmp_fshell = get_active_shell (j, id);
2660 actel = 1;
2661 if (tmp_fshell -> ia[0])
2662 {
2663 k = tmp_fmol -> atoms_id[tmp_fshell -> ia[0]-1][0].a;
2664 str = g_strdup_printf (_("Core-Shell N°%d: Atom %d (%s) - "), tmp_fshell -> id+1, tmp_fshell -> ia[0],
2665 exact_name(tmp_proj -> chemistry -> label[get_active_atom (j, k) -> sp]));
2666 }
2667 else
2668 {
2669 str = g_strdup_printf (_("Core-Shell N°%d: <i>%s</i> - "), tmp_fshell -> id+1, _("None"));
2670 }
2671 if (tmp_fshell -> ia[1])
2672 {
2673 k = tmp_fmol -> atoms_id[tmp_fshell -> ia[1]-1][1].a;
2674 str = g_strdup_printf ("%s%d (%s)", str, tmp_fshell -> ia[1], exact_name(tmp_proj -> chemistry -> label[get_active_atom (j, k) -> sp]));
2675 }
2676 else
2677 {
2678 str = g_strdup_printf ("%s<i>%s</i>", str, _("None"));
2679 }
2680 }
2681 break;
2682 case 3:
2683 if (tmp_fmol -> constraints > 0)
2684 {
2686 actel = 1;
2687 if (tmp_fcons -> ia[0])
2688 {
2689 k = tmp_fmol -> atoms_id[tmp_fcons -> ia[0]-1][0].a;
2690 str = g_strdup_printf (_("Constrained Bond N°%d: Atom %d (%s) - "), tmp_fcons -> id+1, tmp_fcons -> ia[0],
2691 exact_name(tmp_proj -> chemistry -> label[get_active_atom (j, k) -> sp]));
2692 }
2693 else
2694 {
2695 str = g_strdup_printf (_("Constrained Bond N°%d: <i>%s</i> - "), tmp_fcons -> id+1, _("None"));
2696 }
2697 if (tmp_fcons -> ia[1])
2698 {
2699 k = tmp_fmol -> atoms_id[tmp_fcons -> ia[1]-1][1].a;
2700 str = g_strdup_printf ("%s%d (%s)", str, tmp_fcons -> ia[1], exact_name(tmp_proj -> chemistry -> label[get_active_atom (j, k) -> sp]));
2701 }
2702 else
2703 {
2704 str = g_strdup_printf ("%s<i>%s</i>", str, _("None"));
2705 }
2706 }
2707 break;
2708 case 4:
2709 if (tmp_fmol -> pmfs > 0)
2710 {
2711 tmp_fpmf = get_active_pmf (j, id);
2712 actel = 1;
2713 str = g_strdup_printf (_("Mean Force Potential N°%d"), tmp_fpmf -> id+1);
2714 }
2715 break;
2716 case 5:
2717 if (tmp_fmol -> rigids > 0)
2718 {
2719 tmp_frig = get_active_rigid (j, id);
2720 actel = 1;
2721 str = g_strdup_printf (_("Rigid Unit N°%d: %d Atom(s)"), tmp_frig -> id+1, tmp_frig -> num);
2722 }
2723 break;
2724 case 6:
2725 if (tmp_fmol -> tethered > 0)
2726 {
2727 tmp_ftet = get_active_tethered (j, id);
2728 actel = 1;
2729 str = g_strdup_printf (_("Tethering Potential N°%d"), tmp_ftet -> id+1);
2730 }
2731 break;
2732 case SEXTERN:
2733 if (tmp_field -> extern_fields > 0)
2734 {
2736 str = g_strdup_printf ("%s N°: %d", _(felemt[i+1]), tmp_fext -> id+1);
2737 actel = 1;
2738 }
2739 break;
2740 default:
2741 if (i < MOLIMIT)
2742 {
2743 if (tmp_fmol -> nstruct[i-7] > 0)
2744 {
2745 actel = 1;
2746 tmp_fstr = get_active_struct (i-7, j, row_id);
2747 str = g_strdup_printf ("%s N°%d: \"", _(mo_title[i-7]), tmp_fstr -> id+1);
2748 for (k=0; k<struct_id(i); k++)
2749 {
2750 str = g_strdup_printf ("%s%s", str, get_active_atom (j, tmp_fstr -> aid[k]) -> name);
2751 if (k<struct_id(i)-1) str = g_strdup_printf ("%s-", str);
2752 }
2753 str = g_strdup_printf ("%s\"", str);
2754 }
2755 }
2756 else
2757 {
2758 k = i - MOLIMIT;
2759 if (tmp_field -> nbody[k] > 0)
2760 {
2762 str = g_strdup_printf ("%s N°: %d \"%s", _(felemt[i+1]), tmp_fbody -> id+1, get_active_atom (tmp_fbody -> ma[0][0], tmp_fbody -> a[0][0]) -> name);
2763 for (l=1; l<body_at(k); l++)
2764 {
2765 if (tmp_fbody -> na[l] < 0)
2766 {
2767 str = g_strdup_printf (_("%s - NONE"), str);
2768 }
2769 else
2770 {
2771 str = g_strdup_printf ("%s - %s", str, get_active_atom (tmp_fbody -> ma[l][0], tmp_fbody -> a[l][0]) -> name);
2772 }
2773 }
2774 str = g_strdup_printf ("%s\"", str);
2775 actel = 1;
2776 }
2777 }
2778 break;
2779 }
2780 break;
2781 }
2782 return str;
2783}
2784
2792gchar * pop_edit (int i)
2793{
2794 gchar * str = NULL;
2795 switch (i)
2796 {
2797 case 0:
2798 str = g_strdup_printf (_("Edit Name: \"%s\""), tmp_fmol -> name);
2799 break;
2800 default:
2801 str = g_strdup_printf (_("Edit properties %s"), _(intelemt[i]));
2802 break;
2803 }
2804 return str;
2805}
2806
2814gchar * pop_add (int i)
2815{
2816 gchar * str = NULL;
2817 if ((i>1 && i<7) || (i>MOLIMIT && i<MAXDATA)) str = g_strdup_printf (_("Add a new %s"), _(elemt[i]));
2818 return str;
2819}
2820
2828gchar * pop_remove (int i)
2829{
2830 gchar * str = NULL;
2831 if ((i>1 && i<7) || (i>MOLIMIT && i<MAXDATA)) str = g_strdup_printf (_("Remove %s"), _(elemt[i]));
2832 return str;
2833}
2834
2844G_MODULE_EXPORT void to_select_atom_id_from_fied_molecule (GSimpleAction * action, GVariant * parameter, gpointer data)
2845{
2847}
2848
2849GSimpleActionGroup * field_pop_actions = NULL;
2850
2874void append_field_item (GMenu * menu, const gchar * name, const gchar * key, int item_id,
2875 gchar * accel, int image_format, gpointer icon,
2876 gboolean custom, GCallback handler, gpointer data,
2877 gboolean check, gboolean status, gboolean radio, gboolean sensitive)
2878{
2879 gchar * str_a, * str_b, * str_c;
2880 str_a = g_strdup_printf ("set-%s", key);
2881 str_b = g_strdup_printf ("%s.%d", str_a, item_id);
2882 str_c = (sensitive) ? g_strdup_printf ("ff-%d.%s", item_id, (radio) ? str_a : str_b) : g_strdup_printf ("None");
2883 append_menu_item (menu, name, (const gchar *) str_c, accel, (custom) ? str_b : NULL, image_format, icon, check, status, radio, (radio) ? (const gchar *)str_b : NULL);
2884 if (handler)
2885 {
2886 if (! radio || (radio && status))
2887 {
2888 widget_add_action (field_pop_actions, (radio) ? (const gchar *)str_a : (const gchar *)str_b, handler, data,
2889 check, status, radio, (const gchar *)str_b);
2890 }
2891 }
2892 g_free (str_a);
2893 g_free (str_b);
2894 g_free (str_c);
2895}
2896
2897#ifdef GTK4
2909void pop_up_field_context_menu (int id, GtkWidget * widget, double event_x, double event_y, gpointer data)
2910#else
2921void pop_up_field_context_menu (int row_id, GtkWidget * widget, GdkEvent * event, gpointer data)
2922#endif
2923{
2924 GtkWidget * menu;
2925 gchar * str;
2926 int i, j, k, l;
2927 i = GPOINTER_TO_INT (data);
2928 str = pop_info (i, row_id);
2929 if (field_pop_actions) g_object_unref (field_pop_actions);
2930 field_pop_actions = g_simple_action_group_new ();
2931 GMenu * fmenu = g_menu_new ();
2932 GMenu * fmenus;
2933 if (str)
2934 {
2935 fmenus = g_menu_new ();
2936 append_field_item (fmenus, str, "pop", i, NULL, IMG_NONE, NULL, FALSE, NULL, NULL, FALSE, FALSE, FALSE, TRUE);
2937 g_free (str);
2938 g_menu_append_section (fmenu, NULL, (GMenuModel *)fmenus);
2939 g_object_unref (fmenus);
2940 }
2941 if (actel > 0)
2942 {
2943 str = pop_edit (i);
2944 if (str)
2945 {
2946 fmenus = g_menu_new ();
2947 append_field_item (fmenus, str, "edit-fp", i, NULL, IMG_NONE, NULL, FALSE, G_CALLBACK(edit_field_prop), data, FALSE, FALSE, FALSE, TRUE);
2948 g_free (str);
2949 g_menu_append_section (fmenu, NULL, (GMenuModel *)fmenus);
2950 g_object_unref (fmenus);
2951 }
2952 switch (i)
2953 {
2954 case 0:
2955 if (tmp_field -> molecules < tmp_coord -> totcoord[2] && tmp_fmol -> multi > 1)
2956 {
2957 fmenus = g_menu_new ();
2958 append_field_item (fmenus, _("Add new molecule"), "add-mol", i, NULL, IMG_NONE, NULL, FALSE, G_CALLBACK(add_molecule_to_field), data, FALSE, FALSE, FALSE, TRUE);
2959 g_menu_append_section (fmenu, NULL, (GMenuModel *)fmenus);
2960 g_object_unref (fmenus);
2961 }
2962 if (tmp_field -> molecules > tmp_coord -> totcoord[3]
2963 && tmp_fmol -> mol -> multiplicity > 1
2964 && tmp_fmol -> multi < tmp_fmol -> mol -> multiplicity)
2965 {
2966 fmenus = g_menu_new ();
2967 str = g_strdup_printf (_("Remove molecule %s from force field"), tmp_fmol -> name);
2968 append_field_item (fmenus, str, "rem-mol", i, NULL, IMG_NONE, NULL, FALSE, G_CALLBACK(remove_molecule_from_field), data, FALSE, FALSE, FALSE, TRUE);
2969 g_free (str);
2970 g_menu_append_section (fmenu, NULL, (GMenuModel *)fmenus);
2971 g_object_unref (fmenus);
2972 }
2973 break;
2974 default:
2975 if (i == 1)
2976 {
2977 j = combo_get_active (combo_mol[i-1]);
2979 if (actel > 1)
2980 {
2981
2982 fmenus = g_menu_new ();
2983 str = g_strdup_printf (_("Created new force field atom from %s atom(s)"), tmp_fat -> name);
2984 append_field_item (fmenus, str, "add-fat", i, NULL, IMG_NONE, NULL, FALSE, G_CALLBACK(to_select_atom_id_from_fied_molecule), GINT_TO_POINTER(0), FALSE, FALSE, FALSE, TRUE);
2985 g_menu_append_section (fmenu, NULL, (GMenuModel *)fmenus);
2986 g_object_unref (fmenus);
2987 }
2988 l = 0;
2989 tmp_fbt = tmp_fmol -> first_atom;
2990 for (k=0; k<tmp_fmol -> atoms; k++)
2991 {
2992 if (tmp_fbt -> sp == tmp_fat -> sp) l ++;
2993 if (tmp_fbt -> next != NULL) tmp_fbt = tmp_fbt -> next;
2994 }
2995 if (l > 1)
2996 {
2997 fmenus = g_menu_new ();
2998 str = g_strdup_printf (_("Remove atom %s from force field molecule"), tmp_fat -> name);
2999 append_field_item (fmenus, str, "rem-fat", i, NULL, IMG_NONE, NULL, FALSE, G_CALLBACK(remove_atom_from_field_molecule), (gpointer *)tmp_fat, FALSE, FALSE, FALSE, TRUE);
3000 g_free (str);
3001 g_menu_append_section (fmenu, NULL, (GMenuModel *)fmenus);
3002 g_object_unref (fmenus);
3003 }
3004 }
3005 str = pop_remove (i);
3006 if (str) append_field_item (fmenu, str, "rem-fp", i, NULL, IMG_NONE, NULL, FALSE, G_CALLBACK(remove_field_prop), data, FALSE, FALSE, FALSE, TRUE);
3007 g_free (str);
3008 break;
3009 }
3010 }
3011 str = pop_add (i);
3012 if (str != NULL)
3013 {
3014 fmenus = g_menu_new ();
3015 append_field_item (fmenus, str, "add-prop", i, NULL, IMG_NONE, NULL, FALSE, G_CALLBACK(add_field_prop), data, FALSE, FALSE, FALSE, TRUE);
3016 g_free (str);
3017 g_menu_append_section (fmenu, NULL, (GMenuModel *)fmenus);
3018 g_object_unref (fmenus);
3019 }
3020#ifdef GTK4
3021 menu = gtk_popover_menu_new_from_model_full ((GMenuModel *)fmenu, GTK_POPOVER_MENU_NESTED);
3022 gtk_widget_set_parent (menu, widget);
3023 // gtk_widget_set_size_request (menu, -1, i);
3024#else
3025 menu = gtk_menu_new_from_model ((GMenuModel *)fmenu);
3026#endif
3027 str = g_strdup_printf ("ff-%d", i);
3028 gtk_widget_insert_action_group (menu, str, G_ACTION_GROUP(field_pop_actions));
3029 g_free (str);
3030#ifdef GTK4
3031 pop_menu_at_pointer (menu, event_x, event_y);
3032#else
3033 pop_menu_at_pointer (menu, event);
3034#endif
3035 /* GtkWidget * prop;
3036 menu = gtk_menu_new ();
3037 if (str != NULL)
3038 {
3039 prop = create_menu_item (FALSE, str);
3040 g_free (str);
3041 gtk_menu_shell_append ((GtkMenuShell *)menu, prop);
3042 if (actel > 0) add_menu_separator (menu);
3043 }
3044 if (actel > 0)
3045 {
3046 str = pop_edit (i);
3047 if (str != NULL)
3048 {
3049 prop = create_menu_item (FALSE, str);
3050 g_free (str);
3051 gtk_menu_shell_append ((GtkMenuShell *)menu, prop);
3052 g_signal_connect (G_OBJECT(prop), "activate", G_CALLBACK(edit_field_prop), data);
3053 }
3054 switch (i)
3055 {
3056 case 0:
3057 if (tmp_field -> molecules < tmp_coord -> totcoord[2] && tmp_fmol -> multi > 1)
3058 {
3059 add_menu_separator (menu);
3060 prop = create_menu_item (FALSE, _("Add new molecule"));
3061 gtk_menu_shell_append ((GtkMenuShell *)menu, prop);
3062 g_signal_connect (G_OBJECT(prop), "activate", G_CALLBACK(add_molecule_to_field), data);
3063 }
3064 if (tmp_field -> molecules > tmp_coord -> totcoord[3]
3065 && tmp_fmol -> mol -> multiplicity > 1
3066 && tmp_fmol -> multi < tmp_fmol -> mol -> multiplicity)
3067 {
3068 add_menu_separator (menu);
3069 str = g_strdup_printf (_("Remove molecule %s from force field"), tmp_fmol -> name);
3070 prop = create_menu_item (FALSE, str);
3071 g_free (str);
3072 gtk_menu_shell_append ((GtkMenuShell *)menu, prop);
3073 g_signal_connect (G_OBJECT(prop), "activate", G_CALLBACK(remove_molecule_from_field), (gpointer *)tmp_fmol);
3074 }
3075 break;
3076 default:
3077 if (i == 1)
3078 {
3079 j = combo_get_active (combo_mol[i-1]);
3080 tmp_fmol = get_active_field_molecule (j);
3081 if (actel > 1)
3082 {
3083 add_menu_separator (menu);
3084 str = g_strdup_printf (_("Created new force field atom from %s atom(s)"), tmp_fat -> name);
3085 prop = create_menu_item (FALSE, str);
3086 g_free (str);
3087 gtk_menu_shell_append ((GtkMenuShell *)menu, prop);
3088 g_signal_connect (G_OBJECT(prop), "activate", G_CALLBACK(select_atom_id_from_fied_molecule), GINT_TO_POINTER(0));
3089 }
3090 l = 0;
3091 tmp_fbt = tmp_fmol -> first_atom;
3092 for (k=0; k<tmp_fmol -> atoms; k++)
3093 {
3094 if (tmp_fbt -> sp == tmp_fat -> sp) l ++;
3095 if (tmp_fbt -> next != NULL) tmp_fbt = tmp_fbt -> next;
3096 }
3097 if (l > 1)
3098 {
3099 add_menu_separator (menu);
3100 str = g_strdup_printf (_("Remove atom %s from force field molecule"), tmp_fat -> name);
3101 prop = create_menu_item (FALSE, str);
3102 g_free (str);
3103 gtk_menu_shell_append ((GtkMenuShell *)menu, prop);
3104 g_signal_connect (G_OBJECT(prop), "activate", G_CALLBACK(remove_atom_from_field_molecule), (gpointer *)tmp_fat);
3105 }
3106 }
3107 str = pop_remove (i);
3108 if (str != NULL)
3109 {
3110 prop = create_menu_item (FALSE, str);
3111 g_free (str);
3112 gtk_menu_shell_append ((GtkMenuShell *)menu, prop);
3113 g_signal_connect (G_OBJECT(prop), "activate", G_CALLBACK(remove_field_prop), data);
3114 }
3115 break;
3116 }
3117 }
3118 str = pop_add (i);
3119 if (str != NULL)
3120 {
3121 if (actel > 0) add_menu_separator (menu);
3122 prop = create_menu_item (FALSE, str);
3123 g_free (str);
3124 gtk_menu_shell_append ((GtkMenuShell *)menu, prop);
3125 g_signal_connect (G_OBJECT(prop), "activate", G_CALLBACK(add_field_prop), data);
3126 }
3127 pop_menu_at_pointer (menu, (GdkEvent *)event);
3128#endif*/
3129}
3130
3131#ifdef GTK3
3140G_MODULE_EXPORT gboolean on_pop_up_field (GtkWidget * widget, gpointer data)
3141{
3142 pop_up_field_context_menu (row_id, widget, NULL, data);
3143 return TRUE;
3144}
3145#endif
3146
3147#ifdef GTK4
3160void field_button_event (double event_x, double event_y, guint event_button, guint event_type, guint32 event_time, gpointer data)
3161#else
3175void field_button_event (GdkEvent * event, double event_x, double event_y, guint event_button, guint event_type, guint32 event_time, gpointer data)
3176#endif
3177{
3178 if (event_type == GDK_BUTTON_PRESS)
3179 {
3180 GtkTreePath * path;
3181 GtkTreeViewColumn * column;
3182 int i, j, k;
3183 i = GPOINTER_TO_INT(data);
3184#ifdef GTK4
3185 int e_x, e_y;
3186 gtk_tree_view_convert_widget_to_bin_window_coords (GTK_TREE_VIEW(field_tree[i]), event_x, event_y, & e_x, & e_y);
3187 gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW(field_tree[i]), e_x, e_y, & path, & column, & j, & k);
3188#else
3189 gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW(field_tree[i]), event_x, event_y, & path, & column, & j, & k);
3190#endif
3191 if (path != NULL)
3192 {
3194 }
3195 else
3196 {
3197 row_id = 0;
3198 }
3199 if (event_button == 3)
3200 {
3201#ifdef GTK4
3202 pop_up_field_context_menu (row_id, field_tree[i], event_x, event_y, data);
3203#else
3204 pop_up_field_context_menu (row_id, field_tree[i], event, data);
3205#endif
3206 }
3207 }
3208}
3209
3210#ifdef GTK4
3222G_MODULE_EXPORT void on_field_button_pressed (GtkGesture * gesture, int n_press, double x, double y, gpointer data)
3223{
3224 field_button_event (x, y, gtk_gesture_single_get_current_button ((GtkGestureSingle * )gesture), GDK_BUTTON_PRESS, gtk_event_controller_get_current_event_time((GtkEventController *)gesture), data);
3225}
3226
3238G_MODULE_EXPORT void on_field_button_released (GtkGesture * gesture, int n_press, double x, double y, gpointer data)
3239{
3240 field_button_event (x, y, gtk_gesture_single_get_current_button ((GtkGestureSingle * )gesture), GDK_BUTTON_RELEASE, gtk_event_controller_get_current_event_time((GtkEventController *)gesture), data);
3241}
3242#else
3252G_MODULE_EXPORT gboolean on_field_button_event (GtkWidget * widget, GdkEvent * event, gpointer data)
3253{
3254 GdkEventButton * bevent = (GdkEventButton *)event;
3255 field_button_event (event, bevent -> x, bevent -> y, bevent -> button, bevent -> type, bevent -> time, data);
3256 return FALSE;
3257}
3258#endif
3259
3271void field_set_color (GtkTreeViewColumn * col, GtkCellRenderer * renderer, GtkTreeModel * mod, GtkTreeIter * iter, gpointer data)
3272{
3273 int i, j, k, l;
3274 int tree = GPOINTER_TO_INT(data);
3275 gtk_tree_model_get (mod, iter, 0, & i, -1);
3276 if (tree < SEXTERN)
3277 {
3278 if (i == 0)
3279 {
3280 gtk_tree_model_get (mod, iter, field_v[tree]+1, & i, -1);
3281 i ++;
3282 }
3283 else if (i < 0)
3284 {
3285 i = - i;
3286 }
3287 for (k=0; k<field_v[tree]; k++)
3288 {
3289 if (is_special[tree][k] == 2) break;
3290 }
3291 gtk_tree_model_get (mod, iter, k, & j, -1);
3292 l = (tree && tree < MOLIMIT) ? combo_get_active (combo_mol[tree-1]) : 0;
3293 k = get_field_objects (tree, l);
3294 set_renderer_color (j, renderer, init_color (i-1, k));
3295 }
3296}
3297
3309void field_set_markup_box (GtkTreeViewColumn * col, GtkCellRenderer * renderer, GtkTreeModel * mod, GtkTreeIter * iter, gpointer data)
3310{
3311 int tree = GPOINTER_TO_INT(data);
3312 set_renderer_markup (mod, iter, renderer, field_v[tree]-1);
3313}
3314
3326void field_set_markup (GtkTreeViewColumn * col, GtkCellRenderer * renderer, GtkTreeModel * mod, GtkTreeIter * iter, gpointer data)
3327{
3328 int i;
3329 int tree = GPOINTER_TO_INT(data);
3330 i = (tree > 5) ? 1 : 0;
3331 if (i)
3332 {
3333 set_renderer_markup (mod, iter, renderer, field_v[tree]);
3334 }
3335 else
3336 {
3337 gchar * str = NULL;
3338 GtkTreeViewColumn * cal;
3339 switch (tree)
3340 {
3341 case 0:
3342 gtk_tree_model_get (mod, iter, 3, & str, -1);
3343 break;
3344 default:
3345 // CHECK THIS
3346 cal = gtk_tree_view_get_column (GTK_TREE_VIEW(field_tree[tree]), 1);
3347 if (cal == col)
3348 {
3349 gtk_tree_model_get (mod, iter, 1, & str, -1);
3350 }
3351 else
3352 {
3353 gtk_tree_model_get (mod, iter, 2, & str, -1);
3354 }
3355 break;
3356 }
3357 g_object_set (renderer, "markup", str, NULL, NULL);
3358 g_free (str);
3359 }
3360}
3361
3373void field_set_visible (GtkTreeViewColumn * col, GtkCellRenderer * renderer, GtkTreeModel * mod, GtkTreeIter * iter, gpointer data)
3374{
3375 int i, j;
3376 int tree = GPOINTER_TO_INT(data);
3377 if (tree != SEXTERN)
3378 {
3379 if (tree == 4 || tree == 5)
3380 {
3381 gtk_tree_model_get (mod, iter, 0, & j, -1);
3382 if (j < 0) j = 0;
3383 }
3384 else
3385 {
3386 for (i=0; i<field_v[tree]; i++)
3387 {
3388 if (is_special[tree][i] == 3) break;
3389 }
3390 gtk_tree_model_get (mod, iter, i, & j, -1);
3391 }
3392 gtk_cell_renderer_set_visible (renderer, j);
3393 }
3394}
3395
3407void field_set_color_and_markup (GtkTreeViewColumn * col, GtkCellRenderer * renderer, GtkTreeModel * mod, GtkTreeIter * iter, gpointer data)
3408{
3409 field_set_color (col, renderer, mod, iter, data);
3410 field_set_markup (col, renderer, mod, iter, data);
3411}
3412
3424void field_set_color_and_visible (GtkTreeViewColumn * col, GtkCellRenderer * renderer, GtkTreeModel * mod, GtkTreeIter * iter, gpointer data)
3425{
3426 field_set_color (col, renderer, mod, iter, data);
3427 field_set_visible (col, renderer, mod, iter, data);
3428}
3429
3441void prop_set_color_and_visible (GtkTreeViewColumn * col, GtkCellRenderer * renderer, GtkTreeModel * mod, GtkTreeIter * iter, gpointer data)
3442{
3443 int i;
3444 gtk_tree_model_get (mod, iter, 0, & i, -1);
3445 gtk_cell_renderer_set_visible (renderer, i);
3446 field_set_color (col, renderer, mod, iter, data);
3447}
3448
3460void pmf_set_color_and_visible (GtkTreeViewColumn * col, GtkCellRenderer * renderer, GtkTreeModel * mod, GtkTreeIter * iter, gpointer data)
3461{
3462 field_set_color (col, renderer, mod, iter, GINT_TO_POINTER(4));
3463 int i, j, k;
3464 i = GPOINTER_TO_INT(data);
3465 if (i == 3)
3466 {
3467 gtk_tree_model_get (mod, iter, i, & j, -1);
3468 k = (! j || j < 0) ? 0 : 1;
3469 }
3470 else
3471 {
3472 gtk_tree_model_get (mod, iter, 4, & k, -1);
3473 }
3474 gtk_cell_renderer_set_visible (renderer, k);
3475}
3476
3488void rig_set_color_and_visible (GtkTreeViewColumn * col, GtkCellRenderer * renderer, GtkTreeModel * mod, GtkTreeIter * iter, gpointer data)
3489{
3490 field_set_color (col, renderer, mod, iter, data);
3491 int i;
3492 gtk_tree_model_get (mod, iter, 0, & i, -1);
3493 if (i < 0) i = 0;
3494 gtk_cell_renderer_set_visible (renderer, ! i);
3495}
3496
3508void field_set_color_markup_and_visible (GtkTreeViewColumn * col, GtkCellRenderer * renderer, GtkTreeModel * mod, GtkTreeIter * iter, gpointer data)
3509{
3510 field_set_color (col, renderer, mod, iter, data);
3511 field_set_markup (col, renderer, mod, iter, data);
3512 field_set_visible (col, renderer, mod, iter, data);
3513}
3514
3526void field_set_color_markup_and_visible_box (GtkTreeViewColumn * col, GtkCellRenderer * renderer, GtkTreeModel * mod, GtkTreeIter * iter, gpointer data)
3527{
3528 field_set_color (col, renderer, mod, iter, data);
3529 field_set_markup_box (col, renderer, mod, iter, data);
3530 field_set_visible (col, renderer, mod, iter, data);
3531}
3532
3543G_MODULE_EXPORT void edit_field_cell (GtkCellRendererText * cell, gchar * path_string, gchar * new_text, gpointer data)
3544{
3545 int i, j, k, l;
3546 i = GPOINTER_TO_INT(data);
3547 if (i < 2)
3548 {
3549 j = 1;
3550 }
3551 else if (i < 6)
3552 {
3553 j = 2;
3554 }
3555 else if (i == 6)
3556 {
3557 j = 3;
3558 }
3559 else if (i < 9)
3560 {
3561 j = 4;
3562 }
3563 GtkTreeIter iter;
3564 GtkTreePath * path = gtk_tree_path_new_from_string (path_string);
3565 gtk_tree_model_get_iter (GTK_TREE_MODEL(field_model[j]), & iter, path);
3566 gtk_tree_model_get (GTK_TREE_MODEL(field_model[j]), & iter, 0, & k, -1);
3567 l = combo_get_active (combo_mol[j-1]);
3568 float val = string_to_double ((gpointer)new_text);
3569 k --;
3570 if (i == 0) get_active_atom (l, k) -> mass = val;
3571 if (i == 1) get_active_atom (l, k) -> charge = val;
3572 if (i == 2) get_active_shell (l, k) -> m = val;
3573 if (i == 3) get_active_shell (l, k) -> z = val;
3574 if (i == 4) get_active_shell (l, k) -> k2 = val;
3575 if (i == 5) get_active_shell (l, k) -> k4 = val;
3576 if (i == 6) get_active_constraint (l, k) -> length = val;
3577 if (i == 7) get_active_pmf (l, k) -> length = val;
3578 if (i == 8)
3579 {
3580 int n, m;
3581 gtk_tree_model_get (GTK_TREE_MODEL(field_model[j]), & iter, 3, & n, 4, & m, -1);
3582 if (n < 0 && m > 0)
3583 {
3584 get_active_pmf (l, k) -> weight[-n-1][m-1] = val;
3585 }
3586 }
3587 if (j < MOLIMIT) changed_mol_box (GTK_COMBO_BOX(combo_mol[j-1]), GINT_TO_POINTER(j));
3588}
3589
3598void get_field_iter_and_edit (gchar * path_string, gpointer data)
3599{
3600 int i = GPOINTER_TO_INT(data);
3601 gtk_tree_model_get_iter (GTK_TREE_MODEL(field_model[i]),
3602 & field_iter,
3603 gtk_tree_path_new_from_string (path_string));
3604 if (i == 4 || i == 5 || (i > 6 && i < MOLIMIT))
3605 {
3606 GValue vbl = {0, };
3607 if (i < 6)
3608 {
3609 gtk_tree_model_get_value (GTK_TREE_MODEL(field_model[i]), & field_iter, 0, & vbl);
3610 }
3611 else
3612 {
3613 gtk_tree_model_get_value (GTK_TREE_MODEL(field_model[i]), & field_iter, field_v[i]+1, & vbl);
3614 }
3615 row_id = (int) g_value_get_int (& vbl);
3616 if (i < 6) row_id = abs(row_id) - 1;
3617 }
3618 edit_field_prop (g_simple_action_new ("Dummy", NULL), NULL, data);
3619}
3620
3631G_MODULE_EXPORT void to_edit_field_prop (GtkCellRenderer * cell, GtkCellEditable * editable, gchar * path_string, gpointer data)
3632{
3633 destroy_this_widget (GTK_WIDGET(editable));
3634 get_field_iter_and_edit (path_string, data);
3635}
3636
3647G_MODULE_EXPORT void on_field_row_activated (GtkTreeView * treeview, GtkTreePath * path, GtkTreeViewColumn * col, gpointer data)
3648{
3649 get_field_iter_and_edit (gtk_tree_path_to_string (path), data);
3650}
3651
3659GtkWidget * create_field_tree (int f)
3660{
3661 int i, j, k, l, m;
3662 gchar * str;
3663 GtkListStore * list_store_combo;
3664 GtkTreeIter iter;
3665 gboolean combox = FALSE;
3666
3667 l = (f > 5) ? 1 : 0;
3668 m = 0;
3669 field_model[f] = gtk_tree_store_newv (field_v[f]+l+field_a[f], col_type[f]);
3670 field_tree[f] = gtk_tree_view_new_with_model(GTK_TREE_MODEL(field_model[f]));
3671 for (i=0; i<field_v[f]+l; i++)
3672 {
3673 if (is_special[f][i] == 1)
3674 {
3675 k = f-5;
3676 field_renderer[f][i] = gtk_cell_renderer_combo_new ();
3677 list_store_combo = gtk_list_store_new (1, G_TYPE_STRING);
3678 for (j=0; j<fetypes[activef][k]; j++)
3679 {
3680 str = g_strdup_printf ("%s (%s)", dlp_to_translate(activef,k,j) ? _(fnames[activef][k][j]) : fnames[activef][k][j], exact_name(fkeysw[activef][k][j]));
3681 gtk_list_store_append (list_store_combo, & iter);
3682 gtk_list_store_set (list_store_combo, & iter, 0, str, -1);
3683 g_free (str);
3684 }
3685 g_object_set (field_renderer[f][i], "model", list_store_combo,
3686 "text-column", 0,
3687 "has-entry", FALSE,
3688 "editable", TRUE, NULL);
3689 g_signal_connect (G_OBJECT(field_renderer[f][i]), "changed", G_CALLBACK(changed_field_key_renderer), GINT_TO_POINTER(f));
3690 str = g_strdup_printf ("%s", (f == 2 && (i == 5|| i == 6)) ? ctitle[f][i] : _(ctitle[f][i]));
3691 field_col[f][i] = gtk_tree_view_column_new_with_attributes (str, field_renderer[f][i], "text", i, NULL);
3692 g_free (str);
3693 g_object_unref (list_store_combo);
3694 combox = TRUE;
3695 }
3696 else if (combox)
3697 {
3698 field_renderer[f][i] = gtk_cell_renderer_text_new ();
3699 field_col[f][i] = gtk_tree_view_column_new_with_attributes (_("Parameter(s)"), field_renderer[f][i], "text", i, NULL);
3700 m = 1;
3701 combox = FALSE;
3702 }
3703 else if (is_special[f][i] > 1 && is_special[f][i] < 4)
3704 {
3705 field_renderer[f][i] = gtk_cell_renderer_toggle_new ();
3706 str = g_strdup_printf ("%s", (f == 2 && (i-m == 5|| i-m == 6)) ? ctitle[f][i-m] : _(ctitle[f][i-m]));
3707 field_col[f][i] = gtk_tree_view_column_new_with_attributes (str, field_renderer[f][i], "active", i, NULL);
3708 g_free (str);
3709 g_signal_connect (G_OBJECT(field_renderer[f][i]), "toggled",
3711 & tmp_view -> colorp[f][is_special[f][i]-2]);
3712 if ((f == 4 && i == field_v[f]+l-1) || f == SEXTERN) gtk_cell_renderer_toggle_set_radio (GTK_CELL_RENDERER_TOGGLE(field_renderer[f][i]), TRUE);
3713 gtk_tree_view_column_set_clickable (field_col[f][i], TRUE);
3714 if (f != SEXTERN)
3715 {
3716 g_signal_connect (G_OBJECT(field_col[f][i]), "clicked", G_CALLBACK(visualize_or_select_all_elements), & tmp_view -> colorp[f][is_special[f][i]-2]);
3717 }
3718 }
3719 else
3720 {
3721 field_renderer[f][i] = gtk_cell_renderer_text_new();
3722 str = g_strdup_printf ("%s", (f == 2 && (i-m == 5|| i-m == 6)) ? ctitle[f][i-m] : _(ctitle[f][i-m]));
3723 field_col[f][i] = gtk_tree_view_column_new_with_attributes (str, field_renderer[f][i], "text", i, NULL);
3724 g_free (str);
3725 }
3726
3727 if (is_special[f][i] == 4)
3728 {
3729 g_object_set (field_renderer[f][i], "editable", TRUE, NULL);
3730 if (f < 3)
3731 {
3732 j = 2*(f-1) + i - 3;
3733 }
3734 else if (f == 3)
3735 {
3736 j = 6;
3737 }
3738 else if (f == 4)
3739 {
3740 j = (i == 1) ? 7 : 8;
3741 }
3742 g_signal_connect (G_OBJECT(field_renderer[f][i]), "edited", G_CALLBACK(edit_field_cell), GINT_TO_POINTER(j));
3743 }
3744 if ((f == 0 && i == 3) || (f == 2 && (i == 1 || i == 2)) || (f == 3 && (i == 1 || i == 2)))
3745 {
3746 gtk_tree_view_column_set_cell_data_func (field_col[f][i], field_renderer[f][i], field_set_color_and_markup, GINT_TO_POINTER(f), NULL);
3747 }
3748 else if (f == 4 || f == 5)
3749 {
3750 if ((f == 4 && i < 3) || (f == 5 && i < 2))
3751 {
3752 gtk_tree_view_column_set_cell_data_func (field_col[f][i], field_renderer[f][i], field_set_color_and_visible, GINT_TO_POINTER(f), NULL);
3753 }
3754 else if (f == 4 && (i == 3 || i == 4 || i == 5))
3755 {
3756 gtk_tree_view_column_set_cell_data_func (field_col[f][i], field_renderer[f][i], pmf_set_color_and_visible, GINT_TO_POINTER(i), NULL);
3757 }
3758 else if (f == 5 && i == 2)
3759 {
3760 gtk_tree_view_column_set_cell_data_func (field_col[f][i], field_renderer[f][i], rig_set_color_and_visible, GINT_TO_POINTER(f), NULL);
3761 }
3762 else
3763 {
3764 gtk_tree_view_column_set_cell_data_func (field_col[f][i], field_renderer[f][i], field_set_visible, GINT_TO_POINTER(f), NULL);
3765 }
3766 }
3767 else if (f > 6 && f < MOLIMIT && (i == 0 || i == struct_id(f)+1))
3768 {
3769 gtk_tree_view_column_set_cell_data_func (field_col[f][i], field_renderer[f][i], prop_set_color_and_visible, GINT_TO_POINTER(f), NULL);
3770 }
3771 else if (l == 1 && i > field_v[f]-2)
3772 {
3773 if (i == field_v[f]-1)
3774 {
3775 gtk_tree_view_column_set_cell_data_func (field_col[f][i], field_renderer[f][i], field_set_color_markup_and_visible_box, GINT_TO_POINTER(f), NULL);
3776 }
3777 else if (i == field_v[f])
3778 {
3779 gtk_tree_view_column_set_cell_data_func (field_col[f][i], field_renderer[f][i], field_set_color_markup_and_visible, GINT_TO_POINTER(f), NULL);
3780 g_object_set (field_renderer[f][i], "editable", TRUE, NULL);
3781 g_signal_connect (G_OBJECT(field_renderer[f][i]), "editing-started", G_CALLBACK(to_edit_field_prop), GINT_TO_POINTER(f));
3782 }
3783 }
3784 else if (is_special[f][i] < 2 || is_special[f][i] > 3)
3785 {
3786 gtk_tree_view_column_set_cell_data_func (field_col[f][i], field_renderer[f][i], field_set_color, GINT_TO_POINTER(f), NULL);
3787 }
3788 gtk_tree_view_column_set_alignment (field_col[f][i], 0.5);
3789 gtk_tree_view_append_column(GTK_TREE_VIEW(field_tree[f]), field_col[f][i]);
3790 }
3791
3792 fill_field_model (field_model[f], f, 0);
3793 g_object_unref (field_model[f]);
3794 GtkTreeSelection * fieldselect = gtk_tree_view_get_selection (GTK_TREE_VIEW(field_tree[f]));
3795 gtk_tree_selection_set_mode (fieldselect, GTK_SELECTION_SINGLE);
3796#ifdef GTK4
3797 add_widget_gesture_and_key_action (field_tree[f], "field-button-pressed", G_CALLBACK(on_field_button_pressed), GINT_TO_POINTER(f),
3798 "field-button-released", G_CALLBACK(on_field_button_released), GINT_TO_POINTER(f),
3799 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
3800#else
3801 g_signal_connect (G_OBJECT(field_tree[f]), "button_press_event", G_CALLBACK(on_field_button_event), GINT_TO_POINTER(f));
3802 g_signal_connect (G_OBJECT(field_tree[f]), "popup-menu", G_CALLBACK(on_pop_up_field), GINT_TO_POINTER(f));
3803 g_signal_connect (G_OBJECT(field_tree[f]), "row-activated", G_CALLBACK(on_field_row_activated), GINT_TO_POINTER(f));
3804#endif
3805 return field_tree[f];
3806}
3807
3816void create_field_list (GtkWidget * vbx, int f)
3817{
3818 int i;
3819 field_tree[f] = NULL;
3820 field_model[f] = NULL;
3821 for (i=0; i<11; i++)
3822 {
3823 field_renderer[f][i] = NULL;
3824 field_col[f][i] = NULL;
3825 }
3826 GtkWidget * scrollsets = create_scroll (NULL, -1, -1, GTK_SHADOW_ETCHED_IN);
3827 if (f == 0)
3828 {
3829 gtk_widget_set_size_request (scrollsets, field_s[f], 175);
3830 }
3831 else if (f < MOLIMIT)
3832 {
3833 if (f == 1)
3834 {
3835 gtk_widget_set_size_request (scrollsets, field_s[f], 320);
3836 }
3837 else if (f == 8 || f == 10 || f == 12 || f == 13)
3838 {
3839 gtk_widget_set_size_request (scrollsets, field_s[f], 180);
3840 }
3841 else
3842 {
3843 gtk_widget_set_size_request (scrollsets, field_s[f], 220);
3844 }
3845 }
3846 else
3847 {
3848 gtk_widget_set_size_request (scrollsets, field_s[f], 300);
3849 }
3851 GtkWidget * hbox = create_hbox (0);
3852 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, scrollsets, FALSE, FALSE, (800-field_s[f])/2);
3853 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbx, hbox, FALSE, FALSE, 20);
3854}
3855
3863GtkWidget * create_mol_box (int f)
3864{
3865 GtkWidget * hbox;
3866 hbox = create_hbox (0);
3867 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label(_("Please select molecule: "), -1, -1, 0.0, 0.5), FALSE, FALSE, 100);
3868 combo_mol[f] = create_combo_mol (f);
3869 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, combo_mol[f], FALSE, FALSE, 10);
3870 return hbox;
3871}
3872
3880GtkWidget * vbox_field (int f)
3881{
3882 gchar * str;
3883 GtkWidget * vbx;
3884 GtkWidget * hbx;
3885 GtkWidget * vbox;
3886 GtkWidget * hbox;
3887 vbox = create_vbox (5);
3888 if (f > 6 && f < MOLIMIT)
3889 {
3890 hbx = create_hbox (0);
3891 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbx, FALSE, FALSE, 0);
3892 vbx = create_vbox (BSEP);
3893 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbx, vbx, FALSE, FALSE, 0);
3894 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbx, gtk_image_new_from_file(ifield[f-7]), FALSE, FALSE, 50);
3895 }
3896 if (f == 0)
3897 {
3898 hbox = fbox (vbox, _("Number of isolated molecular fragments: "));
3899 str = g_strdup_printf ("<b>%d</b>", tmp_coord -> totcoord[2]);
3900 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label(str, -1, -1, 0.0, 0.5), FALSE, FALSE, 75);
3901 g_free (str);
3902 str = g_strdup_printf (_("\tEach of these fragments can be described separately in the force field."));
3903 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, markup_label(str, -1, -1, 0.0, 0.5), FALSE, FALSE, 5);
3904 g_free (str);
3905 hbox = fbox (vbox, _("Number of distinct molecules: "));
3906 str = g_strdup_printf ("<b>%d</b>", tmp_coord -> totcoord[3]);
3907 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, markup_label(str, -1, -1, 0.0, 0.5), FALSE, FALSE, 75);
3908 g_free (str);
3909 hbox = fbox (vbox, _("Number of molecules in the force field: "));
3911 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, mol_num_label, FALSE, FALSE, 75);
3912 }
3913 else if (f < MOLIMIT)
3914 {
3915 // if f > 0, ie. atoms tab at least
3916 // need a combobox to pick the 'active' molecule and its corresponding force field
3917 // If using molecules the combo box is active, and visible
3918 // Otherwise deactivate and hide the combo box
3919 // Anyway fill the treestore according to the selection
3920
3921 mol_box[f-1] = create_mol_box (f-1);
3922 if (f > 6 && f < MOLIMIT)
3923 {
3924 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbx, mol_box[f-1], FALSE, FALSE, 0);
3925 }
3926 else
3927 {
3928 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, mol_box[f-1], FALSE, FALSE, 0);
3929 }
3931 }
3932
3933 if (f > 6 && f < MOLIMIT)
3934 {
3935 hbox = fbox (vbx, g_strdup_printf (_("Properties %s: "), _(intelemt[f])));
3936 }
3937 else
3938 {
3939 hbox = fbox (vbox, g_strdup_printf (_("Properties %s: "), _(intelemt[f])));
3940 }
3941 if (f > 0)
3942 {
3943 field_label[f] = markup_label(set_field_label(f, 0), 120, 40, 0.35, 0.5);
3944 hbox = create_hbox (0);
3945 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, field_label[f], TRUE, TRUE, 0);
3946 if (f > 6 && f < MOLIMIT)
3947 {
3948 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbx, hbox, FALSE, FALSE, 10);
3949 }
3950 else
3951 {
3952 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, hbox, FALSE, FALSE, 10);
3953 }
3954 }
3956 if (f > 6 && f < MOLIMIT)
3957 {
3958 if (f == 8 || f == 10 || f == 12 || f == 13)
3959 {
3960 int g = (f < 12) ? f - 1 : 11;
3961 str = g_strdup_printf (_("\t <b>*</b> in the FIELD file %s(s) appear in the %s section.\n"
3962 "\t They are presented separately in this assistant for clarity purposes only."),
3963 _(elemts[f]), _(elemts[g]));
3964 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, markup_label(str, -1, -1, 0.0, 0.5), FALSE, FALSE, 0);
3965 g_free (str);
3966 }
3967 else if (f == 14)
3968 {
3969 str = g_strdup_printf (_("\t <b>*</b> the potential will be calculated by the sum of the 3 possible inversion terms between atoms 1 (center), 2, 3 and 4."));
3970 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, markup_label(str, -1, -1, 0.0, 0.5), FALSE, FALSE, 0);
3971 g_free (str);
3972 }
3973 str = g_strdup_printf (_("\t <b>(1)</b> average value for the force field element as measured in the model."));
3974 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, markup_label(str, -1, -1, 0.0, 0.5), FALSE, FALSE, 0);
3975 g_free (str);
3976 str = g_strdup_printf (_("\t <b>(2)</b> only the selected element(s) will be used to create the force field."));
3977 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, markup_label(str, -1, -1, 0.0, 0.5), FALSE, FALSE, 0);
3978 g_free (str);
3979 str = g_strdup_printf (_("\t <b>(3)</b> each force field element can be tuned separately, if not the <b>Default</b> parameters will be used."));
3980 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, markup_label(str, -1, -1, 0.0, 0.5), FALSE, FALSE, 0);
3981 g_free (str);
3982
3983 }
3984 else if (f == 2)
3985 {
3986 cs_label[0] = markup_label(" ", -1, -1, 0.0, 0.5);
3987 cs_label[1] = markup_label(" ", -1, -1, 0.0, 0.5);
3988 setup_cs_labels (tmp_field -> energy_unit);
3989 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, cs_label[0], FALSE, FALSE, 0);
3990 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, cs_label[1], FALSE, FALSE, 0);
3991 str = g_strdup_printf (_("\t <b>(3)</b> only the selected element(s) will be used to create the force field."));
3992 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, markup_label(str, -1, -1, 0.0, 0.5), FALSE, FALSE, 0);
3993 g_free (str);
3994 }
3995 else if (f == 3)
3996 {
3997 str = g_strdup_printf (_("\t <b>(1)</b> average value for the force field element as measured in the model."));
3998 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, markup_label(str, -1, -1, 0.0, 0.5), FALSE, FALSE, 0);
3999 g_free (str);
4000 str = g_strdup_printf (_("\t <b>(2)</b> only the selected element(s) will be used to create the force field."));
4001 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, markup_label(str, -1, -1, 0.0, 0.5), FALSE, FALSE, 0);
4002 g_free (str);
4003 }
4004 else if (f == 4)
4005 {
4006 str = g_strdup_printf (_("\t <b>(1)</b> average distance between the barycenters of units 1 and 2 as measured in the model."));
4007 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, markup_label(str, -1, -1, 0.0, 0.5), FALSE, FALSE, 0);
4008 g_free (str);
4009 str = g_strdup_printf (_("\t <b>(2)</b> if all 0.0 then atomic weight(s) will be used by DL-POLY."));
4010 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, markup_label(str, -1, -1, 0.0, 0.5), FALSE, FALSE, 0);
4011 g_free (str);
4012 str = g_strdup_printf (_("\t <b>(3)</b> only the selected element(s) will be used to create the force field."));
4013 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, markup_label(str, -1, -1, 0.0, 0.5), FALSE, FALSE, 0);
4014 g_free (str);
4015 }
4016 else if ((f > 2 && f < 7) || f > 11)
4017 {
4018 str = g_strdup_printf (_("\t <b>(1)</b> only the selected element(s) will be used to create the force field."));
4019 add_box_child_start (GTK_ORIENTATION_VERTICAL, vbox, markup_label(str, -1, -1, 0.0, 0.5), FALSE, FALSE, 0);
4020 g_free (str);
4021 }
4022 return vbox;
4023}
4024
4025GtkWidget * field_i_prep[2];
4026GtkWidget * field_i_box[2];
4027GtkWidget * field_i_lab[2];
4028GtkWidget * field_i_fixed[2];
4029GtkWidget * field_i_combo[2];
4030GtkWidget * field_i_obj[2];
4031GtkWidget * preview_but;
4035
4043void close_the_assistant (GtkAssistant * assistant)
4044{
4046 int j;
4047#ifdef GTK3
4048 // GTK3 Menu Action To Check
4049 gboolean i = (tmp_proj -> force_field[activef]) ? TRUE : FALSE;
4050 widget_set_sensitive (tmp_view -> color_styles[5], i);
4051 widget_set_sensitive (tmp_view -> color_styles[5+ATOM_MAPS], i);
4052#endif
4053 field_color = FALSE;
4054 for (j=0; j<2; j++)
4055 {
4056 tmp_view -> anim -> last -> img -> acl_format[j] = saved_label_format[j];
4057 tmp_view -> anim -> last -> img -> labels[j].position = saved_label_position[j];
4058 }
4060/*
4061 tmp_fmol = tmp_field -> first_molecule;
4062 for (j=0; j<tmp_field -> molecules; j++)
4063 {
4064 g_debug ("FIELD_CANCEL:: Mol= %d, show= %d, show_id= %d", j, tmp_fmol -> show, tmp_fmol -> show_id);
4065 if (tmp_fmol -> next != NULL) tmp_fmol = tmp_fmol -> next;
4066 }
4067*/
4068 // restore selection if any from calc.c
4070 mol_num_label = NULL;
4071 tmp_field = NULL;
4072 tmp_view = NULL;
4073 if (! assist_init)
4074 {
4075 if (tmp_proj -> force_field[activef])
4076 {
4077 g_free (tmp_proj -> force_field[activef]);
4078 tmp_proj -> force_field[activef] = NULL;
4079 }
4080 }
4081}
4082
4091G_MODULE_EXPORT void on_assistant_cancel (GtkAssistant * assistant, gpointer data)
4092{
4093 close_the_assistant (assistant);
4094}
4095
4096#ifdef GTK4
4105G_MODULE_EXPORT gboolean on_assistant_cancel_event (GtkWindow * assistant, gpointer data)
4106#else
4116G_MODULE_EXPORT gboolean on_assistant_cancel_event (GtkWidget * assistant, GdkEvent * event, gpointer data)
4117#endif
4118{
4119 on_assistant_cancel (((GtkAssistant *)assistant), data);
4120 return TRUE;
4121}
4122
4131G_MODULE_EXPORT void on_assistant_close (GtkAssistant * assistant, gpointer data)
4132{
4133 close_the_assistant (assistant);
4134}
4135
4144G_MODULE_EXPORT gint on_assistant_go_forward (gint current_page, gpointer data)
4145{
4146 int i, j;
4147 j = -1;
4148 switch (current_page)
4149 {
4150 case 0:
4151 j = 1;
4152 if (! tmp_field -> prepare_file[0])
4153 {
4154 j = MAXDATC+1;
4155 if (! tmp_field -> prepare_file[1]) j += MAXDATA+2;
4156 }
4157 return j;
4158 break;
4159 case MAXDATC+MAXDATA+2:
4160 return -1;
4161 break;
4162 default:
4163 if (current_page > MAXDATC-1 && tmp_field -> prepare_file[1])
4164 {
4165 for (i=current_page-1; i<MAXDATC+MAXDATA; i++)
4166 {
4167 if (tmp_field -> afp[i])
4168 {
4169 j = i+2;
4170 break;
4171 }
4172 }
4173 }
4174 else if (tmp_field -> prepare_file[0])
4175 {
4176 for (i=current_page; i<MAXDATC; i++)
4177 {
4178 if (tmp_field -> afp[i])
4179 {
4180 j = i+1;
4181 break;
4182 }
4183 }
4184 }
4185 if (j == -1) j = MAXDATC+MAXDATA+2;
4186 return j;
4187 break;
4188 }
4189}
4190
4200G_MODULE_EXPORT void on_assistant_prepare (GtkAssistant * assistant, GtkWidget * page, gpointer data)
4201{
4202 int i, j, k;
4203 i = gtk_assistant_get_current_page (assistant);
4205 switch (i)
4206 {
4207 case 0:
4208 // hide_the_widgets (preview_but);
4209 break;
4210 case 1:
4211 // show_the_widgets (preview_but);
4212 break;
4213 case MAXDATC+MAXDATA+2:
4214 break;
4215 default:
4216 j = field_object = i-2-MAXDATC;
4217 toviz.c = 1;
4218 switch (j)
4219 {
4220 case 0:
4221 tmp_fmol = tmp_field -> first_molecule;
4222 for (k=0; k<tmp_field -> molecules; k++)
4223 {
4224 if (tmp_fmol -> show) visualize_object (j, k, -1);
4225 if (tmp_fmol -> show_id) visualize_object (-1, k, -1);
4226 if (tmp_fmol -> next != NULL) tmp_fmol = tmp_fmol -> next;
4227 }
4228 break;
4229 default:
4230 if (j > -1 && j < SEXTERN) check_to_visualize_properties (j);
4231 break;
4232 }
4233 break;
4234 }
4236}
4237
4248void hide_show_this_pages (int start, int end, int status, int delta)
4249{
4250 int i;
4251 for (i=start; i<end; i++)
4252 {
4253 if (fibox[i+delta] != NULL)
4254 {
4255 if (GTK_IS_WIDGET(fibox[i+delta]))
4256 {
4257 gtk_widget_set_visible (fibox[i+delta], (status) ? tmp_field -> afp[i] : status);
4258 }
4259 }
4260 }
4261}
4262
4269{
4270 int i;
4271 GtkAssistant * assist = GTK_ASSISTANT(field_assistant);
4273 for (i=MAXDATC+MAXDATA+1; i>-1; i--)
4274 {
4275 gtk_assistant_remove_page (assist, i+1);
4277 }
4278}
4279
4289G_MODULE_EXPORT void run_clean_field (GtkDialog * dial, gint response_id, gpointer data)
4290{
4291 if (response_id == GTK_RESPONSE_APPLY)
4292 {
4293 gtk_assistant_set_page_complete (GTK_ASSISTANT (field_assistant),
4294 gtk_assistant_get_nth_page(GTK_ASSISTANT (field_assistant), 0), FALSE);
4295 gtk_label_set_text (GTK_LABEL(field_i_lab[1]), _("Initialize force field using: "));
4296 int i;
4297 for (i=0; i<2; i++)
4298 {
4300 //tmp_field -> prepare_file[i] = TRUE;
4307 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, field_i_box[i], field_i_obj[i], TRUE, TRUE, 25);
4308 }
4309 for (i=0; i<MAXDATC+MAXDATA+2; i++)
4310 {
4311 if (fibox[i] != NULL)
4312 {
4313 if (GTK_IS_WIDGET(fibox[i]))
4314 {
4315 gtk_widget_set_visible (fibox[i], FALSE);
4316 }
4317 }
4318 }
4320 for (i=0; i<19; i++)
4321 {
4323 }
4325 button_set_status (data, FALSE);
4326 assist_init = FALSE;
4327 }
4328 destroy_this_dialog (dial);
4329}
4330
4331#ifdef GTK4
4340G_MODULE_EXPORT void clean_field (GtkCheckButton * but, gpointer data)
4341#else
4350G_MODULE_EXPORT void clean_field (GtkToggleButton * but, gpointer data)
4351#endif
4352{
4353 if (button_get_status ((GtkWidget *)but))
4354 {
4355 GtkWidget * dial = dialog_cancel_apply (_("Clean all force field parameter(s) ?"), field_assistant, FALSE);
4356 GtkWidget * box = dialog_get_content_area (dial);
4357 gtk_box_set_homogeneous (GTK_BOX(box), FALSE);
4358 add_box_child_start (GTK_ORIENTATION_VERTICAL, box, gtk_label_new (_("Providing that the force field information was already saved once\n"
4359 "the previous data could still be retrieved by canceling the assistant.")), FALSE, FALSE, 0);
4360 run_this_gtk_dialog (dial, G_CALLBACK(run_clean_field), but);
4361 }
4362}
4363
4364#ifdef GTK4
4373G_MODULE_EXPORT void select_field_action (GtkCheckButton * but, gpointer data)
4374#else
4383G_MODULE_EXPORT void select_field_action (GtkToggleButton * but, gpointer data)
4384#endif
4385{
4386 int i, j;
4387 i = GPOINTER_TO_INT(data);
4388 tmp_field -> prepare_file[i] = button_get_status ((GtkWidget *)but);
4389 if (i == 1)
4390 {
4391 for (j=0; j<2; j++)
4392 {
4393 widget_set_sensitive (field_i_lab[j], (tmp_field -> prepare_file[i] && ! assist_init) ? TRUE : FALSE);
4394 widget_set_sensitive (field_i_combo[j], (tmp_field -> prepare_file[i] && ! assist_init) ? TRUE : FALSE);
4395 }
4396 hide_show_this_pages (MAXDATC-1, MAXDATC+MAXDATA, tmp_field -> prepare_file[1], 1);
4397 }
4398 else
4399 {
4400 hide_show_this_pages (0, MAXDATC, tmp_field -> prepare_file[0], 0);
4401 }
4402}
4403
4412{
4413 int i;
4414 gchar * info;
4415 GtkAssistant * assist = GTK_ASSISTANT(field_assistant);
4416 // Control file
4417 for (i=0; i<MAXDATC; i++)
4418 {
4419 fibox[i] = vbox_control (i);
4420 gtk_assistant_append_page (assist, fibox[i]);
4421 gtk_assistant_set_page_title (assist, fibox[i], g_strdup_printf ("%s", _(celemts[i])));
4422 gtk_assistant_set_page_type (assist, fibox[i], GTK_ASSISTANT_PAGE_CONTENT);
4423 gtk_assistant_set_page_complete (assist, fibox[i], TRUE);
4424 }
4425
4426 // Field file
4427 i = MAXDATC;
4428 fibox[i] = vbox_init (p);
4429 gtk_assistant_append_page (assist, fibox[i]);
4430 gtk_assistant_set_page_title (assist, fibox[i], _("Select the component(s) of the force field"));
4431 gtk_assistant_set_page_type (assist, fibox[i], GTK_ASSISTANT_PAGE_CONTENT);
4432 gtk_assistant_set_page_complete (assist, fibox[i], TRUE);
4433 for (i=MAXDATC+1; i<MAXDATC+MAXDATA+1; i++)
4434 {
4435 fibox[i] = vbox_field (i-MAXDATC-1);
4436 gtk_assistant_append_page (assist, fibox[i]);
4437 gtk_assistant_set_page_title (assist, fibox[i], g_strdup_printf ("%s", _(felemts[i-MAXDATC])));
4438 gtk_assistant_set_page_type (assist, fibox[i], GTK_ASSISTANT_PAGE_CONTENT);
4439 gtk_assistant_set_page_complete (assist, fibox[i], TRUE);
4440 }
4441 i = MAXDATC+MAXDATA+1;
4442 fibox[i] = create_vbox (BSEP);
4443
4444 info = g_strdup_printf (_("<b> Finalize the creation of the %s input file(s) now !</b>"), (activef) ? "LAMMPS" : "DL-POLY");
4445 add_box_child_start (GTK_ORIENTATION_VERTICAL, fibox[i], markup_label(info, -1, -1, 0.5, 0.5), TRUE, TRUE, 100);
4446 g_free (info);
4447 add_box_child_start (GTK_ORIENTATION_VERTICAL, fibox[i], 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),
4448 FALSE, FALSE, 0);
4449 gtk_assistant_append_page (assist, fibox[i]);
4450 gtk_assistant_set_page_title (assist, fibox[i], (activef) ? _("Create the LAMMPS input file(s) now !") : _("Create the DL-POLY input file(s) now !"));
4451 gtk_assistant_set_page_type (assist, fibox[i], GTK_ASSISTANT_PAGE_CONFIRM);
4452 gtk_assistant_set_page_complete (assist, fibox[i], TRUE);
4453 gtk_assistant_update_buttons_state (assist);
4454 append_pages = TRUE;
4455}
4456
4457gchar * field_init[3]={i18n("Atomic Species as Field Atoms"),
4458 i18n("Atomic Species and Total Coordinations as Field Atoms"),
4459 i18n("Atomic Species and Partial Coordinations as Field Atoms")};
4460
4461// gboolean create_ff_structure (gpointer data)
4470void create_ff_structure (int ai, int type)
4471{
4472 int i;
4473 //if (append_pages) remove_classical_assistant_pages ();
4474 tmp_proj -> force_field[activef] = create_force_field_data_structure (ai);
4475 tmp_proj -> force_field[activef] -> type = type;
4476 tmp_field = tmp_proj -> force_field[activef];
4477 for (i=0; i<MAXDATC+MAXDATA; i++) tmp_field -> afp[i] = afp_init[i];
4478 for (i=0; i<2; i++)
4479 {
4481 if (activef && ! i)
4482 {
4484 tmp_field -> prepare_file[i] = FALSE;
4485 }
4486 else
4487 {
4488 tmp_field -> prepare_file[i] = button_get_status (field_i_prep[i]);
4489 }
4491 }
4492 // for (i=13; i<19; i++) widget_set_sensitive (ff_but[i], set_nbd_but_sensitive (i));
4498 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, field_i_box[1], field_i_obj[1], TRUE, TRUE, 25);
4499 gtk_label_set_text (GTK_LABEL(field_i_lab[1]), _("Force field was initialized using: "));
4500 gtk_assistant_set_page_complete (GTK_ASSISTANT (field_assistant),
4501 gtk_assistant_get_nth_page(GTK_ASSISTANT (field_assistant), 0), TRUE);
4503 if (tmp_field -> md_opts[1] == 0.0) hide_the_widgets (extra_vbox[1]);
4504 hide_show_this_pages (0, MAXDATC, tmp_field -> prepare_file[0], 0);
4505 hide_show_this_pages (MAXDATC-1, MAXDATC+MAXDATA, tmp_field -> prepare_file[1], 1);
4506 // return FALSE;
4507}
4508
4517G_MODULE_EXPORT void changed_init_box (GtkComboBox * box, gpointer data)
4518{
4519 int i, j;
4520 i = GPOINTER_TO_INT(data);
4521 j = combo_get_active ((GtkWidget *)box);
4522 if (j > -1)
4523 {
4524 switch (i)
4525 {
4526 case 0:
4527 tmp_field -> type = j;
4529 if (tmp_field -> type == j)
4530 {
4533 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, field_i_box[0], field_i_obj[0], TRUE, TRUE, 25);
4535 }
4536 else
4537 {
4538 combo_set_active ((GtkWidget *)box, -1);
4539 }
4540 break;
4541 case 1:
4542 if (tmp_field -> type > -1)
4543 {
4547 field_i_obj[1] = gtk_spinner_new ();
4549 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, field_i_box[1], field_i_obj[1], TRUE, TRUE, 25);
4551 gtk_spinner_start (GTK_SPINNER(field_i_obj[1]));
4552 // gdk_threads_add_idle (create_ff_structure, GINT_TO_POINTER(j));
4553 create_ff_structure (j, tmp_field -> type);
4554 assist_init = TRUE;
4555 }
4556 else
4557 {
4558 show_warning (_("Please select the force field first !"), field_assistant);
4559 }
4560 break;
4561 }
4562 }
4563}
4564
4573G_MODULE_EXPORT void show_force_field_preview (GtkButton * but, gpointer data)
4574{
4575 GtkWidget * preview = (activef) ? dialogmodal (_("LAMMPS files preview"), GTK_WINDOW(field_assistant)) : dialogmodal (_("DL-POLY files preview"), GTK_WINDOW(field_assistant));
4576 GtkWidget * notebook = gtk_notebook_new ();
4577 GtkWidget * scrollsets;
4578 GtkWidget * aview;
4579 gchar * ff_files[2][3] = {{"CONTROL", "FIELD" , "CONFIG"}, {"LAMMPS.IN", "LAMMPS.DATA", ""}};
4580 int num_files[2] = {3, 2};
4581 int i;
4582 for (i=0; i<num_files[activef]; i++)
4583 {
4584 if ((i==0 && tmp_field -> prepare_file[0]) || (i > 0 && tmp_field -> prepare_file[1]))
4585 {
4586 scrollsets = create_scroll (NULL, 700, 350, GTK_SHADOW_ETCHED_IN);
4587 aview = create_text_view (-1, -1, 0, 1, NULL, NULL, NULL);
4589 if (! activef)
4590 {
4591 switch (i)
4592 {
4593 case 0:
4594 print_dlp_control (gtk_text_view_get_buffer(GTK_TEXT_VIEW(aview)));
4595 break;
4596 case 1:
4597 print_dlp_field (gtk_text_view_get_buffer(GTK_TEXT_VIEW(aview)));
4598 break;
4599 case 2:
4600 print_dlp_config (gtk_text_view_get_buffer(GTK_TEXT_VIEW(aview)));
4601 break;
4602 }
4603 }
4604 else
4605 {
4606 switch (i)
4607 {
4608 case 0:
4609
4610 break;
4611 case 1:
4612 print_lammps_atom_file (gtk_text_view_get_buffer(GTK_TEXT_VIEW(aview)));
4613 break;
4614 }
4615 }
4616 gtk_notebook_append_page (GTK_NOTEBOOK(notebook), scrollsets, gtk_label_new (ff_files[activef][i]));
4617 }
4618 }
4619 add_box_child_start (GTK_ORIENTATION_VERTICAL, dialog_get_content_area (preview), notebook, FALSE, FALSE, 0);
4620 if (gtk_assistant_get_current_page (GTK_ASSISTANT (field_assistant)) > MAXDATC && tmp_field -> prepare_file[0]) gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), 1);
4621 run_this_gtk_dialog (preview, G_CALLBACK(run_destroy_dialog), NULL);
4622}
4623
4624#ifdef GTK4
4634G_MODULE_EXPORT void run_on_assistant_apply (GtkNativeDialog * info, gint response_id, gpointer data)
4635{
4636 GtkFileChooser * chooser = GTK_FILE_CHOOSER((GtkFileChooserNative *)info);
4637#else
4647G_MODULE_EXPORT void run_on_assistant_apply (GtkDialog * info, gint response_id, gpointer data)
4648{
4649 GtkFileChooser * chooser = GTK_FILE_CHOOSER((GtkWidget *)info);
4650#endif
4651 int i;
4652 GtkTextBuffer * buffer;
4653 GtkTextIter bStart;
4654 GtkTextIter bEnd;
4655 GError * err = NULL;
4656 gboolean result = FALSE;
4657 gchar * ff_files[2][3] = {{"CONTROL", "FIELD" , "CONFIG"}, {"LAMMPS.IN", "LAMMPS.DATA", ""}};
4658 int num_files[2] = {3, 2};
4659 if (response_id == GTK_RESPONSE_ACCEPT)
4660 {
4661 gchar * direname = file_chooser_get_current_folder (chooser);
4662 if (direname != NULL)
4663 {
4664 gchar * filename;
4665 gchar * str;
4666 gboolean doit[3];
4667 for (i=0; i<num_files[activef]; i++)
4668 {
4669 if ((i==0 && tmp_field -> prepare_file[0]) || (i > 0 && tmp_field -> prepare_file[1]))
4670 {
4671 filename = g_strdup_printf ("%s/%s", direname, ff_files[activef][i]);
4672 if (g_file_test(filename, G_FILE_TEST_EXISTS))
4673 {
4674 str = g_strdup_printf (_("%s file found in '%s'\nreplace existing %s file ?"), ff_files[activef][i], direname, ff_files[activef][i]);
4675 doit[i] = ask_yes_no (_("Replace file ?"), str, GTK_MESSAGE_QUESTION, field_assistant);
4676 g_free (str);
4677 }
4678 else
4679 {
4680 doit[i] = TRUE;
4681 }
4682 }
4683 else
4684 {
4685 doit[i] = FALSE;
4686 }
4687 }
4688 for (i=0; i<num_files[activef]; i++)
4689 {
4690 buffer = add_buffer (NULL, NULL, NULL);
4691 if (doit[i])
4692 {
4693 filename = g_strdup_printf ("%s/%s", direname, ff_files[activef][i]);
4694 switch (i)
4695 {
4696 case 0:
4697 print_dlp_control (buffer);
4698 break;
4699 case 1:
4700 print_dlp_field (buffer);
4701 break;
4702 case 2:
4703 print_dlp_config (buffer);
4704 break;
4705 }
4706 gtk_text_buffer_get_start_iter (buffer, & bStart);
4707 gtk_text_buffer_get_end_iter (buffer, & bEnd);
4708 gchar * text = gtk_text_buffer_get_text (buffer, & bStart, & bEnd, FALSE);
4709 gtk_text_buffer_set_modified (buffer, FALSE);
4710 result = g_file_set_contents (filename, text, -1, & err);
4711 g_free (text);
4712 g_object_unref (buffer);
4713 if (! result && err)
4714 {
4715 show_error (g_strdup_printf (_("Error while saving input file: %s\n Error: %s"), filename, err -> message), 0, field_assistant);
4716 g_error_free (err);
4717 }
4718 g_free (filename);
4719 }
4720 }
4721 g_free (direname);
4722 }
4723 }
4724#ifdef GTK4
4726#else
4727 destroy_this_dialog (info);
4728#endif
4729}
4730
4739void on_assistant_apply (GtkAssistant * assistant, gpointer data)
4740{
4741 gchar * text;
4742#ifdef GTK4
4743 GtkFileChooserNative * info;
4744#else
4745 GtkWidget * info;
4746#endif
4747 gchar * ff_type[2] = {"DL-POLY", "LAMMPS"};
4748
4749 text = g_strdup_printf (_("Saving %s input file(s)"), ff_type[activef]);
4750 info = create_file_chooser (text,
4751 GTK_WINDOW(assistant),
4752 GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
4753 _("Save"));
4754 g_free (text);
4755#ifdef GTK4
4756 run_this_gtk_native_dialog ((GtkNativeDialog *)info, G_CALLBACK(run_on_assistant_apply), NULL);
4757#else
4758 run_this_gtk_dialog (info, G_CALLBACK(run_on_assistant_apply), NULL);
4759 // GTK3 Menu Action To Check
4760 gboolean i = (tmp_proj -> force_field[activef]) ? TRUE : FALSE;
4761 widget_set_sensitive (tmp_view -> color_styles[5], i);
4762 widget_set_sensitive (tmp_view -> color_styles[5+ATOM_MAPS], i);
4763#endif
4764}
4765
4775{
4776 field_assistant = gtk_assistant_new ();
4777 gtk_widget_set_size_request (field_assistant, 800, 600);
4778 int i, j, k;
4779 activef = f;
4780 field_color = TRUE;
4781 field_object = -1;
4782 selected_aspec = -1;
4785 tmp_coord = tmp_proj -> coord;
4786 tmp_view = tmp_proj -> modelgl;
4787 tmp_fmol = NULL;
4788 tmp_fmol = g_malloc0(sizeof*tmp_fmol);
4789 gchar * field_type[2] = {"DL-POLY 4", "LAMMPS"};
4790
4791 // Preparing data structure and pointers
4792 append_pages = FALSE;
4793 if (tmp_proj -> force_field[activef] == NULL)
4794 {
4795 assist_init = FALSE;
4796 tmp_proj -> force_field[activef] = g_malloc0(sizeof*tmp_proj -> force_field[activef]);
4797 tmp_proj -> force_field[activef] -> type = -1;
4798 tmp_proj -> force_field[activef] -> atom_init = -1;
4799 for (i=0; i<2; i++) tmp_proj -> force_field[activef] -> prepare_file[i] = TRUE;
4800 if (activef) tmp_proj -> force_field[activef] -> prepare_file[0] = FALSE;
4801 }
4802 else
4803 {
4804 assist_init = TRUE;
4805 if (tmp_proj -> force_field[activef] -> type > -1) setup_this_force_field (tmp_proj -> force_field[activef] -> type);
4806 //tmp_field = duplicate_dlpoly_field (tmp_proj -> force_field[activef]);
4807 }
4808 tmp_field = tmp_proj -> force_field[activef];
4809
4810 gtk_window_set_resizable (GTK_WINDOW (field_assistant), FALSE);
4811 gtk_window_set_modal (GTK_WINDOW (field_assistant), TRUE);
4812 gchar * info = g_strdup_printf (_("%s calculation assistant"), field_type[f]);
4813 gtk_window_set_title (GTK_WINDOW(field_assistant), info);
4814 g_free (info);
4815
4816 GtkWidget * intro = create_vbox (BSEP);
4817 info = g_strdup_printf (_("<b> This assistant will help you to setup a %s \n"
4818 "calculation using <i>%s</i> 3D model as starting point</b>"), field_type[f], tmp_proj -> name);
4819 add_box_child_start (GTK_ORIENTATION_VERTICAL, intro, markup_label(info, -1, -1, 0.5, 0.5), FALSE, FALSE, 50);
4820 g_free (info);
4821
4822 gchar * i_titles[2][2] = {{i18n("Force field: "), i18n("Force field: ")}, {i18n("Initialize force field using: "), i18n("Force field was initialized using: ")}};
4823 for (i=0; i<2; i++)
4824 {
4825 field_i_box[i] = create_hbox (0);
4826 add_box_child_start (GTK_ORIENTATION_VERTICAL, intro, field_i_box[i], FALSE, FALSE, 0);
4827 j = (i == 0) ? tmp_field -> type + 1 : tmp_field -> atom_init + 1;
4828 k = (j) ? 1 : 0;
4829 field_i_lab[i] = markup_label(_(i_titles[i][k]), 210, -1, 0.0, 0.5);
4830 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, field_i_box[i], field_i_lab[i], FALSE, FALSE, 20);
4833 switch (i)
4834 {
4835 case 0:
4836 for (j=0; j<N_FIELDS; j++) combo_text_append (field_i_combo[i], field_acro[j]);
4838 break;
4839 case 1:
4840 for (j=0; j<3; j++) combo_text_append (field_i_combo[i], _(field_init[j]));
4842 break;
4843 }
4845 g_signal_connect (G_OBJECT (field_i_combo[i]), "changed", G_CALLBACK(changed_init_box), GINT_TO_POINTER(i));
4846 field_i_fixed[i] = gtk_fixed_new ();
4847 gtk_widget_set_size_request (field_i_fixed[i], 410, -1);
4848 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, field_i_box[i], field_i_fixed[i], FALSE, FALSE, 0);
4849 gtk_fixed_put (GTK_FIXED(field_i_fixed[i]), field_i_combo[i], 0, 0);
4851 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, field_i_box[i], field_i_obj[i], FALSE, FALSE, 25);
4852 }
4853
4854 GtkWidget * hbox = create_hbox (0);
4855 add_box_child_start (GTK_ORIENTATION_VERTICAL, intro, hbox, FALSE, FALSE, 10);
4856 GtkWidget * but = check_button (_("\tDelete the existing force field data and reset the parameters to the default values"),
4857 -1, 40, FALSE, G_CALLBACK(clean_field), GINT_TO_POINTER(p));
4858 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, but, FALSE, FALSE, 85);
4859
4860 if (! f)
4861 {
4862 field_i_prep[0] = check_button (_("\tPrepare the CONTROL file to describe the calculation"),
4863 -1, 40, tmp_field -> prepare_file[0], G_CALLBACK(select_field_action), GINT_TO_POINTER(0));
4864 field_i_prep[1] = check_button (_("\tPrepare the FIELD and CONFIG files to describe the force field and the atomic scale model"),
4865 -1, 40, tmp_field -> prepare_file[1], G_CALLBACK(select_field_action), GINT_TO_POINTER(1));
4866 }
4867 else
4868 {
4869 field_i_prep[0] = check_button (_("\tPrepare the LAMMPS Input to describe the calculation"),
4870 -1, 40, tmp_field -> prepare_file[0], G_CALLBACK(select_field_action), GINT_TO_POINTER(0));
4871 field_i_prep[1] = check_button (_("\tPrepare the LAMMPS Atom file to describe the force field and the atomic scale model"),
4872 -1, 40, tmp_field -> prepare_file[1], G_CALLBACK(select_field_action), GINT_TO_POINTER(1));
4873 }
4874 for (i=0; i<2; i++)
4875 {
4876 hbox = create_hbox (0);
4877 add_box_child_start (GTK_ORIENTATION_VERTICAL, intro, hbox, FALSE, FALSE, 0);
4880 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hbox, field_i_prep[i], FALSE, FALSE, 50);
4881 }
4882 add_box_child_start (GTK_ORIENTATION_VERTICAL, intro,
4883 markup_label(_("\n \t<b>Note: </b>You can re-open this assistant later if required to adjust your choices\n"),
4884 -1, -1, 0.0, 0.5), FALSE, FALSE, 50);
4885
4886 gtk_assistant_append_page (GTK_ASSISTANT (field_assistant), intro);
4887 info = g_strdup_printf ("%s calculation set-up", field_type[f]);
4888 gtk_assistant_set_page_title (GTK_ASSISTANT (field_assistant), intro, info);
4889 g_free (info);
4890 gtk_assistant_set_page_type (GTK_ASSISTANT (field_assistant), intro, GTK_ASSISTANT_PAGE_INTRO);
4891 gtk_assistant_set_page_complete (GTK_ASSISTANT (field_assistant), intro, assist_init);
4892 preview_but = create_button (_("Preview"), IMG_STOCK, EDITF, -1, -1, GTK_RELIEF_NORMAL, G_CALLBACK(show_force_field_preview), NULL);
4893 gtk_assistant_add_action_widget (GTK_ASSISTANT (field_assistant), preview_but);
4894
4895 if (assist_init)
4896 {
4899 hide_show_this_pages (0, MAXDATC, tmp_field -> prepare_file[0], 0);
4900 hide_show_this_pages (MAXDATC-1, MAXDATC+MAXDATA, tmp_field -> prepare_file[1], 1);
4901 }
4902 else
4903 {
4906 }
4907
4908 gtk_assistant_set_forward_page_func (GTK_ASSISTANT (field_assistant), on_assistant_go_forward, NULL, NULL);
4909 g_signal_connect (G_OBJECT (field_assistant), "prepare", G_CALLBACK(on_assistant_prepare), NULL);
4910 g_signal_connect (G_OBJECT (field_assistant), "cancel", G_CALLBACK(on_assistant_cancel), NULL);
4911 g_signal_connect (G_OBJECT (field_assistant), "close", G_CALLBACK(on_assistant_close), NULL);
4912 g_signal_connect (G_OBJECT (field_assistant), "apply", G_CALLBACK(on_assistant_apply), NULL);
4914
4915 for (i=0; i<2; i++)
4916 {
4917 saved_label_format[i] = tmp_view -> anim -> last -> img -> acl_format[i];
4918 saved_label_position[i] = tmp_view -> anim -> last -> img -> labels[i].position;
4919 tmp_view -> anim -> last -> img -> labels[i].position = 0;
4920 tmp_view -> anim -> last -> img -> acl_format[i] = ID_IN_MOLECULE;
4921 }
4922
4923 //g_debug ("Number of pages in the assitant: %d", gtk_assistant_get_n_pages (GTK_ASSISTANT (field_assistant)));
4924 //g_debug ("Active page is: %d", gtk_assistant_get_current_page (GTK_ASSISTANT (fwin)));
4925}
insertion_menu mol[]
Definition w_library.c:193
Binding to the Fortran90 subroutines.
int selected_aspec
Definition popup.c:179
Variable declarations for the MD input preparation assistants.
Callback declarations for main window.
integer(kind=c_int) function chemistry()
Definition chemistry.F90:22
color colorp[64]
ColRGBA init_color(int id, int numid)
initialize color based id number over total number of elements
Definition initcoord.c:81
double scale(double axe)
find appropriate major tick spacing based on axis length
Definition curve.c:205
char * sca
Definition curve.c:77
ColRGBA col
Definition d_measures.c:77
int atoms[NUM_STYLES][2]
GtkTreePath * path
Definition datab.c:103
gchar * text
Definition datab.c:105
field_constraint * get_active_constraint(int a, int b)
retrieve constraint property
Definition dlp_active.c:185
field_molecule * get_active_field_molecule(int a)
retrieve field molecule
Definition dlp_active.c:87
field_rigid * get_active_rigid(int a, int b)
retrieve rigid property
Definition dlp_active.c:225
field_prop * get_active_prop_using_atoms(struct field_prop *pr, int ti, int *ids)
retrieve field molecule structural property using atoms
Definition dlp_active.c:286
field_struct * get_active_struct(int s, int a, int b)
retrieve field structural property
Definition dlp_active.c:318
field_shell * get_active_shell(int a, int b)
retrieve shell property
Definition dlp_active.c:165
field_atom * get_active_atom(int a, int b)
retrieve field atom
Definition dlp_active.c:145
field_external * get_active_external(int a)
retrieve external field property
Definition dlp_active.c:125
field_nth_body * get_active_body(int a, int b)
retrieve field nth body interaction
Definition dlp_active.c:106
field_pmf * get_active_pmf(int a, int b)
retrieve PMF property
Definition dlp_active.c:205
field_tethered * get_active_tethered(int a, int b)
retrieve tethered property
Definition dlp_active.c:245
G_MODULE_EXPORT void remove_atom_from_field_molecule(GSimpleAction *action, GVariant *parameter, gpointer data)
remove atom from field molecule - creating the dialog
Definition dlp_atom.c:731
float val
Definition dlp_init.c:117
void init_default_shaders(glwin *view)
re-initialize the default OpenGL shaders
GtkWidget * extra_vbox[2]
gchar * celemts[MAXDATC]
GtkWidget * vbox_control(int f)
crerate DL-POLY option widgets
gchar * mo_title[8]
Definition dlp_field.c:1025
gchar * felemt[MAXDATA+1]
Definition dlp_field.c:164
G_MODULE_EXPORT void add_field_prop(GSimpleAction *action, GVariant *parameter, gpointer data)
add field property callback
Definition dlp_edit.c:3059
int fetypes[2][16]
Definition dlp_field.c:376
gchar * elemts[MAXDATA]
Definition dlp_field.c:187
void adjust_field_prop(int fil, int sti, field_prop *tmp, int *ids, int key)
adjust field property
Definition dlp_edit.c:163
G_MODULE_EXPORT void select_atom_id_from_fied_molecule(GtkButton *but, gpointer data)
select atom id from field molecule - creating the dialog
Definition dlp_edit.c:1177
G_MODULE_EXPORT void edit_field_prop(GSimpleAction *action, GVariant *parameter, gpointer data)
edit field property callback
Definition dlp_edit.c:2994
G_MODULE_EXPORT void remove_field_prop(GSimpleAction *action, GVariant *parameter, gpointer data)
remove field property callback
Definition dlp_edit.c:3299
int * atoms_id
gchar * get_body_element_name(field_nth_body *body, int aid, int nbd)
get field body potential element name
Definition dlp_edit.c:1941
char * fvars_bond[2][FBONDS][FBONDS_P]
Definition dlp_field.c:396
gchar * felemts[MAXDATA+1]
Definition dlp_field.c:141
char * fvars_inversion[2][FINVERS][FINVERS_P]
Definition dlp_field.c:612
char * fvars_dihedral[2][FDIHEDRAL][FDIHEDRAL_P]
Definition dlp_field.c:540
char * fvars_angle[2][FANGLES][FANGLES_P]
Definition dlp_field.c:462
char * fvars_vdw[2][FVDW][FVDW_P]
Definition dlp_field.c:692
model example
Definition dlp_field.c:1128
GtkTreeIter field_iter
Definition dlp_field.c:1038
gchar * field_init[3]
Definition dlp_field.c:4457
int feunit_fbd[2][FFOURBODY][FFOURBODY_P]
Definition dlp_field.c:859
GtkWidget * field_i_lab[2]
Definition dlp_field.c:4027
char * fvars_fbd[2][FFOURBODY][FFOURBODY_P]
Definition dlp_field.c:852
glwin * tmp_view
Definition dlp_field.c:1042
field_constraint * tmp_fcons
Definition dlp_field.c:1049
int fvalues[2][15][21]
Definition dlp_field.c:345
gchar * pop_add(int i)
get add string label
Definition dlp_field.c:2814
void close_the_assistant(GtkAssistant *assistant)
classical force field creation close the assistant
Definition dlp_field.c:4043
gboolean field_file_has_energy_parameters(gboolean scale, int sca, int scb)
scale all field parameter(s) related to the energy unit
Definition dlp_field.c:2041
void on_assistant_apply(GtkAssistant *assistant, gpointer data)
on classical force field assistant apply - creating the dialog
Definition dlp_field.c:4739
GtkWidget * field_i_combo[2]
Definition dlp_field.c:4029
int field_object
Definition dlp_field.c:1069
void field_unselect_all()
unselect all atoms
Definition dlp_viz.c:130
GtkWidget * field_i_fixed[2]
Definition dlp_field.c:4028
field_nth_body * tmp_fbody
Definition dlp_field.c:1055
float internal_to_other[5]
Definition dlp_field.c:1028
GtkCellRenderer * field_renderer[MAXDATA][11]
Definition dlp_field.c:1032
project * tmp_proj
Definition dlp_field.c:1043
int feunit_tbd[2][FTHREEBODY][FTHREEBODY_P]
Definition dlp_field.c:839
G_MODULE_EXPORT void on_assistant_cancel(GtkAssistant *assistant, gpointer data)
classical force field creation cancel assistant
Definition dlp_field.c:4091
field_shell * tmp_fshell
Definition dlp_field.c:1048
int feunit_dihedral[2][FDIHEDRAL][FDIHEDRAL_P]
Definition dlp_field.c:569
GtkWidget * mol_box[MOLIMIT-1]
Definition dlp_field.c:1033
G_MODULE_EXPORT gboolean on_field_button_event(GtkWidget *widget, GdkEvent *event, gpointer data)
classical force field tree model button event callback GTK3
Definition dlp_field.c:3252
field_rigid * tmp_frig
Definition dlp_field.c:1051
void create_ff_structure(int ai, int type)
create the classical force field data structure and update widgets
Definition dlp_field.c:4470
G_MODULE_EXPORT void select_field_action(GtkToggleButton *but, gpointer data)
select force field creation option toggle callback GTK3
Definition dlp_field.c:4383
void pop_up_field_context_menu(int row_id, GtkWidget *widget, GdkEvent *event, gpointer data)
classical force field tree model popup menu GTK3
Definition dlp_field.c:2921
int saved_label_position[2]
Definition dlp_field.c:4034
int feunit_angle[2][FANGLES][FANGLES_P]
Definition dlp_field.c:501
G_MODULE_EXPORT void toggle_field_params(GtkToggleButton *but, gpointer data)
change classical force field parameter toggle callback GTK3
Definition dlp_field.c:1700
int body_at(int b)
find the number of atom(s) in a non bonded interaction
Definition dlp_field.c:1112
void field_set_visible(GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *mod, GtkTreeIter *iter, gpointer data)
set renderer visibility in the classical force field tree store
Definition dlp_field.c:3373
GtkWidget * enbox
Definition dlp_field.c:1066
int num_field_objects
Definition dlp_field.c:1071
void create_field_list(GtkWidget *vbx, int f)
classical force field creation prepare list store selection widgets
Definition dlp_field.c:3816
GtkWidget * vbox_init(int p)
classical force field assistant prepare the field object configuration widgets
Definition dlp_field.c:2311
field_pmf * tmp_fpmf
Definition dlp_field.c:1050
void print_all_field_struct(field_molecule *mol, int str)
print all field structural element(s)
Definition dlp_print.c:195
gchar * fnames[2][16][21]
Definition dlp_field.c:308
void field_set_markup_box(GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *mod, GtkTreeIter *iter, gpointer data)
set renderer pango markup in the classical force field tree store
Definition dlp_field.c:3309
void set_mol_num_label()
classical force field prepare the molecule information widget
Definition dlp_field.c:1135
gchar * la_improper_style_keyw[11]
Definition dlp_field.c:639
field_external * tmp_fext
Definition dlp_field.c:1057
field_atom * tmp_fat
Definition dlp_field.c:1047
GtkTreeViewColumn * field_col[MAXDATA][11]
Definition dlp_field.c:1031
int row_id
Definition dlp_field.c:1072
G_MODULE_EXPORT void clean_field(GtkToggleButton *but, gpointer data)
clean force field data toggle callback GTK3
Definition dlp_field.c:4350
int * has_energy
Definition dlp_field.c:1173
void field_set_color_and_markup(GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *mod, GtkTreeIter *iter, gpointer data)
set renderer color and markup in the classical force field tree store
Definition dlp_field.c:3407
void field_set_color_markup_and_visible(GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *mod, GtkTreeIter *iter, gpointer data)
set renderer color, markup and visibility in the classical force field tree store
Definition dlp_field.c:3508
void field_button_event(GdkEvent *event, double event_x, double event_y, guint event_button, guint event_type, guint32 event_time, gpointer data)
classical force field tree model button event GTK3
Definition dlp_field.c:3175
GtkTreeStore * field_model[MAXDATA]
Definition dlp_field.c:1037
int get_field_tree_data(GtkWidget *tree, int treeid, GtkTreePath *path)
retrieve classical force field data from tree model
Definition dlp_field.c:2404
G_MODULE_EXPORT void changed_mol_box(GtkComboBox *box, gpointer data)
classical force field assistant change the target molecule for the page
Definition dlp_field.c:1891
GtkWidget * aview
Definition dlp_field.c:1060
void field_set_color_and_visible(GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *mod, GtkTreeIter *iter, gpointer data)
set renderer color and visibility in the classical force field tree store
Definition dlp_field.c:3424
gboolean afp_init[MAXDATC+MAXDATA]
Definition dlp_field.c:995
GtkWidget * mol_num_label
Definition dlp_field.c:1064
char * fvars_ters[2][FTERSOFFS][FTERSOFFS_P]
Definition dlp_field.c:816
G_MODULE_EXPORT void to_edit_field_prop(GtkCellRenderer *cell, GtkCellEditable *editable, gchar *path_string, gpointer data)
to edit data in the classical force field tree model
Definition dlp_field.c:3631
GtkWidget * cwin
Definition dlp_field.c:1063
gchar * pop_remove(int i)
get remove string label
Definition dlp_field.c:2828
void check_tersoffs(int id, int key)
check non bonded potential
Definition dlp_edit.c:2958
GtkWidget * cs_label[2]
Definition dlp_field.c:1061
int struct_id(int f)
number of atoms in a structural element
Definition dlp_field.c:1089
G_MODULE_EXPORT void on_assistant_close(GtkAssistant *assistant, gpointer data)
classical force field creation close assistant
Definition dlp_field.c:4131
gboolean field_color
Definition dlp_field.c:1070
int get_field_data_id(int k, gchar *data)
get classical force field parameter from description string
Definition dlp_field.c:2431
G_MODULE_EXPORT void to_select_atom_id_from_fied_molecule(GSimpleAction *action, GVariant *parameter, gpointer data)
create new field atom from field atom popup menu callback
Definition dlp_field.c:2844
G_MODULE_EXPORT void edit_field_cell(GtkCellRendererText *cell, gchar *path_string, gchar *new_text, gpointer data)
edit cell in the classical force field tree model
Definition dlp_field.c:3543
int actel
Definition dlp_field.c:2620
G_MODULE_EXPORT void on_field_row_activated(GtkTreeView *treeview, GtkTreePath *path, GtkTreeViewColumn *col, gpointer data)
activating row in the classical force field tree model
Definition dlp_field.c:3647
void fill_field_model(GtkTreeStore *store, int f, int m)
classical force field fill the tree store
Definition dlp_field.c:1389
void update_field_trees()
classical force field assistant update all tree models
Definition dlp_field.c:1907
int feunit_teth[2][FTETH][FTETH_P]
Definition dlp_field.c:389
int feunit_vdw[2][FVDW][FVDW_P]
Definition dlp_field.c:735
G_MODULE_EXPORT void changed_field_key_renderer(GtkCellRendererCombo *combo, gchar *path_string, GtkTreeIter *iter, gpointer data)
change combo box in classical force field tree model
Definition dlp_field.c:2460
gchar * intelemt[MAXDATA]
Definition dlp_field.c:253
G_MODULE_EXPORT void show_force_field_preview(GtkButton *but, gpointer data)
show classical force field input files preview
Definition dlp_field.c:4573
ColRGBA init_color(int id, int numid)
initialize color based id number over total number of elements
Definition initcoord.c:81
void get_field_iter_and_edit(gchar *path_string, gpointer data)
edit field property in the classical force field tree model
Definition dlp_field.c:3598
field_struct * tmp_fstr
Definition dlp_field.c:1054
gboolean tersoff_question()
change Tersoff potential ?
Definition dlp_edit.c:682
int feunit_bond[2][FBONDS][FBONDS_P]
Definition dlp_field.c:429
gchar * parameters_info(int obj, int key, gchar **words, float *data)
prepare classical force field parameter description string
Definition dlp_field.c:1187
G_MODULE_EXPORT void changed_energy_unit(GtkComboBox *box, gpointer data)
change the classical force field energy unit - creating the dialog
Definition dlp_field.c:2194
GtkWidget * field_i_box[2]
Definition dlp_field.c:4026
GtkWidget * ff_but[19]
Definition dlp_field.c:1067
gchar * intelemts[MAXDATA]
Definition dlp_field.c:231
int get_num_vdw_max()
Get the number of field shell interactions.
Definition dlp_edit.c:2009
void field_set_color_markup_and_visible_box(GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *mod, GtkTreeIter *iter, gpointer data)
set renderer color, markup and visibility in the classical force field tree store
Definition dlp_field.c:3526
G_MODULE_EXPORT void run_clean_field(GtkDialog *dial, gint response_id, gpointer data)
clean force field data - running the dialog
Definition dlp_field.c:4289
field_molecule * tmp_fmol
Definition dlp_field.c:1045
gboolean set_nbd_but_sensitive(int nbid)
adjust non bonded interaction button sensitivity
Definition dlp_field.c:1727
int atom_init
Definition dlp_field.c:1040
gchar * pop_info(int i, int id)
get popup information message
Definition dlp_field.c:2630
void remove_classical_assistant_pages()
classical force field creation remove assistant pages
Definition dlp_field.c:4268
void get_is_energy(int i, int l)
get the energy unit linked parameter list
Definition dlp_field.c:1937
field_atom * tmp_fdt
Definition dlp_field.c:1047
void check_to_visualize_properties(int id)
check if it is requried to update rendering
Definition dlp_viz.c:766
gboolean append_pages
Definition dlp_field.c:136
GtkWidget * field_i_prep[2]
Definition dlp_field.c:4025
G_MODULE_EXPORT gboolean on_assistant_cancel_event(GtkWidget *assistant, GdkEvent *event, gpointer data)
classical force field creation cancel event callback GTK3
Definition dlp_field.c:4116
gboolean assist_init
Definition dlp_field.c:4032
field_prop * tmp_fprop
Definition dlp_field.c:1053
gchar * ctitle[MAXDATA][12]
Definition dlp_field.c:924
GtkWidget * create_mol_box(int f)
classical force field create molecule selection widgets
Definition dlp_field.c:3863
char * fvars_tbd[2][FTHREEBODY][FTHREEBODY_P]
Definition dlp_field.c:826
void restore_ogl_selection(glwin *view)
restore a saved atom selection
Definition calc.c:218
int field_s[MAXDATA]
Definition dlp_field.c:921
GSimpleActionGroup * field_pop_actions
Definition dlp_field.c:2849
GtkWidget * preview_but
Definition dlp_field.c:4031
field_tethered * tmp_ftet
Definition dlp_field.c:1052
field_atom * tmp_fct
Definition dlp_field.c:1047
int fntypes[2][15]
Definition dlp_field.c:379
GType col_type[MAXDATA][12]
Definition dlp_field.c:946
void print_lammps_atom_file(GtkTextBuffer *buf)
print LAMMPS atom file
Definition la_print.c:619
void add_classical_assistant_pages(int p)
classical force field assistant add pages
Definition dlp_field.c:4411
void prop_set_color_and_visible(GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *mod, GtkTreeIter *iter, gpointer data)
set renderer color and visibility in the classical force field structural property tree store
Definition dlp_field.c:3441
GtkWidget * create_combo_mol(int f)
classical force field create molecule selection combo box
Definition dlp_field.c:2600
GtkWidget * field_assistant
Definition dlp_field.c:1030
G_MODULE_EXPORT void on_assistant_prepare(GtkAssistant *assistant, GtkWidget *page, gpointer data)
prepare classical force field assistant pages before display
Definition dlp_field.c:4200
GtkWidget * create_field_tree(int f)
classical force field create the list store selection widgets
Definition dlp_field.c:3659
GtkWidget * field_tree[MAXDATA]
Definition dlp_field.c:1035
GtkWidget * fibox[MAXDATC+MAXDATA+2]
Definition dlp_field.c:1065
int ** is_param
Definition dlp_field.c:1172
int feunit_inversion[2][FINVERS][FINVERS_P]
Definition dlp_field.c:625
G_MODULE_EXPORT gint on_assistant_go_forward(gint current_page, gpointer data)
classical force field assistant find the next page to go to
Definition dlp_field.c:4144
G_MODULE_EXPORT void run_on_assistant_apply(GtkDialog *info, gint response_id, gpointer data)
on classical force field assistant apply - running the dialog GTK3
Definition dlp_field.c:4647
G_MODULE_EXPORT void run_changed_energy_unit(GtkDialog *dialog, gint response_id, gpointer data)
change the classical force field energy unit - running the dialog
Definition dlp_field.c:2172
int feunit_fext[2][FEXTERNAL][FEXTERNAL_P]
Definition dlp_field.c:893
void create_classical_force_field(int p, int f)
create classical force field prepare the assistant
Definition dlp_field.c:4774
gchar * fkeysw[2][16][21]
Definition dlp_field.c:275
int field_v[MAXDATA]
Definition dlp_field.c:920
void field_set_markup(GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *mod, GtkTreeIter *iter, gpointer data)
set renderer pango markup in the classical force field tree store
Definition dlp_field.c:3326
GtkWidget * fwin
Definition dlp_field.c:1062
gchar * elemt[MAXDATA]
Definition dlp_field.c:209
field_atom * tmp_fbt
Definition dlp_field.c:1047
int ** is_energy
Definition dlp_field.c:1174
coord_info * tmp_coord
Definition dlp_field.c:1044
GtkWidget * field_label[MAXDATA]
Definition dlp_field.c:1036
gchar * pop_edit(int i)
get edit string label
Definition dlp_field.c:2792
void hide_show_this_pages(int start, int end, int status, int delta)
classical force field assistant show / hide pages
Definition dlp_field.c:4248
int field_a[MAXDATA]
Definition dlp_field.c:922
molecule * tmp_mol
Definition dlp_field.c:1046
gboolean dlp_to_translate(int fid, int obj, int key)
test if fnames text is to be translated or not
Definition dlp_field.c:1215
classical_field * tmp_field
Definition dlp_field.c:1041
void setup_cs_labels(int i)
classical force field prepare the core-shell description strings
Definition dlp_field.c:1157
void field_set_color(GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *mod, GtkTreeIter *iter, gpointer data)
set renderer color in the classical force field tree store
Definition dlp_field.c:3271
void pmf_set_color_and_visible(GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *mod, GtkTreeIter *iter, gpointer data)
set renderer color and visibility in the classical force field mean force potential tree store
Definition dlp_field.c:3460
char * fvars_fext[2][FEXTERNAL][FEXTERNAL_P]
Definition dlp_field.c:866
int feunit_ters[2][FTERSOFFS][FTERSOFFS_P]
Definition dlp_field.c:821
GtkWidget * vbox_field(int f)
classical force field create page option widgets
Definition dlp_field.c:3880
gchar * set_field_label(int f, int m)
prepare classical force field description string
Definition dlp_field.c:1757
void append_field_item(GMenu *menu, const gchar *name, const gchar *key, int item_id, gchar *accel, int image_format, gpointer icon, gboolean custom, GCallback handler, gpointer data, gboolean check, gboolean status, gboolean radio, gboolean sensitive)
append menu items to the popup menu
Definition dlp_field.c:2874
void fill_field_struct(GtkTreeStore *store, int id, int mo)
classical force field fill the tree store with structural element parameter(s)
Definition dlp_field.c:1246
int feunit_met[2][FMETALS][FMETALS_P]
Definition dlp_field.c:797
GtkWidget * combo_mol[MOLIMIT-1]
Definition dlp_field.c:1034
char * fvars_met[2][FMETALS][FMETALS_P]
Definition dlp_field.c:778
char * fvars_teth[2][FTETH][FTETH_P]
Definition dlp_field.c:382
int is_special[MAXDATA][11]
Definition dlp_field.c:973
GtkWidget * field_i_obj[2]
Definition dlp_field.c:4030
G_MODULE_EXPORT void changed_init_box(GtkComboBox *box, gpointer data)
classical force field change initialization parameter
Definition dlp_field.c:4517
gchar *** is_var
Definition dlp_field.c:1175
void fill_field_body(GtkTreeStore *store, int id)
classical force field fill the tree store with non bonded parameter(s)
Definition dlp_field.c:1332
gchar * get_body_element_name(field_nth_body *body, int aid, int nbd)
get field body potential element name
Definition dlp_edit.c:1941
void rig_set_color_and_visible(GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *mod, GtkTreeIter *iter, gpointer data)
set renderer color and visibility in the classical force field rigid constraint(s) tree store
Definition dlp_field.c:3488
int saved_label_format[2]
Definition dlp_field.c:4033
field_nth_body * new_body
Definition dlp_field.c:1056
Variable declarations for the creation of the DL_POLY input file(s).
#define LA_BONDS_P
Definition dlp_field.h:93
#define FANGLES_P
Definition dlp_field.h:107
#define FBONDS_P
Definition dlp_field.h:106
#define FFOURBODY
Definition dlp_field.h:78
#define DL_METALS
Definition dlp_field.h:50
#define FEXTERNAL
Definition dlp_field.h:79
int * duplicate_int(int num, int *old_val)
copy a list of int
Definition global.c:547
void print_dlp_bond(int bi, GtkTextBuffer *buf, field_struct *bd, int fi, GtkTreeStore *store, GtkTreeIter *iter)
print / fill tree store with force field bond(s) information
Definition dlp_print.c:780
G_MODULE_EXPORT void add_molecule_to_field(GSimpleAction *action, GVariant *parameter, gpointer data)
add molecule to force field - creating the dialog
Definition dlp_mol.c:466
#define FTETH_P
Definition dlp_field.h:105
#define FVDW
Definition dlp_field.h:74
#define DL_METALS_P
Definition dlp_field.h:87
#define DL_TETH_P
Definition dlp_field.h:85
#define FINVERS
Definition dlp_field.h:73
#define LA_INVERS
Definition dlp_field.h:60
#define LA_TERSOFFS_P
Definition dlp_field.h:100
#define DL_ENERGY
Definition dlp_field.h:43
#define DL_BONDS_P
Definition dlp_field.h:81
#define DL_DIHEDRAL
Definition dlp_field.h:46
#define MOLIMIT
Definition dlp_field.h:117
#define DL_INVERS_P
Definition dlp_field.h:84
#define LA_VDW
Definition dlp_field.h:62
G_MODULE_EXPORT void setup_this_force_field(int id)
setup force field parameters
#define DL_TERSOFFS
Definition dlp_field.h:51
#define LA_ENERGY
Definition dlp_field.h:56
#define LA_EXTERNAL
Definition dlp_field.h:67
#define LA_FOURBODY
Definition dlp_field.h:66
void print_dlp_improper_inversion(int di, GtkTextBuffer *buf, field_struct *dh, int fi, GtkTreeStore *store, GtkTreeIter *iter)
print / fill tree store with force field improper(s)/inversion(s) information
Definition dlp_print.c:299
void print_dlp_angle(int ai, GtkTextBuffer *buf, field_struct *an, int fi, GtkTreeStore *store, GtkTreeIter *iter)
print / fill tree store with force field angle(s) information
Definition dlp_print.c:653
#define FVDW_P
Definition dlp_field.h:110
tint toviz
Definition dlp_viz.c:75
#define FDIHEDRAL_P
Definition dlp_field.h:108
#define DL_BONDS
Definition dlp_field.h:44
#define DL_VDW_P
Definition dlp_field.h:86
#define FFOURBODY_P
Definition dlp_field.h:114
void print_dlp_control(GtkTextBuffer *buf)
print DL-POLY CONTROL file
Definition dlp_print.c:1905
#define DL_DIHEDRAL_P
Definition dlp_field.h:83
#define LA_FOURBODY_P
Definition dlp_field.h:102
#define DL_EXTERNAL_P
Definition dlp_field.h:91
#define FTETH
Definition dlp_field.h:69
#define FMETALS_P
Definition dlp_field.h:111
#define FTERSOFFS_P
Definition dlp_field.h:112
#define DL_ANGLES
Definition dlp_field.h:45
char * field_acro[N_FIELDS]
#define DL_FOURBODY_P
Definition dlp_field.h:90
#define LA_ANGLES_P
Definition dlp_field.h:94
#define FBONDS
Definition dlp_field.h:70
#define DL_THREEBODY_P
Definition dlp_field.h:89
#define LA_DIHEDRAL_P
Definition dlp_field.h:95
#define LA_THREEBODY
Definition dlp_field.h:65
#define LA_METALS
Definition dlp_field.h:63
G_MODULE_EXPORT void remove_molecule_from_field(GSimpleAction *action, GVariant *parameter, gpointer data)
remove molecule from force field - creating the dialog
Definition dlp_mol.c:748
#define FEXTERNAL_P
Definition dlp_field.h:115
#define FDIHEDRAL
Definition dlp_field.h:72
#define DL_FOURBODY
Definition dlp_field.h:53
#define SEXTERN
Definition dlp_field.h:118
classical_field * create_force_field_data_structure(int ai)
initialize classical force field
Definition dlp_init.c:2974
#define FTERSOFFS
Definition dlp_field.h:76
#define LA_INVERS_P
Definition dlp_field.h:96
#define FTHREEBODY
Definition dlp_field.h:77
#define DL_TERSOFFS_P
Definition dlp_field.h:88
void print_dlp_field(GtkTextBuffer *buf)
print DL-POLY classical force field
Definition dlp_print.c:1409
void print_dlp_config(GtkTextBuffer *buf)
print DL-POLY CONFIG file
Definition dlp_print.c:1583
#define LA_BONDS
Definition dlp_field.h:57
void visualize_object(int id, int jd, int kd)
visualize object and update OpenGL rendering
Definition dlp_viz.c:550
#define DL_TETH
Definition dlp_field.h:48
#define DL_EXTERNAL
Definition dlp_field.h:54
void print_dlp_dihedral(int di, GtkTextBuffer *buf, field_struct *dh, int fi, GtkTreeStore *store, GtkTreeIter *iter)
print / fill tree store with force field dihedral(s) information
Definition dlp_print.c:501
#define DL_VDW
Definition dlp_field.h:49
#define LA_EXTERNAL_P
Definition dlp_field.h:103
#define DL_INVERS
Definition dlp_field.h:47
#define LA_METALS_P
Definition dlp_field.h:99
#define LA_TETH_P
Definition dlp_field.h:97
#define LA_DIHEDRAL
Definition dlp_field.h:59
G_MODULE_EXPORT void visualize_or_select_all_elements(GtkTreeViewColumn *col, gpointer data)
select all element(s) in the column for visualization
Definition dlp_viz.c:1022
G_MODULE_EXPORT void on_toggle_visualize_or_select_object(GtkCellRendererToggle *cell_renderer, gchar *string_path, gpointer data)
on visualize force field object toggle callback
Definition dlp_viz.c:828
#define FINVERS_P
Definition dlp_field.h:109
#define DL_THREEBODY
Definition dlp_field.h:52
gboolean afp[MAXDATA]
#define N_FIELDS
Definition dlp_field.h:39
#define LA_THREEBODY_P
Definition dlp_field.h:101
#define DL_ANGLES_P
Definition dlp_field.h:82
#define LA_ANGLES
Definition dlp_field.h:58
#define LA_TETH
Definition dlp_field.h:61
#define FANGLES
Definition dlp_field.h:71
int get_field_objects(int id, int jd)
get the number of this type of field object
Definition dlp_viz.c:365
@ PARTIAL_COORD_AND_SPEC
Definition dlp_field.h:148
#define LA_TERSOFFS
Definition dlp_field.h:64
#define LA_VDW_P
Definition dlp_field.h:98
#define FMETALS
Definition dlp_field.h:75
#define FTHREEBODY_P
Definition dlp_field.h:113
int multi
Definition dlp_init.c:121
int ** allocdint(int xal, int yal)
allocate an int ** pointer
Definition global.c:317
int activef
Definition global.c:164
gchar ** duplicate_strings(int num, gchar **old_val)
copy a list of strings
Definition global.c:531
int * allocint(int val)
allocate an int * pointer
Definition global.c:301
#define i18n(String)
Definition global.c:80
float * allocfloat(int val)
allocate a float * pointer
Definition global.c:385
double string_to_double(gpointer string)
convert string to double
Definition global.c:611
gchar * ifield[8]
Definition global.c:143
GtkWidget * dialog_cancel_apply(gchar *title, GtkWidget *parent, gboolean resiz)
create a dialog modal offering a choice to apply something or not
Definition gtk-misc.c:616
#define EDITF
Definition global.h:220
void run_this_gtk_dialog(GtkWidget *dial, GCallback handler, gpointer data)
run a GTK (3 and 4) basic GtkDialog
Definition gtk-misc.c:533
@ IMG_NONE
Definition global.h:276
@ IMG_STOCK
Definition global.h:280
int combo_get_active(GtkWidget *combo)
retrieve the active item's position
Definition gtk-misc.c:935
void set_renderer_color(int tocol, GtkCellRenderer *renderer, ColRGBA col)
set the color of a GtkCellRenderer
Definition gtk-misc.c:1740
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
Definition gtk-misc.c:1286
GtkTextBuffer * add_buffer(GCallback handler, gpointer data, gchar *text)
create a GtkTextBuffer
Definition gtk-misc.c:1258
GtkWidget * create_scroll(GtkWidget *box, int dimx, int dimy, int shadow)
create a scroll window
Definition gtk-misc.c:2139
GtkWidget * dialogmodal(gchar *str, GtkWindow *parent)
Create a new dialog modal window.
Definition gtk-misc.c:552
project * proj
void combo_set_active(GtkWidget *combo, int pos)
set the active item's position
Definition gtk-misc.c:958
#define BSEP
Definition global.h:261
void opengl_project_changed(int id)
change the OpenGL project
Definition update_p.c:296
void pop_menu_at_pointer(GtkWidget *widg, GdkEvent *event)
popup a menu at pointer location
Definition gtk-misc.c:2471
void widget_add_action(GSimpleActionGroup *action_group, const gchar *act, GCallback handler, gpointer data, gboolean check, gboolean status, gboolean radio, const gchar *stat)
add an action to an action group
Definition gui.c:627
GtkWidget * stock_image(const gchar *stock_id)
create a GtkImage for the Gtk database
Definition gtk-misc.c:1451
void add_gtk_close_event(GtkWidget *widg, GCallback handler, gpointer data)
add a close event signal and callback to a GtkWidget
Definition gtk-misc.c:2557
void set_renderer_markup(GtkTreeModel *mod, GtkTreeIter *iter, GtkCellRenderer *renderer, int col)
set Pango text markup for a GtkCellRenderer
Definition gtk-misc.c:1764
void button_set_status(GtkWidget *button, int status)
set status of check / toggle button
Definition gtk-misc.c:1916
GtkWidget * fbox(GtkWidget *box, char *lab)
box creating routine, to help design faster elements for the GUI
Definition gtk-misc.c:2120
gchar * file_chooser_get_current_folder(GtkFileChooser *chooser)
get the current folder for a GtkFileChooser
Definition gtk-misc.c:2322
#define APPLY
Definition global.h:236
GtkWidget * check_button(gchar *text, int dimx, int dimy, gboolean state, GCallback handler, gpointer data)
create a check button
Definition gtk-misc.c:1937
@ CONTAINER_SCR
Definition global.h:267
GtkWidget * create_button(gchar *text, int image_format, gchar *image, int dimx, int dimy, int relief, GCallback handler, gpointer data)
create a simple button
Definition gtk-misc.c:1999
GtkWidget * create_combo()
create a GtkCombox widget, note deprecated in GTK4
Definition gtk-misc.c:1010
GtkWidget * dialog_get_content_area(GtkWidget *widg)
prepare GtkWidget to insert content in a GtkDialog window
Definition gtk-misc.c:861
GtkWidget * markup_label(gchar *text, int dimx, int dimy, float ax, float ay)
create a GtkLabel with pango markup
Definition gtk-misc.c:1672
void add_box_child_start(int orientation, GtkWidget *widg, GtkWidget *child, gboolean expand, gboolean fill, int padding)
Add a GtkWidget in a GtkBox at the initial position.
Definition gtk-misc.c:340
void widget_set_sensitive(GtkWidget *widg, gboolean sensitive)
Set sensitivity for a GtkWidget, ensuring it is a GtkWidget.
Definition gtk-misc.c:247
#define CANCEL
Definition global.h:231
void destroy_this_dialog(GtkDialog *dialog)
destroy a GtkDialog
Definition gtk-misc.c:2235
GtkWidget * create_hbox(int spacing)
create a GtkBox with horizontal orientation
Definition gtk-misc.c:849
void combo_text_append(GtkWidget *combo, gchar *text)
append text in GtkComboBox widget
Definition gtk-misc.c:987
G_MODULE_EXPORT void run_destroy_dialog(GtkDialog *dialog, gint response_id, gpointer data)
to destroy a GtkDialog when the dialog emit the closing signal
Definition gtk-misc.c:2272
GtkWidget * destroy_this_widget(GtkWidget *widg)
destroy a GtkWidget
Definition gtk-misc.c:2213
void add_container_child(int type, GtkWidget *widg, GtkWidget *child)
Add a GtkWidget into another GtkWidget.
Definition gtk-misc.c:267
#define MAXDATC
Number of tabs for the description of the classical calculation.
Definition global.h:771
void hide_the_widgets(GtkWidget *widg)
hide GtkWidget
Definition gtk-misc.c:224
void append_menu_item(GMenu *menu, const gchar *label, const gchar *action, const gchar *accel, const gchar *custom, int format, const gchar *icon, gboolean check, gboolean status, gboolean radio, const gchar *rstatus)
create a menu item, then append it to a menu
Definition gui.c:745
GtkWidget * create_vbox(int spacing)
create a GtkBox with vertical orientation
Definition gtk-misc.c:837
int button_get_status(GtkWidget *button)
get status of check / toggle button
Definition gtk-misc.c:1899
GtkWidget * create_file_chooser(const gchar *title, GtkWindow *parent, GtkFileChooserAction act, const gchar *act_name)
create a GtkFileChooser, utility to select file(s)
Definition gtk-misc.c:2393
#define MAXDATA
Number of tabs for the description of the classical force field.
Definition global.h:776
void destroy_this_native_dialog(GtkNativeDialog *dialog)
destroy a GtkNativeDialog
Definition gtk-misc.c:2254
void show_the_widgets(GtkWidget *widg)
show GtkWidget
Definition gtk-misc.c:202
project * get_project_by_id(int p)
get project pointer using id number
Definition project.c:120
Variable declarations related to the OpenGL window Function declarations related to the OpenGL wind...
action
Definition glview.h:198
labels
Definition glview.h:223
@ ID_IN_MOLECULE
Definition glview.h:229
#define ATOM_MAPS
Definition glwin.h:61
Function declarations for the creation of the OpenGL window.
void show_warning(char *warning, GtkWidget *win)
show warning
Definition interface.c:266
void show_error(char *error, int val, GtkWidget *win)
show error message
Definition interface.c:299
gboolean ask_yes_no(gchar *title, gchar *text, int type, GtkWidget *widg)
ask yes or no for something: prepare dialog
Definition interface.c:420
gchar * exact_name(gchar *name)
short cut to print string without spaces
Definition interface.c:434
Messaging function declarations.
struct file_list * ftmp
Definition main.c:101
integer(kind=c_int) function molecules(frag_and_mol, allbonds)
double z
Definition ogl_draw.c:63
double y
Definition ogl_draw.c:63
double x
Definition ogl_draw.c:63
Function declarations for reading atomes project file Function declarations for saving atomes proje...
Definition glwin.h:350
Definition glwin.h:967
int status
Definition w_advance.c:173
GtkWidget * res[2]
Definition w_encode.c:342
GtkWidget * hbox
Definition workspace.c:71
GtkWidget * img
Definition workspace.c:70
GtkWidget * vbox
Definition workspace.c:72
GtkWidget * lab
Definition workspace.c:73