69extern G_MODULE_EXPORT
void set_color_map (GtkWidget * widg, gpointer data);
84 for (i=0; i<2; i++) colm[i] = view -> anim -> last ->
img -> color_map[i];
105 if ((i == 3 || i == 4) && ! view -> adv_bonding[i-3])
113 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> color_styles[j], TRUE);
174 active_project -> curves[
AN][h] -> name = g_strdup_printf(
"Angles [%s-%s-%s]",
190 active_project -> curves[
AN][h] -> name = g_strdup_printf(
"Dihedral [%s-%s-%s-%s]",
215 int z_a =
min (s_a, s_b);
216 int z_b =
max (s_a, s_b);
219 if (cut -> Z[0] == z_a && cut -> Z[1] == z_b)
return cut -> cutoff;
241 for (i = 0; i < species; i++)
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)
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;
251 for (i = 0; i < species-1; i++)
253 for (j = i+1; j < species; j++)
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)
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;
265 chem -> cutoffs[j][i] = chem -> cutoffs[i][j];
268 chem -> grtotcutoff = (chem -> grtotcutoff != 0.0) ? chem -> grtotcutoff :
default_totcut;
269 if (chem -> grtotcutoff == 0.0)
271 for (i = 0; i < species; i++)
273 chem -> grtotcutoff += chem -> chem_prop[
CHEM_R][i];
275 chem -> grtotcutoff *= 2.0;
276 chem -> grtotcutoff /= species;
277 chem -> grtotcutoff =
max(
MINCUT, chem -> grtotcutoff);
341 for (i=0; i<2; i++)
active_glwin -> adv_bonding[i] = FALSE;
379 if (calc > 3 && calc < 6) i = 1;
380 if (calc > 0 && calc < 6)
389 g_debug (
"Run dmtx Prim= %d, NOHP= %d, UPDATE= %d", i, j, k);
391 clock_gettime (CLOCK_MONOTONIC, &
start_time);
394 clock_gettime (CLOCK_MONOTONIC, &
stop_time);
409 if (this_proj -> text_buffer[
AN+
OT] == NULL) this_proj -> text_buffer[
AN+
OT] =
add_buffer (NULL, NULL, NULL);
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]);
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]);
467 if (GTK_IS_WIDGET(
active_glwin -> search_widg[i] -> filter_box))
471 gtk_combo_box_text_remove ((GtkComboBoxText *)
active_glwin -> search_widg[i] -> filter_box, 4);
479 gtk_combo_box_text_remove ((GtkComboBoxText *)
active_glwin -> search_widg[i] -> filter_box, 3);
550 clock_gettime (CLOCK_MONOTONIC, &
start_time);
552 clock_gettime (CLOCK_MONOTONIC, &
stop_time);
558 show_error (
"Unexpected error when calculating bond properties", 0, (widg) ? widg :
MainWindow);
568 clock_gettime (CLOCK_MONOTONIC, &
start_time);
571 show_error (
"Unexpected error when looking for isolated fragment(s) and molecule(s)", 0, (widg) ? widg :
MainWindow);
600 clock_gettime (CLOCK_MONOTONIC, &
stop_time);
620 clock_gettime (CLOCK_MONOTONIC, &
start_time);
624 show_error (
"Unexpected error when calculating the bond angles distribution", 0, (widg) ? widg :
MainWindow);
629 clock_gettime (CLOCK_MONOTONIC, &
stop_time);
633 show_error (
"Unexpected error when calculating the dihedral angles distribution", 0, (widg) ? widg :
MainWindow);
646 show_error (
"The nearest neighbors table calculation has failed", 0, (widg) ? widg :
MainWindow);
685 print_info (
"Existence of a bond between two atoms i (α) and j (β)\n"
686 "if the two following conditions are verified:\n\n"
689 str = g_strdup_printf (
" < first minimum of the total RDF (%9.5f Å )\n\t2) D",
active_chem -> grtotcutoff);
703 spr = g_strdup_printf(
"%s",
textcolor(sp));
709 str = g_strdup_printf(
"%9.5lf\n", sac);
717 str = g_strdup_printf(
"%s",
textcolor(j));
728 str = g_strdup_printf (
"%9.5lf Å",
active_chem -> cutoffs[sp][j]);
732 str = g_strdup_printf (
"%9.5lf", ssac[j]);
738 str = g_strdup_printf (
"%7.3lf", ssac[j]*100.0/(sac));
742 str = g_strdup_printf (
"%7.3lf", 0.0);
832void env_info (
int sp,
int totgsa,
int numgsa[totgsa])
836 gchar * str, * spr, * snr;
839 spr = g_strdup_printf (
"%s",
textcolor(sp));
849 i = 6 - strlen (snr);
851 str = g_strdup_printf (
"N(%s)", snr);
852 spr = g_strdup_printf (
"%s",
textcolor(j));
861 for ( i=0 ; i < totgsa; i++ )
865 for ( i=0 ; i < totgsa; i++ )
877 k = 12 - strlen (spr);
881 str = g_strdup_printf (
"%3d ", natpg[i]);
886 str = g_strdup_printf(
" %7d", k);
887 spr = g_strdup_printf (
"%s",
textcolor(j));
892 str = g_strdup_printf(
" %16.5lf", (1.0*numgsa[i])/
active_project -> steps);
896 str = g_strdup_printf (
"%7.3lf ", 100.0*numgsa[i]/tgsa);
914 if (this_proj -> text_buffer[
AN+
OT] == NULL) this_proj -> text_buffer[
AN+
OT] =
add_buffer (NULL, NULL, NULL);
916 print_info (
"\n\nAngle distribution function(s)\n\n",
"heading", this_proj -> text_buffer[
AN+
OT]);
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]);
924 print_info (
"\n\n\t between 0.0 and 180.0°\n", NULL, this_proj -> text_buffer[
AN+
OT]);
936void envout_ (
int * sid,
int * totgsa,
int numgsa[* totgsa])
957 if (eda[i] != 0.0 || cda[i] != 0.0) print=TRUE;
967 if (eda[i] != 0.0 || cda[i] != 0.0)
984 str = g_strdup_printf(
" +/- %8.5lf", tepa[i]);
989 str = g_strdup_printf(
"%7.3lf", 100*eda[i]/(eda[i]+cda[i]));
994 str = g_strdup_printf(
" +/- %7.3lf", 100*tepa[i]*
active_project -> steps/(eda[i]+cda[i]));
1003 str = g_strdup_printf(
"%11.5lf", cda[i]/
active_project -> steps);
1008 str = g_strdup_printf(
" +/- %8.5lf", tcpa[i]);
1013 str = g_strdup_printf(
"%7.3lf", 100*cda[i]/(eda[i]+cda[i]));
1018 str = g_strdup_printf(
" +/- %7.3lf", 100*tcpa[i]*
active_project -> steps/(eda[i]+cda[i]));
1027 str = g_strdup_printf(
"%11.5lf", dda[i]/
active_project -> steps);
1032 str = g_strdup_printf(
" +/- %8.5lf", tdda[i]);
1037 str = g_strdup_printf(
"%7.3lf", 100*dda[i]/(eda[i]+cda[i]));
1042 str = g_strdup_printf(
" +/- %7.3lf", 100*tdda[i]*
active_project -> steps/(eda[i]+cda[i]));
1065 str = g_strdup_printf(
"%11.5lf", atd[i]/
active_project -> steps);
1070 str = g_strdup_printf(
" +/- %8.5lf", etd[i]);
1078 str = g_strdup_printf(
"%11.5lf", 2.0*eda[i]/
active_project -> steps);
1083 str = g_strdup_printf(
" +/- %8.5lf", 2.0*tepa[i]);
1088 str = g_strdup_printf(
"%7.3lf", 2.0*100*eda[i]/(eda[i]+cda[i]));
1093 str = g_strdup_printf(
" +/- %7.3lf", 2.0*100*tepa[i]*
active_project -> steps/(eda[i]+cda[i]));
1103 str = g_strdup_printf(
"%11.5lf", (atd[i]-2*eda[i])/
active_project -> steps);
1108 str = g_strdup_printf(
" +/- %8.5lf", 2.0*tepa[i]);
1113 str = g_strdup_printf(
"%7.3lf", 100.0*(atd[i]-2.0*eda[i])/atd[i]);
1118 str = g_strdup_printf(
" +/- %7.3lf", 2.0*100.0*tepa[i]*
active_project -> steps/atd[i]);
double get_cutoff(double s_a, double s_b)
void prep_ogl_bonds()
initialize bond pointers
void coordout_(int *sid, double *sac, double ssac[active_project -> nspec], int *totgsa)
void clean_coord_window(project *this_proj)
update the environment configuration window after edtion
void initang()
initialize the curve widgets for the angle distribution
void restore_color_map(glwin *view, int *colm)
restore saved color maps
int * save_color_map(glwin *view)
save atoms and polyhedra color maps
G_MODULE_EXPORT void set_filter_changed(GtkComboBox *box, gpointer data)
change the search filter
G_MODULE_EXPORT void on_calc_bonds_released(GtkWidget *widg, gpointer data)
compute bonding properties
void coordination_info(int sp, double sac, double ssac[active_project -> nspec])
void recup_dmin_dmax_(double *min, double *max)
retrieve min and max inter-atomic distances from Fortran
void envout_(int *sid, int *totgsa, int numgsa[*totgsa])
retrieve environment information for target chemical species from Fortran
void initbd()
initialize the curve widgets for the bond distribution
gboolean run_distance_matrix(GtkWidget *widg, int calc, int up_ngb)
compute distance matrix
void update_angle_view(project *this_proj)
update angle calculation information text buffer
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])
void update_glwin_after_bonds(int bonding, int *colm)
update glwin menus after bond calculation
void cutoffsend()
send cutoffs to Fortran90
void update_ang_view(project *this_proj)
update angle calculation text buffer
G_MODULE_EXPORT void set_color_map(GtkWidget *widg, gpointer data)
set color map callback
void env_info(int sp, int totgsa, int numgsa[totgsa])
output environment information for target chemical species in text buffer
void initcutoffs(chemical_data *chem, int species)
initialize bond cutoffs
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 *)
integer(kind=c_int) function bonding(scf, sbf, adv, bdist, bmin, delt_ij, sfil)
GtkFileFilter * filter[NCFORMATS+1]
Callback declarations for main window.
void fill_tool_model()
fill the tool window tree model
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
void addcurwidgets(int pid, int rid, int st)
add curve widgets to the project
void clean_curves_data(int calc, int start, int end)
clean curve data on a range of curve id
Variable declarations for the creation of the DL_POLY input file(s)
struct timespec start_time
double ** allocddouble(int xal, int yal)
allocate a double ** pointer
gchar * calculation_time(gboolean modelv, double ctime)
get calculation time, human readable
int * allocint(int val)
allocate an int * pointer
double get_calc_time(struct timespec start, struct timespec stop)
get calculation time in s
struct timespec stop_time
Global variable declarations Global convenience function declarations Global data structure defin...
GtkTextBuffer * add_buffer(GCallback handler, gpointer data, gchar *text)
create a GtkTextBuffer
coord_info * active_coord
chemical_data * active_chem
void widget_set_sensitive(GtkWidget *widg, gboolean sensitive)
Set sensitivity for a GtkWidget, ensuring it is a GtkWidget.
void combo_text_append(GtkWidget *combo, gchar *text)
append text in GtkComboBox widget
void clean_volumes_data(glwin *view)
clean volume data
void show_the_widgets(GtkWidget *widg)
show GtkWidget
void update(glwin *view)
update the rendering of the OpenGL window
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
shaders
The different types of shaders in the atomes program.
void prep_all_coord_menus(glwin *view)
void view_buffer(GtkTextBuffer *buffer)
set a text buffer in the main window or an image
void prepostcalc(GtkWidget *widg, gboolean status, int run, int adv, double opc)
to just before and just after running a calculation
Function declarations to handle the atomic coordination data.
void set_advanced_bonding_menus(glwin *view)
gchar * textcolor(int i)
setup text color keyword
void show_error(char *error, int val, GtkWidget *win)
show error message
gchar * env_name(project *this_proj, int g, int s, int f, GtkTextBuffer *buffer)
ouput the name of a coordination sphere
void print_info(gchar *str, gchar *stag, GtkTextBuffer *buffer)
print information in GtkTextBuffer
gchar * exact_name(gchar *name)
short cut to print string without spaces
Messaging function declarations.
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