82extern gchar *
wnpos[3];
87extern void sort (
int dim,
int * tab);
96gchar *
cif_coord_opts[40][2] = {{
"b1",
"Monoclinic unique axis b, cell choice 1, abc"},
97 {
"b2",
"Monoclinic unique axis b, cell choice 2, abc"},
98 {
"b3",
"Monoclinic unique axis b, cell choice 3, abc"},
99 {
"-b1",
"Monoclinic unique axis b, cell choice 1, c-ba"},
100 {
"-b2",
"Monoclinic unique axis b, cell choice 2, c-ba"},
101 {
"-b3",
"Monoclinic unique axis b, cell choice 3, c-ba"},
102 {
"c1",
"Monoclinic unique axis c, cell choice 1, abc"},
103 {
"c2",
"Monoclinic unique axis c, cell choice 2, abc"},
104 {
"c3",
"Monoclinic unique axis c, cell choice 3, abc"},
105 {
"-c1",
"Monoclinic unique axis c, cell choice 1, ba-c"},
106 {
"-c2",
"Monoclinic unique axis c, cell choice 2, ba-c"},
107 {
"-c3",
"Monoclinic unique axis c, cell choice 3, ba-c"},
108 {
"a1",
"Monoclinic unique axis a, cell choice 1, abc"},
109 {
"a2",
"Monoclinic unique axis a, cell choice 2, abc"},
110 {
"a3",
"Monoclinic unique axis a, cell choice 3, abc"},
111 {
"-a1",
"Monoclinic unique axis a, cell choice 1, -acb"},
112 {
"-a2",
"Monoclinic unique axis a, cell choice 2, -acb"},
113 {
"-a3",
"Monoclinic unique axis a, cell choice 3, -acb"},
114 {
"abc",
"Orthorhombic"},
115 {
"ba-c",
"Orthorhombic"},
116 {
"cab",
"Orthorhombic"},
117 {
"-cba",
"Orthorhombic"},
118 {
"bca",
"Orthorhombic"},
119 {
"a-cb",
"Orthorhombic"},
120 {
"1abc",
"Orthorhombic origin choice 1"},
121 {
"1ba-c",
"Orthorhombic origin choice 1"},
122 {
"1cab",
"Orthorhombic origin choice 1"},
123 {
"1-cba",
"Orthorhombic origin choice 1"},
124 {
"1bca",
"Orthorhombic origin choice 1"},
125 {
"1a-cb",
"rthorhombic origin choice 1"},
126 {
"2abc",
"Orthorhombic origin choice 2"},
127 {
"2ba-c",
"Orthorhombic origin choice 2"},
128 {
"2cab",
"Orthorhombic origin choice 2"},
129 {
"2-cba",
"Orthorhombic origin choice 2"},
130 {
"2bca",
"Orthorhombic origin choice 2"},
131 {
"2a-cb",
"Orthorhombic origin choice 2"},
132 {
"1",
"Tetragonal or cubic origin choice 1"},
133 {
"2",
"Tetragonal or cubic origin choice 2"},
134 {
"h",
"Trigonal using hexagonal axes"},
135 {
"r",
"Trigonal using rhombohedral axes "}};
138 typedef intptr_t ssize_t;
140 ssize_t getline(
char **lineptr,
size_t *n, FILE *stream)
145 if (lineptr == NULL || stream == NULL || n == NULL)
152 if (
c == EOF)
return -1;
154 if (*lineptr == NULL)
156 *lineptr = malloc(128);
157 if (*lineptr == NULL)
return -1;
166 size_t new_size = *
n + (*
n >> 2);
171 char *new_ptr = realloc(*lineptr, new_size);
172 if (new_ptr == NULL)
return -1;
177 ((
unsigned char *)(*lineptr))[pos ++] =
c;
178 if (
c ==
'\n')
break;
182 (*lineptr)[pos] =
'\0';
211 gchar * co_line = g_strdup_printf (
"%s", line);
212 char * co_word = strtok_r (co_line,
" ", & line);
214 for (i=0; i<mid-1; i++)
216 co_word = strtok_r (NULL,
" ", & line);
234 gchar * at_line = g_strdup_printf (
"%s", line);
235 char * at_word = strtok_r (at_line,
" ", & line);
237 for (i=0; i<lid-1; i++) at_word = strtok_r (NULL,
" ", & line);
241 str = g_strdup_printf (
"%d", i);
249 return g_strdup_printf (
"%c%c", at_word[0], tolower(at_word[1]));
262 gchar * wy_line = g_strdup_printf (
"%s", line);
263 char * wy_word = strtok_r (wy_line,
" ", & line);
266 for (i=0; i<wid-1; i++) wy_word = strtok_r (NULL,
" ", & line);
296 i = GPOINTER_TO_INT(data);
297 GtkTreeModel * cmodel = gtk_combo_box_get_model (box);
300 gboolean done = TRUE;
301 if (gtk_combo_box_get_active_iter (box, & iter))
303 gtk_tree_model_get_value (cmodel, & iter, 0, &
val);
304 str = g_strdup_printf (
"%s", (
char *)g_value_get_string (&
val));
312 if (! j) done = FALSE;
316 str = (done) ? g_strdup_printf (
APPLY) : g_strdup_printf (
DELETEB);
319 if (! done) gtk_combo_box_set_active (box, 0);
335 gchar * labpick =
"<b>To continue and build the crystal according to the information of the CIF file\n"
336 "it is required to provide a suitable value for each and every missing parameter(s).</b>"
337 "\n\nPlease select an atom type for the following object(s):";
341 GtkCellRenderer * renderer;
342 GtkTreeModel *
model;
349 str = g_strdup_printf (
"Type NĀ°%d:\t<b>%s</b>", i+1,
this_reader ->
label[i]);
354 but = gtk_combo_box_new_with_model (
model);
355 g_object_unref (
model);
356 renderer = gtk_cell_renderer_combo_new ();
357 gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (but), renderer, TRUE);
358 gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (but), renderer,
"text", 0, NULL);
359 gtk_combo_box_set_active (GTK_COMBO_BOX(but), 0);
360 g_signal_connect (G_OBJECT(but),
"changed", G_CALLBACK(
set_cif_to_insert), GINT_TO_POINTER(i));
361 cell_list = gtk_cell_layout_get_cells(GTK_CELL_LAYOUT(but));
362 if(cell_list && cell_list -> data)
364 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(but), cell_list -> data,
"markup", 0, NULL);
370 gchar * endpick =
"In case of a molecule: insert an extra type of atom and run a substitution afterwards.";
389 for (i=0; i<line_id; i++)
tail =
tail -> next;
407int cif_get_value (gchar * kroot, gchar * keyw,
int linec,
int lstart, gchar ** cif_word, gboolean rec_val, gboolean all_ligne, gboolean in_loop)
413 gchar * str_w, * str_a, * str_b;
419 int numth = (in_loop) ? 1 : omp_get_max_threads ();
421 #pragma omp parallel for num_threads(numth) private(i,m,this_line,saved_line,this_word,str_a,str_b,str_w) shared(j,k,l,this_reader,res,coord_line,cif_word,mot,rec_val,all_ligne,in_loop,kroot,keyw)
422 for (i=lstart; i<linec; i++)
426 saved_line = g_strdup_printf (
"%s",
this_line);
436 str_w = g_ascii_strdown (str_w, strlen(str_w));
437 if (strlen(str_w) == l)
439 str_a = g_strdup_printf (
"%c", str_w[0]);
440 for (m=1; m<j; m++) str_a = g_strdup_printf (
"%s%c", str_a, str_w[m]);
441 str_b = g_strdup_printf (
"%c", str_w[j+1]);
442 for (m=j+2; m<l; m++) str_b = g_strdup_printf (
"%s%c", str_b, str_w[m]);
443 if (g_strcmp0(str_a, kroot) == 0 && g_strcmp0(str_b,keyw) == 0)
445 this_word = strtok_r (NULL,
" ", & saved_line);
448 if (rec_val || all_ligne)
450 str = g_strdup_printf (
"Wrong file format: searching for <b>%s</b> - error at line <b>%d</b> !", keyw, i+1);
464 this_word = strtok_r (NULL,
" ", & saved_line);
468 this_word = strtok_r (NULL,
" ", & saved_line);
483 this_word = strtok_r (NULL,
" ", & saved_line);
498 if (in_loop &&
this_word[0] !=
'_')
return 0;
500 str_w = g_ascii_strdown (str_w, strlen(str_w));
501 if (strlen(str_w) == l)
503 str_a = g_strdup_printf (
"%c", str_w[0]);
504 for (m=1; m<j; m++) str_a = g_strdup_printf (
"%s%c", str_a, str_w[m]);
505 str_b = g_strdup_printf (
"%c", str_w[j+1]);
506 for (m=j+2; m<l; m++) str_b = g_strdup_printf (
"%s%c", str_b, str_w[m]);
507 if (g_strcmp0(str_a, kroot) == 0 && g_strcmp0(str_b,keyw) == 0)
512 if (rec_val || all_ligne)
514 str = g_strdup_printf (
"Wrong file format: searching for <b>%s</b> - error at line <b>%d</b> !", keyw, i+1);
564 gboolean
res = FALSE;
625 gboolean
res = FALSE;
630 while (!
res && (lid+i) < linec)
641 if (j == nelem && init !=
'_')
663 if (j == nelem && init !=
'_')
740 gboolean done = TRUE;
743 int numth = omp_get_max_threads ();
744 #pragma omp parallel for num_threads(numth) private(i,j,v,cline,str) shared(this_reader,coord_line,done)
747 cline = g_strdup_printf (
"%s",
coord_line[i+lin]);
778 if (cline) g_free (cline);
779 if (str) g_free (str);
785 cline = g_strdup_printf (
"%s",
tail -> line);
820 g_free (
tail -> prev);
845 for (i=lid-1; i>-1; i--)
848 saved_line = g_strdup_printf (
"%s",
this_line);
898 i =
cif_get_value (key_a, key_b, linec, 0, & str, FALSE, FALSE, FALSE);
911 gchar * labkeys[2] = {
"type_symbol",
"label"};
912 gchar * frackeys[3] = {
"fract_x",
"fract_y",
"fract_z"};
913 gchar * cartkeys[3] = {
"cartn_x",
"cartn_y",
"cartn_z"};
914 gchar * symkeys[3] = {
"wyckoff_symbol",
"occupancy",
"symmetry_multiplicity"};
936 cid[j] =
cif_get_value (
"_atom_site", labkeys[j], linec, loop_line, & str, FALSE, FALSE, TRUE);
945 add_reader_info (
"<b>Atomic coordinates</b>: impossible to find atomic label(s) ...", 0);
952 cid[j+2] =
cif_get_value (
"_atom_site", cartkeys[j], linec, loop_line, & str, FALSE, FALSE, TRUE);
956 cid[j+2] -= loop_line;
960 str = g_strdup_printf (
"<b>Atomic coordinates</b>: impossible to find '%s' ...", cartkeys[j]);
971 cid[l+2] =
cif_get_value (
"_atom_site", frackeys[l], linec, loop_line, & str, FALSE, FALSE, TRUE);
974 cid[l+2] -= loop_line;
979 str = g_strdup_printf (
"<b>Atomic coordinates</b>: impossible to find '%s' ...", frackeys[l]);
986 add_reader_info (
"<b>Atomic coordinates</b>: no complete cartesian coordinates !", 0);
987 add_reader_info (
"<b>Atomic coordinates</b>: no complete fractional coordinates !", 0);
1000 cid[i+5] =
cif_get_value (
"_atom_site", symkeys[i], linec, loop_line, & str, FALSE, FALSE, TRUE);
1003 cid[i+5] -= loop_line;
1009 g_debug (
"CIF:: Num of field in loop= %d", i);
1013 g_debug (
"CIF:: Number of atoms in CIF file= %d",
this_reader -> natomes);
1059 add_reader_info (
"<b>Atomic coordinates</b>: a site was found to have an occupancy > 1.0 !", 0);
1087 gboolean
res = FALSE;
1114 gchar * sym_pos_line;
1119 sym_pos_line = g_strdup_printf (
"%s",
coord_line[lid+j]);
1122 sym_pos_line = g_strdup_printf (
"%s",
tail -> line);
1124 this_line = g_strdup_printf (
"%s", sym_pos_line);
1126 k_word = g_strdup_printf (
"%s",
this_word);
1127 str = g_strdup_printf (
"%d", j+1);
1128 if (g_strcmp0(k_word, str) == 0)
1132 for (k=strlen(k_word); k<strlen(sym_pos_line); k++)
1136 this_line = g_strdup_printf (
"%c", sym_pos_line[k]);
1146 g_free (sym_pos_line);
1169 gchar * pos_key[2]={
"_symmetry_equiv_pos_as",
"_space_group_symop_operation"};
1179 line_id =
cif_get_value (pos_key[i],
"xyz", linec, loop_line, & str, FALSE, FALSE, TRUE);
1183 if (! loop_line)
return FALSE;
1200 gchar * hm = g_strdup_printf (
"%s",
replace_markup (hmk,
"S", NULL));
1201 for (i=0; i<230; i++)
1204 if (g_strcmp0(str, hm) == 0)
1213 if (g_strcmp0(str, hm) == 0)
1223 for (i=0; i<230; i++)
1227 if (g_strrstr(str,
"-"))
1230 if (g_strcmp0(str, hm) == 0)
1265 str = g_strdup_printf (
"%s",
wnpos[1]);
1293 if (g_strcmp0(str, hmk) == 0)
1325 if (g_strcmp0(str, hmk) == 0)
1328 str = g_strdup_printf (
"<b>Space group</b>: CIF file information could be inaccurate !\n"
1329 " CIF file space group: <b>%s</b>, CIF file H-M symbol: <b>%s</b>",
1341 str = g_strdup_printf (
"<b>Space group</b>: CIF file information could be inaccurate !\n"
1342 " CIF file space group: <b>%s</b>, CIF file H-M symbol: <b>%s</b>",
1372 gchar * exts[2] = {
"h",
"r"};
1373 gchar * orig[2] = {
"1",
"2"};
1380 if (strstr(hmkey,
":"))
1382 key = g_strdup_printf (
"%s", hmkey);
1383 hmk = g_strdup_printf (
"%s", strtok (key,
":"));
1384 hma = g_strdup_printf (
"%s:", hmk);
1387 hmb = g_ascii_strdown (hmb, i);
1390 if (g_strcmp0(hmb, exts[i]) == 0)
1402 if (g_strcmp0(hmb, orig[i]) == 0)
1409 str = g_strdup_printf (
"<b>Space group</b>: CIF file information could be inaccurate !\n"
1410 " CIF file space group: <b>%s</b>, CIF file H-M symbol: <b>%s</b>",
1426 hmk = g_strdup_printf (
"%s", hmkey);
1433 str = g_strdup_printf (
"<b>Space group</b>: CIF file information could be inaccurate !\n"
1434 " CIF file space group: <b>%s</b>, CIF file H-M symbol: <b>%s</b>",
1440 return (spg) ? (j) ? j : spg : j;
1452 gchar * cellkeys[3] = {
"length_a",
"length_b",
"length_c"};
1453 gchar * cellangs[3] = {
"angle_alpha",
"angle_beta",
"angle_gamma",};
1459 if (!
cif_get_value (
"_cell", cellkeys[i], linec, 0, & str, TRUE, FALSE, FALSE))
1461 str = g_strdup_printf (
"<b>Lattice parameters</b>: impossible to retrieve the '%s' parameter !",
box_prop[0][i]);
1470 if (!
cif_get_value (
"_cell", cellangs[i], linec, 0, & str, TRUE, FALSE, FALSE))
1472 str = g_strdup_printf (
"<b>Lattice parameters</b>: impossible to retrieve the '%s' parameter !",
box_prop[1][i]);
1497 gchar * symkey[2] = {
"int_tables_number",
"group_it_number"};
1503 if (
cif_get_value (
"_symmetry", symkey[i], linec, 0, & str, TRUE, FALSE, FALSE))
1511 if (
cif_get_value (
"_space_group",
"it_number", linec, 0, & str, TRUE, FALSE, FALSE))
1516 gchar * hmkey = NULL;
1517 if (!
cif_get_value (
"_symmetry",
"space_group_name_h-m", linec, 0, & hmkey, FALSE, TRUE, FALSE))
1519 cif_get_value (
"_space_group",
"name_h-m_alt", linec, 0, & hmkey, FALSE, TRUE, FALSE);
1521 if (! hmkey && ! spg)
1523 add_reader_info (
"<b>Space group</b>: no space group and no H-M symbol found !", 1);
1527 if (spg) g_debug (
"CIF:: Space group:: NĀ°= %d, name= %s", spg,
groups[spg-1]);
1528 if (hmkey) g_debug (
"CIF:: H-M symbol:: %s", hmkey);
1539 add_reader_info (
"<b>Space group</b>: no space group found, unknown H-M symbol !", 1);
1541 g_debug (
"CIF:: No space group found, unknown H-M symbol !");
1544 else if (spg && ! i)
1546 str = g_strdup_printf (
"<b>Space group</b>: space group and H-M symbol do not match !\n"
1547 " CIF file space group: <b>%s</b>, CIF file H-M symbol: <b>%s</b>",
groups[spg-1], hmkey);
1551 g_debug (
"CIF:: Space group and H-M symbol do not match:: spg= %d, hm= %d", spg, i);
1554 else if (i && ! spg)
1567 if (
cif_get_value (
"_space_group",
"it_coordinate_system_code", linec, 0, & str, FALSE, FALSE, FALSE))
1570 for (i=0; i<40; i++)
1576 if (spg < 3 || spg > 15)
1584 str = g_strdup_printf (
"%c%c", str[0], str[1]);
1589 str = g_strdup_printf (
"%c", str[0]);
1597 if (g_strcmp0(lat, str) == 0) l ++;
1600 if (j < this_reader -> setting)
add_reader_info (
"<b>Space group</b>: ambiguous space group setting !", 1);
1608 if (spg < 16 || spg > 74)
1614 if (str[0] ==
'1' || str[0]==
'2')
1622 lat = g_strdup_printf (
"%s%s%s",
1626 if (g_strcmp0(lat, str) == 0)
1630 add_reader_info (
"<b>Space group</b>: ambiguous space group setting !", 1);
1637 if (! l)
add_reader_info (
"<b>Space group</b>: ambiguous space group setting !", 1);
1641 if (spg < 75 || (spg > 142 && spg < 195))
1647 if (j < this_reader -> setting)
add_reader_info (
"<b>Space group</b>: ambiguous space group setting !", 1);
1652 if (spg < 143 || spg > 165)
1658 if (j < this_reader -> setting)
add_reader_info (
"<b>Space group</b>: ambiguous space group setting !", 1);
1666 if (spg > 142 && spg < 168)
1669 gboolean correct_this = FALSE;
1678 correct_this = TRUE;
1685 if (box ->
param[1][0] == box ->
param[1][1] && box ->
param[1][0] == 90.0 && box ->
param[1][2] == 120.0)
1687 correct_this = TRUE;
1694 gchar * setc[2] = {
"<b>hexagonal</b>",
"<b>rhombohedral</b>"};
1695 str = g_strdup_printf (
"<b>Space group</b>: found trigonal space group NĀ°%d-%s, %s setting\n"
1696 "but the lattice parameters were found in %s format ...\n"
1697 "\t ... the space group setting was modified accordingly !",
1709 str = g_strdup_printf (
"<b>Space group</b> and <b>lattice paramters</b> are not compatible !\n"
1710 "\nCheck a, b, c, and α, β, ɣ, with the type of crystal system.");
1731 int i, j, k, l, m, n;
1747 g_debug (
"CIF:: Impossible to retrieve space group information !");
1799 double spgpos[3][4];
1801 gboolean dist_message = FALSE;
1802 gboolean low_occ = FALSE;
1805 gboolean * save_pos =
allocbool (max_pos);
1810 vec3_t * all_pos = g_malloc0(max_pos*
sizeof*all_pos);
1811 int * all_origin =
allocint (max_pos);
1814 double ** occ_pos = g_malloc0(
sizeof*occ_pos);
1815 int ** lot_pos = g_malloc0(
sizeof*lot_pos);
1825 for (k=0; k<3; k++) cryst_pos[num_pos][k] =
this_reader -> coord[j][k];
1826 cif_pos[num_pos] = 1;
1829 occ_pos[num_pos][0] =
this_reader -> occupancy[j];
1838 for (k=0; k<num_pos; k++)
1850 for (k=0; k<3; k++) cryst_pos[num_pos][k] =
this_reader -> coord[j][k];
1851 cif_pos[num_pos] = 1;
1854 occ_pos[num_pos][0] =
this_reader -> occupancy[j];
1863 occ_pos[k][cif_pos[k]] =
this_reader -> occupancy[j];
1867 pos_max =
max (pos_max, cif_pos[k]);
1877 for (i=0; i<num_pos; i++)
1880 for (j=0; j<cif_pos[i]; j++)
1912 pos_mat = mat4 (spgpos[0][0], spgpos[0][1], spgpos[0][2], spgpos[0][3],
1913 spgpos[1][0], spgpos[1][1], spgpos[1][2], spgpos[1][3],
1914 spgpos[2][0], spgpos[2][1], spgpos[2][2], spgpos[2][3],
1915 0.0, 0.0, 0.0, 1.0);
1916 for (j=0; j<num_pos; j++)
1918 f_pos = vec3 (cryst_pos[j][0], cryst_pos[j][1], cryst_pos[j][2]);
1919 f_pos = m4_mul_coord (pos_mat, f_pos);
1921 all_pos[l].
x = c_pos.
x;
1922 all_pos[l].
y = c_pos.
y;
1923 all_pos[l].
z = c_pos.
z;
1926 at.
x = all_pos[l].
x;
1927 at.
y = all_pos[l].
y;
1928 at.
z = all_pos[l].
z;
1931 bt.
x = all_pos[k].
x;
1932 bt.
y = all_pos[k].
y;
1933 bt.
z = all_pos[k].
z;
1935 if (
dist.length < 0.1)
1937 dist_message = TRUE;
1942 save_pos[l] = save_it;
1953 gboolean ** taken_pos = g_malloc0 (num_pos*
sizeof*taken_pos);
1954 int ** site_lot = g_malloc0 (num_pos*
sizeof*site_lot);
1957 for (i=0; i<num_pos; i++)
1961 for (j=0; j<cif_pos[i]; j++)
1963 u = occ_pos[i][j]*all_id[i];
1964 if (u < 1.0 && tot_pos < all_id[i]) u = 1.0;
1969 CPU_time = clock ();
1970 m = (CPU_time - (j+17)*all_id[i]);
1972 m = round (prob * (all_id[i]-1));
1973 pick_it = ! taken_pos[i][m];
1977 taken_pos[i][m] = TRUE;
1987 int * from_origin =
allocint (num_pos);
1988 for (j=0; j<max_pos; j++)
1994 if (taken_pos[k][l])
1996 cryst -> coord[i] = g_malloc0(
sizeof*cryst -> coord[i]);
1997 cryst -> coord[i][0].x = all_pos[j].
x;
1998 cryst -> coord[i][0].y = all_pos[j].
y;
1999 cryst -> coord[i][0].
z = all_pos[j].
z;
2000 cryst -> pos_by_object[i] = 1;
2001 cryst_lot[i] = site_lot[k][l];
2002 if (cryst_lot[i] < 0)
2008 cryst -> at_by_object[i] = 1;
2016 g_free (all_origin);
2017 g_free (from_origin);
2023 for (j=0; j<cryst ->
objects; j++)
2025 i += cryst -> at_by_object[j] * cryst -> pos_by_object[j];
2032 for (j=0; j<cryst ->
objects; j++)
2034 if (cryst_lot[j] < 0)
2036 k = - cryst_lot[j] - 1;
2038 for (l=0; l<c_obj ->
atoms; l++)
2040 m = c_obj -> at_list[l].sp;
2041 n = c_obj -> old_z[m];
2065 for (j=0; j<120; j++)
2069 tmp_nsps[i] = spec_num[j];
2081 for (j=0; j<120; j++)
2098 add_reader_info (
"The crystal will be created however some objects might be missing,\n"
2099 "Occupancy is too low compared to the number of site(s) per cell.\n\n"
2100 "<b>To build a crystal matching the defined occupancy</b>:\n"
2101 "\t <b>1)</b> If you are trying to read a CIF file, use the crystal builder instead.\n"
2102 "\t <b>2)</b> Modify the occupancy set-up to 'Completely random'.\n"
2103 "\t <b>3)</b> Increase the number of unit cells up to get rid of this message.\n\n", 1);
2107 add_reader_info (
"Object(s) at equivalent positions have been removed\n"
2108 "to ensure the consistency of the model\n"
2109 "when using <b>P</b>eriodic <b>B</b>oundary <b>C</b>onditions\n ", 1);
2117 g_debug (
"CIF:: Impossible to retrieve atomic coordinates !");
atom_search * allocate_atom_search(int proj, int action, int searchid, int tsize)
allocate atom search data structure
Function declarations for the mode edition window.
GtkTreeModel * replace_combo_tree(gboolean insert, int proj)
replace combo box in the tree view
int get_selected_object_id(gboolean visible, int p, gchar *str, atom_search *asearch)
get the id of the object selected (in contextual menu, or in combo box)
void to_insert_in_project(int stat, int orig, project *this_proj, atom_search *asearch, gboolean visible)
to insert object in project
atomic_object * get_atomic_object_by_origin(atomic_object *first, int oid, int aid)
get insert object from a list by id
Binding to the Fortran90 subroutines.
gchar * substitute_string(gchar *init, gchar *o_motif, gchar *n_motif)
substitute all patterns in string
double get_val_from_wyckoff(gchar *pos, gchar *wval)
get point value from wyckoff position
crystal_data * allocate_crystal_data(int objects, int species)
allocate crystal data pointer
double get_value_from_pos(gchar *pos)
get position double value from string description
Function declarations for the crystal builder.
void allocatoms(project *this_proj)
allocate project data
gchar * replace_markup(char *init, char *key, char *rep)
replace pattern in string
void label(cairo_t *cr, double val, int axe, int p, project *this_proj)
draw axis label
int ** allocdint(int xal, int yal)
allocate an int ** pointer
gboolean * allocbool(int val)
allocate a gboolean * pointer
double ** allocddouble(int xal, int yal)
allocate a double ** pointer
double * allocdouble(int val)
allocate a double * pointer
int * allocint(int val)
allocate an int * pointer
gboolean cif_use_symmetry_positions
double string_to_double(gpointer string)
convert string to double
Global variable declarations Global convenience function declarations Global data structure defin...
void run_this_gtk_dialog(GtkWidget *dial, GCallback handler, gpointer data)
run a GTK (3 and 4) basic GtkDialog
GtkWidget * dialogmodal(gchar *str, GtkWindow *parent)
Create a new dialog modal window.
element_data periodic_table_info[]
struct model model
data structure to describe the topology
GtkWidget * stock_image(const gchar *stock_id)
create a GtkImage for the Gtk database
GtkWidget * dialog_get_content_area(GtkWidget *widg)
prepare GtkWidget to insert content in a GtkDialog window
GtkWidget * markup_label(gchar *text, int dimx, int dimy, float ax, float ay)
void add_box_child_start(int orientation, GtkWidget *widg, GtkWidget *child, gboolean expand, gboolean fill, int padding)
Add a GtkWidget in a GtkBox at the initial position.
GtkWidget * create_hbox(int spacing)
create a GtkBox with horizontal orientation
G_MODULE_EXPORT void run_destroy_dialog(GtkDialog *dialog, gint response_id, gpointer data)
to destroy a GtkDialog when the dialog emit the closing signal
void set_image_from_icon_name(GtkWidget *widg, gchar *icon)
set a image from a stock icon name
Messaging function declarations.
integer(kind=c_int) function lattice(totl, lid, vectors, vmod, angles, lat, cfrac, apbc)
Function declarations for reading atomes project file Function declarations for saving atomes proje...
void check_for_species(double v, int ato)
Fill the species for each atom and the associated data.
void file_get_to_line(int line_id)
reach line in CIF file
gchar * get_string_from_origin(space_group *spg)
get the space group origin from its name
gboolean cif_get_symmetry_positions(int linec)
read the symmetry positions from the CIF file
G_MODULE_EXPORT void set_cif_to_insert(GtkComboBox *box, gpointer data)
change the object to insert at an empty cif position
double get_z_from_periodic_table(gchar *lab)
get Z from atom label
int build_crystal(gboolean visible, project *this_proj, gboolean to_wrap, gboolean show_clones, cell_info *cell, GtkWidget *widg)
build crystal
int get_loop_line_for_key(gchar *key_a, gchar *key_b, int linec)
search a string
gboolean cif_get_atomic_coordinates(int linec)
read the atomic coordinates from the CIF file
void check_for_to_lab(int ato, gchar *stlab)
check atom label
gboolean cif_file_get_atoms_data(int lin, int cid[8])
get atoms data from the CIF file
gboolean cif_get_cell_data(int linec)
get the cell data from the CIF file
int get_atom_wyckoff(gchar *line, int wid)
read Wyckoff position from CIF file
space_group * duplicate_space_group(space_group *spg)
duplicate space ground information
int group_info_from_hm_key(int spg, gchar *key_hm)
get the space group information using the HM key from the CIF file
int cif_get_space_group(int linec)
get the space group from the CIF file
int read_space_group(builder_edition *cbuilder, int spg)
read space group NĀ°spg data from file
int cif_file_get_data_in_loop(int linec, int lid)
get the number of "_" motifs in a line
void get_wyck_char(float val, int ax, int bx)
convert wyckoff value to string
float get_atom_coord(gchar *line, int mid)
read atom coordinates from CIF file
int cif_file_get_number_of_atoms(int linec, int lid, int nelem)
get the number of atom(s) in a CIF file
gboolean get_missing_object_from_user()
get missing atomic number in CIF file from the user
int cif_get_value(gchar *kroot, gchar *keyw, int linec, int lstart, gchar **cif_word, gboolean rec_val, gboolean all_ligne, gboolean in_loop)
read pattern in CIF file
int cif_file_get_number_of_positions(int linec, int lid)
get the number of symmetry positions
int get_setting_from_hm(gchar *hmk, int end)
Getting the space group parameters using the HM Key.
void get_origin(space_group *spg)
get space group origin matrices
int open_cif_file(int linec)
open CIF file
gchar * cif_coord_opts[40][2]
gchar * get_atom_label(gchar *line, int lid)
read atom label from CIF file
int get_atom_id_from_periodic_table(atom_search *asearch)
get atom Z from selection in the periodic table
void compute_lattice_properties(cell_info *cell)
compute lattice parameters following cell description
int test_lattice(builder_edition *cbuilder, cell_info *cif_cell)
test lattice parameters
int get_space_group_from_hm(gchar *hmk)
retrieve space group using the HM Key
int get_loop_line_id(int linec, int lid)
reach a line in the CIF file
void sort(int dim, int *tab)
sort, nim to max, a table by integer value
gchar * get_cif_word(gchar *mot)
get string from CIF file, EOL can be ugly
atomic_object * cif_object
distance distance_3d(cell_info *cell, int mdstep, atom *at, atom *bt)
distance between atom a and b in 3D
void add_reader_info(gchar *info, int mid)
append information message to the reader information
Functions declaration to read atomic coordinates.