atomes 1.3.1
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
debugio.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-2026 by CNRS and University of Strasbourg */
15
21
22/*
23* This file: 'debugio.c'
24*
25* Contains:
26*
27
28 - Some debugging and printing functions
29
30*
31* List of functions:
32
33 void debugiocurve (project * this_proj, gboolean win, int rid, int cid, gchar * iost);
34 void debug_lattice_info (project * this_proj, gchar * iost);
35 void debugioproj (project * this_proj, gchar * iost);
36 void debug_chemical_information (project * this_proj);
37
38*/
39
40#include "global.h"
41#include "project.h"
42
54void debugiocurve (project * this_proj, gboolean win, int rid, int cid, gchar * iost)
55{
56 Curve * this_curve = this_proj -> analysis[rid] -> curves[cid];
57 g_debug (" ");
58 g_debug ("IODEBUG: %s: pid= %d, rid= %d, cid= %d", iost, this_proj -> id, rid, cid);
59 g_debug ("IODEBUG: %s: ndata= %d", iost, this_curve -> ndata);
60 if (this_curve -> data[0] == NULL)
61 {
62 g_debug ("IODEBUG: %s: data[0] == NULL", iost);
63 }
64 g_debug ("IODEBUG: %s: x[0]= %f", iost, this_curve -> data[0][0]);
65 g_debug ("IODEBUG: %s: y[0]= %f", iost, this_curve -> data[1][0]);
66 g_debug ("IODEBUG: %s: x[ndata-1]= %f", iost, this_curve -> data[0][this_curve -> ndata - 1]);
67 g_debug ("IODEBUG: %s: y[ndata-1]= %f", iost, this_curve -> data[1][this_curve -> ndata - 1]);
68 if (win)
69 {
70 g_debug ("IODEBUG: %s: cmax[0]= %f, cmax[1]= %f", iost,
71 this_curve -> cmax[0], this_curve -> cmax[1]);
72 g_debug ("IODEBUG: %s: name= %s", iost, this_curve -> name);
73 g_debug ("IODEBUG: %s: show_title= %d", iost, this_curve -> show_title);
74 g_debug ("IODEBUG: %s: default_title= %d", iost, this_curve -> default_title);
75 g_debug ("IODEBUG: %s: title= %s", iost, this_curve -> title);
76 g_debug ("IODEBUG: %s: title_font= %s", iost, this_curve -> title_font);
77 g_debug ("IODEBUG: %s: title_pos[0]= %f, title_pos[1]= %f", iost,
78 this_curve -> title_pos[0], this_curve -> title_pos[1]);
79 g_debug ("IODEBUG: %s: title.red= %f, title.green= %f, title.blue= %f", iost,
80 this_curve -> title_color.red,
81 this_curve -> title_color.green,
82 this_curve -> title_color.blue);
83 // Axis
84 g_debug ("IODEBUG: %s: axmin[0]= %f, axmin[1]= %f", iost,
85 this_curve -> axmin[0], this_curve -> axmin[1]);
86 g_debug ("IODEBUG: %s: axmax[0]= %f, axmax[1]= %f", iost,
87 this_curve -> axmax[0], this_curve -> axmax[1]);
88 g_debug ("IODEBUG: %s: x_axis_title= %s", iost, this_curve -> axis_title[0]);
89 g_debug ("IODEBUG: %s: x_axis_title_font= %s", iost, this_curve -> axis_title_font[0]);
90 g_debug ("IODEBUG: %s: x_axis_title_pos[0]= %d, x_axis_title_pos[1]= %d", iost,
91 this_curve -> axis_title_x[0], this_curve -> axis_title_y[0]);
92 g_debug ("IODEBUG: %s: y_axis_title= %s", iost, this_curve -> axis_title[1]);
93 g_debug ("IODEBUG: %s: y_axis_title_font= %s", iost, this_curve -> axis_title_font[1]);
94 g_debug ("IODEBUG: %s: y_axis_title_pos[0]= %d, y_axis_title_pos[1]= %d", iost,
95 this_curve -> axis_title_x[1], this_curve -> axis_title_y[1]);
96 g_debug ("IODEBUG: %s: scale[0]= %d, scale[1]= %d", iost,
97 this_curve -> scale[0], this_curve -> scale[1]);
98 g_debug ("IODEBUG: %s: x_axis_defaut_title= %d", iost, this_curve -> axis_defaut_title[0]);
99 g_debug ("IODEBUG: %s: y_axis_defaut_title= %d", iost, this_curve -> axis_defaut_title[1]);
100 g_debug ("IODEBUG: %s: grid[0]= %d, grid[1]= %d", iost,
101 this_curve -> show_grid[0], this_curve -> show_grid[1]);
102 g_debug ("IODEBUG: %s: show_axis[0]= %d, show_axis[1]= %d", iost,
103 this_curve -> show_axis[0], this_curve -> show_axis[1]);
104 g_debug ("IODEBUG: %s: autoscale[0]= %d, autoscale[1]= %d", iost,
105 this_curve -> autoscale[0], this_curve -> autoscale[1]);
106 g_debug ("IODEBUG: %s: majt[0]= %f, majt[1]= %f", iost,
107 this_curve -> majt[0], this_curve -> majt[1]);
108 g_debug ("IODEBUG: %s: mint[0]= %d, mint[1]= %d", iost,
109 this_curve -> mint[0], this_curve -> mint[1]);
110 g_debug ("IODEBUG: %s: ticks_io[0]= %d, ticks_io[1]= %d", iost,
111 this_curve -> ticks_io[0], this_curve -> ticks_io[1]);
112 g_debug ("IODEBUG: %s: ticks_pos[0]= %d, ticks_pos[1]= %d", iost,
113 this_curve -> ticks_pos[0], this_curve -> ticks_pos[1]);
114 g_debug ("IODEBUG: %s: majt_size[0]= %d, majt_size[1]= %d", iost,
115 this_curve -> majt_size[0], this_curve -> majt_size[1]);
116 g_debug ("IODEBUG: %s: mint_size[0]= %d, mint_size[1]= %d", iost,
117 this_curve -> mint_size[0], this_curve -> mint_size[1]);
118 g_debug ("IODEBUG: %s: labels_pos[0]= %d, labels_pos[1]= %d", iost,
119 this_curve -> labels_pos[0], this_curve -> labels_pos[1]);
120 g_debug ("IODEBUG: %s: labels_digit[0]= %d, labels_digit[1]= %d", iost,
121 this_curve -> labels_digit[0], this_curve -> labels_digit[1]);
122 g_debug ("IODEBUG: %s: labels_font[0]= %s, labels_font[1]= %s", iost,
123 this_curve -> labels_font[0], this_curve -> labels_font[1]);
124 g_debug ("IODEBUG: %s: labels_angle[0]= %f, labels_angle[1]= %f", iost,
125 this_curve -> labels_angle[0], this_curve -> labels_angle[1]);
126 g_debug ("IODEBUG: %s: labels_shift_x[0]= %d, labels_shift_y[0]= %d", iost,
127 this_curve -> labels_shift_x[0], this_curve -> labels_shift_y[0]);
128 g_debug ("IODEBUG: %s: labels_shift_x[1]= %d, labels_shift_y[1]= %d", iost,
129 this_curve -> labels_shift_x[1], this_curve -> labels_shift_y[1]);
130 // Legend
131 g_debug ("IODEBUG: %s: show_legend= %d", iost, this_curve -> show_legend);
132 g_debug ("IODEBUG: %s: legend_pos[0]= %f, legend_pos[1]= %f", iost,
133 this_curve -> legend_pos[0], this_curve -> legend_pos[1]);
134 g_debug ("IODEBUG: %s: legend_font= %s", iost, this_curve -> legend_font);
135 g_debug ("IODEBUG: %s: legend.red= %f, legend.green= %f, legend.blue= %f", iost,
136 this_curve -> legend_color.red,
137 this_curve -> legend_color.green,
138 this_curve -> legend_color.blue);
139 g_debug ("IODEBUG: %s: show_legend_box= %d", iost, this_curve -> show_legend_box);
140 g_debug ("IODEBUG: %s: legend_box_dash= %d", iost, this_curve -> legend_box_dash);
141 g_debug ("IODEBUG: %s: legend_box_thickness= %f", iost, this_curve -> legend_box_thickness);
142 g_debug ("IODEBUG: %s: legend_box.red= %f, legend_box.green= %f, legend_box.blue= %f", iost,
143 this_curve -> legend_box_color.red,
144 this_curve -> legend_box_color.green,
145 this_curve -> legend_box_color.blue);
146 // Frame
147 g_debug ("IODEBUG: %s: show_frame= %d", iost, this_curve -> show_frame);
148 g_debug ("IODEBUG: %s: frame_type= %d", iost, this_curve -> frame_type);
149 g_debug ("IODEBUG: %s: frame_dash= %d", iost, this_curve -> frame_dash);
150 g_debug ("IODEBUG: %s: frame_thickness= %f", iost, this_curve -> frame_thickness);
151 g_debug ("IODEBUG: %s: frame.red= %f, frame.green= %f, frame.blue= %f", iost,
152 this_curve -> frame_color.red,
153 this_curve -> frame_color.green,
154 this_curve -> frame_color.blue);
155 g_debug ("IODEBUG: %s: frame.xmin= %f, frame.xmax= %f", iost,
156 this_curve -> frame_pos[0][0], this_curve -> frame_pos[0][1]);
157 g_debug ("IODEBUG: %s: frame.ymin= %f, frame.ymax= %f", iost,
158 this_curve -> frame_pos[1][0], this_curve -> frame_pos[1][1]);
159 // Data
160 g_debug ("IODEBUG: %s: backc.red= %f, backc.green= %f, backc.blue= %f", iost,
161 this_curve -> backcolor.red,
162 this_curve -> backcolor.green,
163 this_curve -> backcolor.blue);
164 g_debug ("IODEBUG: %s: legend_font= %s", iost, this_curve -> legend_font);
165 if (this_curve -> cfile != NULL)
166 {
167 g_debug ("IODEBUG: %s: cfile= %s", iost, this_curve -> cfile);
168 }
169 }
170 else
171 {
172 g_debug ("IODEBUG: %s: No curve window", iost);
173 }
174}
175
184void debug_lattice_info (project * this_proj, gchar * iost)
185{
186 g_debug ("IODEBUG::%s:: lattice debug", iost);
187 cell_info * debug_cell = & this_proj -> cell;
188 g_debug ("IODEBUG::%s:: pbc= %d, frac= %d, ltype= %d", iost, debug_cell -> pbc, debug_cell -> frac, debug_cell -> ltype);
189 g_debug ("IODEBUG::%s:: npt= %d, has_a_box= %d, crystal= %d", iost, debug_cell -> npt, debug_cell -> has_a_box, debug_cell -> crystal);
190 g_debug ("IODEBUG::%s:: volumec= %f, density= %f", iost, debug_cell -> volume, debug_cell -> density);
191 g_debug ("IODEBUG::%s:: cextra[0]= %d, cextra[1]= %d, cextra[2]= %d", iost, debug_cell -> cextra[0], debug_cell -> cextra[1], debug_cell -> cextra[2]);
192 if (debug_cell -> box)
193 {
194 box_info * debug_box = debug_cell -> box;
195 int i;
196 for (i=0; i<2; i++) g_debug ("IODEBUG::%s:: i= %d, param[%d][0]= %f, param[%d][1]= %f, param[%d][2]= %f", iost, i, i, debug_box -> param[i][0], i, debug_box -> param[i][1], i, debug_box -> param[i][2]);
197 for (i=0; i<3; i++) g_debug ("IODEBUG::%s:: i= %d, vect[%d][0]= %f, vect[%d][1]= %f, vect[%d][2]= %f", iost, i, i, debug_box -> vect[i][0], i, debug_box -> vect[i][1], i, debug_box -> vect[i][2]);
198 for (i=0; i<3; i++) g_debug ("IODEBUG::%s:: i= %d, rvect[%d][0]= %f, rvect[%d][1]= %f, rvect[%d][2]= %f", iost, i, i, debug_box -> rvect[i][0], i, debug_box -> rvect[i][1], i, debug_box -> rvect[i][2]);
199 }
200}
201
210void debugioproj (project * this_proj, gchar * iost)
211{
212 int i, j;
213
214 g_debug ("IODEBUG::%s: name= %s", iost, this_proj -> name);
215 if (this_proj -> coordfile != NULL)
216 {
217 g_debug ("IODEBUG::%s: coordfile= %s", iost, this_proj -> coordfile);
218 g_debug ("IODEBUG::%s: tfile= %d", iost, this_proj -> tfile);
219 }
220 if (this_proj -> bondfile != NULL)
221 {
222 g_debug ("IODEBUG::%s: bondfile= %s", iost, this_proj -> bondfile);
223 }
224 g_debug ("IODEBUG::%s: newproj= %d", iost, this_proj -> newproj);
225 g_debug ("IODEBUG::%s: pbc= %d", iost, this_proj -> cell.pbc);
226 g_debug ("IODEBUG::%s: frac= %d", iost, this_proj -> cell.frac);
227 g_debug ("IODEBUG::%s: run= %d", iost, this_proj -> run);
228 g_debug ("IODEBUG::%s: dmtx= %d", iost, this_proj -> dmtx);
229 g_debug ("IODEBUG::%s: nspec= %d", iost, this_proj -> nspec);
230 g_debug ("IODEBUG::%s: natomes= %d", iost, this_proj -> natomes);
231 g_debug ("IODEBUG::%s: steps= %d", iost, this_proj -> steps);
232 g_debug ("IODEBUG::%s: grtotcutoff= %f", iost, this_proj -> chemistry -> grtotcutoff);
233 g_debug ("IODEBUG::%s: cvect[0][0]= %f, cvect[0][1]= %f, cvect[0][2]= %f",
234 iost, this_proj -> cell.box[0].vect[0][0], this_proj -> cell.box[0].vect[0][1], this_proj -> cell.box[0].vect[0][2]);
235 g_debug ("IODEBUG::%s: cvect[1][0]= %f, cvect[1][1]= %f, cvect[1][2]= %f",
236 iost, this_proj -> cell.box[0].vect[1][0], this_proj -> cell.box[0].vect[1][1], this_proj -> cell.box[0].vect[1][2]);
237 g_debug ("IODEBUG::%s: cvect[2][0]= %f, cvect[2][1]= %f, cvect[2][2]= %f",
238 iost, this_proj -> cell.box[0].vect[2][0], this_proj -> cell.box[0].vect[2][1], this_proj -> cell.box[0].vect[2][2]);
239 g_debug ("IODEBUG::%s: langles[0]= %f, langles[1]= %f, langles[2]= %f", iost,
240 this_proj -> cell.box[0].param[1][0], this_proj -> cell.box[0].param[1][1], this_proj -> cell.box[0].param[1][2]);
241 g_debug ("IODEBUG::%s: vmod[0]= %f, vmod[1]= %f, vmod[2]= %f", iost,
242 this_proj -> cell.box[0].param[0][0], this_proj -> cell.box[0].param[0][1], this_proj -> cell.box[0].param[0][2]);
243 for (i=0; i<NCALCS; i++)
244 {
245 g_debug ("IODEBUG::%s: i= %d, visok[i]= %d", iost, i, this_proj -> analysis[i] -> calc_ok);
246 g_debug ("IODEBUG::%s: i= %d, initok[i]= %d", iost, i, this_proj -> analysis[i] -> init_ok);
247 g_debug ("IODEBUG::%s: i= %d, num_delta[i]= %d", iost, i, this_proj -> analysis[i] -> num_delta);
248 g_debug ("IODEBUG::%s: i= %d, delta[i]= %f", iost, i, this_proj -> analysis[i] -> delta);
249 g_debug ("IODEBUG::%s: i= %d, min[i]= %f", iost, i, this_proj -> analysis[i] -> min);
250 g_debug ("IODEBUG::%s: i= %d, max[i]= %f", iost, i, this_proj -> analysis[i] -> max);
251 }
252 if (this_proj -> natomes != 0 && this_proj -> nspec != 0)
253 {
254 for (i=0; i<this_proj -> steps; i++)
255 {
256 g_debug ("IODEBUG::%s: proj.atom[%d][%d].x= %f, proj.atom[%d][%d].x= %f",
257 iost, i, 0, this_proj -> atoms[i][0].x, i, this_proj -> natomes-1, this_proj -> atoms[i][this_proj -> natomes - 1].x);
258 g_debug ("IODEBUG::%s: proj.atom[%d][%d].y= %f, proj.atom[%d][%d].y= %f",
259 iost, i, 0, this_proj -> atoms[i][0].y, i, this_proj -> natomes - 1, this_proj -> atoms[i][this_proj -> natomes - 1].y);
260 g_debug ("IODEBUG::%s: proj.atom[%d][%d].z= %f, proj.atom[%d][%d].z= %f",
261 iost, i, 0, this_proj -> atoms[i][0].z, i, this_proj -> natomes - 1, this_proj -> atoms[i][this_proj -> natomes - 1].z);
262 }
263 for (i=0; i<this_proj -> nspec; i++)
264 {
265 g_debug ("IODEBUG::%s: i= %d, nsps[i]= %d", iost, i, this_proj -> chemistry -> nsps[i]);
266 g_debug ("IODEBUG::%s: i= %d, atid[i]= %d", iost, i, (int)this_proj -> chemistry -> chem_prop[CHEM_Z][i]);
267 g_debug ("IODEBUG::%s: i= %d, mass[i]= %f", iost, i, this_proj -> chemistry -> chem_prop[CHEM_M][i]);
268 g_debug ("IODEBUG::%s: i= %d, rad[i]= %f", iost, i, this_proj -> chemistry -> chem_prop[CHEM_R][i]);
269 }
270 for (i=0; i<this_proj -> nspec; i++)
271 {
272 for (j=0; j<this_proj -> nspec; j++)
273 {
274 g_debug ("IODEBUG::%s: i= %d, j= %d, cutoffs[i][j]= %f", iost, i, j, this_proj -> chemistry -> cutoffs[i][j]);
275 }
276 }
277 }
278 debug_lattice_info (this_proj, iost);
279}
280
289{
290 g_debug ("Number of species: %d", this_proj -> nspec);
291 int i;
292 for (i=0; i<this_proj -> nspec; i++)
293 {
294 g_debug ("Spec= %d, label= %s, element= %s ", i+1,
295 this_proj -> chemistry -> label[i],
296 this_proj -> chemistry -> element[i]);
297 g_debug (" nsps[%d]= %d, formula[%d]= %d",
298 i+1, this_proj -> chemistry -> nsps[i], i+1, this_proj -> chemistry -> formula[i]);
299 }
300 g_debug ("Number of atoms: %d", this_proj -> natomes);
301 for (i=0; i<this_proj -> natomes; i++)
302 {
303 g_debug (" at= %d, lot[%d]= %d", i+1, i+1, this_proj -> atoms[0][i].sp);
304 }
305}
306
integer(kind=c_int) function chemistry()
Definition chemistry.F90:22
gchar * param[2]
double scale(double axe)
find appropriate major tick spacing based on axis length
Definition curve.c:205
void show_frame(cairo_t *cd, int tf, int da, int res[2], double ti, double x[2], double y[2], ColRGBA dcol)
draw frame
Definition frame.c:81
GtkWidget * majt
void show_title(cairo_t *cr, Curve *this_curve)
draw title
Definition title.c:104
void show_legend(cairo_t *cr, project *this_proj, int rid, int cid)
draw legend
Definition legend.c:56
const gchar * default_title(int ax, gpointer data)
default title string
Definition title.c:54
int atoms[NUM_STYLES][2]
void debugioproj(project *this_proj, gchar *iost)
debug project info
Definition debugio.c:210
void debugiocurve(project *this_proj, gboolean win, int rid, int cid, gchar *iost)
debug and print some info about the curves in a project
Definition debugio.c:54
void debug_chemical_information(project *this_proj)
debug chemical data info
Definition debugio.c:288
void debug_lattice_info(project *this_proj, gchar *iost)
debug lattice data
Definition debugio.c:184
Global variable declarations Global convenience function declarations Global data structure defin...
#define CHEM_R
Definition global.h:318
#define CHEM_M
Definition global.h:317
#define min(a, b)
Definition global.h:93
#define CHEM_Z
Definition global.h:316
#define NCALCS
#define max(a, b)
Definition global.h:92
void autoscale(gpointer data)
autoscale callback
Definition m_curve.c:99
double z
Definition ogl_draw.c:63
double y
Definition ogl_draw.c:63
double x
Definition ogl_draw.c:63
Function declarations for reading atomes project file Function declarations for saving atomes proje...
Definition glwin.h:350
int element
Definition w_periodic.c:61