atomes 1.2.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-2025 by CNRS and University of Strasbourg */
15
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 initbd ();
42 void initang ();
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 env_info (int sp, int totgsa, int numgsa[totgsa]);
51 void update_angle_view (project * this_proj);
52 void envout_ (int * sid, int * totgsa, int numgsa[* totgsa]);
53
54 G_MODULE_EXPORT void on_calc_bonds_released (GtkWidget * widg, gpointer data);
55
56*/
57
58#include "global.h"
59#include "bind.h"
60#include "interface.h"
61#include "callbacks.h"
62#include "project.h"
63#include "curve.h"
64#include "dlp_field.h"
65#include "glview.h"
66#include "initcoord.h"
67#include "preferences.h"
68
69extern G_MODULE_EXPORT void set_color_map (GtkWidget * widg, gpointer data);
70extern void clean_coord_window (project * this_proj);
71extern G_MODULE_EXPORT void set_filter_changed (GtkComboBox * box, gpointer data);
72
80int * save_color_map (glwin * view)
81{
82 int i;
83 int * colm = allocint(2);
84 for (i=0; i<2; i++) colm[i] = view -> anim -> last -> img -> color_map[i];
85 return colm;
86}
87
96void restore_color_map (glwin * view, int * colm)
97{
98#ifdef GTK3
99 // GTK3 Menu Action To Check
100 int i, j;
101 gboolean was_input = reading_input;
102 reading_input = TRUE;
103 for (i=0; i<2; i++)
104 {
105 if ((i == 3 || i == 4) && ! view -> adv_bonding[i-3])
106 {
107 j = i*ATOM_MAPS;
108 }
109 else
110 {
111 j = i*ATOM_MAPS + colm[i];
112 }
113 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> color_styles[j], TRUE);
114 set_color_map (view -> color_styles[j], & view -> colorp[j][0]);
115 }
116 reading_input = was_input;
117#endif
118}
119
128void recup_dmin_dmax_ (double * min, double * max)
129{
130 active_project -> min[BD] = * min;
131 active_project -> max[BD] = * max;
132}
133
139void initbd ()
140{
141 int i, j, k;
142
143 k = 0;
144 for ( i = 0 ; i < active_project -> nspec ; i++ )
145 {
146 for ( j = 0 ; j < active_project -> nspec ; j++ )
147 {
148 active_project -> curves[BD][k] -> name = g_strdup_printf("Dij [%s-%s]",
149 active_chem -> label[i],
150 active_chem -> label[j]);
151 k=k+1;
152 }
153 }
155 active_project -> initok[BD] = TRUE;
156}
157
163void initang ()
164{
165 int h, i, j, k, l;
166
167 h=0;
168 for ( i = 0 ; i < active_project -> nspec ; i++ )
169 {
170 for ( j = 0 ; j < active_project -> nspec ; j++ )
171 {
172 for ( k = 0 ; k < active_project -> nspec ; k++ )
173 {
174 active_project -> curves[AN][h] -> name = g_strdup_printf("Angles [%s-%s-%s]",
175 active_chem -> label[i],
176 active_chem -> label[j],
177 active_chem -> label[k]);
178 h=h+1;
179 }
180 }
181 }
182 for ( i = 0 ; i < active_project -> nspec ; i++ )
183 {
184 for ( j = 0 ; j < active_project -> nspec ; j++ )
185 {
186 for ( k = 0 ; k < active_project -> nspec ; k++ )
187 {
188 for ( l = 0 ; l < active_project -> nspec ; l++ )
189 {
190 active_project -> curves[AN][h] -> name = g_strdup_printf("Dihedral [%s-%s-%s-%s]",
191 active_chem -> label[i], active_chem -> label[j],
192 active_chem -> label[k], active_chem -> label[l]);
193 h=h+1;
194 }
195 }
196 }
197 }
199 active_project -> initok[AN] = TRUE;
200}
201
210double get_cutoff (double s_a, double s_b)
211{
213 {
215 int z_a = min (s_a, s_b);
216 int z_b = max (s_a, s_b);
217 while (cut)
218 {
219 if (cut -> Z[0] == z_a && cut -> Z[1] == z_b) return cut -> cutoff;
220 cut = cut -> next;
221 }
222 return 0.0;
223 }
224 else
225 {
226 return 0.0;
227 }
228}
229
238void initcutoffs (chemical_data * chem, int species)
239{
240 int i, j;
241 for (i = 0; i < species; i++)
242 {
243 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]);
244 if (chem -> cutoffs[i][i] == 0.0)
245 {
246 chem -> cutoffs[i][i] = 2.0*chem -> chem_prop[CHEM_R][i];
247 chem -> cutoffs[i][i] = max(MINCUT, chem -> cutoffs[i][i]);
248 if (chem -> chem_prop[CHEM_Z][i] == 1.0) chem -> cutoffs[i][i] = 0.5;
249 }
250 }
251 for (i = 0; i < species-1; i++)
252 {
253 for (j = i+1; j < species; j++)
254 {
255 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]);
256 if (chem -> cutoffs[i][j] == 0.0)
257 {
258 chem -> cutoffs[i][j] = chem -> chem_prop[CHEM_R][i] + chem -> chem_prop[CHEM_R][j];
259 chem -> cutoffs[i][j] = max(MINCUT, chem -> cutoffs[i][j]);
260 if (chem -> chem_prop[CHEM_Z][i] == 1.0 && chem -> chem_prop[CHEM_Z][j] == 6.0) chem -> cutoffs[i][j] = 1.2;
261 if (chem -> chem_prop[CHEM_Z][j] == 1.0 && chem -> chem_prop[CHEM_Z][i] == 6.0) chem -> cutoffs[j][i] = 1.2;
262 if (chem -> chem_prop[CHEM_Z][i] == 1.0 && chem -> chem_prop[CHEM_Z][j] == 8.0) chem -> cutoffs[i][j] = 1.2;
263 if (chem -> chem_prop[CHEM_Z][j] == 1.0 && chem -> chem_prop[CHEM_Z][i] == 8.0) chem -> cutoffs[j][i] = 1.2;
264 }
265 chem -> cutoffs[j][i] = chem -> cutoffs[i][j];
266 }
267 }
268 chem -> grtotcutoff = (chem -> grtotcutoff != 0.0) ? chem -> grtotcutoff : default_totcut;
269 if (chem -> grtotcutoff == 0.0)
270 {
271 for (i = 0; i < species; i++)
272 {
273 chem -> grtotcutoff += chem -> chem_prop[CHEM_R][i];
274 }
275 chem -> grtotcutoff *= 2.0;
276 chem -> grtotcutoff /= species;
277 chem -> grtotcutoff = max(MINCUT, chem -> grtotcutoff);
278 }
279}
280
287{
288 int i, j;
289
290 if (active_chem -> cutoffs == NULL)
291 {
292 // g_debug ("alloc cuttofs !!!");
293 active_chem -> cutoffs = allocddouble (active_project -> nspec, active_project -> nspec);
294 }
295 for ( i=0; i < active_project -> nspec; i++)
296 {
297 for (j=0; j < active_project -> nspec; j++)
298 {
299 // g_debug ("cut[%d,%d]= %f", i+1, j+1, active_chem -> cutoffs[i][j]);
300 sendcuts_ (& i, & j, & active_chem -> cutoffs[i][j]);
301 }
302 }
303 i = active_project -> nspec;
304 // g_debug ("totcut= %f", active_chem -> grtotcutoff);
305 sendcuts_ (& i, & i, & active_chem -> grtotcutoff);
306}
307
314{
315 int i;
316 active_glwin -> bonding = FALSE;
317#ifdef GTK3
318 // GTK3 Menu Action To Check
319 for (i=0; i<ATOM_MAPS+POLY_MAPS; i++)
320 {
321 widget_set_sensitive (active_glwin -> color_styles[i], 0);
322 }
323 for (i=1; i<OGL_COORDS; i++)
324 {
325 widget_set_sensitive (active_glwin -> ogl_coord[i], 0);
326 }
327#endif
328 active_image -> color_map[0] = 0;
329 active_image -> color_map[1] = 0;
330 for (i=0; i<4; i++)
331 {
332 if (active_glwin -> gcid[i]) g_free (active_glwin -> gcid[i]);
333 active_glwin -> gcid[i] = NULL;
334 active_coord -> totcoord[i] = 0;
335 }
336 if (! active_project -> dmtx)
337 {
338 active_glwin -> allbonds[0] = 0;
339 active_glwin -> allbonds[1] = 0;
340 }
341 for (i=0; i<2; i++) active_glwin -> adv_bonding[i] = FALSE;
342}
343
353gboolean run_distance_matrix (GtkWidget * widg, int calc, int up_ngb)
354{
355 int i, j, k;
356 gboolean res;
357 if (up_ngb)
358 {
359 for (i=0; i < active_project -> steps; i++)
360 {
361 for (j=0; j < active_project -> natomes; j++)
362 {
363 active_project -> atoms[i][j].cloned = FALSE;
364 if (active_project -> atoms[i][j].numv)
365 {
366 active_project -> atoms[i][j].numv = 0;
367 if (active_project -> atoms[i][j].vois)
368 {
369 g_free (active_project -> atoms[i][j].vois);
370 active_project -> atoms[i][j].vois = NULL;
371 }
372 }
373 }
374 }
375 }
376 prepostcalc (widg, FALSE, -1, (active_project -> steps > 1) ? 1 : 0, opac);
377 i = j = 0;
378 k = up_ngb;;
379 if (calc > 3 && calc < 6) i = 1;
380 if (calc > 0 && calc < 6)
381 {
382 j = active_project -> rsparam[calc-1][4];
383 }
384 else if (calc == 6)
385 {
386 j = active_project -> csparam[3];
387 }
388#ifdef DEBUG
389 g_debug ("Run dmtx Prim= %d, NOHP= %d, UPDATE= %d", i, j, k);
390#endif
391 clock_gettime (CLOCK_MONOTONIC, & start_time);
392 res = rundmtx_ (& i, & j, & k);
393 prepostcalc (widg, TRUE, -1, 0, 1.0);
394 clock_gettime (CLOCK_MONOTONIC, & stop_time);
395 g_print ("Time to calculate distance matrix: %s\n", calculation_time(FALSE, get_calc_time (start_time, stop_time)));
396 return res;
397}
398
406void update_ang_view (project * this_proj)
407{
408 gchar * str;
409 if (this_proj -> text_buffer[AN+OT] == NULL) this_proj -> text_buffer[AN+OT] = add_buffer (NULL, NULL, NULL);
410 view_buffer (this_proj -> text_buffer[AN+OT]);
411 print_info ("\n\nAngles and diherdrals distribution(s)\n\n", "heading", this_proj -> text_buffer[AN+OT]);
412 print_info ("Calculation details:\n\n", NULL, this_proj -> text_buffer[AN+OT]);
413 print_info ("\tAngular space discretization:\n\n", NULL, this_proj -> text_buffer[AN+OT]);
414 print_info ("\t - Number of δ° steps: ", "bold", this_proj -> text_buffer[AN+OT]);
415 str = g_strdup_printf ("%d", this_proj -> num_delta[AN]);
416 print_info (str, "bold_blue", this_proj -> text_buffer[AN+OT]);
417 g_free (str);
418 print_info ("\n\n\t between 0.0 and 180.0", NULL, this_proj -> text_buffer[AN+OT]);
419 print_info (" °\n\n\t - δ° = ", "bold", this_proj -> text_buffer[AN+OT]);
420 str = g_strdup_printf ("%f", this_proj -> delta[AN]);
421 print_info (str, "bold_blue", this_proj -> text_buffer[AN+OT]);
422 g_free (str);
423 print_info (" °\n", "bold", this_proj -> text_buffer[AN+OT]);
424 print_info (calculation_time(TRUE, this_proj -> calc_time[AN]), NULL, this_proj -> text_buffer[AN+OT]);
425}
426
435void update_glwin_after_bonds (int bonding, int * colm)
436{
438#ifdef GTK3
439 // GTK3 Menu Action To Check
440 if (active_glwin -> init)
441 {
444 widget_set_sensitive (active_glwin -> ogl_clones[0], active_glwin -> allbonds[1]);
445 }
446#endif
447 int shaders[5] = {ATOMS, BONDS, POLYS, RINGS, SELEC};
449 active_glwin -> create_shaders[MEASU] = TRUE;
450 active_glwin -> create_shaders[PICKS] = TRUE;
452 if (active_glwin -> init)
453 {
455 g_free (colm);
456 }
457
458 int i, j;
459 for (i=2; i<7; i++)
460 {
461 if (i != 5)
462 {
463 if (active_glwin -> search_widg[i])
464 {
465 if (active_glwin -> search_widg[i] -> filter_box)
466 {
467 if (GTK_IS_WIDGET(active_glwin -> search_widg[i] -> filter_box))
468 {
469 if (active_glwin -> atom_win -> adv_bonding[1] && ! active_glwin -> adv_bonding[1])
470 {
471 gtk_combo_box_text_remove ((GtkComboBoxText *) active_glwin -> search_widg[i] -> filter_box, 4);
472 }
473 else if (! active_glwin -> atom_win -> adv_bonding[0] && active_glwin -> adv_bonding[0])
474 {
475 combo_text_append (active_glwin -> search_widg[i] -> filter_box, "Fragment");
476 }
477 if (active_glwin -> atom_win -> adv_bonding[0] && ! active_glwin -> adv_bonding[0])
478 {
479 gtk_combo_box_text_remove ((GtkComboBoxText *) active_glwin -> search_widg[i] -> filter_box, 3);
480 }
481 else if (! active_glwin -> atom_win -> adv_bonding[1] && active_glwin -> adv_bonding[1])
482 {
483 combo_text_append (active_glwin -> search_widg[i] -> filter_box, "Molecule");
484 }
485 j = active_glwin -> search_widg[i] -> object + active_glwin -> search_widg[i] -> filter;
486 if (j == 4)
487 {
488 set_filter_changed (GTK_COMBO_BOX(active_glwin -> search_widg[i] -> filter_box), active_glwin -> search_widg[i]);
489 }
490 }
491 }
492 }
493 }
494 }
495 if (active_glwin -> atom_win)
496 {
497 for (i=0; i<2; i++) active_glwin -> atom_win -> adv_bonding[i] = active_glwin -> adv_bonding[i];
498 }
500#ifdef GTK4
501 update_menu_bar (active_glwin);
502#endif
504}
505
514G_MODULE_EXPORT void on_calc_bonds_released (GtkWidget * widg, gpointer data)
515{
516 int j, k, l, m;
517 int statusb = 0;
518 int bonding = 0;
519 int * colm = NULL;
520 gboolean vis_bd = active_project -> visok[BD];
521
522 if (widg) bonds_update = 1;
523 bonding = (active_project -> runc[0]) ? 1 : 0;
524 if (! bonds_update && active_project -> runc[0]) bonding = 0;
525 if (active_glwin)
526 {
527 if (active_glwin -> init) colm = save_color_map (active_glwin);
529 }
530 cutoffsend ();
531 if (! active_project -> dmtx) active_project -> dmtx = run_distance_matrix (widg, 0, 1);
532
533 if (active_project -> dmtx)
534 {
535 //if (bonding && active_project -> steps > 1) statusb = 1;
536 if (bonds_update || active_project -> runc[0] || active_project -> runc[2])
537 {
538 if (! active_project -> initok[BD] && bonding) initbd ();
539 if (active_project -> runc[0]) clean_curves_data (BD, 0, active_project -> numc[BD]);
540 prepostcalc (widg, FALSE, BD, statusb, opac);
541 l = 0;
542 m = 1;
543 if (active_project -> bondfile != NULL)
544 {
545 l = 1;
546 m = strlen (active_project -> bondfile);
547 }
548 // debug_chemical_information (active_project);
549 active_project -> delta[BD] = (active_project -> max[BD]-active_project -> min[BD]) / active_project -> num_delta[BD];
550 clock_gettime (CLOCK_MONOTONIC, & start_time);
551 j = bonding_ (& m, & l, & bonding, & active_project -> num_delta[BD], & active_project -> min[BD], & active_project -> delta[BD], active_project -> bondfile);
552 clock_gettime (CLOCK_MONOTONIC, & stop_time);
554 active_project -> runok[SP] = j;
555 prepostcalc (widg, bonding, BD, (bonding) ? j : vis_bd, 1.0);
556 if (! j)
557 {
558 show_error ("Unexpected error when calculating bond properties", 0, (widg) ? widg : MainWindow);
559 }
560 else
561 {
562 if (active_glwin -> init) print_info (calculation_time(TRUE, active_project -> calc_time[BD]), NULL, active_project -> text_buffer[BD+OT]);
563 bonding = 1;
564 if (frag_update)
565 {
566 prepostcalc (widg, FALSE, -1, statusb, opac);
567 k = active_glwin -> allbonds[0] + active_glwin -> allbonds[1];
568 clock_gettime (CLOCK_MONOTONIC, & start_time);
569 if (! molecules_ (& mol_update, & k))
570 {
571 show_error ("Unexpected error when looking for isolated fragment(s) and molecule(s)", 0, (widg) ? widg : MainWindow);
572 if (active_glwin)
573 {
574 for (k=0; k<2; k++)
575 {
576 active_glwin -> adv_bonding[k] = FALSE;
577 if (k)
578 {
579 for (l=0; l<2; l++)
580 {
581 if (active_project -> force_field[l])
582 {
583 g_free (active_project -> force_field[l]);
584 active_project -> force_field[l] = NULL;
585 }
586 }
587 }
588 active_coord -> totcoord[k+2] = 0;
589 }
590 }
591 }
592 else
593 {
594 if (active_glwin)
595 {
596 active_glwin -> adv_bonding[0] = frag_update;
597 active_glwin -> adv_bonding[1] = mol_update;
598 }
599 }
600 clock_gettime (CLOCK_MONOTONIC, & stop_time);
601 // Using the RI slot to store Frag-mol calc time.
604 prepostcalc (widg, TRUE, -1, statusb, 1.0);
605 if (widg != NULL) show_the_widgets (curvetoolbox);
606 }
607 else
608 {
609 active_glwin -> adv_bonding[0] = frag_update;
610 active_glwin -> adv_bonding[1] = mol_update;
611 }
612 }
613 }
614 if (active_project -> runc[1])
615 {
616 if (! active_project -> initok[AN]) initang ();
617 clean_curves_data (AN, 0, active_project -> numc[AN]);
618 prepostcalc (widg, FALSE, AN, statusb, opac);
619 active_project -> delta[AN] = 180.0 / active_project -> num_delta[AN];
620 clock_gettime (CLOCK_MONOTONIC, & start_time);
621 j = bond_angles_ (& active_project -> num_delta[AN]);
622 if (! j)
623 {
624 show_error ("Unexpected error when calculating the bond angles distribution", 0, (widg) ? widg : MainWindow);
625 }
626 else
627 {
628 j = bond_diedrals_ (& active_project -> num_delta[AN]);
629 clock_gettime (CLOCK_MONOTONIC, & stop_time);
631 if (! j)
632 {
633 show_error ("Unexpected error when calculating the dihedral angles distribution", 0, (widg) ? widg : MainWindow);
634 }
635 else
636 {
637 if (widg != NULL) show_the_widgets (curvetoolbox);
639 }
640 }
641 prepostcalc (widg, TRUE, AN, j, 1.0);
642 }
643 }
644 else
645 {
646 show_error ("The nearest neighbors table calculation has failed", 0, (widg) ? widg : MainWindow);
647 bonding = 0;
648 active_glwin -> adv_bonding[0] = 0;
649 active_glwin -> adv_bonding[1] = 0;
650 }
653 if (widg)
654 {
656 }
657 else
658 {
659 for (j=0; j<3; j++) active_project -> runc[j] = FALSE;
660 }
662}
663
664double bdtc;
665
675void coordination_info (int sp, double sac, double ssac[active_project -> nspec])
676{
677 int j;
678 gchar * str;
679 gchar * spr;
680 if (active_project -> text_buffer[BD+OT] == NULL) active_project -> text_buffer[BD+OT] = add_buffer (NULL, NULL, NULL);
681 view_buffer (active_project -> text_buffer[BD+OT]);
682 if (sp == 0)
683 {
684 print_info ("\n\nBond properties\n\n", "heading", active_project -> text_buffer[BD+OT]);
685 print_info ("Existence of a bond between two atoms i (α) and j (β)\n"
686 "if the two following conditions are verified:\n\n"
687 "\t1) D", "italic", active_project -> text_buffer[BD+OT]);
688 print_info ("ij", "sub_italic", active_project -> text_buffer[BD+OT]);
689 str = g_strdup_printf (" < first minimum of the total RDF (%9.5f Å )\n\t2) D", active_chem -> grtotcutoff);
690 print_info (str, "italic", active_project -> text_buffer[BD+OT]);
691 g_free (str);
692 print_info ("ij", "sub_italic", active_project -> text_buffer[BD+OT]);
693 print_info (" < r", "italic", active_project -> text_buffer[BD+OT]);
694 print_info ("cut", "sub_italic", active_project -> text_buffer[BD+OT]);
695 print_info ("(α,β)\n", "italic", active_project -> text_buffer[BD+OT]);
696 bdtc = sac * active_chem -> nsps[sp];
697 }
698 else
699 {
700 bdtc += sac * active_chem -> nsps[sp];
701 }
702 print_info ("\nCoordination numbers: ", "italic", active_project -> text_buffer[BD+OT]);
703 spr = g_strdup_printf("%s", textcolor(sp));
704 print_info (active_chem -> element[sp], spr, active_project -> text_buffer[BD+OT]);
705 str = g_strdup_printf ("\n\n\t%s", exact_name(active_chem -> label[sp]));
706 print_info (str, spr, active_project -> text_buffer[BD+OT]);
707 g_free (str);
708 print_info (" (total)=\t", "italic", active_project -> text_buffer[BD+OT]);
709 str = g_strdup_printf("%9.5lf\n", sac);
710 print_info (str, "bold", active_project -> text_buffer[BD+OT]);
711 g_free (str);
712 for ( j=0 ; j < active_project -> nspec ; j++ )
713 {
714 str = g_strdup_printf ("\t%s(", active_chem -> label[sp]);
715 print_info (str, spr, active_project -> text_buffer[BD+OT]);
716 g_free (str);
717 str = g_strdup_printf("%s", textcolor(j));
718 print_info (active_chem -> label[j], str, active_project -> text_buffer[BD+OT]);
719 print_info (")", spr, active_project -> text_buffer[BD+OT]);
720 print_info ("[r", NULL, active_project -> text_buffer[BD+OT]);
721 print_info ("cut", "sub", active_project -> text_buffer[BD+OT]);
722 print_info ("(", NULL, active_project -> text_buffer[BD+OT]);
723 print_info (active_chem -> label[sp], spr, active_project -> text_buffer[BD+OT]);
724 print_info (",", NULL, active_project -> text_buffer[BD+OT]);
725 print_info (active_chem -> label[j], str, active_project -> text_buffer[BD+OT]);
726 g_free (str);
727 print_info (")= ", NULL, active_project -> text_buffer[BD+OT]);
728 str = g_strdup_printf ("%9.5lf Å", active_chem -> cutoffs[sp][j]);
729 print_info (str, NULL, active_project -> text_buffer[BD+OT]);
730 g_free (str);
731 print_info ("] = ", NULL, active_project -> text_buffer[BD+OT]);
732 str = g_strdup_printf ("%9.5lf", ssac[j]);
733 print_info (str, "bold", active_project -> text_buffer[BD+OT]);
734 g_free (str);
735 print_info ("\t or \t", NULL, active_project -> text_buffer[BD+OT]);
736 if (sac != 0.0)
737 {
738 str = g_strdup_printf ("%7.3lf", ssac[j]*100.0/(sac));
739 }
740 else
741 {
742 str = g_strdup_printf ("%7.3lf", 0.0);
743 }
744 print_info (str, "bold", active_project -> text_buffer[BD+OT]);
745 g_free (str);
746 print_info (" %\n", NULL, active_project -> text_buffer[BD+OT]);
747 }
748 g_free (spr);
749 if (sp == active_project -> nspec-1)
750 {
751 print_info ("\nAverage coordination number: ", "italic", active_project -> text_buffer[BD+OT]);
752 str = g_strdup_printf ("%9.5lf\n", bdtc / active_project -> natomes);
753 print_info (str, "bold", active_project -> text_buffer[BD+OT]);
754 g_free (str);
755 }
756}
757
768void coordout_ (int * sid, double * sac, double ssac[active_project -> nspec], int * totgsa)
769{
770 active_coord -> ntg[1][* sid] = * totgsa;
771 if (bonds_update) coordination_info (* sid, * sac, ssac);
772}
773
774/*void wccp_out_ (double cp[5])
775{
776 double x, y, z;
777 gchar * str;
778 print_info ("Warren-Cowley chemical order parameters:\n\n", "italic", active_project -> text_buffer[BD+OT]);
779 print_info ("\tα", NULL, active_project -> text_buffer[BD+OT]);
780 print_info ("w", "sub", active_project -> text_buffer[BD+OT]);
781 print_info ("=\t", NULL, active_project -> text_buffer[BD+OT]);
782 x = 0.0;
783 x += (cp[1] * active_chem -> nsps[0])/active_project -> natomes;
784 x += (cp[0] * active_chem -> nsps[1])/active_project -> natomes;
785 y = 1.0 - cp[2] / (cp[3] * x);
786 str = g_strdup_printf ("%f\n", y);
787 print_info (str, "bold", active_project -> text_buffer[BD+OT]);
788 if ((cp[0] * active_chem -> nsps[0])/active_project -> natomes > (cp[1] * active_chem -> nsps[1])/active_project -> natomes)
789 {
790 z = 1.0 - cp[0] / (active_chem -> nsps[1] /(active_project -> natomes * y));
791 }
792 else
793 {
794 z = 1.0 - cp[1] / (active_chem -> nsps[0] /(active_project -> natomes * y));
795 }
796 print_info ("\tα", NULL, active_project -> text_buffer[BD+OT]);
797 print_info ("w", "sub", active_project -> text_buffer[BD+OT]);
798 print_info ("0", "sup", active_project -> text_buffer[BD+OT]);
799 print_info ("=\t", NULL, active_project -> text_buffer[BD+OT]);
800 str = g_strdup_printf ("%f\n", y/z);
801 print_info (str, "bold", active_project -> text_buffer[BD+OT]);
802 print_info ("Cargill-Spaepen chemical order parameters:\n\n", "italic", active_project -> text_buffer[BD+OT]);
803 // ρ
804 print_info ("\tη=\t", NULL, active_project -> text_buffer[BD+OT]);
805 x = cp[2] * cp[4] / (active_chem -> nsps[0]/active_project -> natomes * cp[0] * cp[1]) - 1.0;
806 str = g_strdup_printf ("%f\n", x);
807 print_info (str, "bold", active_project -> text_buffer[BD+OT]);
808 if ((cp[0] * active_chem -> nsps[0])/active_project -> natomes > (cp[1] * active_chem -> nsps[1])/active_project -> natomes)
809 {
810 z = ;
811 }
812 else
813 {
814 z = ;
815 }
816 print_info ("\tη", NULL, active_project -> text_buffer[BD+OT]);
817 print_info ("0", "sup", active_project -> text_buffer[BD+OT]);
818 print_info ("=\t", NULL, active_project -> text_buffer[BD+OT]);
819 str = g_strdup_printf ("%f\n", y/z);
820 print_info (str, "bold", active_project -> text_buffer[BD+OT]);
821}*/
822
832void env_info (int sp, int totgsa, int numgsa[totgsa])
833{
834 int i, j, k;
835 int natpg[totgsa];
836 gchar * str, * spr, * snr;
837 int tgsa;
838 print_info ("\nEnvironments for ", "italic", active_project -> text_buffer[BD+OT]);
839 spr = g_strdup_printf ("%s", textcolor(sp));
840 str = g_strdup_printf ("%s", exact_name(active_chem -> label[sp]));
841 print_info (str, spr, active_project -> text_buffer[BD+OT]);
842 g_free (spr);
843 g_free (str);
844 print_info (" atoms:\n\n", "italic", active_project -> text_buffer[BD+OT]);
845 print_info ("\t \tN(tot)", NULL, active_project -> text_buffer[BD+OT]);
846 for ( j=0 ; j < active_project -> nspec ; j++ )
847 {
848 snr = g_strdup_printf ("%s", exact_name(active_chem -> label[j]));
849 i = 6 - strlen (snr);
850 for (k=0; k<i; k++) print_info (" ", NULL, active_project -> text_buffer[BD+OT]);
851 str = g_strdup_printf ("N(%s)", snr);
852 spr = g_strdup_printf ("%s", textcolor(j));
853 print_info (str, spr, active_project -> text_buffer[BD+OT]);
854 g_free (spr);
855 g_free (str);
856 g_free (snr);
857 }
858 print_info ("\tNumber\t\t or \tPercent\n\n", NULL, active_project -> text_buffer[BD+OT]);
859
860 tgsa = 0;
861 for ( i=0 ; i < totgsa; i++ )
862 {
863 tgsa += numgsa[i];
864 }
865 for ( i=0 ; i < totgsa; i++ )
866 {
867 natpg[i] = 0;
868 for ( j=0 ; j < active_project -> nspec ; j++ )
869 {
870 k = active_coord -> partial_geo[sp][i][j];
871 natpg[i] += k;
872 }
873 print_info ("\t", NULL, active_project -> text_buffer[BD+OT]);
874 spr = g_strdup_printf ("%s", env_name (active_project, i, sp, 1, active_project -> text_buffer[BD+OT]));
875 g_free (spr);
876 spr = g_strdup_printf ("%s", exact_name(env_name (active_project, i, sp, 0, NULL)));
877 k = 12 - strlen (spr);
878 g_free (spr);
879 for (j=0; j<k; j++) print_info (" ", NULL, active_project -> text_buffer[BD+OT]);
880 print_info ("\t", NULL, active_project -> text_buffer[BD+OT]);
881 str = g_strdup_printf ("%3d ", natpg[i]);
882 print_info (str, NULL, active_project -> text_buffer[BD+OT]);
883 for ( j=0 ; j < active_project -> nspec ; j++ )
884 {
885 k = active_coord -> partial_geo[sp][i][j];
886 str = g_strdup_printf(" %7d", k);
887 spr = g_strdup_printf ("%s", textcolor(j));
888 print_info (str, spr, active_project -> text_buffer[BD+OT]);
889 g_free (str);
890 g_free (spr);
891 }
892 str = g_strdup_printf(" %16.5lf", (1.0*numgsa[i])/active_project -> steps);
893 print_info (str, "bold", active_project -> text_buffer[BD+OT]);
894 g_free (str);
895 print_info ("\t or \t", NULL, active_project -> text_buffer[BD+OT]);
896 str = g_strdup_printf ("%7.3lf ", 100.0*numgsa[i]/tgsa);
897 print_info (str, "bold", active_project -> text_buffer[BD+OT]);
898 g_free (str);
899 print_info ("%\n", "bold", active_project -> text_buffer[BD+OT]);
900 }
901}
902
903
911void update_angle_view (project * this_proj)
912{
913 gchar * str;
914 if (this_proj -> text_buffer[AN+OT] == NULL) this_proj -> text_buffer[AN+OT] = add_buffer (NULL, NULL, NULL);
915 view_buffer (this_proj -> text_buffer[AN+OT]);
916 print_info ("\n\nAngle distribution function(s)\n\n", "heading", this_proj -> text_buffer[AN+OT]);
917
918
919 print_info ("\tAngle space discretization:\n\n", NULL, this_proj -> text_buffer[AN+OT]);
920 print_info ("\t - Number of δ° steps: ", "bold", this_proj -> text_buffer[AN+OT]);
921 str = g_strdup_printf ("%d", this_proj -> num_delta[AN]);
922 print_info (str, "bold_blue", this_proj -> text_buffer[AN+OT]);
923 g_free (str);
924 print_info ("\n\n\t between 0.0 and 180.0°\n", NULL, this_proj -> text_buffer[AN+OT]);
925}
926
936void envout_ (int * sid, int * totgsa, int numgsa[* totgsa])
937{
938 /* Send info for OpenGL */
939 if (bonds_update) env_info (* sid, * totgsa, numgsa);
940}
941
942void tetraout_ (int * sid, double eda[active_project -> nspec],
943 double cda[active_project -> nspec],
944 double dda[active_project -> nspec],
945 double tepa[active_project -> nspec],
946 double tcpa[active_project -> nspec],
947 double tdda[active_project -> nspec],
948 double atd[active_project -> nspec],
949 double etd[active_project -> nspec])
950{
951 int i;
952 gboolean print;
953 gchar * str;
954 print=FALSE;
955 for ( i=0 ; i < active_project -> nspec ; i++)
956 {
957 if (eda[i] != 0.0 || cda[i] != 0.0) print=TRUE;
958 }
959
960 if (print && bonds_update)
961 {
962 print_info ("\nNumber and proportion of tetrahedra links for ", "italic", active_project -> text_buffer[BD+OT]);
963 print_info (exact_name(active_chem -> label[* sid]), textcolor(* sid), active_project -> text_buffer[BD+OT]);
964 print_info (" atoms:\n\n", "italic", active_project -> text_buffer[BD+OT]);
965 for ( i=0 ; i < active_project -> nspec ; i++ )
966 {
967 if (eda[i] != 0.0 || cda[i] != 0.0)
968 {
969 print_info ("\t- ", NULL, active_project -> text_buffer[BD+OT]);
970 print_info (exact_name(active_chem -> label[* sid]), textcolor(* sid), active_project -> text_buffer[BD+OT]);
971 print_info ("(", NULL, active_project -> text_buffer[BD+OT]);
972 print_info (exact_name(active_chem -> label[i]), textcolor(i), active_project -> text_buffer[BD+OT]);
973 print_info (")", NULL, active_project -> text_buffer[BD+OT]);
974 print_info ("4", "sub", active_project -> text_buffer[BD+OT]);
975 print_info (" tetrahedra:\n", NULL, active_project -> text_buffer[BD+OT]);
976 if (eda[i] != 0.0)
977 {
978 print_info ("\t\t Edge-sharing: ", NULL, active_project -> text_buffer[BD+OT]);
979 str = g_strdup_printf("%11.5lf", eda[i]/active_project -> steps);
980 print_info (str, "bold", active_project -> text_buffer[BD+OT]);
981 g_free (str);
982 if (active_project -> steps > 1)
983 {
984 str = g_strdup_printf(" +/- %8.5lf", tepa[i]);
985 print_info (str, "bold", active_project -> text_buffer[BD+OT]);
986 g_free (str);
987 }
988 print_info ("\t or \t", NULL, active_project -> text_buffer[BD+OT]);
989 str = g_strdup_printf("%7.3lf", 100*eda[i]/(eda[i]+cda[i]));
990 print_info (str, "bold", active_project -> text_buffer[BD+OT]);
991 g_free (str);
992 if (active_project -> steps > 1)
993 {
994 str = g_strdup_printf(" +/- %7.3lf", 100*tepa[i]*active_project -> steps/(eda[i]+cda[i]));
995 print_info (str, "bold", active_project -> text_buffer[BD+OT]);
996 g_free (str);
997 }
998 print_info (" %\n", "bold", active_project -> text_buffer[BD+OT]);
999 }
1000 if (cda[i] != 0.0)
1001 {
1002 print_info ("\t\t Corner-sharing: ", NULL, active_project -> text_buffer[BD+OT]);
1003 str = g_strdup_printf("%11.5lf", cda[i]/active_project -> steps);
1004 print_info (str, "bold", active_project -> text_buffer[BD+OT]);
1005 g_free (str);
1006 if (active_project -> steps > 1)
1007 {
1008 str = g_strdup_printf(" +/- %8.5lf", tcpa[i]);
1009 print_info (str, "bold", active_project -> text_buffer[BD+OT]);
1010 g_free (str);
1011 }
1012 print_info ("\t or \t", NULL, active_project -> text_buffer[BD+OT]);
1013 str = g_strdup_printf("%7.3lf", 100*cda[i]/(eda[i]+cda[i]));
1014 print_info (str, "bold", active_project -> text_buffer[BD+OT]);
1015 g_free (str);
1016 if (active_project -> steps > 1)
1017 {
1018 str = g_strdup_printf(" +/- %7.3lf", 100*tcpa[i]*active_project -> steps/(eda[i]+cda[i]));
1019 print_info (str, "bold", active_project -> text_buffer[BD+OT]);
1020 g_free (str);
1021 }
1022 print_info (" %\n", "bold", active_project -> text_buffer[BD+OT]);
1023 }
1024 if (dda[i] != 0.0)
1025 {
1026 print_info ("\t\t with the following bond defects: ", NULL, active_project -> text_buffer[BD+OT]);
1027 str = g_strdup_printf("%11.5lf", dda[i]/active_project -> steps);
1028 print_info (str, "bold", active_project -> text_buffer[BD+OT]);
1029 g_free (str);
1030 if (active_project -> steps > 1)
1031 {
1032 str = g_strdup_printf(" +/- %8.5lf", tdda[i]);
1033 print_info (str, "bold", active_project -> text_buffer[BD+OT]);
1034 g_free (str);
1035 }
1036 print_info ("\t or \t", NULL, active_project -> text_buffer[BD+OT]);
1037 str = g_strdup_printf("%7.3lf", 100*dda[i]/(eda[i]+cda[i]));
1038 print_info (str, "bold", active_project -> text_buffer[BD+OT]);
1039 g_free (str);
1040 if (active_project -> steps > 1)
1041 {
1042 str = g_strdup_printf(" +/- %7.3lf", 100*tdda[i]*active_project -> steps/(eda[i]+cda[i]));
1043 print_info (str, "bold", active_project -> text_buffer[BD+OT]);
1044 g_free (str);
1045 }
1046 print_info (" %\n", "bold", active_project -> text_buffer[BD+OT]);
1047 }
1048 }
1049 }
1050 print_info ("\nNumber and proportion of tetrahedra units for ", "italic", active_project -> text_buffer[BD+OT]);
1051 print_info (exact_name(active_chem -> label[* sid]), textcolor(* sid), active_project -> text_buffer[BD+OT]);
1052 print_info (" atoms:\n\n", "italic", active_project -> text_buffer[BD+OT]);
1053 for ( i=0 ; i < active_project -> nspec ; i++ )
1054 {
1055 if (atd[i] != 0.0)
1056 {
1057 print_info ("\t- ", NULL, active_project -> text_buffer[BD+OT]);
1058 print_info (exact_name(active_chem -> label[* sid]), textcolor(* sid), active_project -> text_buffer[BD+OT]);
1059 print_info ("(", NULL, active_project -> text_buffer[BD+OT]);
1060 print_info (exact_name(active_chem -> label[i]), textcolor(i), active_project -> text_buffer[BD+OT]);
1061 print_info (")", NULL, active_project -> text_buffer[BD+OT]);
1062 print_info ("4", "sub", active_project -> text_buffer[BD+OT]);
1063 print_info (" tetrahedra:\n", NULL, active_project -> text_buffer[BD+OT]);
1064 print_info ("\t\t Total number of tetrahedra:", NULL, active_project -> text_buffer[BD+OT]);
1065 str = g_strdup_printf("%11.5lf", atd[i]/active_project -> steps);
1066 print_info (str, "bold", active_project -> text_buffer[BD+OT]);
1067 g_free (str);
1068 if (active_project -> steps > 1)
1069 {
1070 str = g_strdup_printf(" +/- %8.5lf", etd[i]);
1071 print_info (str, "bold", active_project -> text_buffer[BD+OT]);
1072 g_free (str);
1073 }
1074 print_info ("\n", "bold", active_project -> text_buffer[BD+OT]);
1075 if (eda[i] != 0.0 )
1076 {
1077 print_info ("\t\t Edge-sharing: ", NULL, active_project -> text_buffer[BD+OT]);
1078 str = g_strdup_printf("%11.5lf", 2.0*eda[i]/active_project -> steps);
1079 print_info (str, "bold", active_project -> text_buffer[BD+OT]);
1080 g_free (str);
1081 if (active_project -> steps > 1)
1082 {
1083 str = g_strdup_printf(" +/- %8.5lf", 2.0*tepa[i]);
1084 print_info (str, "bold", active_project -> text_buffer[BD+OT]);
1085 g_free (str);
1086 }
1087 print_info ("\t or \t", NULL, active_project -> text_buffer[BD+OT]);
1088 str = g_strdup_printf("%7.3lf", 2.0*100*eda[i]/(eda[i]+cda[i]));
1089 print_info (str, "bold", active_project -> text_buffer[BD+OT]);
1090 g_free (str);
1091 if (active_project -> steps > 1)
1092 {
1093 str = g_strdup_printf(" +/- %7.3lf", 2.0*100*tepa[i]*active_project -> steps/(eda[i]+cda[i]));
1094 print_info (str, "bold", active_project -> text_buffer[BD+OT]);
1095 g_free (str);
1096 }
1097 print_info (" %\n", "bold", active_project -> text_buffer[BD+OT]);
1098 }
1099 if (cda[i] != 0.0 )
1100 {
1101
1102 print_info ("\t\t Corner-sharing: ", NULL, active_project -> text_buffer[BD+OT]);
1103 str = g_strdup_printf("%11.5lf", (atd[i]-2*eda[i])/active_project -> steps);
1104 print_info (str, "bold", active_project -> text_buffer[BD+OT]);
1105 g_free (str);
1106 if (active_project -> steps > 1)
1107 {
1108 str = g_strdup_printf(" +/- %8.5lf", 2.0*tepa[i]);
1109 print_info (str, "bold", active_project -> text_buffer[BD+OT]);
1110 g_free (str);
1111 }
1112 print_info ("\t or \t", NULL, active_project -> text_buffer[BD+OT]);
1113 str = g_strdup_printf("%7.3lf", 100.0*(atd[i]-2.0*eda[i])/atd[i]);
1114 print_info (str, "bold", active_project -> text_buffer[BD+OT]);
1115 g_free (str);
1116 if (active_project -> steps > 1)
1117 {
1118 str = g_strdup_printf(" +/- %7.3lf", 2.0*100.0*tepa[i]*active_project -> steps/atd[i]);
1119 print_info (str, "bold", active_project -> text_buffer[BD+OT]);
1120 g_free (str);
1121 }
1122 print_info (" %\n", "bold", active_project -> text_buffer[BD+OT]);
1123 }
1124 }
1125 }
1126 }
1127}
double get_cutoff(double s_a, double s_b)
Definition bdcall.c:210
void prep_ogl_bonds()
initialize bond pointers
Definition bdcall.c:313
void coordout_(int *sid, double *sac, double ssac[active_project -> nspec], int *totgsa)
Definition bdcall.c:768
void clean_coord_window(project *this_proj)
update the environment configuration window after edtion
Definition atom_edit.c:87
void initang()
initialize the curve widgets for the angle distribution
Definition bdcall.c:163
void restore_color_map(glwin *view, int *colm)
restore saved color maps
Definition bdcall.c:96
int * save_color_map(glwin *view)
save atoms and polyhedra color maps
Definition bdcall.c:80
G_MODULE_EXPORT void set_filter_changed(GtkComboBox *box, gpointer data)
change the search filter
Definition w_search.c:3856
G_MODULE_EXPORT void on_calc_bonds_released(GtkWidget *widg, gpointer data)
compute bonding properties
Definition bdcall.c:514
void coordination_info(int sp, double sac, double ssac[active_project -> nspec])
Definition bdcall.c:675
double bdtc
Definition bdcall.c:664
void recup_dmin_dmax_(double *min, double *max)
retrieve min and max inter-atomic distances from Fortran
Definition bdcall.c:128
void envout_(int *sid, int *totgsa, int numgsa[*totgsa])
retrieve environment information for target chemical species from Fortran
Definition bdcall.c:936
void initbd()
initialize the curve widgets for the bond distribution
Definition bdcall.c:139
gboolean run_distance_matrix(GtkWidget *widg, int calc, int up_ngb)
compute distance matrix
Definition bdcall.c:353
void update_angle_view(project *this_proj)
update angle calculation information text buffer
Definition bdcall.c:911
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:942
void update_glwin_after_bonds(int bonding, int *colm)
update glwin menus after bond calculation
Definition bdcall.c:435
void cutoffsend()
send cutoffs to Fortran90
Definition bdcall.c:286
void update_ang_view(project *this_proj)
update angle calculation text buffer
Definition bdcall.c:406
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:832
void initcutoffs(chemical_data *chem, int species)
initialize bond cutoffs
Definition bdcall.c:238
Binding to the Fortran90 subroutines.
int molecules_(int *, int *)
int rundmtx_(int *, int *, int *)
int bond_diedrals_(int *)
void sendcuts_(int *, int *, double *)
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:1416
Callback declarations for main window.
void fill_tool_model()
fill the tool window tree model
Definition tools.c:87
color colorp[64]
Variable declarations for the curve widget Functions for interactions with the curve widget.
void label(cairo_t *cr, double val, int axe, int p, project *this_proj)
draw axis label
Definition labels.c:56
void addcurwidgets(int pid, int rid, int st)
add curve widgets to the project
Definition cwidget.c:259
void clean_curves_data(int calc, int start, int end)
clean curve data on a range of curve id
Definition initc.c:55
int atoms[NUM_STYLES][2]
Variable declarations for the creation of the DL_POLY input file(s)
gboolean reading_input
Definition global.c:182
int mol_update
Definition global.c:171
struct timespec start_time
Definition global.c:191
int activep
Definition global.c:159
double ** allocddouble(int xal, int yal)
allocate a double ** pointer
Definition global.c:475
int frag_update
Definition global.c:170
GtkWidget * MainWindow
Definition global.c:201
gchar * calculation_time(gboolean modelv, double ctime)
get calculation time, human readable
Definition global.c:656
int bonds_update
Definition global.c:169
double opac
Definition global.c:194
int * allocint(int val)
allocate an int * pointer
Definition global.c:314
double get_calc_time(struct timespec start, struct timespec stop)
get calculation time in s
Definition global.c:643
struct timespec stop_time
Definition global.c:192
GtkWidget * curvetoolbox
Definition global.c:205
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:1232
coord_info * active_coord
Definition project.c:49
#define MINCUT
Definition global.h:339
chemical_data * active_chem
Definition project.c:48
#define OT
Definition global.h:323
#define CHEM_R
Definition global.h:301
#define RI
Definition global.h:330
#define BD
Definition global.h:328
void widget_set_sensitive(GtkWidget *widg, gboolean sensitive)
Set sensitivity for a GtkWidget, ensuring it is a GtkWidget.
Definition gtk-misc.c:215
#define AN
Definition global.h:329
void combo_text_append(GtkWidget *combo, gchar *text)
append text in GtkComboBox widget
Definition gtk-misc.c:961
#define min(a, b)
Definition global.h:81
void clean_volumes_data(glwin *view)
clean volume data
Definition w_volumes.c:83
#define CHEM_Z
Definition global.h:299
#define SP
Definition global.h:332
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:182
#define max(a, b)
Definition global.h:80
void update(glwin *view)
update the rendering of the OpenGL window
Definition glview.c:450
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 prep_all_coord_menus(glwin *view)
void view_buffer(GtkTextBuffer *buffer)
set a text buffer in the main window or an image
Definition gui.c:309
void prepostcalc(GtkWidget *widg, gboolean status, int run, int adv, double opc)
to just before and just after running a calculation
Definition initc.c:154
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:824
void show_error(char *error, int val, GtkWidget *win)
show error message
Definition interface.c:293
gchar * env_name(project *this_proj, int g, int s, int f, GtkTextBuffer *buffer)
ouput the name of a coordination sphere
Definition interface.c:950
void print_info(gchar *str, gchar *stag, GtkTextBuffer *buffer)
print information in GtkTextBuffer
Definition interface.c:799
gchar * exact_name(gchar *name)
short cut to print string without spaces
Definition interface.c:370
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:175
Definition glwin.h:351
Definition glwin.h:965
GtkWidget * res[2]
Definition w_encode.c:212
int element
Definition w_periodic.c:61
GtkWidget * img
Definition workspace.c:70