73 this_proj -> analysis[
CHA] -> curves[0] -> name = g_strdup_printf (_(
"Chains - C<sub>c</sub>(n)[All]"));
74 for (i=0 ; i<this_proj -> nspec ; i++)
76 this_proj -> analysis[
CHA] -> curves[i+1] -> name = g_strdup_printf (_(
"Chains - C<sub>c</sub>(n)[%s]"),
active_chem -> label[i]);
79 this_proj -> analysis[
CHA] -> init_ok = TRUE;
95 menu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (view -> ogl_coord[0]));
96 if (GTK_IS_WIDGET(menu))
98 gtk_menu_shell_insert (GTK_MENU_SHELL(menu), view -> ogl_chains[0], 3);
119 if (this_proj -> analysis[
CHA] -> calc_buffer == NULL) this_proj -> analysis[
CHA] -> calc_buffer =
add_buffer (NULL, NULL, NULL);
121 j = this_proj -> csparam[0];
124 nelt = g_strdup_printf (_(
"All"));
129 nelt = g_strdup_printf (
"%s", this_proj ->
chemistry -> label[j-1]);
132 print_info (_(
"\n\nChain statistics\n\n"),
"heading", this_proj -> analysis[
CHA] -> calc_buffer);
134 if (this_proj -> csparam[1])
136 print_info (_(
" * only AAAA chains have been considered\n"),
"italic", this_proj -> analysis[
CHA] -> calc_buffer);
138 if (this_proj -> csparam[2])
140 print_info (_(
" * only ABAB chains have been considered\n"),
"italic", this_proj -> analysis[
CHA] -> calc_buffer);
142 if (this_proj -> csparam[3])
144 print_info (_(
" * homopolar bonds can not shorten the chains\n"),
"italic", this_proj -> analysis[
CHA] -> calc_buffer);
146 if (this_proj -> csparam[4])
148 print_info (_(
" * only 1-(2)"),
"italic", this_proj -> analysis[
CHA] -> calc_buffer);
149 print_info (
"n",
"sub_italic", this_proj -> analysis[
CHA] -> calc_buffer);
150 print_info (_(
"-1 chains have been considered, ie. isolated chains\n"),
"italic", this_proj -> analysis[
CHA] -> calc_buffer);
152 print_info (_(
"\n Atom(s) used to start the search: "), NULL, this_proj -> analysis[
CHA] -> calc_buffer);
154 if (j != 0)
print_info (_(
" atom(s) only"), NULL, this_proj -> analysis[
CHA] -> calc_buffer);
156 if (this_proj -> steps > 1)
158 print_info (_(
"\n Average number of chains per configuration: "), NULL, this_proj -> analysis[
CHA] -> calc_buffer);
159 str = g_strdup_printf (
"%f", this_proj -> csdata[0]);
160 print_info (str,
"bold", this_proj -> analysis[
CHA] -> calc_buffer);
162 str = g_strdup_printf (
" +/- %f\n", this_proj -> csdata[1]);
163 print_info (str,
"bold", this_proj -> analysis[
CHA] -> calc_buffer);
168 print_info (_(
"\n Total number of chains: "), NULL, this_proj -> analysis[
CHA] -> calc_buffer);
169 str = g_strdup_printf (
"%f\n", this_proj -> csdata[0]);
170 print_info (str,
"bold", this_proj -> analysis[
CHA] -> calc_buffer);
174 if (this_proj -> steps > 1)
176 print_info (_(
"\n\t n Av. by step \tC"),
"bold", this_proj -> analysis[
CHA] -> calc_buffer);
177 print_info (
"c",
"sub_bold", this_proj -> analysis[
CHA] -> calc_buffer);
178 print_info (
"(n)[",
"bold", this_proj -> analysis[
CHA] -> calc_buffer);
180 if (j == this_proj -> nspec)
182 print_info (
"]\t +/-\n",
"bold", this_proj -> analysis[
CHA] -> calc_buffer);
186 print_info (
"]\t +/-\n",
"bold", this_proj -> analysis[
CHA] -> calc_buffer);
191 print_info (_(
"\n\t n\tNumber\t\tC"),
"bold", this_proj -> analysis[
CHA] -> calc_buffer);
192 print_info (
"c",
"sub_bold", this_proj -> analysis[
CHA] -> calc_buffer);
193 print_info (
"(n)[",
"bold", this_proj -> analysis[
CHA] -> calc_buffer);
195 print_info (
"]\n", NULL, this_proj -> analysis[
CHA] -> calc_buffer);
199 k = this_proj -> csparam[0];
200 l = (! k) ? this_proj -> natomes : this_proj ->
chemistry -> nsps[k-1];
202 for ( i=1 ; i < this_proj -> csparam[5] ; i++ )
204 if (this_proj -> analysis[
CHA] -> curves[k] -> data[1][i] != 0.0)
207 if (j - 2*(j/2) == 0)
209 tab = g_strdup_printf (
"grey_back");
210 cid = g_strdup_printf (
"bold_grey_back");
215 cid = g_strdup_printf (
"bold");
217 print_info (
"\t", NULL, this_proj -> analysis[
CHA] -> calc_buffer);
220 print_info (
" ",cid, this_proj -> analysis[
CHA] -> calc_buffer);
222 str = g_strdup_printf(
"%d", i+1);
223 print_info (str, cid, this_proj -> analysis[
CHA] -> calc_buffer);
225 str = g_strdup_printf(
"\t%f\t", l*this_proj -> analysis[
CHA] -> curves[k] -> data[1][i]);
226 print_info (str, tab, this_proj -> analysis[
CHA] -> calc_buffer);
228 str = g_strdup_printf(
"%f\t", this_proj -> analysis[
CHA] -> curves[k] -> data[1][i]);
229 print_info (str, tab, this_proj -> analysis[
CHA] -> calc_buffer);
231 if (this_proj -> steps > 1)
233 str = g_strdup_printf(
"%f\t", this_proj -> analysis[
CHA] -> curves[k] -> err[i]);
234 print_info (str, tab, this_proj -> analysis[
CHA] -> calc_buffer);
237 print_info (
"\n", NULL, this_proj -> analysis[
CHA] -> calc_buffer);
266 if (this_proj -> coord -> totcoord[9])
268 if (this_proj -> coord -> ntg[9]) g_free (this_proj -> coord -> ntg[9]);
269 this_proj -> coord -> ntg[9] = NULL;
270 if (this_proj -> coord -> geolist[9][0]) g_free (this_proj -> coord -> geolist[9][0]);
271 this_proj -> coord -> geolist[9][0] = NULL;
272 this_proj -> coord -> totcoord[9] = 0;
274 if (view -> all_chains) g_free (view -> all_chains);
275 view -> all_chains = NULL;
276 if (view -> num_chains) g_free (view -> num_chains);
277 view -> num_chains = NULL;
278 if (view -> gcid[9]) g_free (view -> gcid[9]);
279 view -> gcid[9] = NULL;
281 view -> chain_max = 0;
283 for (i=0; i<this_proj -> steps; i++)
285 for (j=0; j<this_proj -> natomes; j++)
287 if (this_proj ->
atoms[i][j].chain)
289 g_free (this_proj ->
atoms[i][j].chain);
290 this_proj ->
atoms[i][j].chain = NULL;
315 show_error (_(
"The nearest neighbors table calculation has failed"), 0, widg);
346 show_error (_(
"The chain statistics calculation has failed"), 0, widg);
350 gchar * str = g_strdup_printf (_(
"\t<b>The chain statistics have failed !</b>\n\n"
351 "The number of chain per MD step appears\n"
352 "to be bigger than the initial value of <b>%d</b>\n"
353 "used to allocate memory to store the results.\n\n"
354 "Increase the value and start again !"),
gboolean run_distance_matrix(GtkWidget *widg, int calc, int up_ngb)
compute distance matrix
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 init_chain(project *this_proj)
initialize the curve widgets for the chains statistics calculation
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
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
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
gchar * calculation_time(gboolean modelv, double ctime)
get calculation time, human readable
int * allocint(int val)
allocate an int * pointer
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
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...