atomes 1.3.1
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
dlp_print.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
24
25/*
26* This file: 'dlp_print.c'
27*
28* Contains:
29*
30
31 - The functions to handle the output of the DL-POLY FIELD file
32 - The functions to handle the output of the DL-POLY CONTROL file
33 - The functions to handle the output of the DL-POLY CONFIG file
34 - The functions to fill the structural element(s) tree models in the assistant
35
36*
37* List of functions:
38
39 int get_num_struct_to_print (field_molecule * fmol, int sid);
40 int get_pbc ();
41
42 gboolean print_this_imp_inv (imp_inv * inv, int di, int a, int b, int c, int d);
43 gboolean member_of_atom (field_atom* fat, int id);
44 gboolean print_ana ();
45
46 void print_field_prop (field_prop * pro, int st, field_molecule * mol);
47 void print_field_struct (field_struct * stru, field_molecule * mol);
48 void print_all_field_struct (field_molecule * mol, int str);
49 void print_dlp_improper_inversion (int di, GtkTextBuffer * buf, field_struct * dhii, int fi, GtkTreeStore * store, GtkTreeIter * iter);
50 void print_dlp_dihedral (int dih, GtkTextBuffer * buf, field_struct * dh, int fi, GtkTreeStore * store, GtkTreeIter * iter);
51 void print_dlp_angle (int ai, GtkTextBuffer * buf, field_struct * an, int fi, GtkTreeStore * store, GtkTreeIter * iter);
52 void print_dlp_bond (int bi, GtkTextBuffer * buf, field_struct * bd, int fi, GtkTreeStore * store, GtkTreeIter * iter);
53 void print_dlp_rigid (GtkTextBuffer * buf, field_rigid * rig);
54 void print_dlp_tet (GtkTextBuffer * buf, field_tethered * tet);
55 void print_dlp_pmf (GtkTextBuffer * buf, field_pmf * pmf);
56 void print_dlp_cons (GtkTextBuffer * buf, field_constraint * cons);
57 void print_dlp_shell (GtkTextBuffer * buf, field_molecule * fmol, field_shell * shell);
58 void print_dlp_atom (GtkTextBuffer * buf, int at, int numat);
59 void print_dlp_molecule (GtkTextBuffer * buf, field_molecule * fmol);
60 void print_dlp_body (GtkTextBuffer * buf, field_nth_body * body);
61 void print_dlp_tersoff_cross (GtkTextBuffer * buf, field_nth_body * body_a, field_nth_body * body_b);
62 void print_dlp_tersoff (GtkTextBuffer * buf, field_nth_body * body);
63 void print_dlp_field (GtkTextBuffer * buf);
64 void print_dlp_config (GtkTextBuffer * buf);
65 void print_int (GtkTextBuffer * buf, int data);
66 void print_control_int (GtkTextBuffer * buf, int data, gchar * info_a, gchar * info_b, gchar * key);
67 void print_float (GtkTextBuffer * buf, double data);
68 void print_control_float (GtkTextBuffer * buf, double data, gchar * info_a, gchar * info_b, gchar * key);
69 void print_sci (GtkTextBuffer * buf, double data);
70 void print_control_sci (GtkTextBuffer * buf, double data, gchar * info_a, gchar * info_b, gchar * key);
71 void print_string (GtkTextBuffer * buf, gchar * string);
72 void print_control_string (GtkTextBuffer * buf, gchar * string, gchar * info_a, gchar * info_b, gchar * key);
73 void print_control_key (GtkTextBuffer * buf, gchar * info, gchar * key);
74 void print_dlp_control (GtkTextBuffer * buf);
75
76*/
77
78#include "dlp_field.h"
79#include "interface.h"
80
81extern gboolean in_bond (int at, int bd[2]);
82extern int get_num_vdw_max ();
83extern gchar * get_body_element_name (field_nth_body * body, int aid, int nbd);
84
95{
96 int i, j, k, u, v;
97 field_atom* fat;
98 j = struct_id(st+7);
99#ifdef DEBUG
100 int w;
101 g_debug ("Prop - natomes= %d", j);
102#endif
103 for (i=0; i<j; i++)
104 {
105#ifdef DEBUG
106 g_debug (" at[%d]= %d", i, pro -> aid[i]);
107#endif
108 if (mol != NULL)
109 {
110 for (k=0; k< mol -> multi; k++)
111 {
112 u = mol -> atoms_id[pro -> aid[i]][k].a;
113 v = mol -> atoms_id[pro -> aid[i]][k].b;
114 fat = get_active_atom (mol -> id, u);
115 if (v > fat -> num)
116 {
117#ifdef DEBUG
118 g_debug ("********************** BIG BUG BIG BUG BIG BUG **********************");
119 g_debug (" TO CHEK:: multi= %d:: at.a= %d, at.b= %d", k, u, v);
120 g_debug ("********************** BIG BUG BIG BUG BIG BUG **********************");
121#endif
122 }
123 else
124 {
125#ifdef DEBUG
126 w = fat -> list[v];
127 g_debug (" multi= %d:: at.a= %d, at.b= %d, real_id= %d", k, u, v, w);
128#endif
129 }
130 }
131 }
132 }
133
134#ifdef DEBUG
135 g_debug ("Prop - key= %d", pro -> key);
136 j = fvalues[activef][st][pro -> key];
137 for (i=0; i<j; i++)
138 {
139 g_debug (" val[%d]= %f", i, pro -> val[i]);
140 }
141 g_debug ("Prop - show= %d", pro -> show);
142 g_debug ("Prop - use= %d", pro -> use);
143#endif
144}
145
155{
156#ifdef DEBUG
157 int i;
158 g_debug (" ");
159 g_debug ("Struct - st= %d", stru -> st);
160 g_debug ("Struct - id= %d", stru -> id);
161 g_debug ("Struct - num= %d", stru -> num);
162 g_debug ("Struct - av= %f", stru -> av);
163 g_debug ("Struct - natomes= %d", struct_id(stru -> st+7));
164 for (i=0; i<struct_id(stru -> st+7); i++)
165 {
166 g_debug (" at[%d]= %d", i, stru -> aid[i]);
167 }
168 g_debug ("Default property:: ");
169#endif
170 print_field_prop (stru -> def, stru -> st, NULL);
171 if (stru -> other != NULL)
172 {
173#ifdef DEBUG
174 g_debug ("Other property(ies):: ");
175#endif
176 field_prop * tmp_pr;
177 tmp_pr = stru -> other;
178 print_field_prop (tmp_pr, stru -> st, mol);
179 while (tmp_pr -> next != NULL)
180 {
181 print_field_prop (tmp_pr -> next, stru -> st, mol);
182 tmp_pr = tmp_pr -> next;
183 }
184 }
185}
186
196{
197 int i;
198 field_struct * tmp_s;
199#ifdef DEBUG
200 g_debug (" ");
201 g_debug ("IN MOL:: %d", mol -> id);
202 g_debug ("PRINTING STRUCT:: %d", str);
203 g_debug ("Total Num of Struct %d:: NUM= %d", str, mol -> nstruct[str]);
204#endif
205 tmp_s = mol -> first_struct[str];
206 for (i=0; i<mol -> nstruct[str]; i++)
207 {
208 print_field_struct (tmp_s, mol);
209 if (tmp_s -> next != NULL) tmp_s = tmp_s -> next;
210 }
211#ifdef DEBUG
212 g_debug ("END STRUCT :: %d", str);
213#endif
214}
215
216typedef struct imp_inv imp_inv;
218{
219 int a;
220 int b;
221 int c;
222 int d;
225};
226
239gboolean print_this_imp_inv (imp_inv * inv, int di, int a, int b, int c, int d)
240{
241 if (! inv) return TRUE;
242 while (inv)
243 {
244 if (di == 6)
245 {
246 if (inv -> a == a && inv -> d == d)
247 {
248 if (inv -> b == b && inv -> c == c) return FALSE;
249 if (inv -> b == c && inv -> c == b) return FALSE;
250 }
251 }
252 else
253 {
254 if (inv -> a == a && inv -> b == b) return FALSE;
255 /*
256 {
257 if (inv -> b == b && inv -> c == d && inv -> d == c) return FALSE;
258 if (inv -> b == c && inv -> c == b && inv -> d == d) return FALSE;
259 if (inv -> b == c && inv -> c == d && inv -> d == b) return FALSE;
260 if (inv -> b == d && inv -> c == b && inv -> d == c) return FALSE;
261 if (inv -> b == d && inv -> c == c && inv -> d == b) return FALSE;
262 }*/
263 }
264 inv = inv -> next;
265 }
266 return TRUE;
267}
268
277gboolean member_of_atom (field_atom* fat, int id)
278{
279 int i;
280 for (i=0; i<tmp_fat -> num; i++)
281 {
282 if (tmp_fat -> list[i] == id) return TRUE;
283 }
284 return FALSE;
285}
286
299void print_dlp_improper_inversion (int di, GtkTextBuffer * buf, field_struct * dhii, int fi, GtkTreeStore * store, GtkTreeIter * iter)
300{
301 int a, b, c, d, e, i, j, k, l, m, n, o, p, q, r, s, t, u, v;
302 gboolean show;
303 gchar * stra, * strb, * strc, * strd, * stre, * strf, * strg;
304 float w;
305 GtkTreeIter di_level;
306 int * ids = allocint (4);
307 imp_inv * first_imp_inv = NULL;
308 imp_inv * this_ii = NULL;
309
310 for (i=0; i<tmp_fat -> num; i++)
311 {
312 j = tmp_fat -> list[i];
313 if (tmp_proj -> atoms[0][j].coord[2] == fi)
314 {
315 if ((tmp_proj -> atoms[0][j].numv > 2 && di == 6) || (tmp_proj -> atoms[0][j].numv == 3 && di == 7))
316 {
317 a = ids[0] = tmp_fat -> list_id[i];
318 for (k=0; k<tmp_proj -> atoms[0][j].numv; k++)
319 {
320 l = tmp_proj -> atoms[0][j].vois[k];
321 if (tmp_proj -> atoms[0][l].faid == tmp_fbt -> id)
322 {
323 b = ids[1] = tmp_proj -> atoms[0][l].fid;
324 for (m=0; m<tmp_proj -> atoms[0][j].numv; m++)
325 {
326 if (m != k)
327 {
328 n = tmp_proj -> atoms[0][j].vois[m];
329 if (tmp_proj -> atoms[0][n].faid == tmp_fct -> id)
330 {
331 c = ids[2] = tmp_proj -> atoms[0][n].fid;
332 for (o=0; o<tmp_proj -> atoms[0][j].numv; o++)
333 {
334 if (o != k && o != m)
335 {
336 p = tmp_proj -> atoms[0][j].vois[o];
337 if (tmp_proj -> atoms[0][p].faid == tmp_fdt -> id)
338 {
339 d = ids[3] = tmp_proj -> atoms[0][p].fid;
340 if (print_this_imp_inv(first_imp_inv, di, a, b, c, d))
341 {
342 if (! first_imp_inv)
343 {
344 first_imp_inv = g_malloc0(sizeof*first_imp_inv);
345 this_ii = first_imp_inv;
346 }
347 else
348 {
349 this_ii -> next = g_malloc0(sizeof*this_ii);
350 this_ii -> next -> prev = this_ii;
351 this_ii = this_ii -> next;
352 }
353 this_ii -> a = a;
354 this_ii -> b = b;
355 this_ii -> c = c;
356 this_ii -> d = d;
357 tmp_fprop = get_active_prop_using_atoms (dhii -> other, 4, ids);
358 if (tmp_fprop == NULL)
359 {
360 tmp_fprop = dhii -> def;
361 if (buf == NULL) show = FALSE;
362 }
363 else if (buf == NULL)
364 {
365 show = tmp_fprop -> show;
366 }
367 if (buf != NULL && tmp_fprop -> use)
368 {
369 if (di == 6)
370 {
371 stra = g_strdup_printf ("%4s\t%d\t%d\t%d\t%d",fkeysw[activef][di+2][tmp_fprop -> key], b+1, a+1, c+1, d+1);
372 }
373 else
374 {
375 stra = g_strdup_printf ("%4s\t%d\t%d\t%d\t%d",fkeysw[activef][di+2][tmp_fprop -> key], a+1, b+1, c+1, d+1);
376 }
377 print_info (stra, NULL, buf);
378 g_free (stra);
379 for (e=0; e<fvalues[activef][di+1][tmp_fprop -> key]; e++)
380 {
381 stra = g_strdup_printf ("\t%15.10f", tmp_fprop -> val[e]);
382 print_info (stra, NULL, buf);
383 g_free (stra);
384 if (e == 2)
385 {
386 // Print 1-4 electrostatic interaction scale factor
387 stra = g_strdup_printf ("\t%15.10f", 0.0);
388 print_info (stra, NULL, buf);
389 g_free (stra);
390 // Print 1-4 van der Waals interaction scale factor
391 stra = g_strdup_printf ("\t%15.10f", 0.0);
392 print_info (stra, NULL, buf);
393 g_free (stra);
394 }
395 }
396 print_info ("\n", NULL, buf);
397 }
398 else if (buf == NULL)
399 {
400 stra = g_strdup_printf ("%d", a+1);
401 strb = g_strdup_printf ("%d", b+1);
402 strc = g_strdup_printf ("%d", c+1);
403 strd = g_strdup_printf ("%d", d+1);
404 w = 0.0;
405 for (e=0; e<tmp_fmol -> multi; e++)
406 {
407 q = tmp_fmol -> atoms_id[a][e].a;
408 r = tmp_fmol -> atoms_id[a][e].b;
409 s = get_active_atom (tmp_fmol -> id, q) -> list[r];
410 q = tmp_fmol -> atoms_id[b][e].a;
411 r = tmp_fmol -> atoms_id[b][e].b;
412 t = get_active_atom (tmp_fmol -> id, q) -> list[r];
413 q = tmp_fmol -> atoms_id[c][e].a;
414 r = tmp_fmol -> atoms_id[c][e].b;
415 u = get_active_atom (tmp_fmol -> id, q) -> list[r];
416 q = tmp_fmol -> atoms_id[d][e].a;
417 r = tmp_fmol -> atoms_id[d][e].b;
418 v = get_active_atom (tmp_fmol -> id, q) -> list[r];
419 if (di == 6)
420 {
421 w += dihedral_3d (& tmp_proj -> cell, 0,
422 & tmp_proj -> atoms[0][t],
423 & tmp_proj -> atoms[0][u],
424 & tmp_proj -> atoms[0][s],
425 & tmp_proj -> atoms[0][v]).angle;
426 }
427 else
428 {
429 w += inversion_3d (& tmp_proj -> cell, 0,
430 & tmp_proj -> atoms[0][s],
431 & tmp_proj -> atoms[0][t],
432 & tmp_proj -> atoms[0][u],
433 & tmp_proj -> atoms[0][v]).angle;
434 }
435 }
436
437 w /= tmp_fmol -> multi;
438 stre = g_strdup_printf ("%.3f", w);
439 strf = g_strdup_printf ("%s (%s)",
440 dlp_to_translate(activef,di+2,tmp_fprop -> key) ? _(fnames[activef][di+2][tmp_fprop -> key]) : fnames[activef][di+2][tmp_fprop -> key],
441 fkeysw[activef][di+2][tmp_fprop -> key]);
442 strg = parameters_info (di+1, tmp_fprop -> key, fvars_dihedral[activef][tmp_fprop -> key], tmp_fprop -> val);
443 gtk_tree_store_append (store, & di_level, iter);
444 gtk_tree_store_set (store, & di_level, 0, 0,
445 1, stra,
446 2, strb,
447 3, strc,
448 4, strd,
449 5, 0,
450 6, stre,
451 7, show,
452 8, tmp_fprop -> use,
453 9, strf,
454 10, strg,
455 11, dhii -> id, -1);
456 g_free (stra);
457 g_free (strb);
458 g_free (strc);
459 g_free (strd);
460 g_free (stre);
461 g_free (strf);
462 g_free (strg);
463 }
464 }
465 }
466 }
467 }
468 }
469 }
470 }
471 }
472 }
473 }
474 }
475 }
476 if (first_imp_inv)
477 {
478 this_ii = first_imp_inv;
479 while (this_ii -> next)
480 {
481 this_ii = this_ii -> next;
482 g_free (this_ii -> prev);
483 }
484 g_free (this_ii);
485 }
486 g_free (ids);
487}
488
501void print_dlp_dihedral (int dih, GtkTextBuffer * buf, field_struct * dh, int fi, GtkTreeStore * store, GtkTreeIter * iter)
502{
503 int a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s;
504 gboolean show;
505 gchar * stra, * strb, * strc, * strd, * stre, * strf, * strg;
506 float v;
507 GtkTreeIter di_level;
508 gboolean same_atom = FALSE;
509 gboolean * already_done;
510 if (tmp_fat -> id == tmp_fdt -> id && tmp_fbt -> id && tmp_fct -> id)
511 {
512 same_atom = TRUE;
513 already_done = allocbool (tmp_fmol -> mol -> natoms);
514 }
515 int * ids = allocint (4);
516 for (i=0; i<tmp_fat -> num; i++)
517 {
518 j = tmp_fat -> list[i];
519 if (tmp_proj -> atoms[0][j].coord[2] == fi)
520 {
521 a = ids[0] = tmp_fat -> list_id[i];
522 if (same_atom) already_done[a] = TRUE;
523 for (k=0; k<tmp_proj -> atoms[0][j].numv; k++)
524 {
525 l = tmp_proj -> atoms[0][j].vois[k];
526 if (tmp_proj -> atoms[0][l].faid == tmp_fbt -> id)
527 {
528 b = ids[1] = tmp_proj -> atoms[0][l].fid;
529 for (m=0; m<tmp_proj -> atoms[0][l].numv; m++)
530 {
531 n = tmp_proj -> atoms[0][l].vois[m];
532 if (n != j && tmp_proj -> atoms[0][n].faid == tmp_fct -> id)
533 {
534 c = ids[2] = tmp_proj -> atoms[0][n].fid;
535 for (o=0; o<tmp_proj -> atoms[0][n].numv; o++)
536 {
537 p = tmp_proj -> atoms[0][n].vois[o];
538 d = ids[3] = tmp_proj -> atoms[0][p].fid;
539 if (p != j && p != l && tmp_proj -> atoms[0][p].faid == tmp_fdt -> id && (! same_atom || (same_atom && ! already_done[d])))
540 {
541 tmp_fprop = get_active_prop_using_atoms (dh -> other, 4, ids);
542 if (tmp_fprop == NULL)
543 {
544 tmp_fprop = dh -> def;
545 if (buf == NULL) show = FALSE;
546 }
547 else if (buf == NULL)
548 {
549 show = tmp_fprop -> show;
550 }
551 if (buf != NULL && tmp_fprop -> use)
552 {
553 stra = g_strdup_printf ("%4s\t%d\t%d\t%d\t%d",fkeysw[activef][dih+2][tmp_fprop -> key], a+1, b+1, c+1, d+1);
554 print_info (stra, NULL, buf);
555 g_free (stra);
556 for (q=0; q<fvalues[activef][dih+1][tmp_fprop -> key]; q++)
557 {
558 stra = g_strdup_printf ("\t%15.10f", tmp_fprop -> val[q]);
559 print_info (stra, NULL, buf);
560 g_free (stra);
561 if (q == 2)
562 {
563 // Print 1-4 electrostatic interaction scale factor
564 stra = g_strdup_printf ("\t%15.10f", 0.0);
565 print_info (stra, NULL, buf);
566 g_free (stra);
567 // Print 1-4 van der Waals interaction scale factor
568 stra = g_strdup_printf ("\t%15.10f", 0.0);
569 print_info (stra, NULL, buf);
570 g_free (stra);
571 }
572 }
573 print_info ("\n", NULL, buf);
574 }
575 else if (buf == NULL)
576 {
577 stra = g_strdup_printf ("%d", a+1);
578 strb = g_strdup_printf ("%d", b+1);
579 strc = g_strdup_printf ("%d", c+1);
580 strd = g_strdup_printf ("%d", d+1);
581 v = 0.0;
582 for (q=0; q<tmp_fmol -> multi; q++)
583 {
584 r = tmp_fmol -> atoms_id[a][q].a;
585 s = tmp_fmol -> atoms_id[a][q].b;
586 e = get_active_atom (tmp_fmol -> id, r) -> list[s];
587 r = tmp_fmol -> atoms_id[b][q].a;
588 s = tmp_fmol -> atoms_id[b][q].b;
589 f = get_active_atom (tmp_fmol -> id, r) -> list[s];
590 r = tmp_fmol -> atoms_id[c][q].a;
591 s = tmp_fmol -> atoms_id[c][q].b;
592 g = get_active_atom (tmp_fmol -> id, r) -> list[s];
593 r = tmp_fmol -> atoms_id[d][q].a;
594 s = tmp_fmol -> atoms_id[d][q].b;
595 h = get_active_atom (tmp_fmol -> id, r) -> list[s];
596 v += dihedral_3d (& tmp_proj -> cell, 0,
597 & tmp_proj -> atoms[0][e],
598 & tmp_proj -> atoms[0][f],
599 & tmp_proj -> atoms[0][g],
600 & tmp_proj -> atoms[0][h]).angle;
601 }
602 v /= tmp_fmol -> multi;
603 stre = g_strdup_printf ("%.3f", v);
604 strf = g_strdup_printf ("%s (%s)",
605 dlp_to_translate(activef,dih+2,tmp_fprop -> key) ? _(fnames[activef][dih+2][tmp_fprop -> key]) : fnames[activef][dih+2][tmp_fprop -> key],
606 fkeysw[activef][dih+2][tmp_fprop -> key]);
607 strg = parameters_info (dih+1, tmp_fprop -> key, fvars_dihedral[activef][tmp_fprop -> key], tmp_fprop -> val);
608 gtk_tree_store_append (store, & di_level, iter);
609 gtk_tree_store_set (store, & di_level, 0, 0,
610 1, stra,
611 2, strb,
612 3, strc,
613 4, strd,
614 5, 0,
615 6, stre,
616 7, show,
617 8, tmp_fprop -> use,
618 9, strf,
619 10, strg,
620 11, dh -> id, -1);
621 g_free (stra);
622 g_free (strb);
623 g_free (strc);
624 g_free (strd);
625 g_free (stre);
626 g_free (strf);
627 g_free (strg);
628 }
629 }
630 }
631 }
632 }
633 }
634 }
635 }
636 }
637 g_free (ids);
638 if (same_atom) g_free (already_done);
639}
640
653void print_dlp_angle (int ai, GtkTextBuffer * buf, field_struct * an, int fi, GtkTreeStore * store, GtkTreeIter * iter)
654{
655 int a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, u;
656 gboolean show;
657 gchar * stra, * strb, * strc, * strd, * stre, * strf;
658 float v;
659 GtkTreeIter an_level;
660 int * ids = allocint (3);
661 gboolean same_atom = FALSE;
662 gboolean * already_done;
663 if (tmp_fat -> id == tmp_fct -> id)
664 {
665 same_atom = TRUE;
666 already_done = allocbool (tmp_fmol -> mol -> natoms);
667 }
668
669 for (i=0; i<tmp_fat -> num; i++)
670 {
671 j = tmp_fat -> list[i];
672 if (tmp_proj -> atoms[0][j].coord[2] == fi)
673 {
674 k = ids[0] = tmp_proj -> atoms[0][j].fid;
675 if (same_atom) already_done[k] = TRUE;
676 for (l=0; l<tmp_proj -> atoms[0][j].numv; l++)
677 {
678 m = tmp_proj -> atoms[0][j].vois[l];
679 if (tmp_proj -> atoms[0][m].faid == tmp_fbt -> id)
680 {
681 n = ids[1] = tmp_proj -> atoms[0][m].fid;
682 for (o=0; o<tmp_proj -> atoms[0][m].numv; o++)
683 {
684 p = tmp_proj -> atoms[0][m].vois[o];
685 q = ids[2] = tmp_proj -> atoms[0][p].fid;
686 if (p != j && tmp_proj -> atoms[0][p].faid == tmp_fct -> id && (! same_atom || (same_atom && ! already_done[q])))
687 {
688 tmp_fprop = get_active_prop_using_atoms (an -> other, 3, ids);
689 if (tmp_fprop == NULL)
690 {
691 tmp_fprop = an -> def;
692 if (buf == NULL) show = FALSE;
693 }
694 else if (buf == NULL)
695 {
696 show = tmp_fprop -> show;
697 }
698 if (buf != NULL && tmp_fprop -> use)
699 {
700 stra = g_strdup_printf ("%4s\t%d\t%d\t%d",fkeysw[activef][ai+2][tmp_fprop -> key], k+1, n+1, q+1);
701 print_info (stra, NULL, buf);
702 g_free (stra);
703 for (u=0; u<fvalues[activef][ai+1][tmp_fprop -> key]; u++)
704 {
705 stra = g_strdup_printf ("\t%15.10f", tmp_fprop -> val[u]);
706 print_info (stra, NULL, buf);
707 g_free (stra);
708 }
709 print_info ("\n", NULL, buf);
710 }
711 else if (buf == NULL)
712 {
713 stra = g_strdup_printf ("%d", k+1);
714 strb = g_strdup_printf ("%d", n+1);
715 strc = g_strdup_printf ("%d", q+1);
716 v = 0.0;
717 for (u=0; u<tmp_fmol -> multi; u++)
718 {
719 a = tmp_fmol -> atoms_id[k][u].a;
720 b = tmp_fmol -> atoms_id[k][u].b;
721 c = get_active_atom (tmp_fmol -> id, a) -> list[b];
722 d = tmp_fmol -> atoms_id[n][u].a;
723 e = tmp_fmol -> atoms_id[n][u].b;
724 f = get_active_atom (tmp_fmol -> id, d) -> list[e];
725 e = tmp_fmol -> atoms_id[q][u].a;
726 g = tmp_fmol -> atoms_id[q][u].b;
727 h = get_active_atom (tmp_fmol -> id, e) -> list[g];
728 v += angle_3d (& tmp_proj -> cell, 0,
729 & tmp_proj -> atoms[0][c],
730 & tmp_proj -> atoms[0][f],
731 & tmp_proj -> atoms[0][h]).angle;
732 }
733 v /= tmp_fmol -> multi;
734 strd = g_strdup_printf ("%.3f", v);
735 stre = g_strdup_printf ("%s (%s)",
736 dlp_to_translate(activef,ai+2,tmp_fprop -> key) ? _(fnames[activef][ai+2][tmp_fprop -> key]) : fnames[activef][ai+2][tmp_fprop -> key],
737 fkeysw[activef][ai+2][tmp_fprop -> key]);
738 strf = parameters_info (ai+1, tmp_fprop -> key, fvars_angle[activef][tmp_fprop -> key], tmp_fprop -> val);
739 gtk_tree_store_append (store, & an_level, iter);
740 gtk_tree_store_set (store, & an_level, 0, 0,
741 1, stra,
742 2, strb,
743 3, strc,
744 4, 0,
745 5, strd,
746 6, show,
747 7, tmp_fprop -> use,
748 8, stre,
749 9, strf,
750 10, an -> id, -1);
751 g_free (stra);
752 g_free (strb);
753 g_free (strc);
754 g_free (strd);
755 g_free (stre);
756 g_free (strf);
757 }
758 }
759 }
760 }
761 }
762 }
763 }
764 g_free (ids);
765 if (same_atom) g_free (already_done);
766}
767
780void print_dlp_bond (int bi, GtkTextBuffer * buf, field_struct * bd, int fi, GtkTreeStore * store, GtkTreeIter * iter)
781{
782 int i, j, k, l, m, n, o, p, q, r, s, t, u;
783 gboolean show;
784 gchar * stra, * strb, * strc, * strd, * stre;
785 float v;
786 int * ids = allocint (2);
787 GtkTreeIter bd_level;
788 gboolean same_atom = FALSE;
789 gboolean * already_done;
790 if (tmp_fat -> id == tmp_fbt -> id)
791 {
792 same_atom = TRUE;
793 already_done = allocbool (tmp_fmol -> mol -> natoms);
794 }
795 for (i=0; i<tmp_fat -> num; i++)
796 {
797 j = tmp_fat -> list[i];
798 if (tmp_proj -> atoms[0][j].coord[2] == fi)
799 {
800 k = ids[0] = tmp_fat -> list_id[i];
801 if (same_atom) already_done[k] = TRUE;
802 for (l=0; l<tmp_proj -> atoms[0][j].numv; l++)
803 {
804 m = tmp_proj -> atoms[0][j].vois[l];
805 n = ids[1] = tmp_proj -> atoms[0][m].fid;
806 if (tmp_proj -> atoms[0][m].faid == tmp_fbt -> id && (! same_atom || (same_atom && ! already_done[n])))
807 {
808 tmp_fprop = get_active_prop_using_atoms (bd -> other, 2, ids);
809 if (tmp_fprop == NULL)
810 {
811 tmp_fprop = bd -> def;
812 if (buf == NULL) show = FALSE;
813 }
814 else if (buf == NULL)
815 {
816 show = tmp_fprop -> show;
817 }
818 if (buf != NULL && tmp_fprop -> use)
819 {
820 stra = g_strdup_printf ("%4s\t%d\t%d",fkeysw[activef][bi+2][tmp_fprop -> key], k+1, n+1);
821 print_info (stra, NULL, buf);
822 g_free (stra);
823 for (o=0; o<fvalues[activef][bi+1][tmp_fprop -> key]; o++)
824 {
825 stra = g_strdup_printf ("\t%15.10f", tmp_fprop -> val[o]);
826 print_info (stra, NULL, buf);
827 g_free (stra);
828 }
829 print_info ("\n", NULL, buf);
830 }
831 else if (buf == NULL)
832 {
833 stra = g_strdup_printf ("%d", k+1);
834 strb = g_strdup_printf ("%d", n+1);
835 v = 0.0;
836 for (o=0; o<tmp_fmol -> multi; o++)
837 {
838 p = tmp_fmol -> atoms_id[k][o].a;
839 q = tmp_fmol -> atoms_id[k][o].b;
840 r = get_active_atom (tmp_fmol -> id, p) -> list[q];
841 s = tmp_fmol -> atoms_id[n][o].a;
842 t = tmp_fmol -> atoms_id[n][o].b;
843 u = get_active_atom (tmp_fmol -> id, s) -> list[t];
844 v += distance_3d (& tmp_proj -> cell, 0, & tmp_proj -> atoms[0][r], & tmp_proj -> atoms[0][u]).length;
845 }
846 v /= tmp_fmol -> multi;
847 strc = g_strdup_printf ("%.3f", v);
848 strd = g_strdup_printf ("%s (%s)",
849 dlp_to_translate(activef,bi+2,tmp_fprop -> key) ? _(fnames[activef][bi+2][tmp_fprop -> key]) : fnames[activef][bi+2][tmp_fprop -> key],
850 fkeysw[activef][bi+2][tmp_fprop -> key]);
851 stre = parameters_info (bi+1, tmp_fprop -> key, fvars_bond[activef][tmp_fprop -> key], tmp_fprop -> val);
852 gtk_tree_store_append (store, & bd_level, iter);
853 gtk_tree_store_set (store, & bd_level, 0, 0,
854 1, stra,
855 2, strb,
856 3, 0,
857 4, strc,
858 5, show,
859 6, tmp_fprop -> use,
860 7, strd,
861 8, stre,
862 9, bd -> id, -1);
863 g_free (stra);
864 g_free (strb);
865 g_free (strc);
866 g_free (strd);
867 g_free (stre);
868 }
869 }
870 }
871 }
872 }
873 g_free (ids);
874 if (same_atom) g_free (already_done);
875}
876
885void print_dlp_rigid (GtkTextBuffer * buf, field_rigid * rig)
886{
887 gchar * str;
888 int h, i, j, k, l, m, n;
889 str = g_strdup_printf ("%d\t", rig -> num);
890 j = 1;
891 n = rig -> num;
892 if (rig -> num > 15)
893 {
894 k = rig -> num - 15;
895 l = k / 16;
896 j += l + 1;
897 n = k - l*16;
898 }
899 h = 0;
900 for (i=0; i<j; i++)
901 {
902 k = (i) ? 1 : 0;
903 l = (j == 1 || (j > 1 && i == j-1)) ? n : 15+k;
904 for (m=0; m<l; m++)
905 {
906 str = g_strdup_printf ("%s\t%d", str, rig -> list[h]+1);
907 h ++;
908 }
909 str = g_strdup_printf ("%s\n", str);
910 }
911 print_info (str, NULL, buf);
912 g_free (str);
913}
914
923void print_dlp_tet (GtkTextBuffer * buf, field_tethered * tet)
924{
925 gchar * str;
926 str = g_strdup_printf ("%4s\t\%d", fkeysw[activef][1][tet -> key], tet -> num);
927 print_info (str, NULL, buf);
928 g_free (str);
929 int i;
930 for (i=0; i<fvalues[activef][0][tmp_ftet -> key]; i++)
931 {
932 str = g_strdup_printf ("\t%15.10f", tmp_ftet -> val[i]);
933 print_info (str, NULL, buf);
934 g_free (str);
935 }
936 print_info ("\n", NULL, buf);
937}
938
947void print_dlp_pmf (GtkTextBuffer * buf, field_pmf * pmf)
948{
949 gchar * str;
950 int i, j;
951 print_info ("PMF", "bold", buf);
952 str = g_strdup_printf ("\t%f\n", pmf -> length);
953 print_info (str, NULL, buf);
954 g_free (str);
955 for (i=0; i<2; i++)
956 {
957 str = g_strdup_printf ("PMF UNIT %d\n", pmf -> num[i]);
958 print_info (str, NULL, buf);
959 g_free (str);
960 for (j=0; j < pmf -> num[i]; j++)
961 {
962 str = g_strdup_printf ("%d\t%f\n", pmf -> list[i][j]+1, pmf -> weight[i][j]);
963 print_info (str, NULL, buf);
964 g_free (str);
965 }
966 }
967}
968
977void print_dlp_cons (GtkTextBuffer * buf, field_constraint * cons)
978{
979 gchar * str;
980 str = g_strdup_printf ("%d\t\%d\t%f\n", cons -> ia[0], cons -> ia[1], cons -> length);
981 print_info (str, NULL, buf);
982 g_free (str);
983}
984
994void print_dlp_shell (GtkTextBuffer * buf, field_molecule * fmol, field_shell * shell)
995{
996 gchar * str;
997 str = g_strdup_printf ("%d\t\%d\t%f\t%f\n", shell -> ia[0], shell -> ia[1], shell -> k2, shell -> k4);
998 print_info (str, NULL, buf);
999 g_free (str);
1000}
1001
1011void print_dlp_atom (GtkTextBuffer * buf, int at, int numat)
1012{
1013 gchar * str;
1014 if (tmp_fat -> frozen_id[at])
1015 {
1016 str = g_strdup_printf ("%8s %15.10f %15.10f %d %d\n", tmp_fat -> name, tmp_fat -> mass, tmp_fat -> charge, numat, 1);
1017 }
1018 else
1019 {
1020 str = g_strdup_printf ("%8s %15.10f %15.10f %d\n", tmp_fat -> name, tmp_fat -> mass, tmp_fat -> charge, numat);
1021 }
1022 print_info (str, NULL, buf);
1023 g_free (str);
1024}
1025
1035{
1036 int i = 0;
1037 tmp_fstr = fmol -> first_struct[sid];
1038 while (tmp_fstr)
1039 {
1040 if (tmp_fstr -> def -> use)
1041 {
1042 i += tmp_fstr -> num;
1043 }
1044 else if (tmp_fstr -> other)
1045 {
1046 tmp_fprop = tmp_fstr -> other;
1047 while (tmp_fprop)
1048 {
1049 if (tmp_fprop -> use) i ++;
1050 tmp_fprop = tmp_fprop -> next;
1051 }
1052 }
1053 tmp_fstr = tmp_fstr -> next;
1054 }
1055 return i;
1056}
1057
1066void print_dlp_molecule (GtkTextBuffer * buf, field_molecule * fmol)
1067{
1068 gchar * str;
1069 str = g_strdup_printf ("%s", fmol -> name);
1070 print_info (str, "bold_orange", buf);
1071 g_free (str);
1072 print_info ("\nNUMMOLS\t", "bold", buf);
1073 str = g_strdup_printf ("%d", fmol -> multi);
1074 print_info (str, "bold_green", buf);
1075 g_free (str);
1076 int i, j, k, l, m, n, o, p;
1077
1078 j = 0;
1079 tmp_fat = fmol -> first_atom;
1080 for (i=0; i<fmol -> atoms; i++)
1081 {
1082 j += tmp_fat -> num;
1083 if (tmp_fat -> next != NULL) tmp_fat = tmp_fat -> next;
1084 }
1085 j /= fmol -> multi;
1086 if (j != fmol -> mol -> natoms) g_debug ("PRINT:: Error the number of atom(s) is wrong ?!");
1087 print_info ("\nATOMS\t", "bold", buf);
1088 str = g_strdup_printf ("%d\n", fmol -> mol -> natoms);
1089 print_info (str, "bold_blue", buf);
1090 g_free (str);
1091 for (i=0; i < fmol -> mol -> natoms ; i+=(m-i))
1092 {
1093 j = fmol -> atoms_id[i][0].a;
1094 tmp_fat = get_active_atom (fmol -> id, j);
1095 k = fmol -> atoms_id[i][0].b;
1096 l = tmp_fat -> frozen_id[k];
1097 for (m=i+1; m<fmol -> mol -> natoms; m++)
1098 {
1099 n = fmol -> atoms_id[m][0].a;
1100 o = fmol -> atoms_id[m][0].b;
1101 tmp_fbt = get_active_atom (fmol -> id, n);
1102 p = tmp_fbt -> frozen_id[o];
1103 if (j != n || l != p) break;
1104 }
1105 print_dlp_atom (buf, k, m-i);
1106 }
1107 // Shells
1108 int ncs = 0;
1109 if (tmp_field -> afp[10])
1110 {
1111 tmp_fshell = fmol -> first_shell;
1112 while (tmp_fshell)
1113 {
1114 if (tmp_fshell -> use)
1115 {
1116 if (tmp_fshell -> ia[0] && tmp_fshell -> ia[1]) ncs ++;
1117 }
1118 tmp_fshell = tmp_fshell -> next;
1119 }
1120 }
1121 if (ncs)
1122 {
1123 print_info ("SHELLS\t", "bold", buf);
1124 str = g_strdup_printf ("%d\n", ncs);
1125 print_info (str, "bold", buf);
1126 g_free (str);
1127 tmp_fshell = fmol -> first_shell;
1128 while (tmp_fshell)
1129 {
1130 if (tmp_fshell -> use && tmp_fshell -> ia[0] && tmp_fshell -> ia[1])
1131 {
1132 print_dlp_shell (buf, fmol, tmp_fshell);
1133 }
1134 tmp_fshell = tmp_fshell -> next;
1135 }
1136 }
1137
1138 // Constraints
1139 if (tmp_field -> afp[11])
1140 {
1141 j = 0;
1142 tmp_fcons = fmol -> first_constraint;
1143 while (tmp_fcons)
1144 {
1145 if (tmp_fcons -> use) j ++;
1146 tmp_fcons = tmp_fcons -> next;
1147 }
1148 if (j > 0)
1149 {
1150 print_info ("CONSTRAINTS\t", "bold", buf);
1151 str = g_strdup_printf ("%d\n", j);
1152 print_info (str, "bold", buf);
1153 g_free (str);
1154 tmp_fcons = fmol -> first_constraint;
1155 while (tmp_fcons)
1156 {
1157 if (tmp_fcons -> use) print_dlp_cons (buf, tmp_fcons);
1158 tmp_fcons = tmp_fcons -> next;
1159 }
1160 }
1161 }
1162
1163 // PMFs
1164 if (tmp_field -> afp[12])
1165 {
1166 tmp_fpmf = fmol -> first_pmf;
1167 while (tmp_fpmf)
1168 {
1169 if (tmp_fpmf -> use)
1170 {
1171 print_dlp_pmf (buf, tmp_fpmf);
1172 break;
1173 }
1174 tmp_fpmf = tmp_fpmf -> next;
1175 }
1176 }
1177
1178 // Rigid
1179 if (tmp_field -> afp[13])
1180 {
1181 j = 0;
1182 k = 0;
1183 tmp_frig = fmol -> first_rigid;
1184 while (tmp_frig)
1185 {
1186 if (tmp_frig -> use) j ++;
1187 tmp_frig = tmp_frig -> next;
1188 }
1189 if (j > 0)
1190 {
1191 print_info ("RIGID\t", "bold", buf);
1192 str = g_strdup_printf ("%d\n", j);
1193 print_info (str, "bold", buf);
1194 g_free (str);
1195 tmp_frig = fmol -> first_rigid;
1196 while (tmp_frig)
1197 {
1198 if (tmp_frig -> use)
1199 {
1201 }
1202 tmp_frig = tmp_frig -> next;
1203 }
1204 }
1205 }
1206
1207 // Tethering
1208 if (tmp_field -> afp[14])
1209 {
1210 j = 0;
1211 tmp_ftet = fmol -> first_tethered;
1212 while (tmp_ftet)
1213 {
1214 if (tmp_ftet -> use && tmp_ftet -> num) j ++;
1215 tmp_ftet = tmp_ftet -> next;
1216 }
1217 if (j > 0)
1218 {
1219 print_info ("TETH\t", "bold", buf);
1220 str = g_strdup_printf ("%d\n", j);
1221 print_info (str, "bold", buf);
1222 g_free (str);
1223 tmp_ftet = fmol -> first_tethered;
1224 while (tmp_ftet)
1225 {
1226 if (tmp_ftet -> use) print_dlp_tet (buf, tmp_ftet);
1227 tmp_ftet = tmp_ftet -> next;
1228 }
1229 }
1230 }
1231 gchar * str_title[8] = {"BONDS ", "BONDS ", "ANGLES ", "ANGLES ", "DIHEDRALS ", "DIHEDRALS ", "DIHEDRALS ", "INVERSIONS "};
1232 gboolean doprint;
1233 for (i=0; i<8; i++)
1234 {
1235 if (tmp_field -> afp[i+15])
1236 {
1237 j = get_num_struct_to_print (fmol, i);
1238 if ((i == 0 || i == 2 || i == 4) && tmp_field -> afp[i+16])
1239 {
1240 // To add the number of constraints
1241 j += get_num_struct_to_print (fmol, i+1);
1242 }
1243 if ((i == 4 && tmp_field -> afp[i+17]) || (i == 5 && ! tmp_field -> afp[i+14] && tmp_field -> afp[i+16]))
1244 {
1245 // To add the number of impropers
1246 k = (i == 4) ? 2 : 1;
1247 j += get_num_struct_to_print (fmol, i+k);
1248 }
1249 doprint = (i == 0 || i == 2 || i == 4 || i == 7) ? TRUE : FALSE;
1250 if ((i == 1 || i == 3 || i == 5) && ! tmp_field -> afp[i+14])
1251 {
1252 doprint = TRUE;
1253 }
1254 else if (i == 5 && ! tmp_field -> afp[i+14])
1255 {
1256 doprint = TRUE;
1257 }
1258 else if (i == 6 && ! tmp_field -> afp[i+13] && ! tmp_field -> afp[i+14])
1259 {
1260 doprint = TRUE;
1261 }
1262
1263 if (j > 0)
1264 {
1265 if (doprint)
1266 {
1267 print_info (str_title[i], "bold", buf);
1268 str = g_strdup_printf ("%d\n", j);
1269 print_info (str, "bold_blue", buf);
1270 g_free (str);
1271 }
1272 tmp_fstr = fmol -> first_struct[i];
1273 while (tmp_fstr)
1274 {
1275 tmp_fat = get_active_atom (fmol -> id, tmp_fstr -> aid[0]);
1276 tmp_fbt = get_active_atom (fmol -> id, tmp_fstr -> aid[1]);
1277 if (i > 1) tmp_fct = get_active_atom (fmol -> id, tmp_fstr -> aid[2]);
1278 if (i > 3) tmp_fdt = get_active_atom (fmol -> id, tmp_fstr -> aid[3]);
1279 if (i == 0 || i == 1) print_dlp_bond (i, buf, tmp_fstr, fmol -> fragments[0], NULL, NULL);
1280 if (i == 2 || i == 3) print_dlp_angle (i, buf, tmp_fstr, fmol -> fragments[0], NULL, NULL);
1281 if (i == 4 || i == 5) print_dlp_dihedral (i, buf, tmp_fstr, fmol -> fragments[0], NULL, NULL);
1282 if (i == 6 || i == 7) print_dlp_improper_inversion (i, buf, tmp_fstr, fmol -> fragments[0], NULL, NULL);
1283 tmp_fstr = tmp_fstr -> next;
1284 }
1285 }
1286 }
1287 }
1288
1289 print_info ("FINISH\n", "bold_orange", buf);
1290}
1291
1300void print_dlp_body (GtkTextBuffer * buf, field_nth_body * body)
1301{
1302 gchar * str;
1303 int i, j;
1304 j = body_at (body -> bd);
1305 if (! body -> bd)
1306 {
1307 for (i=0; i<j; i++) print_info (g_strdup_printf ("%8s\t", get_body_element_name (body, i, 0)), NULL, buf);
1308 }
1309 else
1310 {
1311 for (i=0; i<j; i++) print_info (g_strdup_printf ("%8s\t", get_active_atom(body -> ma[i][0], body -> a[i][0]) -> name), NULL, buf);
1312 }
1313 str = g_strdup_printf ("%4s",fkeysw[activef][10+ body -> bd][body -> key]);
1314 print_info (str, NULL, buf);
1315 g_free (str);
1316 for (i=0; i<fvalues[activef][9+ body -> bd][body -> key]; i++)
1317 {
1318 str = g_strdup_printf ("\t%15.10f", body -> val[i]);
1319 print_info (str, NULL, buf);
1320 g_free (str);
1321 }
1322 print_info ("\n", NULL, buf);
1323}
1324
1334void print_dlp_tersoff_cross (GtkTextBuffer * buf, field_nth_body * body_a, field_nth_body * body_b)
1335{
1336 gchar * str;
1337 int j;
1338 print_info (g_strdup_printf ("%8s\t", get_active_atom(body_a -> ma[0][0], body_a -> a[0][0]) -> name), NULL, buf);
1339 print_info (g_strdup_printf ("%8s\t", get_active_atom(body_b -> ma[0][0], body_b -> a[0][0]) -> name), NULL, buf);
1340 for (j=0; j<3; j++)
1341 {
1342
1343 str = g_strdup_printf ("%15.10f", tmp_field -> cross[body_a -> id][body_b -> id][j]);
1344 print_info (str, NULL, buf);
1345 g_free (str);
1346 if (j<2) print_info ("\t", NULL, buf);
1347 }
1348 print_info ("\n", NULL, buf);
1349}
1350
1359void print_dlp_tersoff (GtkTextBuffer * buf, field_nth_body * body)
1360{
1361 gchar * str;
1362 int i, j, k;
1363 int num[2]={2, 3};
1364 int nc[2][3]={{5, 6, 3}, {5, 6, 5}};
1365 j = body_at (body -> bd);
1366 k = 0;
1367 for (i=0; i<num[body -> key]; i++)
1368 {
1369 if (i==0)
1370 {
1371 print_info (g_strdup_printf ("%8s\t", get_active_atom(body -> ma[0][0], body -> a[0][0]) -> name), NULL, buf);
1372 str = g_strdup_printf ("%4s\t",fkeysw[activef][10+body -> bd][body -> key]);
1373 print_info (str, NULL, buf);
1374 g_free (str);
1375 }
1376 else
1377 {
1378 print_info (" \t \t", NULL, buf);
1379 }
1380 for (j=0; j<nc[body -> key][i]; j++)
1381 {
1382 if (j > 0) print_info ("\t", NULL, buf);
1383 str = g_strdup_printf ("%15.10f", body -> val[j+k]);
1384 print_info (str, NULL, buf);
1385 g_free (str);
1386 }
1387 print_info ("\n", NULL, buf);
1388 k += nc[body -> key][i];
1389 }
1390 if (! body -> key)
1391 {
1392 field_nth_body * tmp_fbo;
1393 tmp_fbo = tmp_field -> first_body[2];
1394 while (tmp_fbo)
1395 {
1396 print_dlp_tersoff_cross (buf, body, tmp_fbo);
1397 tmp_fbo = tmp_fbo -> next;
1398 }
1399 }
1400}
1401
1409void print_dlp_field (GtkTextBuffer * buf)
1410{
1411 int i, j;
1412 gchar * str;
1413
1414 GtkTextIter bStart;
1415 GtkTextIter bEnd;
1416
1417 gtk_text_buffer_get_start_iter (buf, & bStart);
1418 gtk_text_buffer_get_end_iter (buf, & bEnd);
1419 gtk_text_buffer_delete (buf, & bStart, & bEnd);
1420
1421 str = g_strdup_printf (_("# This file was created using %s\n"), PACKAGE);
1422 print_info (str, NULL, buf);
1423 g_free (str);
1424 str = g_strdup_printf (_("# %s contains:\n"), prepare_for_title(tmp_proj -> name));
1425 print_info (str, NULL, buf);
1426 g_free (str);
1427 i = 0;
1428 for (j=0; j<tmp_proj -> modelfc -> mol_by_step[0]; j++)
1429 {
1430 i += tmp_proj -> modelfc -> mols[0][j].multiplicity;
1431 }
1432 str = g_strdup_printf (_("# - %d atoms\n"
1433 "# - %d isolated molecular fragments\n"
1434 "# - %d distinct molecules\n"),
1435 tmp_proj -> natomes, i, tmp_proj -> modelfc -> mol_by_step[0]);
1436 print_info (str, NULL, buf);
1437 g_free (str);
1438
1439 print_info (_("# Energy unit:\n"), NULL, buf);
1440 print_info ("UNITS ", "bold", buf);
1441 str = g_strdup_printf ("%s\n", fkeysw[activef][0][tmp_field -> energy_unit]);
1442 print_info (str, "bold_green", buf);
1443 g_free (str);
1444 print_info (_("# Number of field molecules:\n"), NULL, buf);
1445 print_info ("MOLECULES ", "bold", buf);
1446 str = g_strdup_printf ("%d\n", tmp_field -> molecules);
1447 print_info (str, "bold_red", buf);
1448 g_free (str);
1449 tmp_fmol = tmp_field -> first_molecule;
1450 for (i=0; i<tmp_field -> molecules; i++)
1451 {
1452 str = g_strdup_printf (_("# Begin molecule %d\n"), i+1);
1453 print_info (str, NULL, buf);
1454 g_free (str);
1456 str = g_strdup_printf (_("# End molecule %d\n"), i+1);
1457 print_info (str, NULL, buf);
1458 g_free (str);
1459 if (tmp_fmol -> next != NULL) tmp_fmol = tmp_fmol -> next;
1460 }
1461
1462 // Non bonded
1463 gchar * nd_title[5] = {"VDW", "METAL", "TERSOFF", "TBP", "FBP"};
1464 gchar * com_ndb[5] = {i18n("van der Walls pair"), i18n("metal"), "Tersoff", i18n("three-body"), i18n("four-body")};
1465 for (i=0; i<5; i++)
1466 {
1467 if (tmp_field -> afp[i+23])
1468 {
1469 j=0;
1470 tmp_fbody = tmp_field -> first_body[i];
1471 while (tmp_fbody)
1472 {
1473 if (tmp_fbody -> use) j++;
1474 tmp_fbody = tmp_fbody -> next;
1475 }
1476 if (j > 0)
1477 {
1478 str = g_strdup_printf (_("# Non-bonded: %s potential(s)\n"), (i != 2) ? _(com_ndb[i]) : com_ndb[i]);
1479 print_info (str, NULL, buf);
1480 g_free (str);
1481 print_info (nd_title[i], "bold", buf);
1482 str = g_strdup_printf (" %d\n", j);
1483 print_info (str, "bold_red", buf);
1484 tmp_fbody = tmp_field -> first_body[i];
1485 while (tmp_fbody)
1486 {
1487 if (tmp_fbody -> use)
1488 {
1489 if (i == 2)
1490 {
1492 }
1493 else
1494 {
1496 }
1497 }
1498 tmp_fbody = tmp_fbody -> next;
1499 }
1500 }
1501 }
1502 }
1503
1504 // External fields
1505 if (tmp_field -> afp[28])
1506 {
1507 i = 0;
1508 tmp_fext = tmp_field -> first_external;
1509 while (tmp_fext)
1510 {
1511 if (tmp_fext -> use) i ++;
1512 tmp_fext = tmp_fext -> next;
1513 }
1514 if (i == 1)
1515 {
1516 print_info ("EXTERN", "bold", buf);
1517 tmp_fext = tmp_field -> first_external;
1518 while (tmp_fext)
1519 {
1520 if (tmp_fext -> use)
1521 {
1522 str = g_strdup_printf ("\n%4s",fkeysw[activef][15][tmp_fext -> key]);
1523 print_info (str, NULL, buf);
1524 g_free (str);
1525 for (j=0; j<fvalues[activef][SEXTERN-6][tmp_fext -> key]; j++)
1526 {
1527 print_info (g_strdup_printf ("\t%15.10f", tmp_fext -> val[j]), NULL, buf);
1528 }
1529 print_info ("\n", NULL, buf);
1530 break;
1531 }
1532 tmp_fext = tmp_fext -> next;
1533 }
1534 }
1535 }
1536 print_info ("CLOSE", "bold", buf);
1537}
1538
1545{
1546 box_info * box = & tmp_proj -> cell.box[0];
1547 if (box -> param[1][0] == box -> param[1][1] && box -> param[1][0] == box -> param[1][2] && box -> param[1][0] == 90.0)
1548 {
1549 if (box -> param[0][0] == box -> param[0][1] && box -> param[0][0] == box -> param[0][2])
1550 {
1551 return 1;
1552 }
1553 else
1554 {
1555 return 2;
1556 }
1557 }
1558 else if (box -> vect[0][1] == 0.0 && box -> vect[0][2] == 0.0 && box -> vect[1][0] == 0.0
1559 && box -> vect[1][2] == 0.0 && box -> vect[2][0] == 0.0 && box -> vect[2][1] == 0.0)
1560 {
1561 if (box -> vect[0][0] == box -> vect[1][1] && box -> vect[0][0] == box -> vect[2][2])
1562 {
1563 return 1;
1564 }
1565 else
1566 {
1567 return 2;
1568 }
1569 }
1570 else
1571 {
1572 return 3;
1573 }
1574}
1575
1583void print_dlp_config (GtkTextBuffer * buf)
1584{
1585 int h, i, j, k, l, m, n;
1586 int pbc;
1587 gchar * str;
1588
1589 GtkTextIter bStart;
1590 GtkTextIter bEnd;
1591
1592 gtk_text_buffer_get_start_iter (buf, & bStart);
1593 gtk_text_buffer_get_end_iter (buf, & bEnd);
1594 gtk_text_buffer_delete (buf, & bStart, & bEnd);
1595
1596 str = g_strdup_printf (_("# DL-POLY CONFIG file created by %s, %s - %d atoms\n"),
1597 PACKAGE,
1598 prepare_for_title(tmp_proj -> name),
1599 tmp_proj -> natomes);
1600 print_info (str, "bold", buf);
1601 g_free (str);
1602 if (tmp_proj -> cell.pbc)
1603 {
1604 pbc = get_pbc ();
1605 }
1606 else
1607 {
1608 pbc = 0;
1609 }
1610 str = g_strdup_printf ("%d", 0);
1611 print_info (str, "bold_red", buf);
1612 g_free (str);
1613 str = g_strdup_printf ("\t%d", pbc);
1614 print_info (str, "bold_green", buf);
1615 g_free (str);
1616 str = g_strdup_printf ("\t%d\n", tmp_proj -> natomes);
1617 print_info (str, "bold_blue", buf);
1618 g_free (str);
1619 if (pbc > 0)
1620 {
1621 for (i=0; i<3; i++)
1622 {
1623 str = g_strdup_printf ("%f\t%f\t%f\n",
1624 tmp_proj -> cell.box[0].vect[i][0],
1625 tmp_proj -> cell.box[0].vect[i][1],
1626 tmp_proj -> cell.box[0].vect[i][2]);
1627 print_info (str, NULL, buf);
1628 g_free (str);
1629
1630 }
1631 }
1632 tmp_fmol = tmp_field -> first_molecule;
1633 h = 0;
1634 for (i=0; i<tmp_field -> molecules; i++)
1635 {
1636 for (j=0; j<tmp_fmol -> multi; j++)
1637 {
1638 for (k=0; k<tmp_fmol -> mol -> natoms; k++)
1639 {
1640 l = tmp_fmol -> atoms_id[k][j].a;
1641 m = tmp_fmol -> atoms_id[k][j].b;
1642 tmp_fat = get_active_atom (tmp_fmol -> id, l);
1643 str = g_strdup_printf ("%8s", tmp_fat -> name);
1644 print_info (str, "bold", buf);
1645 g_free (str);
1646 if (tmp_field -> sys_opts[2])
1647 {
1648 print_info ("\n", NULL, buf);
1649 }
1650 else
1651 {
1652 str = g_strdup_printf (" %d\n", h+1);
1653 print_info (str, "bold_red", buf);
1654 g_free (str);
1655 h ++;
1656 }
1657 n = tmp_fat -> list[m];
1658 str = g_strdup_printf ("%f\t%f\t%f\n", tmp_proj -> atoms[0][n].x, tmp_proj -> atoms[0][n].y, tmp_proj -> atoms[0][n].z);
1659 print_info (str, NULL, buf);
1660 g_free (str);
1661 }
1662 }
1663 if (tmp_fmol -> next != NULL) tmp_fmol = tmp_fmol -> next;
1664 }
1665}
1666
1667
1668gchar * ens_keyw[4] = {"nve", "nvt", "npt", "nst"};
1669gchar * thermo_keyw[10] = {"evans", "lang", "ander", "ber", "hoover", "gst", "dpd", "mtk", "ttm", "inhomo"};
1670gchar * pseudo_thermo[3] = {"langevin", "gauss", "direct"};
1671gchar * area_keyw[5]={"area", "tens", "tens", "orth", "orth"};
1672gchar * md_keyw[4]={"temp ", "steps ", "integrat ", "pres "};
1673gchar * md_text[4]={i18n("# Target temperature in K\n"), i18n("# Number of MD steps\n"), i18n("# Integration time step in ps\n"), i18n("# Target presssure in k atms\n")};
1674gchar * min_key[3]={"force", "energy", "distance"};
1675//gchar * md_legend[3]={i18n("# Target temperature"), i18n("# Number of MD steps"), i18n("# MD time step d(t)")};
1676
1682gboolean print_ana ()
1683{
1684 if ((int)tmp_field -> ana_opts[0] || (int)tmp_field -> ana_opts[4] || (int)tmp_field -> ana_opts[8] || (int)tmp_field -> ana_opts[11] || (int)tmp_field -> ana_opts[14])
1685 {
1686 return TRUE;
1687 }
1688 else
1689 {
1690 return FALSE;
1691 }
1692}
1693
1694extern gchar * eval_m[10];
1695extern gchar * eval_vdw[6];
1696extern gchar * io_rw_m[4];
1697extern gchar * io_pres[2];
1698
1699gchar * elec_key[10]={"coul ",
1700 "distan ",
1701 "ewald precision ",
1702 "ewald ",
1703 "reaction ",
1704 "reaction damp ",
1705 "reaction precision ",
1706 "shift ",
1707 "shift damp ",
1708 "shift precision "};
1709gchar * vdw_key[6]={"lor ", "fend", "hoge",
1710 "halg", "tang", "func"};
1711gchar * sys_info[8]={i18n("\n# Ignore particle indices from CONFIG file and set indices by order of reading"),
1712 i18n("\n# Ignore strict checks when reading CONFIG file, warning messages and assume safe simulation parameters"),
1713 i18n("\n# Skip detailed topology reporting when reading FIELD file"),
1714 i18n("\n# Ignore center of mass momentum removal during the simulation"),
1715 i18n("\n# Tolerance for the relaxed shell model\n"),
1716 i18n("\n# Subcelling threshold density of particle per link cell\n"),
1717 i18n("\n# Create an expanded version of the current model\n"),
1718 i18n("\n# Restart job from previous run: ")};
1719gchar * sys_key[8]={NULL, NULL, NULL, NULL, "rlxtol ", "subcell ", "nfold ", "restart "};
1720gchar * sys_string[8]={"ind", "str", "top", "vom", NULL, NULL, NULL, NULL};
1721gchar * rest_inf[3]={i18n("\n# Continue current simulation - require REVOLD file"),
1722 i18n("\n# Start new simulation from older run without temperature reset"),
1723 i18n("\n# Start new simulation from older run with temperature reset")};
1724gchar * rest_key[3]={NULL, "noscale", "scale"};
1725
1726gchar * time_inf[2]={i18n("\n\n# Set job time to "), i18n("\n\n# Set job closure time to ")};
1727gchar * time_key[2]={"job time ", "close time "};
1728gchar * io_inf[2]={i18n("\n# I/O read interface, with:\n"), i18n("\n# I/O write interface, with:\n")};
1729gchar * io_key[2]={"\nio read ", "\nio writ "};
1730gchar * io_meth[4]={"mpiio", "direct", "master", "netcdf"};
1731gchar * io_pec[2]={"off", "on"};
1732gchar * io_typ[2]={"sorted", "unsorted"};
1733
1742void print_int (GtkTextBuffer * buf, int data)
1743{
1744 gchar * str = g_strdup_printf (" %d", data);
1745 print_info (str, "bold_blue", buf);
1746 g_free (str);
1747}
1748
1760void print_control_int (GtkTextBuffer * buf, int data, gchar * info_a, gchar * info_b, gchar * key)
1761{
1762 gchar * str = g_strdup_printf ("%d", data);
1763 print_info (info_a, NULL, buf);
1764 print_info (str, NULL, buf);
1765 g_free (str);
1766 if (info_b != NULL) print_info (info_b, NULL, buf);
1767 print_info ("\n", NULL, buf);
1768 print_info (key, "bold", buf);
1769 print_int (buf, data);
1770}
1771
1780void print_float (GtkTextBuffer * buf, double data)
1781{
1782 gchar * str = g_strdup_printf (" %f", data);
1783 print_info (str, "bold_red", buf);
1784 g_free (str);
1785}
1786
1798void print_control_float (GtkTextBuffer * buf, double data, gchar * info_a, gchar * info_b, gchar * key)
1799{
1800 gchar * str = g_strdup_printf ("%f", data);
1801 print_info (info_a, NULL, buf);
1802 print_info (str, NULL, buf);
1803 g_free (str);
1804 if (info_b != NULL) print_info (info_b, NULL, buf);
1805 print_info ("\n", NULL, buf);
1806 print_info (key, "bold", buf);
1807 print_float (buf, data);
1808}
1809
1818void print_sci (GtkTextBuffer * buf, double data)
1819{
1820 gchar * str = g_strdup_printf (" %e", data);
1821 print_info (str, "bold_orange", buf);
1822 g_free (str);
1823}
1824
1836void print_control_sci (GtkTextBuffer * buf, double data, gchar * info_a, gchar * info_b, gchar * key)
1837{
1838 gchar * str = g_strdup_printf ("%e", data);
1839 print_info (info_a, NULL, buf);
1840 print_info (str, NULL, buf);
1841 if (info_b != NULL) print_info (info_b, NULL, buf);
1842 print_info ("\n", NULL, buf);
1843 print_info (key, "bold", buf);
1844 print_info (str, "bold_orange", buf);
1845 g_free (str);
1846}
1847
1856void print_string (GtkTextBuffer * buf, gchar * string)
1857{
1858 print_info (" ", NULL, buf);
1859 print_info (string, "bold_green", buf);
1860}
1861
1873void print_control_string (GtkTextBuffer * buf, gchar * string, gchar * info_a, gchar * info_b, gchar * key)
1874{
1875 if (info_a != NULL) print_info (info_a, NULL, buf);
1876 if (info_b != NULL) print_info (info_b, NULL, buf);
1877 if (info_a != NULL) print_info ("\n", NULL, buf);
1878 print_info (key, "bold", buf);
1879 if (string) print_string (buf, string);
1880}
1881
1891void print_control_key (GtkTextBuffer * buf, gchar * info, gchar * key)
1892{
1893 if (info != NULL) print_info (info, NULL, buf);
1894 print_info (key, "bold", buf);
1895}
1896
1897
1905void print_dlp_control (GtkTextBuffer * buf)
1906{
1907 int i, j, k;
1908 gchar * str;
1909 gchar * str_a, * str_b, * str_c;
1910
1911 GtkTextIter bStart;
1912 GtkTextIter bEnd;
1913
1914 gtk_text_buffer_get_start_iter (buf, & bStart);
1915 gtk_text_buffer_get_end_iter (buf, & bEnd);
1916 gtk_text_buffer_delete (buf, & bStart, & bEnd);
1917
1918 str = g_strdup_printf (_("# DL-POLY CONTROL file created by %s, %s - %d atoms\n\n"),
1919 PACKAGE,
1920 prepare_for_title(tmp_proj -> name),
1921 tmp_proj -> natomes);
1922 print_info (str, "bold", buf);
1923 g_free (str);
1924
1925
1926 if (tmp_field -> sys_opts[0] != 1.0)
1927 {
1928 print_control_float (buf, tmp_field -> sys_opts[0], _("# Relative dielectric constant = "), NULL, "eps ");
1929 }
1930 if (tmp_field -> sys_opts[1] != 0.0)
1931 {
1932 print_control_float (buf, tmp_field -> sys_opts[1], _("\n# Allowing local variation of system density of: "), " \%", "densvar ");
1933 }
1934 for (i=2; i<10; i++)
1935 {
1936 j = (i < 7) ? i : (i == 7) ? 8 : (i == 8) ? 10 : 14;
1937 if (tmp_field -> sys_opts[j] == 1.0)
1938 {
1939 if (i == 9)
1940 {
1941 k = (int)tmp_field -> sys_opts[15];
1942 print_control_string (buf, rest_key[k], _(sys_info[i-2]), _(rest_inf[k]), sys_key[i-2]);
1943 }
1944 else if (i < 6)
1945 {
1946 print_control_string (buf, sys_string[i-2], _(sys_info[i-2]), NULL, "no ");
1947 }
1948 else
1949 {
1950 print_control_key (buf, _(sys_info[i-2]), sys_key[i-2]);
1951 }
1952 if (i == 6 || i == 7)
1953 {
1954 print_float (buf, tmp_field -> sys_opts[j+1]);
1955 }
1956 else if (i == 8)
1957 {
1958 for (k=1; k<4; k++) print_int (buf, (int)tmp_field -> sys_opts[j+k]);
1959 }
1960 print_info ("\n", NULL, buf);
1961 }
1962 }
1963
1964 if (tmp_field -> vdw_opts[0] == 1.0)
1965 {
1966 print_info (_("\n# Non-bonded short range interactions - type vdW"), NULL, buf);
1967 print_control_float (buf, tmp_field -> vdw_opts[1], _("\n# van der Waals short range cutoff = "), " Ang.", "rvdw ");
1968 if (tmp_field -> vdw_opts[2] == 1.0)
1969 {
1970 print_control_string (buf, "direct", _("\n# Enforce direct calculation of vdW interactions"),
1971 _("\n# Do not work with system using tabulated potentials"), "vdw ");
1972 }
1973 if (tmp_field -> vdw_opts[3] == 1.0)
1974 {
1975 print_control_string (buf, "shift", _("\n# Apply force-shifting for vdW interactions"), NULL, "vdw ");
1976 }
1977 if (tmp_field -> vdw_opts[4] == 1.0)
1978 {
1979 print_control_string (buf, vdw_key[(int)tmp_field -> vdw_opts[5]], _("\n# Apply mixing rule of type: "), eval_vdw[(int)tmp_field -> vdw_opts[5]], "vdw mix ");
1980 }
1981 }
1982 else
1983 {
1984 print_control_string (buf, "vdw", _("\n# No van der Waals interactions (short range)"), NULL, "no ");
1985 }
1986 print_info ("\n\n", NULL, buf);
1987
1988 if (tmp_field -> elec_opts[0] == 1.0)
1989 {
1990 print_info (_("\n# Non-bonded long range interactions"), NULL, buf);
1991 print_control_float (buf, tmp_field -> elec_opts[1], _("\n# Electrostatics long range cutoff = "), " Ang.", "cut ");
1992 if (tmp_field -> elec_opts[2] == 1.0)
1993 {
1994 print_control_float (buf, tmp_field -> elec_opts[3], _("\n# Use optional padding to the cutoff = "), " Ang.", "pad ");
1995 }
1996 if (tmp_field -> elec_opts[4] == 1.0)
1997 {
1998 print_control_key (buf, _("\n# Use extended coulombic exclusion\n"), "exclu");
1999 }
2000 print_info (_("\n# Electrostatics calculated using "), NULL, buf);
2001 print_info (eval_m[(int)tmp_field -> elec_opts[5]], NULL, buf);
2002 print_info ("\n", NULL, buf);
2003 print_info (elec_key[(int)tmp_field -> elec_opts[5]], "bold", buf);
2004 if (tmp_field -> elec_opts[5] == 2.0 || tmp_field -> elec_opts[5] == 6.0 || tmp_field -> elec_opts[5] == 9.0)
2005 {
2006 print_sci (buf, tmp_field -> elec_opts[6]);
2007 }
2008 else if (tmp_field -> elec_opts[5] == 3.0)
2009 {
2010 print_float (buf, tmp_field -> elec_opts[6]);
2011 for (k=7; k<10; k++) print_int (buf, (int)tmp_field -> elec_opts[k]);
2012 }
2013 else if (tmp_field -> elec_opts[5] == 5.0 || tmp_field -> elec_opts[5] == 8.0)
2014 {
2015 print_float (buf, tmp_field -> elec_opts[6]);
2016 }
2017
2018 if (tmp_field -> elec_opts[5] == 2.0 || tmp_field -> elec_opts[5] == 3.0)
2019 {
2020 print_control_int (buf, (int)tmp_field -> elec_opts[10], _("\n# Evaluate k space contribution to the Ewald sum every: "), _(" MD step(s)"), "ewald evalu ");
2021 }
2022 }
2023 else
2024 {
2025 print_control_string (buf, "elec", _("# No electrostatics interactions (long range)"), NULL, "no ");
2026 }
2027 print_info ("\n", NULL, buf);
2028
2029 if (tmp_field -> met_opts[0] == 1.0 || tmp_field -> met_opts[1] == 1.0)
2030 {
2031 print_info (_("\n# Metallic interactions"), NULL, buf);
2032 }
2033 if (tmp_field -> met_opts[0] == 1.0)
2034 {
2035 print_control_string (buf, "direct", _("\n# Enforce direct calculation of metal interactions"), _("\n# This does not work with metal alloy systems using the *EAM* potentials"), "metal ");
2036 }
2037 if (tmp_field -> met_opts[1] == 1.0)
2038 {
2039 print_control_string (buf, "sqrtrho", _("\n# Switch the TABEAM default embedding functions, F, from F(ρ) to F(√ρ)"), NULL, "metal ");
2040 }
2041 if (tmp_field -> met_opts[0] == 1.0 || tmp_field -> met_opts[1] == 1.0) print_info ("\n", NULL, buf);
2042
2043 print_control_string (buf, ens_keyw[tmp_field -> ensemble], _("\n# Thermostat information"), NULL, "ensemble ");
2044 if (tmp_field -> ensemble)
2045 {
2046 switch (tmp_field -> ensemble)
2047 {
2048 case 1:
2049 i = (tmp_field -> thermostat > 6) ? tmp_field -> thermostat + 1 : tmp_field -> thermostat;
2050 break;
2051 default:
2052 i = (! tmp_field -> thermostat) ? 1 : (tmp_field -> thermostat == 3) ? 7 : tmp_field -> thermostat + 2;
2053 break;
2054 }
2055 print_string (buf, thermo_keyw[i]);
2056 if (tmp_field -> ensemble > 1 || tmp_field -> thermostat)
2057 {
2058 if (tmp_field -> ensemble == 1 && tmp_field -> thermostat == 6)
2059 {
2060 str = g_strdup_printf ("s%1d", (int)tmp_field -> thermo_opts[0]+1);
2061 print_string (buf, str);
2062 g_free (str);
2063 print_float (buf, tmp_field -> thermo_opts[1]);
2064 }
2065 else
2066 {
2067 if (tmp_field -> ensemble == 3 && tmp_field -> thermo_opts[3] > 0.0) print_string (buf, "Q");
2068 print_float (buf, tmp_field -> thermo_opts[0]);
2069 if (tmp_field -> ensemble != 1 || (tmp_field -> thermostat == 2 || tmp_field -> thermostat == 5 || tmp_field -> thermostat > 6))
2070 {
2071 print_float (buf, tmp_field -> thermo_opts[1]);
2072 if (tmp_field -> ensemble == 1 && tmp_field -> thermostat > 6) print_float (buf, tmp_field -> thermo_opts[2]);
2073 }
2074 }
2075 if (tmp_field -> ensemble == 3 && tmp_field -> thermo_opts[3] > 0.0)
2076 {
2077 i = (int)tmp_field -> thermo_opts[3] - 1;
2078 print_string (buf, area_keyw[i]);
2079 if (tmp_field -> thermo_opts[3] == 2.0) print_float (buf, tmp_field -> thermo_opts[4]);
2080 }
2081 if (tmp_field -> thermo_opts[5] == 1.0) print_string (buf, "semi");
2082 }
2083 }
2084
2085 print_info ("\n\n", NULL, buf);
2086 if (tmp_field -> thermo_opts[6] == 1.0)
2087 {
2088 print_info (_("# Attach a pseudo thermal bath with:\n"), NULL, buf);
2089 if (tmp_field -> thermo_opts[7] > 0.0)
2090 {
2091 str = g_strdup_printf (_("# - thermostat of type: %s\n"), pseudo_thermo[(int)tmp_field -> thermo_opts[7] - 1]);
2092 }
2093 else
2094 {
2095 str = g_strdup_printf (_("# - thermostats of type Langevin and Direct applied successively\n"));
2096 }
2097 print_info (str, NULL, buf);
2098 g_free (str);
2099 str = g_strdup_printf (_("# - thickness of thermostat layer to MD cell boundaries: %f Ang.\n"), tmp_field -> thermo_opts[8]);
2100 print_info (str, NULL, buf);
2101 g_free (str);
2102 if (tmp_field -> thermo_opts[9] > 0.0)
2103 {
2104 str = g_strdup_printf (_("# - Target temperature: %f K\n"), tmp_field -> thermo_opts[9]);
2105 print_info (str, NULL, buf);
2106 g_free (str);
2107 }
2108 else
2109 {
2110 print_info (_("# - Target temperature: system target temperature\n"), NULL, buf);
2111 }
2112 print_info ("pseudo ", "bold", buf);
2113 if (tmp_field -> thermo_opts[7] > 0.0)
2114 {
2115 print_info (pseudo_thermo[(int)tmp_field -> thermo_opts[7] - 1], "bold_green", buf);
2116 }
2117 print_float (buf, tmp_field -> thermo_opts[8]);
2118 if (tmp_field -> thermo_opts[9] > 0.0) print_float (buf, tmp_field -> thermo_opts[9]);
2119 print_info ("\n\n", NULL, buf);
2120 }
2121
2122 // MD information
2123 print_info (_("# Molecular dynamics information\n"), NULL, buf);
2124 for (i=0; i<2+(int)tmp_field -> md_opts[1]; i++)
2125 {
2126 print_control_key (buf, _(md_text[i]), md_keyw[i]);
2127 switch (i)
2128 {
2129 case 0:
2130 print_float (buf, tmp_field -> md_opts[0]);
2131 if (tmp_field -> ensemble > 1)
2132 {
2133 print_info ("\n", NULL, buf);
2134 print_info (md_keyw[3], "bold", buf);
2135 print_float (buf, tmp_field -> md_opts[5]);
2136 }
2137 break;
2138 case 1:
2139 print_int (buf, (int)tmp_field -> md_opts[2]);
2140 break;
2141 case 2:
2142 print_info ("leapfrog", "bold_green", buf);
2143 break;
2144 }
2145 print_info ("\n", NULL, buf);
2146 }
2147
2148 if (tmp_field -> md_opts[3] == 1.0)
2149 {
2150 print_control_float (buf, tmp_field -> md_opts[4], _("# Variable time step, initial time step = "), " ps", "variable timestep ");
2151 print_control_float (buf, tmp_field -> md_opts[6], _("\n# Maximum time step allowed = "), " ps", "mxstep ");
2152 print_control_float (buf, tmp_field -> md_opts[7], _("\n# Maximum move allowed = "), " Ang.", "maxdis ");
2153 print_control_float (buf, tmp_field -> md_opts[8], _("\n# Minimum move allowed = "), " Ang.", "mindis ");
2154 }
2155 else
2156 {
2157 print_control_float (buf, tmp_field -> md_opts[4], _("# MD time step = "), " fs", "timestep ");
2158 }
2159
2160 print_control_int (buf, (int)tmp_field -> md_opts[9], _("\n# Shake / Rattle iterations limit: "), _(" cycle(s)"), "mxshak ");
2161 print_control_sci (buf, tmp_field -> md_opts[10], _("\n# Shake / Rattle tolerance: "), NULL, "shake ");
2162
2163 if (tmp_field -> md_opts[1] == 1.0)
2164 {
2165 print_control_int (buf, (int)tmp_field -> md_opts[11], _("\n# FIQA iterations limit: "), _(" cycle(s)"), "mxquat ");
2166 print_control_sci (buf, tmp_field -> md_opts[12], _("\n# Quaternion tolerance: "), NULL, "quater ");
2167 }
2168
2169 if (tmp_field -> md_opts[13] == 1.0)
2170 {
2171 print_info (_("\n\n# Initiate impact on particle\n# - with particle index: "), NULL, buf);
2172 str = g_strdup_printf ("%d", (int)tmp_field -> md_opts[14]);
2173 print_info (str, NULL, buf);
2174 print_info (_("\n# - at MD step: "), NULL, buf);
2175 str = g_strdup_printf ("%d", (int)tmp_field -> md_opts[15]);
2176 print_info (str, NULL, buf);
2177 g_free (str);
2178 print_info (_("\n# - with energy (k eV): "), NULL, buf);
2179 str = g_strdup_printf ("%f", tmp_field -> md_opts[16]);
2180 print_info (str, NULL, buf);
2181 g_free (str);
2182 print_info (_("\n# - direction (x, y, z): "), NULL, buf);
2183 str = g_strdup_printf ("%f %f %f", tmp_field -> md_opts[17], tmp_field -> md_opts[18], tmp_field -> md_opts[19]);
2184 print_info (str, NULL, buf);
2185 g_free (str);
2186 print_info ("\n", NULL, buf);
2187 print_info ("impact ", "bold", buf);
2188 for (k=14; k<16; k++) print_int (buf, (int)tmp_field -> md_opts[k]);
2189 for (k=16; k<20; k++) print_float (buf, tmp_field -> md_opts[k]);
2190 }
2191
2192
2193 if (tmp_field -> equi_opts[0] == 1.0)
2194 {
2195 // Equilibration information
2196 print_info (_("\n\n# Equilibration information"), NULL, buf);
2197 print_control_int (buf, (int)tmp_field -> equi_opts[1], _("\n# Equilibrate during: "), _(" MD step(s)"), "equil ");
2198 if (tmp_field -> equi_opts[2] == 1.0)
2199 {
2200 print_control_int (buf, (int)tmp_field -> equi_opts[3], _("\n# During equilibration: rescale system temperature every: "), _(" MD step(s)"), "scale ");
2201 }
2202 if (tmp_field -> equi_opts[4] == 1.0)
2203 {
2204 print_control_float (buf, tmp_field -> equi_opts[5], _("\n# During equilibration: cap forces, with fmax= "), " Kb T Ang-1", "cap ");
2205 }
2206 if (tmp_field -> equi_opts[6] == 1.0)
2207 {
2208 print_control_int (buf, (int)tmp_field -> equi_opts[7], _("\n# During equilibration: resample the instantaneous momenta distribution every: "), _(" MD step(s)"), "regaus ");
2209 }
2210 if (tmp_field -> equi_opts[8] == 1.0)
2211 {
2212 str = g_strdup_printf (_("\n# Every %d step(s) during equilibration: minimize %s with target %s= %f\n"),
2213 (int)tmp_field -> equi_opts[11], min_key[(int)tmp_field -> equi_opts[9]], min_key[(int)tmp_field -> equi_opts[9]], tmp_field -> equi_opts[10]);
2214 print_control_key (buf, str, "minim ");
2215 g_free (str);
2216 print_string (buf, min_key[(int)tmp_field -> equi_opts[9]]);
2217 print_int (buf, (int)tmp_field -> equi_opts[11]);
2218 print_float (buf, tmp_field -> equi_opts[10]);
2219 print_info ("\n", NULL, buf);
2220 }
2221 if (tmp_field -> equi_opts[12] == 1.0)
2222 {
2223 str = g_strdup_printf (_("# At the start of the equilibration: minimize %s with target %s= %f\n"),
2224 min_key[(int)tmp_field -> equi_opts[13]], min_key[(int)tmp_field -> equi_opts[13]], tmp_field -> equi_opts[14]);
2225 print_control_key (buf, str, "optim ");
2226 g_free (str);
2227 print_string (buf, min_key[(int)tmp_field -> equi_opts[13]]);
2228 print_float (buf, tmp_field -> equi_opts[14]);
2229 print_info ("\n", NULL, buf);
2230 }
2231 if (tmp_field -> equi_opts[15] == 1.0)
2232 {
2233 print_control_key (buf, _("# During equilibration: perform a zero temperature MD minimization\n"), "zero");
2234 print_info ("\n", NULL, buf);
2235 }
2236 if (tmp_field -> equi_opts[16] == 1.0)
2237 {
2238 print_control_key (buf, _("# Include equilibration data in overall statistics\n"), "collect");
2239 print_info ("\n", NULL, buf);
2240 }
2241 }
2242
2243 if (print_ana())
2244 {
2245 print_info (_("\n# Analysis information"), NULL, buf);
2246 if (tmp_field -> ana_opts[0] == 1.0)
2247 {
2248 print_control_string (buf, "all", _("\n# Calculate and collect all intra-molecular PDFs"), NULL, "ana ");
2249 for (k=1; k<3; k++) print_int (buf, (int)tmp_field -> ana_opts[k]);
2250 print_float (buf, tmp_field -> ana_opts[3]);
2251 }
2252 if (tmp_field -> ana_opts[4] == 1.0)
2253 {
2254 print_control_string (buf, "bon", _("\n# Calculate and collect bonds PDFs"), NULL, "ana ");
2255 for (k=5; k<6; k++) print_int (buf, (int)tmp_field -> ana_opts[k]);
2256 print_float (buf, tmp_field -> ana_opts[7]);
2257 }
2258 if (tmp_field -> ana_opts[8] == 1.0)
2259 {
2260 print_control_string (buf, "ang", _("\n# Calculate and collect angles PDFs"), NULL, "ana ");
2261 for (k=9; k<11; k++) print_int (buf, (int)tmp_field -> ana_opts[k]);
2262 }
2263 if (tmp_field -> ana_opts[11] == 1.0)
2264 {
2265 print_control_string (buf, "dih", _("\n# Calculate and collect dihedrals PDFs"), NULL, "ana ");
2266 for (k=12; k<14; k++) print_int (buf, (int)tmp_field -> ana_opts[k]);
2267 }
2268 if (tmp_field -> ana_opts[14] == 1.0)
2269 {
2270 print_control_string (buf, "inv", _("\n# Calculate and collect inversions PDFs"), NULL, "ana ");
2271 for (k=15; k<17; k++) print_int (buf, (int)tmp_field -> ana_opts[k]);
2272 }
2273 print_control_string (buf, "ana", _("\n# Print any opted for analysis inter and intra-molecular PDFs"), NULL, "print ");
2274 }
2275
2276 print_info ("\n", NULL, buf);
2277
2278 if (tmp_field -> out_opts[21] == 1.0 || tmp_field -> out_opts[27] == 1.0)
2279 {
2280 print_control_float (buf, tmp_field -> out_opts[23], _("\n# Bin size for RDfs and Z-density distribution: "), " Ang.", "binsize ");
2281 }
2282 if (tmp_field -> out_opts[21] == 1.0)
2283 {
2284 print_control_int (buf, (int)tmp_field -> out_opts[22], _("\n# Calculate and collect radial distribution functions every: "), _(" MD step(s)"), "rdf ");
2285 print_info ("\n", NULL, buf);
2286 print_control_string (buf, "rdf", NULL, NULL, "print ");
2287 }
2288 if (tmp_field -> out_opts[27] == 1.0)
2289 {
2290 print_control_int (buf, (int)tmp_field -> out_opts[28], _("\n# Calculate and collect Z-density profile every: "), _(" MD step(s)"), "zden ");
2291 print_info ("\n", NULL, buf);
2292 print_control_string (buf, "zden", NULL, NULL, "print ");
2293 }
2294 if (tmp_field -> out_opts[24] == 1.0)
2295 {
2296 print_control_key (buf, _("\n# Velocity autocorrelation functions, VAFs\n"), "vaf ");
2297 for (k=25; k<27; k++) print_int (buf, (int)tmp_field -> out_opts[k]);
2298 print_info ("\n", NULL, buf);
2299 print_control_string (buf, "vaf", NULL, NULL, "print ");
2300 if (tmp_field -> out_opts[29] == 1.0)
2301 {
2302 print_control_string (buf, "vafav", _("\n# Ignore time averaging for the VAFs"), NULL, "no ");
2303 }
2304 }
2305
2306 if ((int)tmp_field -> out_opts[0] || (int)tmp_field -> out_opts[4] || (int)tmp_field -> out_opts[8]
2307 || (int)tmp_field -> out_opts[12] || (int)tmp_field -> out_opts[15] || (int)tmp_field -> out_opts[17] || (int)tmp_field -> out_opts[19])
2308 {
2309 print_info (_("\n\n# Output information"), NULL, buf);
2310 if ((int)tmp_field -> out_opts[0])
2311 {
2312 print_control_key (buf, _("\n# Write defects trajectory file, DEFECTS\n"), "defe ");
2313 for (k=1; k<3; k++) print_int (buf, (int)tmp_field -> out_opts[k]);
2314 print_float (buf, tmp_field -> out_opts[3]);
2315 }
2316 if ((int)tmp_field -> out_opts[4])
2317 {
2318 print_control_key (buf, _("\n# Write displacement trajectory file, RSDDAT\n"), "disp ");
2319 for (k=5; k<7; k++) print_int (buf, (int)tmp_field -> out_opts[k]);
2320 print_float (buf, tmp_field -> out_opts[7]);
2321 }
2322 if ((int)tmp_field -> out_opts[8])
2323 {
2324 print_control_key (buf, _("\n# Write HISTORY file\n"), "traj ");
2325 for (k=9; k<11; k++) print_int (buf, (int)tmp_field -> out_opts[k]);
2326 print_float (buf, tmp_field -> out_opts[11]);
2327 }
2328 if ((int)tmp_field -> out_opts[12])
2329 {
2330 print_control_key (buf, _("\n# Write MSDTMP file\n"), "msdtmp ");
2331 for (k=13; k<15; k++) print_int (buf, (int)tmp_field -> out_opts[k]);
2332 }
2333 if ((int)tmp_field -> out_opts[15])
2334 {
2335 print_control_int (buf, (int)tmp_field -> out_opts[16], _("\n# Print system data every: "), _(" MD step(s)"), "print ");
2336 }
2337 if ((int)tmp_field -> out_opts[17])
2338 {
2339 print_control_int (buf, (int)tmp_field -> out_opts[18], _("\n# Accumulate statics data every: "), _(" MD step(s)"), "stats ");
2340 }
2341 if ((int)tmp_field -> out_opts[19])
2342 {
2343 print_control_int (buf, (int)tmp_field -> out_opts[20], _("\n# Set rolling average stack to: "), _(" MD step(s)"), "stack ");
2344 }
2345 }
2346
2347 print_control_int (buf, (int)tmp_field -> out_opts[30], _("\n# Dump restart information every: "), _(" MD step(s)"), "dump ");
2348
2349 for (i=0; i<2; i++)
2350 {
2351 if (tmp_field -> io_opts[2*i] == 1.0)
2352 {
2353 print_control_float (buf, tmp_field -> io_opts[2*i+1], _(time_inf[i]), " s", time_key[i]);
2354 }
2355 }
2356 print_info ("\n", NULL, buf);
2357 for (i=0; i<2; i++)
2358 {
2359 j=4 + i*6;
2360 if (tmp_field -> io_opts[j] == 1.0)
2361 {
2362 j ++;
2363 print_info (_(io_inf[i]), NULL, buf);
2364 print_info (_("# - method = "), NULL, buf);
2365 print_info (io_rw_m[(int)tmp_field -> io_opts[j]], NULL, buf);
2366 j++;
2367 if (i)
2368 {
2369 if (tmp_field -> io_opts[j-1] == 3.0)
2370 {
2371 print_info (_("\n# - precision = "), NULL, buf);
2372 print_info (io_pres[(int)tmp_field -> io_opts[j]], NULL, buf);
2373 }
2374 j ++;
2375 print_info (_("\n# - type = "), NULL, buf);
2376 print_info (io_typ[(int)tmp_field -> io_opts[j]], NULL, buf);
2377 j++;
2378 }
2379 if (tmp_field -> io_opts[4+7*i] != 2.0)
2380 {
2381 print_info (_("\n# - j, reader count = "), NULL, buf);
2382 str_a = g_strdup_printf ("%d", (int)tmp_field -> io_opts[j]);
2383 print_info (str_a, NULL, buf);
2384 }
2385 j++;
2386 if (tmp_field -> io_opts[4+7*i] != 2.0)
2387 {
2388 print_info (_("\n# - k, batch size = "), NULL, buf);
2389 str_b = g_strdup_printf ("%d", (int)tmp_field -> io_opts[j]);
2390 print_info (str_b, NULL, buf);
2391 }
2392 j++;
2393 print_info (_("\n# - l, buffer size = "), NULL, buf);
2394 str_c = g_strdup_printf ("%d", (int)tmp_field -> io_opts[j]);
2395 print_info (str_c, NULL, buf);
2396 j++;
2397 if (tmp_field -> io_opts[4+7*i] != 2.0)
2398 {
2399 print_info (_("\n# - e, parallel error check is "), NULL, buf);
2400 print_info (io_pec[(int)tmp_field -> io_opts[j]], NULL, buf);
2401 }
2402 print_info (io_key[i], "bold", buf);
2403 print_info (io_meth[(int)tmp_field -> io_opts[5+6*i]], "bold_green", buf);
2404 if (i)
2405 {
2406 if (tmp_field -> io_opts[11] == 3.0)
2407 {
2408 print_info (io_pres[(int)tmp_field -> io_opts[12]], "bold_green", buf);
2409 }
2410 print_info (" ", NULL, buf);
2411 print_info (io_typ[(int)tmp_field -> io_opts[13]], "bold_green", buf);
2412 }
2413 if (tmp_field -> io_opts[4+7*i] != 2.0)
2414 {
2415 print_info (" ", NULL, buf);
2416 print_info (str_a, "bold_blue", buf);
2417 g_free (str_a);
2418 print_info (" ", NULL, buf);
2419 print_info (str_b, "bold_blue", buf);
2420 g_free (str_b);
2421 }
2422 print_info (" ", NULL, buf);
2423 print_info (str_c, "bold_blue", buf);
2424 g_free (str_c);
2425 if (tmp_field -> io_opts[4+7*i] != 2.0)
2426 {
2427 (tmp_field -> io_opts[j] == 0.0) ? print_string (buf, "N") : print_string (buf, "Y");
2428 }
2429 print_info ("\n", NULL, buf);
2430 j++;
2431 }
2432 }
2433 if (tmp_field -> io_opts[18] == 1.0)
2434 {
2435 print_control_key (buf, _("\n# Seeds for the random number generators\n"), "seed ");
2436 for (i=19; i<22; i++) print_int (buf, (int)tmp_field -> io_opts[i]);
2437 print_info ("\n", NULL, buf);
2438 }
2439 if (tmp_field -> io_opts[22] == 1.0)
2440 {
2441 print_control_key (buf, _("\n# Limits to 2 the number of processors in z direction for slab simulations\n"), "slab");
2442 }
2443
2444 print_info ("\n\n", NULL, buf);
2445 print_info ("finish", "bold", buf); // Close the CONTROL file
2446}
insertion_menu mol[]
Definition w_library.c:193
#define PACKAGE
Definition config.h:46
gchar * param[2]
int atoms[NUM_STYLES][2]
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_atom * get_active_atom(int a, int b)
retrieve field atom
Definition dlp_active.c:145
float val
Definition dlp_init.c:117
gchar * eval_vdw[6]
gchar * io_pres[2]
gchar * io_rw_m[4]
gchar * sys_opts[10]
gchar * eval_m[10]
int * atoms_id
double *** cross
Definition dlp_edit.c:418
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
char * fvars_dihedral[2][FDIHEDRAL][FDIHEDRAL_P]
Definition dlp_field.c:540
char * fvars_angle[2][FANGLES][FANGLES_P]
Definition dlp_field.c:462
field_constraint * tmp_fcons
Definition dlp_field.c:1049
int fvalues[2][15][21]
Definition dlp_field.c:345
field_nth_body * tmp_fbody
Definition dlp_field.c:1055
project * tmp_proj
Definition dlp_field.c:1043
field_shell * tmp_fshell
Definition dlp_field.c:1048
field_rigid * tmp_frig
Definition dlp_field.c:1051
int body_at(int b)
find the number of atom(s) in a non bonded interaction
Definition dlp_field.c:1112
field_pmf * tmp_fpmf
Definition dlp_field.c:1050
gchar * fnames[2][16][21]
Definition dlp_field.c:308
field_external * tmp_fext
Definition dlp_field.c:1057
field_atom * tmp_fat
Definition dlp_field.c:1047
int struct_id(int f)
number of atoms in a structural element
Definition dlp_field.c:1089
field_struct * tmp_fstr
Definition dlp_field.c:1054
gchar * parameters_info(int obj, int key, gchar **words, float *data)
prepare classical force field parameter description string
Definition dlp_field.c:1187
field_molecule * tmp_fmol
Definition dlp_field.c:1045
field_atom * tmp_fdt
Definition dlp_field.c:1047
field_prop * tmp_fprop
Definition dlp_field.c:1053
field_tethered * tmp_ftet
Definition dlp_field.c:1052
field_atom * tmp_fct
Definition dlp_field.c:1047
gchar * fkeysw[2][16][21]
Definition dlp_field.c:275
field_atom * tmp_fbt
Definition dlp_field.c:1047
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
Variable declarations for the creation of the DL_POLY input file(s).
angle dihedral_3d(cell_info *cell, int mdstep, atom *at, atom *bt, atom *ct, atom *dt)
dihedral between atom a, b, c and d in 3D
Definition ogl_utils.c:204
angle inversion_3d(cell_info *cell, int mdstep, atom *at, atom *bt, atom *ct, atom *dt)
inversion angle between atom a, b, c and d in 3D
Definition ogl_utils.c:240
#define SEXTERN
Definition dlp_field.h:118
angle angle_3d(cell_info *cell, int mdstep, atom *at, atom *bt, atom *ct)
angle between atom a, b and c in 3D
Definition ogl_utils.c:179
gboolean afp[MAXDATA]
distance distance_3d(cell_info *cell, int mdstep, atom *at, atom *bt)
distance between atom a and b in 3D
Definition ogl_utils.c:81
int multi
Definition dlp_init.c:121
gchar * vdw_key[6]
Definition dlp_print.c:1709
gboolean print_this_imp_inv(imp_inv *inv, int di, int a, int b, int c, int d)
print this improper / inversion structure or not (already printed) ?
Definition dlp_print.c:239
gchar * md_keyw[4]
Definition dlp_print.c:1672
gchar * pseudo_thermo[3]
Definition dlp_print.c:1670
gchar * io_typ[2]
Definition dlp_print.c:1732
void print_dlp_tet(GtkTextBuffer *buf, field_tethered *tet)
print force field tethered potential
Definition dlp_print.c:923
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
void print_sci(GtkTextBuffer *buf, double data)
print float in scientific format
Definition dlp_print.c:1818
void print_dlp_dihedral(int dih, 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
void print_all_field_struct(field_molecule *mol, int str)
print all field structural element(s)
Definition dlp_print.c:195
gchar * io_inf[2]
Definition dlp_print.c:1728
gchar * ens_keyw[4]
Definition dlp_print.c:1668
void print_dlp_atom(GtkTextBuffer *buf, int at, int numat)
print force field atom
Definition dlp_print.c:1011
void print_dlp_tersoff(GtkTextBuffer *buf, field_nth_body *body)
print force field Tersoff potential
Definition dlp_print.c:1359
void print_dlp_pmf(GtkTextBuffer *buf, field_pmf *pmf)
print force field mean force potential
Definition dlp_print.c:947
void print_control_int(GtkTextBuffer *buf, int data, gchar *info_a, gchar *info_b, gchar *key)
print CONTROL file print integer value
Definition dlp_print.c:1760
void print_control_string(GtkTextBuffer *buf, gchar *string, gchar *info_a, gchar *info_b, gchar *key)
print CONTROL file print string
Definition dlp_print.c:1873
void print_dlp_improper_inversion(int di, GtkTextBuffer *buf, field_struct *dhii, 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
void print_dlp_tersoff_cross(GtkTextBuffer *buf, field_nth_body *body_a, field_nth_body *body_b)
print Tersoff potential cross term
Definition dlp_print.c:1334
void print_dlp_molecule(GtkTextBuffer *buf, field_molecule *fmol)
print force field molecule
Definition dlp_print.c:1066
gchar * sys_key[8]
Definition dlp_print.c:1719
void print_dlp_control(GtkTextBuffer *buf)
print DL-POLY CONTROL file
Definition dlp_print.c:1905
gchar * time_key[2]
Definition dlp_print.c:1727
gchar * sys_string[8]
Definition dlp_print.c:1720
gboolean member_of_atom(field_atom *fat, int id)
is the id atom from the model in target field atom
Definition dlp_print.c:277
void print_control_float(GtkTextBuffer *buf, double data, gchar *info_a, gchar *info_b, gchar *key)
print CONTROL file print float value
Definition dlp_print.c:1798
int get_num_vdw_max()
Get the number of field shell interactions.
Definition dlp_edit.c:2009
int get_pbc()
get the PBC DL-POLY lattice type
Definition dlp_print.c:1544
void print_float(GtkTextBuffer *buf, double data)
print float value
Definition dlp_print.c:1780
gchar * sys_info[8]
Definition dlp_print.c:1711
gchar * io_pec[2]
Definition dlp_print.c:1731
gchar * thermo_keyw[10]
Definition dlp_print.c:1669
gchar * time_inf[2]
Definition dlp_print.c:1726
gchar * io_meth[4]
Definition dlp_print.c:1730
gchar * rest_key[3]
Definition dlp_print.c:1724
void print_field_prop(field_prop *pro, int st, field_molecule *mol)
print force field property
Definition dlp_print.c:94
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
gchar * area_keyw[5]
Definition dlp_print.c:1671
int get_num_struct_to_print(field_molecule *fmol, int sid)
find the number of structural element(s) to print
Definition dlp_print.c:1034
void print_dlp_body(GtkTextBuffer *buf, field_nth_body *body)
print force field non bonded potential
Definition dlp_print.c:1300
gboolean in_bond(int at, int bd[2])
is atom at in bond bd
Definition dlp_init.c:892
void print_string(GtkTextBuffer *buf, gchar *string)
print string
Definition dlp_print.c:1856
gboolean print_ana()
determine if the analysis information section is required
Definition dlp_print.c:1682
void print_field_struct(field_struct *stru, field_molecule *mol)
print force field structural element
Definition dlp_print.c:154
gchar * rest_inf[3]
Definition dlp_print.c:1721
void print_control_sci(GtkTextBuffer *buf, double data, gchar *info_a, gchar *info_b, gchar *key)
print CONTROL file print float value in scientific format
Definition dlp_print.c:1836
void print_int(GtkTextBuffer *buf, int data)
print integer value
Definition dlp_print.c:1742
void print_dlp_shell(GtkTextBuffer *buf, field_molecule *fmol, field_shell *shell)
print force field core shell
Definition dlp_print.c:994
void print_dlp_rigid(GtkTextBuffer *buf, field_rigid *rig)
print force field rigid
Definition dlp_print.c:885
gchar * md_text[4]
Definition dlp_print.c:1673
void print_dlp_cons(GtkTextBuffer *buf, field_constraint *cons)
print force field constraint
Definition dlp_print.c:977
gchar * elec_key[10]
Definition dlp_print.c:1699
gchar * get_body_element_name(field_nth_body *body, int aid, int nbd)
get field body potential element name
Definition dlp_edit.c:1941
gchar * io_key[2]
Definition dlp_print.c:1729
void print_control_key(GtkTextBuffer *buf, gchar *info, gchar *key)
print CONTROL file print key
Definition dlp_print.c:1891
gchar * min_key[3]
Definition dlp_print.c:1674
gboolean * allocbool(int val)
allocate a gboolean * pointer
Definition global.c:241
int activef
Definition global.c:164
int * allocint(int val)
allocate an int * pointer
Definition global.c:301
#define i18n(String)
Definition global.c:80
gchar * prepare_for_title(gchar *init)
prepare a string for a window title, getting rid of all markup
Definition tools.c:71
void print_info(gchar *str, gchar *stag, GtkTextBuffer *buffer)
print information in GtkTextBuffer
Definition interface.c:869
Messaging function declarations.
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
double angle
Definition glwin.h:116
Definition glwin.h:350
double length
Definition glwin.h:124
imp_inv * prev
Definition dlp_print.c:224
imp_inv * next
Definition dlp_print.c:223