70 active_project -> curves[
CH][0] -> name = g_strdup_printf (
"Chains - Cc(n)[All]");
92 menu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (view -> ogl_coord[0]));
93 if (GTK_IS_WIDGET(menu))
95 gtk_menu_shell_insert (GTK_MENU_SHELL(menu), view -> ogl_chains[0], 3);
117 if (this_proj -> text_buffer[
CH+
OT] == NULL) this_proj -> text_buffer[
CH+
OT] =
add_buffer (NULL, NULL, NULL);
119 j = this_proj -> csparam[0];
122 nelt = g_strdup_printf (
"All");
127 nelt = g_strdup_printf (
"%s", this_proj ->
chemistry ->
label[j-1]);
130 print_info (
"\n\nChain statistics\n\n",
"heading", this_proj -> text_buffer[
CH+
OT]);
133 if (this_proj -> csparam[1])
135 print_info (
" * only AAAA chains have been considered\n",
"italic", this_proj -> text_buffer[
CH+
OT]);
137 if (this_proj -> csparam[2])
139 print_info (
" * only ABAB chains have been considered\n",
"italic", this_proj -> text_buffer[
CH+
OT]);
141 if (this_proj -> csparam[3])
143 print_info (
" * homopolar bonds can not shorten the chains\n",
"italic", this_proj -> text_buffer[
CH+
OT]);
145 if (this_proj -> csparam[4])
147 print_info (
" * only 1-(2)",
"italic", this_proj -> text_buffer[
CH+
OT]);
149 print_info (
"-1 chains have been considered, ie. isolated chains\n",
"italic", this_proj -> text_buffer[
CH+
OT]);
151 print_info (
"\n Atom(s) used to start the search: ", NULL, this_proj -> text_buffer[
CH+
OT]);
153 if (j != 0)
print_info (
" atom(s) only", NULL, this_proj -> text_buffer[
CH+
OT]);
155 if (this_proj -> steps > 1)
157 print_info (
"\n Average number of chains per configuration: ", NULL, this_proj -> text_buffer[
CH+
OT]);
158 str = g_strdup_printf (
"%f", this_proj -> csdata[0]);
161 str = g_strdup_printf (
" +/- %f\n", this_proj -> csdata[1]);
167 print_info (
"\n Total number of chains: ", NULL, this_proj -> text_buffer[
CH+
OT]);
168 str = g_strdup_printf (
"%f\n", this_proj -> csdata[0]);
173 if (this_proj -> steps > 1)
175 print_info (
"\n\t n Av. by step \tCc(n)[",
"bold", this_proj -> text_buffer[
CH+
OT]);
177 if (j == this_proj -> nspec)
179 print_info (
"]\t +/-\n",
"bold", this_proj -> text_buffer[
CH+
OT]);
183 print_info (
"]\t +/-\n",
"bold", this_proj -> text_buffer[
CH+
OT]);
188 print_info (
"\n\t n\tNumber\t\tCc(n)[",
"bold", this_proj -> text_buffer[
CH+
OT]);
194 k = this_proj -> csparam[0];
195 l = (! k) ? this_proj -> natomes : this_proj ->
chemistry -> nsps[k-1];
197 for ( i=1 ; i < this_proj -> csparam[5] ; i++ )
199 if (this_proj -> curves[
CH][k] -> data[1][i] != 0.0)
202 if (j - 2*(j/2) == 0)
204 tab = g_strdup_printf (
"grey_back");
205 cid = g_strdup_printf (
"bold_grey_back");
210 cid = g_strdup_printf (
"bold");
217 str = g_strdup_printf(
"%d", i+1);
220 str = g_strdup_printf(
"\t%f\t", l*this_proj -> curves[
CH][k] -> data[1][i]);
223 str = g_strdup_printf(
"%f\t", this_proj -> curves[
CH][k] -> data[1][i]);
226 if (this_proj -> steps > 1)
228 str = g_strdup_printf(
"%f\t", this_proj -> curves[
CH][k] -> err[i]);
261 if (this_proj -> coord -> totcoord[9])
263 if (this_proj -> coord -> ntg[9]) g_free (this_proj -> coord -> ntg[9]);
264 this_proj -> coord -> ntg[9] = NULL;
265 if (this_proj -> coord -> geolist[9][0]) g_free (this_proj -> coord -> geolist[9][0]);
266 this_proj -> coord -> geolist[9][0] = NULL;
267 this_proj -> coord -> totcoord[9] = 0;
269 if (view -> all_chains) g_free (view -> all_chains);
270 view -> all_chains = NULL;
271 if (view -> num_chains) g_free (view -> num_chains);
272 view -> num_chains = NULL;
273 if (view -> gcid[9]) g_free (view -> gcid[9]);
274 view -> gcid[9] = NULL;
276 view -> chain_max = 0;
278 for (i=0; i<this_proj -> steps; i++)
280 for (j=0; j<this_proj -> natomes; j++)
282 if (this_proj ->
atoms[i][j].chain)
284 g_free (this_proj ->
atoms[i][j].chain);
285 this_proj ->
atoms[i][j].chain = NULL;
328 clock_gettime (CLOCK_MONOTONIC, &
start_time);
336 clock_gettime (CLOCK_MONOTONIC, &
stop_time);
340 show_error (
"The chain statistics calculation has failed", 0, widg);
344 gchar * str = g_strdup_printf (
"\t<b>The chain statistics have failed !</b>\n\n"
345 "The number of chain per MD step appears\n"
346 "to be bigger than the initial value of <b>%d</b>\n"
347 "used to allocate memory to store the results.\n\n"
348 "Increase the value and start again !",
358 show_error (
"The nearest neighbors table calculation has failed", 0, widg);
Binding to the Fortran90 subroutines.
int initchains_(int *, int *, int *, int *, int *, int *, int *)
Callback declarations for main window.
void fill_tool_model()
fill the tool window tree model
integer function chains()
void update_chains_view(project *this_proj)
update the chains statistics text view after the calculation
void clean_coord_window(project *this_proj)
update the environment configuration window after edtion
G_MODULE_EXPORT void on_calc_chains_released(GtkWidget *widg, gpointer data)
compute chains statistics
void clean_chains_data(glwin *view)
cleaning the OpenGL data related to chain statistics
void save_chains_data_(int *taille, double ectrc[*taille], double *rpstep, double *ectrpst)
get chains statistics results form Fortran90
void initchn()
initialize the curve widgets for the chains statistics calculation
gboolean run_distance_matrix(GtkWidget *widg, int calc, int up_ngb)
compute distance matrix
integer(kind=c_int) function chemistry()
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
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...
void update_chains_menus(glwin *view)
GtkTextBuffer * add_buffer(GCallback handler, gpointer data, gchar *text)
create a GtkTextBuffer
coord_info * active_coord
chemical_data * active_chem
GtkWidget * destroy_this_widget(GtkWidget *widg)
destroy a GtkWidget
void cutoffsend()
send cutoffs to Fortran90
GtkWidget * menu_item_new_with_submenu(gchar *name, gboolean active, GtkWidget *sub_menu)
void show_the_widgets(GtkWidget *widg)
show GtkWidget
project * get_project_by_id(int p)
get project pointer using id number
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.
GMenu * add_menu_coord(glwin *view, int popm, int id)
create a coordination type submenu
Function declarations for reading atomes project file Function declarations for saving atomes proje...