atomes 1.3.1
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
bdcall.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
21
22/*
23* This file: 'bdcall.c'
24*
25* Contains:
26*
27
28 - The callbacks for the bond properties calculation dialog
29
30*
31* List of functions:
32
33 int * save_color_map (glwin * view);
34
35 gboolean run_distance_matrix (GtkWidget * widg, int calc, int up_ngb);
36
37 double get_cutoff (double s_a, double s_b);
38
39 void restore_color_map (glwin * view, int * colm);
40 void recup_dmin_dmax_ (double * min, double * max);
41 void init_bond (project * this_proj);
42 void init_ang (project * this_proj);
43 void initcutoffs (chemical_data * chem, int species);
44 void cutoffsend ();
45 void prep_ogl_bonds ();
46 void update_ang_view (project * this_proj);
47 void update_glwin_after_bonds (int bonding, int * colm);
48 void coordination_info (int sp, double sac, double ssac[active_project -> nspec]);
49 void coordout_ (int * sid, double * sac, double ssac[active_project -> nspec], int * totgsa);
50 void warren_cowley_out_ (int * spa, double ssac[active_project -> nspec]);
51 void cargill_spaepen_out_ (int * spa, double ssac[active_project -> nspec]);
52 void env_info (int sp, int totgsa, int numgsa[totgsa]);
53 void update_angle_view (project * this_proj);
54 void envout_ (int * sid, int * totgsa, int numgsa[* totgsa]);
55
56 G_MODULE_EXPORT void on_calc_bonds_released (GtkWidget * widg, gpointer data);
57
58*/
59
60#include "global.h"
61#include "bind.h"
62#include "interface.h"
63#include "callbacks.h"
64#include "project.h"
65#include "curve.h"
66#include "dlp_field.h"
67#include "glview.h"
68#include "initcoord.h"
69#include "preferences.h"
70
71extern G_MODULE_EXPORT void set_color_map (GtkWidget * widg, gpointer data);
72extern void clean_coord_window (project * this_proj);
73extern G_MODULE_EXPORT void set_filter_changed (GtkComboBox * box, gpointer data);
74
82int * save_color_map (glwin * view)
83{
84 int i;
85 int * colm = allocint (2);
86 for (i=0; i<2; i++) colm[i] = view -> anim -> last -> img -> color_map[i];
87 return colm;
88}
89
98void restore_color_map (glwin * view, int * colm)
99{
100#ifdef GTK3
101 // GTK3 Menu Action To Check
102 int i, j;
103 gboolean was_input = reading_input;
104 reading_input = TRUE;
105 for (i=0; i<2; i++)
106 {
107 if ((i == 3 || i == 4) && ! view -> adv_bonding[i-3])
108 {
109 j = i*ATOM_MAPS;
110 }
111 else
112 {
113 j = i*ATOM_MAPS + colm[i];
114 }
115 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> color_styles[j], TRUE);
116 set_color_map (view -> color_styles[j], & view -> colorp[j][0]);
117 }
118 reading_input = was_input;
119#endif
120}
121
130void recup_dmin_dmax_ (double * min, double * max)
131{
132 if (active_project -> analysis)
133 {
134 active_project -> analysis[BND] -> min = * min;
135 active_project -> analysis[BND] -> max = * max;
136 }
137}
138
146void init_bond (project * this_proj)
147{
148 int i, j, k;
149
150 k = 0;
151 for ( i = 0 ; i < this_proj -> nspec ; i++ )
152 {
153 for ( j = 0 ; j < this_proj -> nspec ; j++ )
154 {
155 this_proj -> analysis[BND] -> curves[k] -> name = g_strdup_printf("Dij [%s-%s]", active_chem -> label[i], active_chem -> label[j]);
156 k=k+1;
157 }
158 }
159 add_curve_widgets (this_proj, BND);
160 this_proj -> analysis[BND] -> init_ok = TRUE;
161}
162
170void init_ang (project * this_proj)
171{
172 int h, i, j, k, l;
173
174 h=0;
175 for ( i = 0 ; i < this_proj -> nspec ; i++ )
176 {
177 for ( j = 0 ; j < this_proj -> nspec ; j++ )
178 {
179 for ( k = 0 ; k < this_proj -> nspec ; k++ )
180 {
181 this_proj -> analysis[ANG] -> curves[h] -> name = g_strdup_printf(_("Angles [%s-%s-%s]"),
182 active_chem -> label[i],
183 active_chem -> label[j],
184 active_chem -> label[k]);
185 h=h+1;
186 }
187 }
188 }
189 for ( i = 0 ; i < this_proj -> nspec ; i++ )
190 {
191 for ( j = 0 ; j < this_proj -> nspec ; j++ )
192 {
193 for ( k = 0 ; k < this_proj -> nspec ; k++ )
194 {
195 for ( l = 0 ; l < this_proj -> nspec ; l++ )
196 {
197 this_proj -> analysis[ANG] -> curves[h] -> name = g_strdup_printf(_("Dihedrals [%s-%s-%s-%s]"),
198 active_chem -> label[i], active_chem -> label[j],
199 active_chem -> label[k], active_chem -> label[l]);
200 h=h+1;
201 }
202 }
203 }
204 }
205 add_curve_widgets (this_proj, ANG);
206 this_proj -> analysis[ANG] -> init_ok = TRUE;
207}
208
217double get_cutoff (double s_a, double s_b)
218{
220 {
222 int z_a = min (s_a, s_b);
223 int z_b = max (s_a, s_b);
224 while (cut)
225 {
226 if (cut -> Z[0] == z_a && cut -> Z[1] == z_b) return cut -> cutoff;
227 cut = cut -> next;
228 }
229 return 0.0;
230 }
231 else
232 {
233 return 0.0;
234 }
235}
236
245void initcutoffs (chemical_data * chem, int species)
246{
247 int i, j;
248 for (i = 0; i < species; i++)
249 {
250 chem -> cutoffs[i][i] = (chem -> cutoffs[i][i] != 0.0) ? chem -> cutoffs[i][i] : get_cutoff (chem -> chem_prop[CHEM_Z][i], chem -> chem_prop[CHEM_Z][i]);
251 if (chem -> cutoffs[i][i] == 0.0)
252 {
253 chem -> cutoffs[i][i] = 2.0*chem -> chem_prop[CHEM_R][i];
254 chem -> cutoffs[i][i] = max(MINCUT, chem -> cutoffs[i][i]);
255 if (chem -> chem_prop[CHEM_Z][i] == 1.0) chem -> cutoffs[i][i] = 0.5;
256 }
257 }
258 for (i = 0; i < species-1; i++)
259 {
260 for (j = i+1; j < species; j++)
261 {
262 chem -> cutoffs[i][j] = (chem -> cutoffs[i][j] != 0.0) ? chem -> cutoffs[i][j] : get_cutoff (chem -> chem_prop[CHEM_Z][i], chem -> chem_prop[CHEM_Z][j]);
263 if (chem -> cutoffs[i][j] == 0.0)
264 {
265 chem -> cutoffs[i][j] = chem -> chem_prop[CHEM_R][i] + chem -> chem_prop[CHEM_R][j];
266 chem -> cutoffs[i][j] = max(MINCUT, chem -> cutoffs[i][j]);
267 if (chem -> chem_prop[CHEM_Z][i] == 1.0 && chem -> chem_prop[CHEM_Z][j] == 6.0) chem -> cutoffs[i][j] = 1.2;
268 if (chem -> chem_prop[CHEM_Z][j] == 1.0 && chem -> chem_prop[CHEM_Z][i] == 6.0) chem -> cutoffs[j][i] = 1.2;
269 if (chem -> chem_prop[CHEM_Z][i] == 1.0 && chem -> chem_prop[CHEM_Z][j] == 8.0) chem -> cutoffs[i][j] = 1.2;
270 if (chem -> chem_prop[CHEM_Z][j] == 1.0 && chem -> chem_prop[CHEM_Z][i] == 8.0) chem -> cutoffs[j][i] = 1.2;
271 }
272 chem -> cutoffs[j][i] = chem -> cutoffs[i][j];
273 }
274 }
275 chem -> grtotcutoff = (chem -> grtotcutoff != 0.0) ? chem -> grtotcutoff : default_totcut;
276 if (chem -> grtotcutoff == 0.0)
277 {
278 for (i = 0; i < species; i++)
279 {
280 chem -> grtotcutoff += chem -> chem_prop[CHEM_R][i];
281 }
282 chem -> grtotcutoff *= 2.0;
283 chem -> grtotcutoff /= species;
284 chem -> grtotcutoff = max(MINCUT, chem -> grtotcutoff);
285 }
286}
287
294{
295 int i, j;
296
297 if (active_chem -> cutoffs == NULL)
298 {
299 active_chem -> cutoffs = allocddouble (active_project -> nspec, active_project -> nspec);
300 }
301 for ( i=0; i < active_project -> nspec; i++)
302 {
303 for (j=0; j < active_project -> nspec; j++)
304 {
305 // g_debug ("cut[%d,%d]= %f", i+1, j+1, active_chem -> cutoffs[i][j]);
306 sendcuts_ (& i, & j, & active_chem -> cutoffs[i][j]);
307 }
308 }
309 i = active_project -> nspec;
310 // g_debug ("totcut= %f", active_chem -> grtotcutoff);
311 sendcuts_ (& i, & i, & active_chem -> grtotcutoff);
312}
313
320{
321 int i;
322 active_glwin -> bonding = FALSE;
323#ifdef GTK3
324 // GTK3 Menu Action To Check
325 for (i=0; i<ATOM_MAPS+POLY_MAPS; i++)
326 {
327 widget_set_sensitive (active_glwin -> color_styles[i], 0);
328 }
329 for (i=1; i<OGL_COORDS; i++)
330 {
331 widget_set_sensitive (active_glwin -> ogl_coord[i], 0);
332 }
333#endif
334 active_image -> color_map[0] = 0;
335 active_image -> color_map[1] = 0;
336 for (i=0; i<2; i++)
337 {
338 if (active_glwin -> gcid[i]) g_free (active_glwin -> gcid[i]);
339 active_glwin -> gcid[i] = NULL;
340 active_coord -> totcoord[i] = 0;
341 }
342 if (! active_project -> dmtx)
343 {
344 active_glwin -> allbonds[0] = 0;
345 active_glwin -> allbonds[1] = 0;
346 }
347 if (frag_update)
348 {
349 if (active_glwin -> gcid[2]) g_free (active_glwin -> gcid[2]);
350 active_glwin -> gcid[2] = NULL;
351 active_coord -> totcoord[2] = 0;
352 active_glwin -> adv_bonding[0] = FALSE;
353 }
354 if (mol_update)
355 {
356 if (active_glwin -> gcid[3]) g_free (active_glwin -> gcid[3]);
357 active_glwin -> gcid[3] = NULL;
358 active_coord -> totcoord[3] = 0;
359 active_glwin -> adv_bonding[1] = FALSE;
360 }
361}
362
372gboolean run_distance_matrix (GtkWidget * widg, int calc, int up_ngb)
373{
374 int i, j, k;
375 gboolean res;
376 if (up_ngb)
377 {
378 for (i=0; i < active_project -> steps; i++)
379 {
380 for (j=0; j < active_project -> natomes; j++)
381 {
382 active_project -> atoms[i][j].cloned = FALSE;
383 if (active_project -> atoms[i][j].numv)
384 {
385 active_project -> atoms[i][j].numv = 0;
386 if (active_project -> atoms[i][j].vois)
387 {
388 g_free (active_project -> atoms[i][j].vois);
389 active_project -> atoms[i][j].vois = NULL;
390 }
391 }
392 }
393 }
394 }
395 i = j = 0;
396 k = up_ngb;;
397 if (calc > 3 && calc < 6) i = 1;
398 if (calc > 0 && calc < 6)
399 {
400 j = active_project -> rsparam[calc-1][4];
401 }
402 else if (calc == 6)
403 {
404 j = active_project -> csparam[3];
405 }
406#ifdef DEBUG
407 g_debug ("Run dmtx Prim= %d, NOHP= %d, UPDATE= %d", i, j, k);
408#endif
409 clock_gettime (CLOCK_MONOTONIC, & start_time);
410 res = rundmtx_ (& i, & j, & k);
411 clock_gettime (CLOCK_MONOTONIC, & stop_time);
412// #ifdef DEBUG
413 g_print ("Time to calculate distance matrix: %s\n", calculation_time(FALSE, get_calc_time (start_time, stop_time)));
414// #endif
415 return res;
416}
417
425void update_ang_view (project * this_proj)
426{
427 gchar * str;
428
429 if (this_proj -> analysis[ANG] -> calc_buffer == NULL) this_proj -> analysis[ANG] -> calc_buffer = add_buffer (NULL, NULL, NULL);
430 view_buffer (this_proj -> analysis[ANG] -> calc_buffer);
431 print_info (_("\n\nAngles and diherdrals distribution(s)\n\n"), "heading", this_proj -> analysis[ANG] -> calc_buffer);
432 print_info (_("Calculation details:\n\n"), NULL, this_proj -> analysis[ANG] -> calc_buffer);
433 print_info (_("\tAngular space discretization:\n\n"), NULL, this_proj -> analysis[ANG] -> calc_buffer);
434 print_info (_("\t - Number of δ° steps: "), "bold", this_proj -> analysis[ANG] -> calc_buffer);
435 str = g_strdup_printf ("%d", this_proj -> analysis[ANG] -> num_delta);
436 print_info (str, "bold_blue", this_proj -> analysis[ANG] -> calc_buffer);
437 g_free (str);
438 print_info (_("\n\n\t between 0.0 and 180.0"), NULL, this_proj -> analysis[ANG] -> calc_buffer);
439 print_info (" °\n\n\t - δ° = ", "bold", this_proj -> analysis[ANG] -> calc_buffer);
440 str = g_strdup_printf ("%f", this_proj -> analysis[ANG] -> delta);
441 print_info (str, "bold_blue", this_proj -> analysis[ANG] -> calc_buffer);
442 g_free (str);
443 print_info (" °\n", "bold", this_proj -> analysis[ANG] -> calc_buffer);
444 print_info (calculation_time(TRUE, this_proj -> analysis[ANG] -> calc_time), NULL, this_proj -> analysis[ANG] -> calc_buffer);
445}
446
455void update_glwin_after_bonds (int bonding, int * colm)
456{
458#ifdef GTK3
459 // GTK3 Menu Action To Check
460 if (active_glwin -> init)
461 {
462 prep_all_coord_menus (active_glwin);
464 widget_set_sensitive (active_glwin -> ogl_clones[0], active_glwin -> allbonds[1]);
465 }
466#endif
467 int shaders[5] = {ATOMS, BONDS, POLYS, RINGS, SELEC};
469 active_glwin -> create_shaders[MEASU] = TRUE;
470 active_glwin -> create_shaders[PICKS] = TRUE;
472 if (active_glwin -> init)
473 {
475 g_free (colm);
476 }
477
478 int i, j;
479 for (i=2; i<7; i++)
480 {
481 if (i != 5)
482 {
483 if (active_glwin -> search_widg[i])
484 {
485 if (active_glwin -> search_widg[i] -> filter_box)
486 {
487 if (GTK_IS_WIDGET(active_glwin -> search_widg[i] -> filter_box))
488 {
489 if (active_glwin -> atom_win -> adv_bonding[1] && ! active_glwin -> adv_bonding[1])
490 {
491 gtk_combo_box_text_remove ((GtkComboBoxText *) active_glwin -> search_widg[i] -> filter_box, 4);
492 }
493 else if (! active_glwin -> atom_win -> adv_bonding[0] && active_glwin -> adv_bonding[0])
494 {
495 combo_text_append (active_glwin -> search_widg[i] -> filter_box, _("Fragment"));
496 }
497 if (active_glwin -> atom_win -> adv_bonding[0] && ! active_glwin -> adv_bonding[0])
498 {
499 gtk_combo_box_text_remove ((GtkComboBoxText *) active_glwin -> search_widg[i] -> filter_box, 3);
500 }
501 else if (! active_glwin -> atom_win -> adv_bonding[1] && active_glwin -> adv_bonding[1])
502 {
503 combo_text_append (active_glwin -> search_widg[i] -> filter_box, _("Molecule"));
504 }
505 j = active_glwin -> search_widg[i] -> object + active_glwin -> search_widg[i] -> filter;
506 if (j == 4)
507 {
508 set_filter_changed (GTK_COMBO_BOX(active_glwin -> search_widg[i] -> filter_box), active_glwin -> search_widg[i]);
509 }
510 }
511 }
512 }
513 }
514 }
515 if (active_glwin -> atom_win)
516 {
517 for (i=0; i<2; i++) active_glwin -> atom_win -> adv_bonding[i] = active_glwin -> adv_bonding[i];
518 }
520#ifdef GTK4
521 update_menu_bar (active_glwin);
522#endif
524}
525
532{
533 int i, j, k;
534
535 if (! alloc_contj_voisj_ (& active_project -> natomes, & active_project -> steps)) return 0;
536
537 for (i=0; i<active_project -> steps; i++)
538 {
539 for (j=0; j<active_project -> natomes; j++)
540 {
541 read_contj_ (& j, & i, & active_project -> atoms[i][j].numv);
542 for (k=0; k<active_project -> atoms[i][j].numv; k++)
543 {
544 read_voisj_ (& j, & i, & k, & active_project -> atoms[i][j].vois[k]);
545 }
546 }
547 }
548 return 1;
549}
550
559G_MODULE_EXPORT void on_calc_bonds_released (GtkWidget * widg, gpointer data)
560{
561 int j, k, l, m;
562 int statusb = 0;
563 int bonding = 0;
564 int err_update = 1;
565 int * colm = NULL;
566
567 // intitialize_this_analysis (active_project, BND);
568 gboolean vis_bd = active_project -> analysis[BND] -> calc_ok;
569 if (widg) bonds_update = 1;
570 bonding = (active_project -> runc[0]) ? 1 : 0;
571 if (! bonds_update && active_project -> runc[0]) bonding = 0;
572 if (active_glwin)
573 {
574 if (active_glwin -> init) colm = save_color_map (active_glwin);
576 }
577 cutoffsend ();
578 if (! active_project -> dmtx)
579 {
580 active_project -> dmtx = run_distance_matrix (widg, 0, 1);
581 }
582 else
583 {
584 err_update = update_voisj_and_contj ();
585 }
586
587 if (! active_project -> dmtx)
588 {
589 show_error (_("The nearest neighbors table calculation has failed"), 0, (widg) ? widg : MainWindow);
590 bonding = 0;
591 active_glwin -> adv_bonding[0] = 0;
592 active_glwin -> adv_bonding[1] = 0;
593 }
594 else if (! err_update)
595 {
596 show_error (_("Impossible to update FORTRAN data"), 0, (widg) ? widg : MainWindow);
597 bonding = 0;
598 active_glwin -> adv_bonding[0] = 0;
599 active_glwin -> adv_bonding[1] = 0;
600 }
601 else
602 {
603 //if (bonding && active_project -> steps > 1) statusb = 1;
604 if (bonds_update || active_project -> runc[0] || active_project -> runc[2])
605 {
606 if (! active_project -> analysis[BND] -> init_ok && bonding) init_bond (active_project);
607 if (active_project -> runc[0]) clean_curves_data (BND, 0, active_project -> analysis[BND] -> numc);
608 prepostcalc (widg, FALSE, BND, statusb, opac);
609 l = 0;
610 m = 1;
611 if (active_project -> bondfile != NULL)
612 {
613 l = 1;
614 m = strlen (active_project -> bondfile);
615 }
616 // debug_chemical_information (active_project);
617 active_project -> analysis[BND] -> delta = (active_project -> analysis[BND] -> max-active_project -> analysis[BND] -> min) / active_project -> analysis[BND] -> num_delta;
618 j = bonding_ (& m, & l, & bonding, & active_project -> analysis[BND] -> num_delta, & active_project -> analysis[BND] -> min, & active_project -> analysis[BND] -> delta, active_project -> bondfile);
619 prepostcalc (widg, bonding, BND, (bonding) ? j : vis_bd, 1.0);
620 active_project -> analysis[SPH] -> avail_ok = j;
621 if (! j)
622 {
623 show_error (_("Unexpected error when calculating bond properties"), 0, (widg) ? widg : MainWindow);
624 }
625 else
626 {
627 if (active_glwin -> init && ! atomes_render_image) print_info (calculation_time(TRUE, active_project -> analysis[BND] -> calc_time), NULL, active_project -> analysis[BND] -> calc_buffer);
628 bonding = 1;
629 if (frag_update)
630 {
631 k = active_glwin -> allbonds[0] + active_glwin -> allbonds[1];
632 clock_gettime (CLOCK_MONOTONIC, & start_time);
633 if (! molecules_ (& mol_update, & k))
634 {
635 show_error (_("Unexpected error when looking for isolated fragment(s) and molecule(s)"), 0, (widg) ? widg : MainWindow);
636 if (active_glwin)
637 {
638 for (k=0; k<2; k++)
639 {
640 active_glwin -> adv_bonding[k] = FALSE;
641 if (k)
642 {
643 for (l=0; l<2; l++)
644 {
645 if (active_project -> force_field[l])
646 {
647 g_free (active_project -> force_field[l]);
648 active_project -> force_field[l] = NULL;
649 }
650 }
651 }
652 active_coord -> totcoord[k+2] = 0;
653 }
654 }
655 }
656 else
657 {
658 if (active_glwin)
659 {
660 active_glwin -> adv_bonding[0] = frag_update;
661 active_glwin -> adv_bonding[1] = mol_update;
662 }
663 }
664 clock_gettime (CLOCK_MONOTONIC, & stop_time);
665 // Using the unused RI calc_time slot to store Frag-mol calc time.
666 active_project -> analysis[RIN] -> calc_time = get_calc_time (start_time, stop_time);
668 if (widg != NULL && ! atomes_render_image) show_the_widgets (curvetoolbox);
669 }
670 }
671 }
672 if (active_project -> runc[1])
673 {
674 if (! active_project -> analysis[ANG] -> init_ok) init_ang (active_project);
675 clean_curves_data (ANG, 0, active_project -> analysis[ANG] -> numc);
676 active_project ->analysis[ANG] -> delta = 180.0 / active_project -> analysis[ANG] -> num_delta;
677 j = bond_angles_ (& active_project -> analysis[ANG] -> num_delta);
678 if (! j)
679 {
680 prepostcalc (widg, TRUE, ANG, j, 1.0);
681 show_error (_("Unexpected error when calculating the bond angles distribution"), 0, (widg) ? widg : MainWindow);
682 }
683 else
684 {
685 j = bond_diedrals_ (& active_project -> analysis[ANG] -> num_delta);
686 prepostcalc (widg, TRUE, ANG, j, 1.0);
687 if (! j)
688 {
689 show_error (_("Unexpected error when calculating the dihedral angles distribution"), 0, (widg) ? widg : MainWindow);
690 }
691 else
692 {
693 if (widg != NULL && ! atomes_render_image) show_the_widgets (curvetoolbox);
695 }
696 }
697 }
698 }
699
702 {
704 if (widg) show_the_widgets (curvetoolbox);
705 }
706 if (! widg)
707 {
708 for (j=0; j<3; j++) active_project -> runc[j] = FALSE;
709 }
712}
713
714double bdtc;
715
725void coordination_info (int sp, double sac, double ssac[active_project -> nspec])
726{
727 int j;
728 gchar * str;
729 gchar * spr;
730
731 if (active_project -> analysis[BND] -> calc_buffer == NULL) active_project -> analysis[BND] -> calc_buffer = add_buffer (NULL, NULL, NULL);
732 view_buffer (active_project -> analysis[BND] -> calc_buffer);
733 if (sp == 0)
734 {
735 print_info (_("\n\nBond properties\n\n"), "heading", active_project -> analysis[BND] -> calc_buffer);
736 print_info (_("Existence of a bond between 2 atoms i (α) and j (β)\n"), "italic", active_project -> analysis[BND] -> calc_buffer);
737 print_info (_("if the 2 following conditions are verified:\n\n\t1) D"), "italic", active_project -> analysis[BND] -> calc_buffer);
738 print_info ("ij", "sub_italic", active_project -> analysis[BND] -> calc_buffer);
739 str = g_strdup_printf (_(" < first minimum of the total g(r) (%9.5f Ã… )\n\t2) D"), active_chem -> grtotcutoff);
740 print_info (str, "italic", active_project -> analysis[BND] -> calc_buffer);
741 g_free (str);
742 print_info ("ij", "sub_italic", active_project -> analysis[BND] -> calc_buffer);
743 print_info (" < r", "italic", active_project -> analysis[BND] -> calc_buffer);
744 print_info (_("cut"), "sub_italic", active_project -> analysis[BND] -> calc_buffer);
745 print_info ("(α,β)\n", "italic", active_project -> analysis[BND] -> calc_buffer);
746 bdtc = sac * active_chem -> nsps[sp];
747 }
748 else
749 {
750 bdtc += sac * active_chem -> nsps[sp];
751 }
752 print_info (_("\nCoordination numbers: "), "italic", active_project -> analysis[BND] -> calc_buffer);
753 spr = g_strdup_printf("%s", textcolor(sp));
754 print_info (active_chem -> element[sp], spr, active_project -> analysis[BND] -> calc_buffer);
755 str = g_strdup_printf ("\n\n\t%s", exact_name(active_chem -> label[sp]));
756 print_info (str, spr, active_project -> analysis[BND] -> calc_buffer);
757 g_free (str);
758 print_info (_(" (total)=\t"), "italic", active_project -> analysis[BND] -> calc_buffer);
759 str = g_strdup_printf("%9.5lf\n", sac);
760 print_info (str, "bold", active_project -> analysis[BND] -> calc_buffer);
761 g_free (str);
762 for ( j=0 ; j < active_project -> nspec ; j++ )
763 {
764 str = g_strdup_printf ("\t%s(", active_chem -> label[sp]);
765 print_info (str, spr, active_project -> analysis[BND] -> calc_buffer);
766 g_free (str);
767 str = g_strdup_printf("%s", textcolor(j));
768 print_info (active_chem -> label[j], str, active_project -> analysis[BND] -> calc_buffer);
769 print_info (")", spr, active_project -> analysis[BND] -> calc_buffer);
770 print_info ("[r", NULL, active_project -> analysis[BND] -> calc_buffer);
771 print_info (_("cut"), "sub", active_project -> analysis[BND] -> calc_buffer);
772 print_info ("(", NULL, active_project -> analysis[BND] -> calc_buffer);
773 print_info (active_chem -> label[sp], spr, active_project -> analysis[BND] -> calc_buffer);
774 print_info (",", NULL, active_project -> analysis[BND] -> calc_buffer);
775 print_info (active_chem -> label[j], str, active_project -> analysis[BND] -> calc_buffer);
776 g_free (str);
777 print_info (")= ", NULL, active_project -> analysis[BND] -> calc_buffer);
778 str = g_strdup_printf ("%9.5lf Ã…", active_chem -> cutoffs[sp][j]);
779 print_info (str, NULL, active_project -> analysis[BND] -> calc_buffer);
780 g_free (str);
781 print_info ("] = ", NULL, active_project -> analysis[BND] -> calc_buffer);
782 str = g_strdup_printf ("%9.5lf", ssac[j]);
783 print_info (str, "bold", active_project -> analysis[BND] -> calc_buffer);
784 g_free (str);
785 print_info (_("\t or \t"), NULL, active_project -> analysis[BND] -> calc_buffer);
786 if (sac != 0.0)
787 {
788 str = g_strdup_printf ("%7.3lf", ssac[j]*100.0/(sac));
789 }
790 else
791 {
792 str = g_strdup_printf ("%7.3lf", 0.0);
793 }
794 print_info (str, "bold", active_project -> analysis[BND] -> calc_buffer);
795 g_free (str);
796 print_info (" %\n", NULL, active_project -> analysis[BND] -> calc_buffer);
797 }
798 g_free (spr);
799 if (sp == active_project -> nspec-1)
800 {
801 print_info (_("\nAverage coordination number: "), "italic", active_project -> analysis[BND] -> calc_buffer);
802 str = g_strdup_printf ("%9.5lf\n", bdtc / active_project -> natomes);
803 print_info (str, "bold", active_project -> analysis[BND] -> calc_buffer);
804 g_free (str);
805 }
806}
807
818void coordout_ (int * sid, double * sac, double ssac[active_project -> nspec], int * totgsa)
819{
820 active_coord -> ntg[1][* sid] = * totgsa;
821 if (bonds_update && ! atomes_render_image) coordination_info (* sid, * sac, ssac);
822}
823
832void warren_cowley_out_ (int * spa, double ssac[active_project -> nspec])
833{
834 gchar * str;
835 int id_a = * spa;
836 int id_b = ! id_a;
837 double x_b = ((double)active_chem -> nsps[id_b]) / active_project -> natomes;
838 double p_ab = ssac[id_b] / (ssac[0] + ssac[1]);
839 // Warren-Cowley for binary A x B 1-x systems
840 if (! id_a)
841 {
842 print_info (_("\nWarren-Cowley chemical order parameters for A"), "italic", active_project -> analysis[BND] -> calc_buffer);
843 print_info ("x", "sub_italic", active_project -> analysis[BND] -> calc_buffer);
844 print_info ("B", "italic", active_project -> analysis[BND] -> calc_buffer);
845 print_info ("1-x", "sub_italic", active_project -> analysis[BND] -> calc_buffer);
846 print_info (_(" binary systems:\n\n"), "italic", active_project -> analysis[BND] -> calc_buffer);
847 }
848 print_info ("\tα", NULL, active_project -> analysis[BND] -> calc_buffer);
849 print_info ("l", "sub", active_project -> analysis[BND] -> calc_buffer);
850 print_info ("[", NULL, active_project -> analysis[BND] -> calc_buffer);
851 str = g_strdup_printf("%s", textcolor(id_a));
852 print_info (active_chem -> label[id_a], str, active_project -> analysis[BND] -> calc_buffer);
853 g_free (str);
854 print_info ("]=\t", NULL, active_project -> analysis[BND] -> calc_buffer);
855 double wc_ab = 1.0 - p_ab / x_b;
856 str = g_strdup_printf ("%f\n", wc_ab);
857 print_info (str, "bold", active_project -> analysis[BND] -> calc_buffer);
858 g_free (str);
859}
860
869void cargill_spaepen_out_ (int * spa, double ssac[active_project -> nspec])
870{
871 gchar * str;
872 int id_a = * spa;
873 int id_b = ! id_a;
874 double x_a = ((double)active_chem -> nsps[id_a]) / active_project -> natomes;
875 double x_b = ((double)active_chem -> nsps[id_b]) / active_project -> natomes;
876 double p_ab = ssac[id_b] / (ssac[0] + ssac[1]);
877 // Cargill-Spaepen for metal alloys, also A x B 1-x systems
878 if (! id_a)
879 {
880 print_info (_("\nCargill-Spaepen chemical order parameters for A"), "italic", active_project -> analysis[BND] -> calc_buffer);
881 print_info ("x", "sub_italic", active_project -> analysis[BND] -> calc_buffer);
882 print_info ("B", "italic", active_project -> analysis[BND] -> calc_buffer);
883 print_info ("1-x", "sub_italic", active_project -> analysis[BND] -> calc_buffer);
884 print_info (_(" binary systems:\n\n"), "italic", active_project -> analysis[BND] -> calc_buffer);
885 }
886 print_info ("\tη", NULL, active_project -> analysis[BND] -> calc_buffer);
887 print_info ("[", NULL, active_project -> analysis[BND] -> calc_buffer);
888 str = g_strdup_printf("%s", textcolor(id_a));
889 print_info (active_chem -> label[id_a], str, active_project -> analysis[BND] -> calc_buffer);
890 g_free (str);
891 print_info ("]=\t", NULL, active_project -> analysis[BND] -> calc_buffer);
892 double cs_ab = (p_ab - x_b) / x_a;
893 str = g_strdup_printf ("%f\n", cs_ab);
894 print_info (str, "bold", active_project -> analysis[BND] -> calc_buffer);
895 g_free (str);
896}
897
907void env_info (int sp, int totgsa, int numgsa[totgsa])
908{
909 int i, j, k;
910 int natpg[totgsa];
911 gchar * env;
912 gchar * str, * spr, * snr;
913 int tgsa;
914
915 print_info (_("\nEnvironments for "), "italic", active_project -> analysis[BND] -> calc_buffer);
916 spr = g_strdup_printf ("%s", textcolor(sp));
917 str = g_strdup_printf ("%s", exact_name(active_chem -> label[sp]));
918 print_info (str, spr, active_project -> analysis[BND] -> calc_buffer);
919 g_free (spr);
920 g_free (str);
921 print_info (_(" atoms:\n\n"), "italic", active_project -> analysis[BND] -> calc_buffer);
922 print_info (_("\t \tN(tot)"), NULL, active_project -> analysis[BND] -> calc_buffer);
923 for ( j=0 ; j < active_project -> nspec ; j++ )
924 {
925 snr = g_strdup_printf ("%s", exact_name(active_chem -> label[j]));
926 i = 6 - strlen (snr);
927 for (k=0; k<i; k++) print_info (" ", NULL, active_project -> analysis[BND] -> calc_buffer);
928 str = g_strdup_printf ("N(%s)", snr);
929 spr = g_strdup_printf ("%s", textcolor(j));
930 print_info (str, spr, active_project -> analysis[BND] -> calc_buffer);
931 g_free (spr);
932 g_free (str);
933 g_free (snr);
934 }
935 print_info (_("\tNumber\t\t or \tPercent\n\n"), NULL, active_project -> analysis[BND] -> calc_buffer);
936
937 tgsa = 0;
938 for ( i=0 ; i < totgsa; i++ )
939 {
940 tgsa += numgsa[i];
941 }
942 for ( i=0 ; i < totgsa; i++ )
943 {
944 natpg[i] = 0;
945 for ( j=0 ; j < active_project -> nspec ; j++ )
946 {
947 k = active_coord -> partial_geo[sp][i][j];
948 natpg[i] += k;
949 }
950 print_info ("\t", NULL, active_project -> analysis[BND] -> calc_buffer);
951 spr = env_name (active_project, i, sp, 1, active_project -> analysis[BND] -> calc_buffer);
952 g_free (spr);
953 env = env_name (active_project, i, sp, 0, NULL);
954 spr = g_strdup_printf ("%s", exact_name(env));
955 g_free (env);
956 k = 12 - strlen (spr);
957 g_free (spr);
958 for (j=0; j<k; j++) print_info (" ", NULL, active_project -> analysis[BND] -> calc_buffer);
959 print_info ("\t", NULL, active_project -> analysis[BND] -> calc_buffer);
960 str = g_strdup_printf ("%3d ", natpg[i]);
961 print_info (str, NULL, active_project -> analysis[BND] -> calc_buffer);
962 for ( j=0 ; j < active_project -> nspec ; j++ )
963 {
964 k = active_coord -> partial_geo[sp][i][j];
965 str = g_strdup_printf(" %7d", k);
966 spr = g_strdup_printf ("%s", textcolor(j));
967 print_info (str, spr, active_project -> analysis[BND] -> calc_buffer);
968 g_free (str);
969 g_free (spr);
970 }
971 str = g_strdup_printf(" %16.5lf", (1.0*numgsa[i])/active_project -> steps);
972 print_info (str, "bold", active_project -> analysis[BND] -> calc_buffer);
973 g_free (str);
974 print_info (_("\t or \t"), NULL, active_project -> analysis[BND] -> calc_buffer);
975 str = g_strdup_printf ("%7.3lf ", 100.0*numgsa[i]/tgsa);
976 print_info (str, "bold", active_project -> analysis[BND] -> calc_buffer);
977 g_free (str);
978 print_info ("%\n", "bold", active_project -> analysis[BND] -> calc_buffer);
979 }
980}
981
989void update_angle_view (project * this_proj)
990{
991 gchar * str;
992
993 if (this_proj -> analysis[ANG] -> calc_buffer == NULL) this_proj -> analysis[ANG] -> calc_buffer = add_buffer (NULL, NULL, NULL);
994 view_buffer (this_proj -> analysis[ANG] -> calc_buffer);
995 print_info (_("\n\nAngle distribution function(s)\n\n"), "heading", this_proj -> analysis[ANG] -> calc_buffer);
996 print_info (_("\tAngle space discretization:\n\n"), NULL, this_proj -> analysis[ANG] -> calc_buffer);
997 print_info (_("\t - Number of δ° steps: "), "bold", this_proj -> analysis[ANG] -> calc_buffer);
998 str = g_strdup_printf ("%d", this_proj -> analysis[ANG] -> num_delta);
999 print_info (str, "bold_blue", this_proj -> analysis[ANG] -> calc_buffer);
1000 g_free (str);
1001 print_info (_("\n\n\t between 0.0 and 180.0°\n"), NULL, this_proj -> analysis[ANG] -> calc_buffer);
1002}
1003
1013void envout_ (int * sid, int * totgsa, int numgsa[* totgsa])
1014{
1015 /* Send info for OpenGL */
1016 if (bonds_update && ! atomes_render_image) env_info (* sid, * totgsa, numgsa);
1017}
1018
1019void tetraout_ (int * sid, double eda[active_project -> nspec],
1020 double cda[active_project -> nspec],
1021 double dda[active_project -> nspec],
1022 double tepa[active_project -> nspec],
1023 double tcpa[active_project -> nspec],
1024 double tdda[active_project -> nspec],
1025 double atd[active_project -> nspec],
1026 double etd[active_project -> nspec])
1027{
1028 int i;
1029 gboolean print;
1030 gchar * str;
1031 print=FALSE;
1032 for ( i=0 ; i < active_project -> nspec ; i++)
1033 {
1034 if (eda[i] != 0.0 || cda[i] != 0.0) print=TRUE;
1035 }
1036
1037 if (print && bonds_update && ! atomes_render_image)
1038 {
1039 print_info (_("\nNumber and proportion of tetrahedra links for "), "italic", active_project -> analysis[BND] -> calc_buffer);
1040 print_info (exact_name(active_chem -> label[* sid]), textcolor(* sid), active_project -> analysis[BND] -> calc_buffer);
1041 print_info (_(" atoms:\n\n"), "italic", active_project -> analysis[BND] -> calc_buffer);
1042 for ( i=0 ; i < active_project -> nspec ; i++ )
1043 {
1044 if (eda[i] != 0.0 || cda[i] != 0.0)
1045 {
1046 print_info ("\t- ", NULL, active_project -> analysis[BND] -> calc_buffer);
1047 print_info (exact_name(active_chem -> label[* sid]), textcolor(* sid), active_project -> analysis[BND] -> calc_buffer);
1048 print_info ("(", NULL, active_project -> analysis[BND] -> calc_buffer);
1049 print_info (exact_name(active_chem -> label[i]), textcolor(i), active_project -> analysis[BND] -> calc_buffer);
1050 print_info (")", NULL, active_project -> analysis[BND] -> calc_buffer);
1051 print_info ("4", "sub", active_project -> analysis[BND] -> calc_buffer);
1052 print_info (_(" tetrahedra:\n"), NULL, active_project -> analysis[BND] -> calc_buffer);
1053 if (eda[i] != 0.0)
1054 {
1055 print_info (_("\t\t Edge-sharing: "), NULL, active_project -> analysis[BND] -> calc_buffer);
1056 str = g_strdup_printf("%11.5lf", eda[i]/active_project -> steps);
1057 print_info (str, "bold", active_project -> analysis[BND] -> calc_buffer);
1058 g_free (str);
1059 if (active_project -> steps > 1)
1060 {
1061 str = g_strdup_printf(" +/- %8.5lf", tepa[i]);
1062 print_info (str, "bold", active_project -> analysis[BND] -> calc_buffer);
1063 g_free (str);
1064 }
1065 print_info (_("\t or \t"), NULL, active_project -> analysis[BND] -> calc_buffer);
1066 str = g_strdup_printf("%7.3lf", 100*eda[i]/(eda[i]+cda[i]));
1067 print_info (str, "bold", active_project -> analysis[BND] -> calc_buffer);
1068 g_free (str);
1069 if (active_project -> steps > 1)
1070 {
1071 str = g_strdup_printf(" +/- %7.3lf", 100*tepa[i]*active_project -> steps/(eda[i]+cda[i]));
1072 print_info (str, "bold", active_project -> analysis[BND] -> calc_buffer);
1073 g_free (str);
1074 }
1075 print_info (" %\n", "bold", active_project -> analysis[BND] -> calc_buffer);
1076 }
1077 if (cda[i] != 0.0)
1078 {
1079 print_info (_("\t\t Corner-sharing: "), NULL, active_project -> analysis[BND] -> calc_buffer);
1080 str = g_strdup_printf("%11.5lf", cda[i]/active_project -> steps);
1081 print_info (str, "bold", active_project -> analysis[BND] -> calc_buffer);
1082 g_free (str);
1083 if (active_project -> steps > 1)
1084 {
1085 str = g_strdup_printf(" +/- %8.5lf", tcpa[i]);
1086 print_info (str, "bold", active_project -> analysis[BND] -> calc_buffer);
1087 g_free (str);
1088 }
1089 print_info (_("\t or \t"), NULL, active_project -> analysis[BND] -> calc_buffer);
1090 str = g_strdup_printf("%7.3lf", 100*cda[i]/(eda[i]+cda[i]));
1091 print_info (str, "bold", active_project -> analysis[BND] -> calc_buffer);
1092 g_free (str);
1093 if (active_project -> steps > 1)
1094 {
1095 str = g_strdup_printf(" +/- %7.3lf", 100*tcpa[i]*active_project -> steps/(eda[i]+cda[i]));
1096 print_info (str, "bold", active_project -> analysis[BND] -> calc_buffer);
1097 g_free (str);
1098 }
1099 print_info (" %\n", "bold", active_project -> analysis[BND] -> calc_buffer);
1100 }
1101 if (dda[i] != 0.0)
1102 {
1103 print_info (_("\t\t with the following bond defects: "), NULL, active_project -> analysis[BND] -> calc_buffer);
1104 str = g_strdup_printf("%11.5lf", dda[i]/active_project -> steps);
1105 print_info (str, "bold", active_project -> analysis[BND] -> calc_buffer);
1106 g_free (str);
1107 if (active_project -> steps > 1)
1108 {
1109 str = g_strdup_printf(" +/- %8.5lf", tdda[i]);
1110 print_info (str, "bold", active_project -> analysis[BND] -> calc_buffer);
1111 g_free (str);
1112 }
1113 print_info (_("\t or \t"), NULL, active_project -> analysis[BND] -> calc_buffer);
1114 str = g_strdup_printf("%7.3lf", 100*dda[i]/(eda[i]+cda[i]));
1115 print_info (str, "bold", active_project -> analysis[BND] -> calc_buffer);
1116 g_free (str);
1117 if (active_project -> steps > 1)
1118 {
1119 str = g_strdup_printf(" +/- %7.3lf", 100*tdda[i]*active_project -> steps/(eda[i]+cda[i]));
1120 print_info (str, "bold", active_project -> analysis[BND] -> calc_buffer);
1121 g_free (str);
1122 }
1123 print_info (" %\n", "bold", active_project -> analysis[BND] -> calc_buffer);
1124 }
1125 }
1126 }
1127 print_info (_("\nNumber and proportion of tetrahedra units for "), "italic", active_project -> analysis[BND] -> calc_buffer);
1128 print_info (exact_name(active_chem -> label[* sid]), textcolor(* sid), active_project -> analysis[BND] -> calc_buffer);
1129 print_info (_(" atoms:\n\n"), "italic", active_project -> analysis[BND] -> calc_buffer);
1130 for ( i=0 ; i < active_project -> nspec ; i++ )
1131 {
1132 if (atd[i] != 0.0)
1133 {
1134 print_info ("\t- ", NULL, active_project -> analysis[BND] -> calc_buffer);
1135 print_info (exact_name(active_chem -> label[* sid]), textcolor(* sid), active_project -> analysis[BND] -> calc_buffer);
1136 print_info ("(", NULL, active_project -> analysis[BND] -> calc_buffer);
1137 print_info (exact_name(active_chem -> label[i]), textcolor(i), active_project -> analysis[BND] -> calc_buffer);
1138 print_info (")", NULL, active_project -> analysis[BND] -> calc_buffer);
1139 print_info ("4", "sub", active_project -> analysis[BND] -> calc_buffer);
1140 print_info (_(" tetrahedra:\n"), NULL, active_project -> analysis[BND] -> calc_buffer);
1141 print_info (_("\t\t Total number of tetrahedra:"), NULL, active_project -> analysis[BND] -> calc_buffer);
1142 str = g_strdup_printf("%11.5lf", atd[i]/active_project -> steps);
1143 print_info (str, "bold", active_project -> analysis[BND] -> calc_buffer);
1144 g_free (str);
1145 if (active_project -> steps > 1)
1146 {
1147 str = g_strdup_printf(" +/- %8.5lf", etd[i]);
1148 print_info (str, "bold", active_project -> analysis[BND] -> calc_buffer);
1149 g_free (str);
1150 }
1151 print_info ("\n", "bold", active_project -> analysis[BND] -> calc_buffer);
1152 if (eda[i] != 0.0 )
1153 {
1154 print_info (_("\t\t Edge-sharing: "), NULL, active_project -> analysis[BND] -> calc_buffer);
1155 str = g_strdup_printf("%11.5lf", 2.0*eda[i]/active_project -> steps);
1156 print_info (str, "bold", active_project -> analysis[BND] -> calc_buffer);
1157 g_free (str);
1158 if (active_project -> steps > 1)
1159 {
1160 str = g_strdup_printf(" +/- %8.5lf", 2.0*tepa[i]);
1161 print_info (str, "bold", active_project -> analysis[BND] -> calc_buffer);
1162 g_free (str);
1163 }
1164 print_info (_("\t or \t"), NULL, active_project -> analysis[BND] -> calc_buffer);
1165 str = g_strdup_printf("%7.3lf", 2.0*100*eda[i]/(eda[i]+cda[i]));
1166 print_info (str, "bold", active_project -> analysis[BND] -> calc_buffer);
1167 g_free (str);
1168 if (active_project -> steps > 1)
1169 {
1170 str = g_strdup_printf(" +/- %7.3lf", 2.0*100*tepa[i]*active_project -> steps/(eda[i]+cda[i]));
1171 print_info (str, "bold", active_project -> analysis[BND] -> calc_buffer);
1172 g_free (str);
1173 }
1174 print_info (" %\n", "bold", active_project -> analysis[BND] -> calc_buffer);
1175 }
1176 if (cda[i] != 0.0 )
1177 {
1178
1179 print_info (_("\t\t Corner-sharing: "), NULL, active_project -> analysis[BND] -> calc_buffer);
1180 str = g_strdup_printf("%11.5lf", (atd[i]-2*eda[i])/active_project -> steps);
1181 print_info (str, "bold", active_project -> analysis[BND] -> calc_buffer);
1182 g_free (str);
1183 if (active_project -> steps > 1)
1184 {
1185 str = g_strdup_printf(" +/- %8.5lf", 2.0*tepa[i]);
1186 print_info (str, "bold", active_project -> analysis[BND] -> calc_buffer);
1187 g_free (str);
1188 }
1189 print_info (_("\t or \t"), NULL, active_project -> analysis[BND] -> calc_buffer);
1190 str = g_strdup_printf("%7.3lf", 100.0*(atd[i]-2.0*eda[i])/atd[i]);
1191 print_info (str, "bold", active_project -> analysis[BND] -> calc_buffer);
1192 g_free (str);
1193 if (active_project -> steps > 1)
1194 {
1195 str = g_strdup_printf(" +/- %7.3lf", 2.0*100.0*tepa[i]*active_project -> steps/atd[i]);
1196 print_info (str, "bold", active_project -> analysis[BND] -> calc_buffer);
1197 g_free (str);
1198 }
1199 print_info (" %\n", "bold", active_project -> analysis[BND] -> calc_buffer);
1200 }
1201 }
1202 }
1203 }
1204}
double get_cutoff(double s_a, double s_b)
Definition bdcall.c:217
void prep_ogl_bonds()
initialize bond pointers
Definition bdcall.c:319
void coordout_(int *sid, double *sac, double ssac[active_project -> nspec], int *totgsa)
Definition bdcall.c:818
void init_ang(project *this_proj)
initialize the curve widgets for the angle distribution
Definition bdcall.c:170
void clean_coord_window(project *this_proj)
update the environment configuration window after edtion
Definition atom_edit.c:87
void cargill_spaepen_out_(int *spa, double ssac[active_project -> nspec])
compute Cargill-Spaepen chemical order parameters for binary systems
Definition bdcall.c:869
void restore_color_map(glwin *view, int *colm)
restore saved color maps
Definition bdcall.c:98
int * save_color_map(glwin *view)
save atoms and polyhedra color maps
Definition bdcall.c:82
G_MODULE_EXPORT void set_filter_changed(GtkComboBox *box, gpointer data)
change the search filter
Definition w_search.c:3846
G_MODULE_EXPORT void on_calc_bonds_released(GtkWidget *widg, gpointer data)
compute bonding properties
Definition bdcall.c:559
void warren_cowley_out_(int *spa, double ssac[active_project -> nspec])
compute Warren-Cowley and Cargill-Spaepen chemical order parameters for binary systems
Definition bdcall.c:832
void coordination_info(int sp, double sac, double ssac[active_project -> nspec])
Definition bdcall.c:725
double bdtc
Definition bdcall.c:714
void recup_dmin_dmax_(double *min, double *max)
retrieve min and max inter-atomic distances from Fortran
Definition bdcall.c:130
void envout_(int *sid, int *totgsa, int numgsa[*totgsa])
retrieve environment information for target chemical species from Fortran
Definition bdcall.c:1013
int update_voisj_and_contj()
update FORTRAN CONTJ and VOISJ for the active project
Definition bdcall.c:531
gboolean run_distance_matrix(GtkWidget *widg, int calc, int up_ngb)
compute distance matrix
Definition bdcall.c:372
void update_angle_view(project *this_proj)
update angle calculation information text buffer
Definition bdcall.c:989
void init_bond(project *this_proj)
initialize the curve widgets for the bond distribution
Definition bdcall.c:146
void tetraout_(int *sid, double eda[active_project -> nspec], double cda[active_project -> nspec], double dda[active_project -> nspec], double tepa[active_project -> nspec], double tcpa[active_project -> nspec], double tdda[active_project -> nspec], double atd[active_project -> nspec], double etd[active_project -> nspec])
Definition bdcall.c:1019
void update_glwin_after_bonds(int bonding, int *colm)
update glwin menus after bond calculation
Definition bdcall.c:455
void cutoffsend()
send cutoffs to Fortran90
Definition bdcall.c:293
void update_ang_view(project *this_proj)
update angle calculation text buffer
Definition bdcall.c:425
G_MODULE_EXPORT void set_color_map(GtkWidget *widg, gpointer data)
set color map callback
Definition m_map.c:1011
void env_info(int sp, int totgsa, int numgsa[totgsa])
output environment information for target chemical species in text buffer
Definition bdcall.c:907
void initcutoffs(chemical_data *chem, int species)
initialize bond cutoffs
Definition bdcall.c:245
Binding to the Fortran90 subroutines.
int molecules_(int *, int *)
int rundmtx_(int *, int *, int *)
int alloc_contj_voisj_(int *, int *)
void free_contj_voisj_()
int bond_diedrals_(int *)
void sendcuts_(int *, int *, double *)
void read_voisj_(int *, int *, int *, int *)
void read_contj_(int *, int *, int *)
int bonding_(int *, int *, int *, int *, double *, double *, char *)
int bond_angles_(int *)
integer(kind=c_int) function bonding(scf, sbf, adv, bdist, bmin, delt_ij, sfil)
Definition bonds.F90:22
GtkFileFilter * filter[NCFORMATS+1]
Definition callbacks.c:1557
Callback declarations for main window.
void fill_tool_model()
fill the tool window tree model
Definition tools.c:91
color colorp[64]
Variable declarations for the curve widget Functions for interactions with the curve widget.
void add_curve_widgets(project *this_proj, int rid)
add curve widgets to the project
Definition cwidget.c:283
void clean_curves_data(int calc, int start, int end)
clean curve data on a range of curve id
Definition initc.c:61
int atoms[NUM_STYLES][2]
Variable declarations for the creation of the DL_POLY input file(s).
gboolean reading_input
Definition global.c:186
int mol_update
Definition global.c:175
struct timespec start_time
Definition global.c:198
int activep
Definition global.c:162
double ** allocddouble(int xal, int yal)
allocate a double ** pointer
Definition global.c:462
int frag_update
Definition global.c:174
GtkWidget * MainWindow
Definition global.c:207
gchar * calculation_time(gboolean modelv, double ctime)
get calculation time, human readable
Definition global.c:643
int bonds_update
Definition global.c:173
gboolean atomes_render_image
Definition global.c:196
double opac
Definition global.c:201
int * allocint(int val)
allocate an int * pointer
Definition global.c:301
double get_calc_time(struct timespec start, struct timespec stop)
get calculation time in s
Definition global.c:630
struct timespec stop_time
Definition global.c:199
GtkWidget * curvetoolbox
Definition global.c:211
Global variable declarations Global convenience function declarations Global data structure defin...
glwin * active_glwin
Definition project.c:53
GtkTextBuffer * add_buffer(GCallback handler, gpointer data, gchar *text)
create a GtkTextBuffer
Definition gtk-misc.c:1258
coord_info * active_coord
Definition project.c:49
#define MINCUT
Definition global.h:353
#define RIN
Definition global.h:343
chemical_data * active_chem
Definition project.c:48
#define SPH
Definition global.h:345
#define CHEM_R
Definition global.h:318
#define ANG
Definition global.h:342
void widget_set_sensitive(GtkWidget *widg, gboolean sensitive)
Set sensitivity for a GtkWidget, ensuring it is a GtkWidget.
Definition gtk-misc.c:247
void combo_text_append(GtkWidget *combo, gchar *text)
append text in GtkComboBox widget
Definition gtk-misc.c:987
#define BND
Definition global.h:341
#define min(a, b)
Definition global.h:93
void clean_volumes_data(glwin *view)
clean volume data
Definition w_volumes.c:83
#define CHEM_Z
Definition global.h:316
project * active_project
Definition project.c:47
image * active_image
Definition project.c:52
void show_the_widgets(GtkWidget *widg)
show GtkWidget
Definition gtk-misc.c:202
#define max(a, b)
Definition global.h:92
void update(glwin *view)
update the rendering of the OpenGL window
Definition glview.c:461
Variable declarations related to the OpenGL window Function declarations related to the OpenGL wind...
void re_create_md_shaders(int nshaders, int shaders[nshaders], project *this_proj)
re-initialize some MD dependent OpenGL shaders
#define OGL_COORDS
Definition glwin.h:63
#define POLY_MAPS
Definition glwin.h:62
shaders
The different types of shaders in the atomes program.
Definition glwin.h:88
@ BONDS
Definition glwin.h:90
@ PICKS
Definition glwin.h:97
@ POLYS
Definition glwin.h:92
@ SELEC
Definition glwin.h:91
@ MEASU
Definition glwin.h:99
@ ATOMS
Definition glwin.h:89
@ RINGS
Definition glwin.h:96
#define ATOM_MAPS
Definition glwin.h:61
void view_buffer(GtkTextBuffer *buffer)
set a text buffer in the main window or an image
Definition gui.c:311
void prepostcalc(GtkWidget *widg, gboolean status, int run, int adv, double opc)
to just before and just after running a calculation
Definition initc.c:87
Function declarations to handle the atomic coordination data.
void set_advanced_bonding_menus(glwin *view)
gchar * textcolor(int i)
setup text color keyword
Definition interface.c:893
void show_error(char *error, int val, GtkWidget *win)
show error message
Definition interface.c:299
gchar * env_name(project *this_proj, int g, int s, int f, GtkTextBuffer *buffer)
output the name of a coordination sphere
Definition interface.c:1022
void print_info(gchar *str, gchar *stag, GtkTextBuffer *buffer)
print information in GtkTextBuffer
Definition interface.c:869
gchar * exact_name(gchar *name)
short cut to print string without spaces
Definition interface.c:434
Messaging function declarations.
double default_totcut
bond_cutoff * default_bond_cutoff
Preference variable declarations.
Function declarations for reading atomes project file Function declarations for saving atomes proje...
void active_project_changed(int id)
change the active project
Definition update_p.c:220
Definition glwin.h:350
Definition glwin.h:967
GtkWidget * res[2]
Definition w_encode.c:342
int element
Definition w_periodic.c:61
GtkWidget * img
Definition workspace.c:70