71extern G_MODULE_EXPORT
void show_hide_poly (GtkWidget * widg, gpointer data);
86 char * cp[4] = {
"R<sub>c</sub>(n)[",
"P<sub>n</sub>(n)[",
"P<sub>max</sub>(n)[",
"P<sub>min</sub>(n)["};
88 for ( i = 0 ; i < 5 ; i++ )
90 for ( j = 0 ; j < 4 ; j++ )
93 this_proj -> analysis[
RIN] -> curves[l] -> name = g_strdup_printf (_(
"%s - %sAll]"), _(
rings_type[i]), cp[j]);
96 for ( j = 0 ; j < this_proj -> nspec ; j++ )
98 for ( k = 0 ; k < 4 ; k++ )
100 this_proj -> analysis[
RIN] -> curves[l] -> name = g_strdup_printf (
"%s - %s%s]", _(
rings_type[i]), cp[k],
active_chem -> label[j]);
106 this_proj -> analysis[
RIN] -> init_ok = TRUE;
123 menu = gtk_menu_item_get_submenu (GTK_MENU_ITEM(view -> ogl_rings[i*6]));
124 if (GTK_IS_WIDGET(menu))
128 if (GTK_IS_WIDGET(view -> ogl_rings[i*6+j]))
130 g_object_ref (view -> ogl_rings[i*6+j]);
131 gtk_container_remove (GTK_CONTAINER(menu), view -> ogl_rings[i*6+j]);
135 gtk_menu_item_set_submenu ((GtkMenuItem *)view -> ogl_rings[i*6],
prep_rings_menu (view, i*6));
158 if (this_proj -> analysis[
RIN] -> calc_buffer == NULL) this_proj -> analysis[
RIN] -> calc_buffer =
add_buffer (NULL, NULL, NULL);
160 j = this_proj -> rsparam[c][0];
163 nelt = g_strdup_printf (_(
"All"));
168 nelt = g_strdup_printf (
"%s", this_proj ->
chemistry -> label[j-1]);
171 print_info (_(
"\n\nRing statistics\n\n"),
"heading", this_proj -> analysis[
RIN] -> calc_buffer);
172 str = g_strdup_printf (_(
"\n%s rings analysis details:\n"),
rings_type[c]);
173 print_info (str,
"italic", this_proj -> analysis[
RIN] -> calc_buffer);
176 if (this_proj -> rsparam[c][2])
178 print_info (_(
" * only ABAB rings have been considered\n"),
"italic", this_proj -> analysis[
RIN] -> calc_buffer);
180 if (this_proj -> rsparam[c][3])
182 print_info (_(
" * no homopolar bonds in the rings (A-A, B-B ...)\n"),
"italic", this_proj -> analysis[
RIN] -> calc_buffer);
184 if (this_proj -> rsparam[c][4])
186 print_info (_(
" * no homopolar bonds in the connectivity matrix (A-A, B-B ...)\n"),
"italic", this_proj -> analysis[
RIN] -> calc_buffer);
189 print_info (_(
"\n Atom(s) used to start the search: "), NULL, this_proj -> analysis[
RIN] -> calc_buffer);
191 if (j != 0)
print_info (_(
" atom(s) only"), NULL, this_proj -> analysis[
RIN] -> calc_buffer);
193 if (this_proj -> steps > 1)
195 print_info (_(
"\n Average number of rings per configuration: "), NULL, this_proj -> analysis[
RIN] -> calc_buffer);
196 str = g_strdup_printf (
"%f", this_proj -> rsdata[c][0]);
197 print_info (str,
"bold", this_proj -> analysis[
RIN] -> calc_buffer);
199 str = g_strdup_printf (
" +/- %f\n", this_proj -> rsdata[c][1]);
200 print_info (str,
"bold", this_proj -> analysis[
RIN] -> calc_buffer);
205 print_info (_(
"\n Total number of rings: "), NULL, this_proj -> analysis[
RIN] -> calc_buffer);
206 str = g_strdup_printf (
"%f\n", this_proj -> rsdata[c][0]);
207 print_info (str,
"bold", this_proj -> analysis[
RIN] -> calc_buffer);
210 if (c == 1 || c == 2)
212 if (this_proj -> steps > 1)
214 print_info (_(
" Average number of ring(s) with n > "), NULL, this_proj -> analysis[
RIN] -> calc_buffer);
218 print_info (_(
" Number of ring(s) with n > "), NULL, this_proj -> analysis[
RIN] -> calc_buffer);
220 str = g_strdup_printf (
"%d", this_proj -> rsparam[c][1]);
221 print_info (str,
"bold", this_proj -> analysis[
RIN] -> calc_buffer);
223 print_info (_(
" nodes that potentially exist: "), NULL, this_proj -> analysis[
RIN] -> calc_buffer);
224 str = g_strdup_printf (
"%f", this_proj -> rsdata[c][2]);
225 print_info (str,
"bold", this_proj -> analysis[
RIN] -> calc_buffer);
227 if (this_proj -> steps > 1)
229 str = g_strdup_printf (
" +/- %f", this_proj -> rsdata[c][3]);
230 print_info (str,
"bold", this_proj -> analysis[
RIN] -> calc_buffer);
233 print_info (
"\n", NULL, this_proj -> analysis[
RIN] -> calc_buffer);
235 print_info (
"\n\t n\tR",
"bold", this_proj -> analysis[
RIN] -> calc_buffer);
236 print_info (
"c",
"sub_bold", this_proj -> analysis[
RIN] -> calc_buffer);
237 print_info (
"(n)[",
"bold", this_proj -> analysis[
RIN] -> calc_buffer);
239 if (this_proj -> steps > 1)
241 print_info (
"]\t +/- \tP",
"bold", this_proj -> analysis[
RIN] -> calc_buffer);
242 print_info (
"n",
"sub_bold", this_proj -> analysis[
RIN] -> calc_buffer);
243 print_info (
"(n)[",
"bold", this_proj -> analysis[
RIN] -> calc_buffer);
245 print_info (
"]\t +/- \tP",
"bold", this_proj -> analysis[
RIN] -> calc_buffer);
246 print_info (
"max",
"sub_bold", this_proj -> analysis[
RIN] -> calc_buffer);
247 print_info (
"(n)[",
"bold", this_proj -> analysis[
RIN] -> calc_buffer);
249 print_info (
"]\t +/- \tP",
"bold", this_proj -> analysis[
RIN] -> calc_buffer);
250 print_info (
"min",
"sub_bold", this_proj -> analysis[
RIN] -> calc_buffer);
251 print_info (
"(n)[",
"bold", this_proj -> analysis[
RIN] -> calc_buffer);
253 print_info (
"]\t +/-\n",
"bold", this_proj -> analysis[
RIN] -> calc_buffer);
257 print_info (
"]\tP",
"bold", this_proj -> analysis[
RIN] -> calc_buffer);
258 print_info (
"n",
"sub_bold", this_proj -> analysis[
RIN] -> calc_buffer);
259 print_info (
"(n)[",
"bold", this_proj -> analysis[
RIN] -> calc_buffer);
261 print_info (
"]\tP",
"bold", this_proj -> analysis[
RIN] -> calc_buffer);
262 print_info (
"max",
"sub_bold", this_proj -> analysis[
RIN] -> calc_buffer);
263 print_info (
"(n)[",
"bold", this_proj -> analysis[
RIN] -> calc_buffer);
265 print_info (
"]\tP",
"bold", this_proj -> analysis[
RIN] -> calc_buffer);
266 print_info (
"min",
"sub_bold", this_proj -> analysis[
RIN] -> calc_buffer);
267 print_info (
"(n)[",
"bold", this_proj -> analysis[
RIN] -> calc_buffer);
269 print_info (
"]\n",
"bold", this_proj -> analysis[
RIN] -> calc_buffer);
273 k = 4*(c*(this_proj -> nspec+1) + this_proj -> rsparam[c][0]);
275 for ( i=2 ; i < this_proj -> rsparam[c][1] ; i++ )
277 if (this_proj -> analysis[
RIN] -> curves[k] -> data[1][i] != 0.0)
280 if (j - 2*(j/2) == 0)
282 tab = g_strdup_printf (
"grey_back");
283 cid = g_strdup_printf (
"bold_grey_back");
288 cid = g_strdup_printf (
"bold");
290 print_info (
"\t", NULL, this_proj -> analysis[
RIN] -> calc_buffer);
293 print_info (
" ",cid, this_proj -> analysis[
RIN] -> calc_buffer);
295 str = g_strdup_printf(
"%d", i+1);
296 print_info (str, cid, this_proj -> analysis[
RIN] -> calc_buffer);
298 str = g_strdup_printf(
"\t%f\t", this_proj -> analysis[
RIN] -> curves[k] -> data[1][i]);
299 print_info (str, tab, this_proj -> analysis[
RIN] -> calc_buffer);
301 if (this_proj -> steps > 1)
303 str = g_strdup_printf(
"%f\t", this_proj -> analysis[
RIN] -> curves[k] -> err[i]);
304 print_info (str, tab, this_proj -> analysis[
RIN] -> calc_buffer);
307 str = g_strdup_printf(
"%f\t", this_proj -> analysis[
RIN] -> curves[k+1] -> data[1][i]);
308 print_info (str, tab, this_proj -> analysis[
RIN] -> calc_buffer);
310 if (this_proj -> steps > 1)
312 str = g_strdup_printf(
"%f\t", this_proj -> analysis[
RIN] -> curves[k+1] -> err[i]);
313 print_info (str, tab, this_proj -> analysis[
RIN] -> calc_buffer);
316 str = g_strdup_printf(
"%f\t", this_proj -> analysis[
RIN] -> curves[k+2] -> data[1][i]);
317 print_info (str, tab, this_proj -> analysis[
RIN] -> calc_buffer);
319 if (this_proj -> steps > 1)
321 str = g_strdup_printf(
"%f\t", this_proj -> analysis[
RIN] -> curves[k+2] -> err[i]);
322 print_info (str, tab, this_proj -> analysis[
RIN] -> calc_buffer);
325 str = g_strdup_printf(
"%f", this_proj -> analysis[
RIN] -> curves[k+3] -> data[1][i]);
326 print_info (str, tab, this_proj -> analysis[
RIN] -> calc_buffer);
328 if (this_proj -> steps > 1)
330 str = g_strdup_printf(
"\t%f", this_proj -> analysis[
RIN] -> curves[k+3] -> err[i]);
331 print_info (str, tab, this_proj -> analysis[
RIN] -> calc_buffer);
334 print_info (
"\n", NULL, this_proj -> analysis[
RIN] -> calc_buffer);
364 view -> ring_max[rid] = 0;
368 for (i=0; i<this_proj -> coord -> totcoord[4+rid]; i++)
370 if (view -> ogl_poly[0][4+rid][i] != NULL)
372 if (GTK_IS_WIDGET(view -> ogl_poly[0][4+rid][i]))
374 if (view -> anim -> last ->
img -> show_poly[4+rid][i])
376 gtk_check_menu_item_set_active ((GtkCheckMenuItem *)view -> ogl_poly[0][4+rid][i], FALSE);
377 show_hide_poly (view -> ogl_poly[0][4+rid][i], & view -> gcid[4+rid][i][4+rid]);
383 if (this_proj -> coord -> totcoord[4+rid])
385 if (this_proj -> coord -> ntg[4+rid]) g_free (this_proj -> coord -> ntg[4+rid]);
386 this_proj -> coord -> ntg[4+rid] = NULL;
387 if (this_proj -> coord -> geolist[4+rid][0]) g_free (this_proj -> coord -> geolist[4+rid][0]);
388 this_proj -> coord -> geolist[4+rid][0] = NULL;
389 this_proj -> coord -> totcoord[4+rid] = 0;
391 if (view -> all_rings[rid]) g_free (view -> all_rings[rid]);
392 view -> all_rings[rid] = NULL;
393 if (view -> num_rings[rid]) g_free (view -> num_rings[rid]);
394 view -> num_rings[rid] = NULL;
395 if (view -> show_rpoly[rid]) g_free (view -> show_rpoly[rid]);
396 view -> show_rpoly[rid] = NULL;
397 if (view -> gcid[4+rid]) g_free (view -> gcid[4+rid]);
398 view -> gcid[4+rid] = NULL;
399 for (i=0; i<this_proj -> steps; i++)
401 for (j=0; j<this_proj -> natomes; j++)
403 if (this_proj ->
atoms[i][j].rings[rid])
405 g_free (this_proj ->
atoms[i][j].rings[rid]);
406 this_proj ->
atoms[i][j].rings[rid] = NULL;
414 update_menu_bar (view);
432 g_debug (
"Calc rings !");
433 g_debug (
" - rings definition: %d", search);
434 if (
active_project -> rsparam[search][2]) g_debug (
" - only ABAB rings !");
435 if (
active_project -> rsparam[search][3]) g_debug (
" - no homopolar bonds in rings !");
436 if (
active_project -> rsparam[search][4]) g_debug (
" - no homopolar bonds at all !");
446 show_error (_(
"The nearest neighbors table calculation has failed"), 0, widg);
480 show_error (_(
"The ring statistics calculation has failed"), 0, widg);
486 gchar * str = g_strdup_printf (_(
"\t<b>The ring statistics have failed !</b>\n\n"
487 "The number of ring per MD step appears\n"
488 "to be bigger than the initial value of <b>%d</b>\n"
489 "used to allocate memory to store the results.\n\n"
490 "Increase the value and start again !"),
554 double ectrc[* taille],
555 double ectpna[* taille],
556 double ectmax[* taille],
557 double ectmin[* taille],
558 double * rpstep,
double * ectrpst,
559 double * nampat,
double * ectampat)
gboolean run_distance_matrix(GtkWidget *widg, int calc, int up_ngb)
compute distance matrix
Binding to the Fortran90 subroutines.
int initrings_(int *, int *, int *, int *, int *, int *)
Callback declarations for main window.
void fill_tool_model()
fill the tool window tree model
integer(kind=c_int) function chemistry()
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
void clean_curves_data(int calc, int start, int end)
clean curve data on a range of curve id
double * duplicate_double(int num, double *old_val)
copy a list of double
struct timespec start_time
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 cutoffsend()
send cutoffs to Fortran90
void update_rings_menus(glwin *view)
void show_the_widgets(GtkWidget *widg)
show GtkWidget
project * get_project_by_id(int p)
get project pointer using id number
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 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.
gchar * textcolor(int i)
setup text color keyword
void show_error(char *error, int val, GtkWidget *win)
show error message
void print_info(gchar *str, gchar *stag, GtkTextBuffer *buffer)
print information in GtkTextBuffer
Messaging function declarations.
Function declarations for reading atomes project file Function declarations for saving atomes proje...
void save_rings_data_(int *taille, double ectrc[*taille], double ectpna[*taille], double ectmax[*taille], double ectmin[*taille], double *rpstep, double *ectrpst, double *nampat, double *ectampat)
get rings statistics results form Fortran90
void clean_coord_window(project *this_proj)
update the environment configuration window after edtion
void update_rings_view(project *this_proj, int c)
update the text view for ring statistics
G_MODULE_EXPORT void on_calc_rings_released(GtkWidget *widg, gpointer data)
compute ring statistics
void clean_rings_data(int rid, glwin *view)
clean a ring type data for a glview
GtkWidget * prep_rings_menu(glwin *view, int id)
int update_voisj_and_contj()
update FORTRAN CONTJ and VOISJ for the active project
gboolean run_distance_matrix(GtkWidget *widg, int calc, int up_ngb)
compute distance matrix
G_MODULE_EXPORT void show_hide_poly(GSimpleAction *action, GVariant *parameter, gpointer data)
void init_ring(project *this_proj)
initialize the curve widgets for the ring statistics