80extern gchar *
wnpos[3];
85extern void sort (
int dim,
int * tab);
94gchar *
cif_coord_opts[40][2] = {{
"b1",
"Monoclinic unique axis b, cell choice 1, abc"},
95 {
"b2",
"Monoclinic unique axis b, cell choice 2, abc"},
96 {
"b3",
"Monoclinic unique axis b, cell choice 3, abc"},
97 {
"-b1",
"Monoclinic unique axis b, cell choice 1, c-ba"},
98 {
"-b2",
"Monoclinic unique axis b, cell choice 2, c-ba"},
99 {
"-b3",
"Monoclinic unique axis b, cell choice 3, c-ba"},
100 {
"c1",
"Monoclinic unique axis c, cell choice 1, abc"},
101 {
"c2",
"Monoclinic unique axis c, cell choice 2, abc"},
102 {
"c3",
"Monoclinic unique axis c, cell choice 3, abc"},
103 {
"-c1",
"Monoclinic unique axis c, cell choice 1, ba-c"},
104 {
"-c2",
"Monoclinic unique axis c, cell choice 2, ba-c"},
105 {
"-c3",
"Monoclinic unique axis c, cell choice 3, ba-c"},
106 {
"a1",
"Monoclinic unique axis a, cell choice 1, abc"},
107 {
"a2",
"Monoclinic unique axis a, cell choice 2, abc"},
108 {
"a3",
"Monoclinic unique axis a, cell choice 3, abc"},
109 {
"-a1",
"Monoclinic unique axis a, cell choice 1, -acb"},
110 {
"-a2",
"Monoclinic unique axis a, cell choice 2, -acb"},
111 {
"-a3",
"Monoclinic unique axis a, cell choice 3, -acb"},
112 {
"abc",
"Orthorhombic"},
113 {
"ba-c",
"Orthorhombic"},
114 {
"cab",
"Orthorhombic"},
115 {
"-cba",
"Orthorhombic"},
116 {
"bca",
"Orthorhombic"},
117 {
"a-cb",
"Orthorhombic"},
118 {
"1abc",
"Orthorhombic origin choice 1"},
119 {
"1ba-c",
"Orthorhombic origin choice 1"},
120 {
"1cab",
"Orthorhombic origin choice 1"},
121 {
"1-cba",
"Orthorhombic origin choice 1"},
122 {
"1bca",
"Orthorhombic origin choice 1"},
123 {
"1a-cb",
"rthorhombic origin choice 1"},
124 {
"2abc",
"Orthorhombic origin choice 2"},
125 {
"2ba-c",
"Orthorhombic origin choice 2"},
126 {
"2cab",
"Orthorhombic origin choice 2"},
127 {
"2-cba",
"Orthorhombic origin choice 2"},
128 {
"2bca",
"Orthorhombic origin choice 2"},
129 {
"2a-cb",
"Orthorhombic origin choice 2"},
130 {
"1",
"Tetragonal or cubic origin choice 1"},
131 {
"2",
"Tetragonal or cubic origin choice 2"},
132 {
"h",
"Trigonal using hexagonal axes"},
133 {
"r",
"Trigonal using rhombohedral axes "}};
136 typedef intptr_t ssize_t;
138 ssize_t getline(
char **lineptr,
size_t *n, FILE *stream)
143 if (lineptr == NULL || stream == NULL || n == NULL)
150 if (
c == EOF)
return -1;
152 if (*lineptr == NULL)
154 *lineptr = malloc(128);
155 if (*lineptr == NULL)
return -1;
164 size_t new_size = *
n + (*
n >> 2);
169 char *new_ptr = realloc(*lineptr, new_size);
170 if (new_ptr == NULL)
return -1;
175 ((
unsigned char *)(*lineptr))[pos ++] =
c;
176 if (
c ==
'\n')
break;
180 (*lineptr)[pos] =
'\0';
209 gchar * co_line = g_strdup_printf (
"%s", line);
210 char * co_word = strtok_r (co_line,
" ", & line);
212 for (i=0; i<mid-1; i++)
214 co_word = strtok_r (NULL,
" ", & line);
232 gchar * at_line = g_strdup_printf (
"%s", line);
233 char * at_word = strtok_r (at_line,
" ", & line);
235 for (i=0; i<lid-1; i++) at_word = strtok_r (NULL,
" ", & line);
239 str = g_strdup_printf (
"%d", i);
247 return g_strdup_printf (
"%c%c", at_word[0], tolower(at_word[1]));
260 gchar * wy_line = g_strdup_printf (
"%s", line);
261 char * wy_word = strtok_r (wy_line,
" ", & line);
264 for (i=0; i<wid-1; i++) wy_word = strtok_r (NULL,
" ", & line);
294 i = GPOINTER_TO_INT(data);
295 GtkTreeModel * cmodel = gtk_combo_box_get_model (box);
298 gboolean done = TRUE;
299 if (gtk_combo_box_get_active_iter (box, & iter))
301 gtk_tree_model_get_value (cmodel, & iter, 0, &
val);
302 str = g_strdup_printf (
"%s", (
char *)g_value_get_string (&
val));
310 if (! j) done = FALSE;
314 str = (done) ? g_strdup_printf (
APPLY) : g_strdup_printf (
DELETEB);
317 if (! done) gtk_combo_box_set_active (box, 0);
333 gchar * labpick =
"<b>To continue and build the crystal according to the information of the CIF file\n"
334 "it is required to provide a suitable value for each and every missing parameter(s).</b>"
335 "\n\nPlease select an atom type for the following object(s):";
339 GtkCellRenderer * renderer;
340 GtkTreeModel *
model;
347 str = g_strdup_printf (
"Type NĀ°%d:\t<b>%s</b>", i+1,
this_reader ->
label[i]);
352 but = gtk_combo_box_new_with_model (
model);
353 g_object_unref (
model);
354 renderer = gtk_cell_renderer_combo_new ();
355 gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (but), renderer, TRUE);
356 gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (but), renderer,
"text", 0, NULL);
357 gtk_combo_box_set_active (GTK_COMBO_BOX(but), 0);
358 g_signal_connect (G_OBJECT(but),
"changed", G_CALLBACK(
set_cif_to_insert), GINT_TO_POINTER(i));
359 cell_list = gtk_cell_layout_get_cells(GTK_CELL_LAYOUT(but));
360 if(cell_list && cell_list -> data)
362 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(but), cell_list -> data,
"markup", 0, NULL);
368 gchar * endpick =
"In case of a molecule: insert an extra type of atom and run a substitution afterwards.";
387 for (i=0; i<line_id; i++)
tail =
tail -> next;
405int cif_get_value (gchar * kroot, gchar * keyw,
int linec,
int lstart, gchar ** cif_word, gboolean rec_val, gboolean all_ligne, gboolean in_loop)
411 gchar * str_w, * str_a, * str_b;
417 int numth = (in_loop) ? 1 : omp_get_max_threads ();
419 #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)
420 for (i=lstart; i<linec; i++)
424 saved_line = g_strdup_printf (
"%s",
this_line);
434 str_w = g_ascii_strdown (str_w, strlen(str_w));
435 if (strlen(str_w) == l)
437 str_a = g_strdup_printf (
"%c", str_w[0]);
438 for (m=1; m<j; m++) str_a = g_strdup_printf (
"%s%c", str_a, str_w[m]);
439 str_b = g_strdup_printf (
"%c", str_w[j+1]);
440 for (m=j+2; m<l; m++) str_b = g_strdup_printf (
"%s%c", str_b, str_w[m]);
441 if (g_strcmp0(str_a, kroot) == 0 && g_strcmp0(str_b,keyw) == 0)
443 this_word = strtok_r (NULL,
" ", & saved_line);
446 if (rec_val || all_ligne)
448 str = g_strdup_printf (
"Wrong file format: searching for <b>%s</b> - error at line <b>%d</b> !", keyw, i+1);
462 this_word = strtok_r (NULL,
" ", & saved_line);
466 this_word = strtok_r (NULL,
" ", & saved_line);
481 this_word = strtok_r (NULL,
" ", & saved_line);
496 if (in_loop &&
this_word[0] !=
'_')
return 0;
498 str_w = g_ascii_strdown (str_w, strlen(str_w));
499 if (strlen(str_w) == l)
501 str_a = g_strdup_printf (
"%c", str_w[0]);
502 for (m=1; m<j; m++) str_a = g_strdup_printf (
"%s%c", str_a, str_w[m]);
503 str_b = g_strdup_printf (
"%c", str_w[j+1]);
504 for (m=j+2; m<l; m++) str_b = g_strdup_printf (
"%s%c", str_b, str_w[m]);
505 if (g_strcmp0(str_a, kroot) == 0 && g_strcmp0(str_b,keyw) == 0)
510 if (rec_val || all_ligne)
512 str = g_strdup_printf (
"Wrong file format: searching for <b>%s</b> - error at line <b>%d</b> !", keyw, i+1);
562 gboolean
res = FALSE;
623 gboolean
res = FALSE;
628 while (!
res && (lid+i) < linec)
639 if (j == nelem && init !=
'_')
661 if (j == nelem && init !=
'_')
738 gboolean done = TRUE;
741 int numth = omp_get_max_threads ();
742 #pragma omp parallel for num_threads(numth) private(i,j,v,cline,str) shared(this_reader,coord_line,done)
745 cline = g_strdup_printf (
"%s",
coord_line[i+lin]);
776 if (cline) g_free (cline);
777 if (str) g_free (str);
783 cline = g_strdup_printf (
"%s",
tail -> line);
818 g_free (
tail -> prev);
843 for (i=lid-1; i>-1; i--)
846 saved_line = g_strdup_printf (
"%s",
this_line);
896 i =
cif_get_value (key_a, key_b, linec, 0, & str, FALSE, FALSE, FALSE);
909 gchar * labkeys[2] = {
"type_symbol",
"label"};
910 gchar * frackeys[3] = {
"fract_x",
"fract_y",
"fract_z"};
911 gchar * cartkeys[3] = {
"cartn_x",
"cartn_y",
"cartn_z"};
912 gchar * symkeys[3] = {
"wyckoff_symbol",
"occupancy",
"symmetry_multiplicity"};
934 cid[j] =
cif_get_value (
"_atom_site", labkeys[j], linec, loop_line, & str, FALSE, FALSE, TRUE);
943 add_reader_info (
"<b>Atomic coordinates</b>: impossible to find atomic label(s) ...", 0);
950 cid[j+2] =
cif_get_value (
"_atom_site", cartkeys[j], linec, loop_line, & str, FALSE, FALSE, TRUE);
954 cid[j+2] -= loop_line;
958 str = g_strdup_printf (
"<b>Atomic coordinates</b>: impossible to find '%s' ...", cartkeys[j]);
969 cid[l+2] =
cif_get_value (
"_atom_site", frackeys[l], linec, loop_line, & str, FALSE, FALSE, TRUE);
972 cid[l+2] -= loop_line;
977 str = g_strdup_printf (
"<b>Atomic coordinates</b>: impossible to find '%s' ...", frackeys[l]);
984 add_reader_info (
"<b>Atomic coordinates</b>: no complete cartesian coordinates !", 0);
985 add_reader_info (
"<b>Atomic coordinates</b>: no complete fractional coordinates !", 0);
998 cid[i+5] =
cif_get_value (
"_atom_site", symkeys[i], linec, loop_line, & str, FALSE, FALSE, TRUE);
1001 cid[i+5] -= loop_line;
1007 g_debug (
"CIF:: Num of field in loop= %d", i);
1011 g_debug (
"CIF:: Number of atoms in CIF file= %d",
this_reader -> natomes);
1057 add_reader_info (
"<b>Atomic coordinates</b>: a site was found to have an occupancy > 1.0 !", 0);
1085 gboolean
res = FALSE;
1112 gchar * sym_pos_line;
1117 sym_pos_line = g_strdup_printf (
"%s",
coord_line[lid+j]);
1120 sym_pos_line = g_strdup_printf (
"%s",
tail -> line);
1122 this_line = g_strdup_printf (
"%s", sym_pos_line);
1124 k_word = g_strdup_printf (
"%s",
this_word);
1125 str = g_strdup_printf (
"%d", j+1);
1126 if (g_strcmp0(k_word, str) == 0)
1130 for (k=strlen(k_word); k<strlen(sym_pos_line); k++)
1134 this_line = g_strdup_printf (
"%c", sym_pos_line[k]);
1143 g_free (sym_pos_line);
1166 gchar * pos_key[2]={
"_symmetry_equiv_pos_as",
"_space_group_symop_operation"};
1176 line_id =
cif_get_value (pos_key[i],
"xyz", linec, loop_line, & str, FALSE, FALSE, TRUE);
1180 if (! loop_line)
return FALSE;
1197 gchar * hm = g_strdup_printf (
"%s",
replace_markup (hmk,
"S", NULL));
1198 for (i=0; i<230; i++)
1201 if (g_strcmp0(str, hm) == 0)
1210 if (g_strcmp0(str, hm) == 0)
1220 for (i=0; i<230; i++)
1224 if (g_strrstr(str,
"-"))
1227 if (g_strcmp0(str, hm) == 0)
1262 str = g_strdup_printf (
"%s",
wnpos[1]);
1290 if (g_strcmp0(str, hmk) == 0)
1322 if (g_strcmp0(str, hmk) == 0)
1325 str = g_strdup_printf (
"<b>Space group</b>: CIF file information could be inaccurate !\n"
1326 " CIF file space group: <b>%s</b>, CIF file H-M symbol: <b>%s</b>",
1338 str = g_strdup_printf (
"<b>Space group</b>: CIF file information could be inaccurate !\n"
1339 " CIF file space group: <b>%s</b>, CIF file H-M symbol: <b>%s</b>",
1369 gchar * exts[2] = {
"h",
"r"};
1370 gchar * orig[2] = {
"1",
"2"};
1377 if (strstr(hmkey,
":"))
1379 key = g_strdup_printf (
"%s", hmkey);
1380 hmk = g_strdup_printf (
"%s", strtok (key,
":"));
1381 hma = g_strdup_printf (
"%s:", hmk);
1384 hmb = g_ascii_strdown (hmb, i);
1387 if (g_strcmp0(hmb, exts[i]) == 0)
1399 if (g_strcmp0(hmb, orig[i]) == 0)
1406 str = g_strdup_printf (
"<b>Space group</b>: CIF file information could be inaccurate !\n"
1407 " CIF file space group: <b>%s</b>, CIF file H-M symbol: <b>%s</b>",
1423 hmk = g_strdup_printf (
"%s", hmkey);
1430 str = g_strdup_printf (
"<b>Space group</b>: CIF file information could be inaccurate !\n"
1431 " CIF file space group: <b>%s</b>, CIF file H-M symbol: <b>%s</b>",
1437 return (spg) ? (j) ? j : spg : j;
1449 gchar * cellkeys[3] = {
"length_a",
"length_b",
"length_c"};
1450 gchar * cellangs[3] = {
"angle_alpha",
"angle_beta",
"angle_gamma",};
1456 if (!
cif_get_value (
"_cell", cellkeys[i], linec, 0, & str, TRUE, FALSE, FALSE))
1458 str = g_strdup_printf (
"<b>Lattice parameters</b>: impossible to retrieve the '%s' parameter !",
box_prop[0][i]);
1467 if (!
cif_get_value (
"_cell", cellangs[i], linec, 0, & str, TRUE, FALSE, FALSE))
1469 str = g_strdup_printf (
"<b>Lattice parameters</b>: impossible to retrieve the '%s' parameter !",
box_prop[1][i]);
1494 gchar * symkey[2] = {
"int_tables_number",
"group_it_number"};
1500 if (
cif_get_value (
"_symmetry", symkey[i], linec, 0, & str, TRUE, FALSE, FALSE))
1502 spg = (int)atof(str);
1508 if (
cif_get_value (
"_space_group",
"it_number", linec, 0, & str, TRUE, FALSE, FALSE))
1510 spg = (int)atof(str);
1513 gchar * hmkey = NULL;
1514 if (!
cif_get_value (
"_symmetry",
"space_group_name_h-m", linec, 0, & hmkey, FALSE, TRUE, FALSE))
1516 cif_get_value (
"_space_group",
"name_h-m_alt", linec, 0, & hmkey, FALSE, TRUE, FALSE);
1518 if (! hmkey && ! spg)
1520 add_reader_info (
"<b>Space group</b>: no space group and no H-M symbol found !", 1);
1524 if (spg) g_debug (
"CIF:: Space group:: NĀ°= %d, name= %s", spg,
groups[spg-1]);
1525 if (hmkey) g_debug (
"CIF:: H-M symbol:: %s", hmkey);
1536 add_reader_info (
"<b>Space group</b>: no space group found, unknown H-M symbol !", 1);
1538 g_debug (
"CIF:: No space group found, unknown H-M symbol !");
1541 else if (spg && ! i)
1543 str = g_strdup_printf (
"<b>Space group</b>: space group and H-M symbol do not match !\n"
1544 " CIF file space group: <b>%s</b>, CIF file H-M symbol: <b>%s</b>",
groups[spg-1], hmkey);
1548 g_debug (
"CIF:: Space group and H-M symbol do not match:: spg= %d, hm= %d", spg, i);
1551 else if (i && ! spg)
1564 if (
cif_get_value (
"_space_group",
"it_coordinate_system_code", linec, 0, & str, FALSE, FALSE, FALSE))
1567 for (i=0; i<40; i++)
1573 if (spg < 3 || spg > 15)
1580 k = (int) atof (g_strdup_printf (
"%c", str[2]));
1581 str = g_strdup_printf (
"%c%c", str[0], str[1]);
1585 k = (int) atof (g_strdup_printf (
"%c", str[1]));
1586 str = g_strdup_printf (
"%c", str[0]);
1594 if (g_strcmp0(lat, str) == 0) l ++;
1597 if (j < this_reader -> setting)
add_reader_info (
"<b>Space group</b>: ambiguous space group setting !", 1);
1605 if (spg < 16 || spg > 74)
1611 if (str[0] ==
'1' || str[0]==
'2')
1613 k = (int) atof(g_strdup_printf (
"%c", str[0]));
1619 lat = g_strdup_printf (
"%s%s%s",
1623 if (g_strcmp0(lat, str) == 0)
1627 add_reader_info (
"<b>Space group</b>: ambiguous space group setting !", 1);
1634 if (! l)
add_reader_info (
"<b>Space group</b>: ambiguous space group setting !", 1);
1638 if (spg < 75 || (spg > 142 && spg < 195))
1644 if (j < this_reader -> setting)
add_reader_info (
"<b>Space group</b>: ambiguous space group setting !", 1);
1649 if (spg < 143 || spg > 165)
1655 if (j < this_reader -> setting)
add_reader_info (
"<b>Space group</b>: ambiguous space group setting !", 1);
1663 if (spg > 142 && spg < 168)
1666 gboolean correct_this = FALSE;
1675 correct_this = TRUE;
1682 if (box ->
param[1][0] == box ->
param[1][1] && box ->
param[1][0] == 90.0 && box ->
param[1][2] == 120.0)
1684 correct_this = TRUE;
1691 gchar * setc[2] = {
"<b>hexagonal</b>",
"<b>rhombohedral</b>"};
1692 str = g_strdup_printf (
"<b>Space group</b>: found trigonal space group NĀ°%d-%s, %s setting\n"
1693 "but the lattice parameters were found in %s format ...\n"
1694 "\t ... the space group setting was modified accordingly !",
1706 str = g_strdup_printf (
"<b>Space group</b> and <b>lattice paramters</b> are not compatible !\n"
1707 "\nCheck a, b, c, and α, β, ɣ, with the type of crystal system.");
1728 int i, j, k, l, m, n;
1744 g_debug (
"CIF:: Impossible to retrieve space group information !");
1796 double spgpos[3][4];
1798 gboolean dist_message = FALSE;
1799 gboolean low_occ = FALSE;
1802 gboolean * save_pos =
allocbool (max_pos);
1807 vec3_t * all_pos = g_malloc0(max_pos*
sizeof*all_pos);
1808 int * all_origin =
allocint (max_pos);
1811 double ** occ_pos = g_malloc0(
sizeof*occ_pos);
1812 int ** lot_pos = g_malloc0(
sizeof*lot_pos);
1822 for (k=0; k<3; k++) cryst_pos[num_pos][k] =
this_reader -> coord[j][k];
1823 cif_pos[num_pos] = 1;
1826 occ_pos[num_pos][0] =
this_reader -> occupancy[j];
1835 for (k=0; k<num_pos; k++)
1847 for (k=0; k<3; k++) cryst_pos[num_pos][k] =
this_reader -> coord[j][k];
1848 cif_pos[num_pos] = 1;
1851 occ_pos[num_pos][0] =
this_reader -> occupancy[j];
1860 occ_pos[k][cif_pos[k]] =
this_reader -> occupancy[j];
1864 pos_max =
max (pos_max, cif_pos[k]);
1874 for (i=0; i<num_pos; i++)
1877 for (j=0; j<cif_pos[i]; j++)
1909 pos_mat = mat4 (spgpos[0][0], spgpos[0][1], spgpos[0][2], spgpos[0][3],
1910 spgpos[1][0], spgpos[1][1], spgpos[1][2], spgpos[1][3],
1911 spgpos[2][0], spgpos[2][1], spgpos[2][2], spgpos[2][3],
1912 0.0, 0.0, 0.0, 1.0);
1913 for (j=0; j<num_pos; j++)
1915 f_pos = vec3 (cryst_pos[j][0], cryst_pos[j][1], cryst_pos[j][2]);
1916 f_pos = m4_mul_coord (pos_mat, f_pos);
1918 all_pos[l].
x = c_pos.
x;
1919 all_pos[l].
y = c_pos.
y;
1920 all_pos[l].
z = c_pos.
z;
1923 at.
x = all_pos[l].
x;
1924 at.
y = all_pos[l].
y;
1925 at.
z = all_pos[l].
z;
1928 bt.
x = all_pos[k].
x;
1929 bt.
y = all_pos[k].
y;
1930 bt.
z = all_pos[k].
z;
1932 if (
dist.length < 0.1)
1934 dist_message = TRUE;
1939 save_pos[l] = save_it;
1950 gboolean ** taken_pos = g_malloc0 (num_pos*
sizeof*taken_pos);
1951 int ** site_lot = g_malloc0 (num_pos*
sizeof*site_lot);
1954 for (i=0; i<num_pos; i++)
1958 for (j=0; j<cif_pos[i]; j++)
1960 u = occ_pos[i][j]*all_id[i];
1961 if (u < 1.0 && tot_pos < all_id[i]) u = 1.0;
1966 CPU_time = clock ();
1967 m = (CPU_time - (j+17)*all_id[i]);
1969 m = round (prob * (all_id[i]-1));
1970 pick_it = ! taken_pos[i][m];
1974 taken_pos[i][m] = TRUE;
1984 int * from_origin =
allocint (num_pos);
1985 for (j=0; j<max_pos; j++)
1991 if (taken_pos[k][l])
1993 cryst -> coord[i] = g_malloc0(
sizeof*cryst -> coord[i]);
1994 cryst -> coord[i][0].x = all_pos[j].
x;
1995 cryst -> coord[i][0].y = all_pos[j].
y;
1996 cryst -> coord[i][0].
z = all_pos[j].
z;
1997 cryst -> pos_by_object[i] = 1;
1998 cryst_lot[i] = site_lot[k][l];
1999 if (cryst_lot[i] < 0)
2005 cryst -> at_by_object[i] = 1;
2013 g_free (all_origin);
2014 g_free (from_origin);
2020 for (j=0; j<cryst ->
objects; j++)
2022 i += cryst -> at_by_object[j] * cryst -> pos_by_object[j];
2029 for (j=0; j<cryst ->
objects; j++)
2031 if (cryst_lot[j] < 0)
2033 k = - cryst_lot[j] - 1;
2035 for (l=0; l<c_obj ->
atoms; l++)
2037 m = c_obj -> at_list[l].sp;
2038 n = c_obj -> old_z[m];
2062 for (j=0; j<120; j++)
2066 tmp_nsps[i] = spec_num[j];
2078 for (j=0; j<120; j++)
2095 add_reader_info (
"The crystal will be created however some objects might be missing,\n"
2096 "Occupancy is too low compared to the number of site(s) per cell.\n\n"
2097 "<b>To build a crystal matching the defined occupancy</b>:\n"
2098 "\t <b>1)</b> If you are trying to read a CIF file, use the crystal builder instead.\n"
2099 "\t <b>2)</b> Modify the occupancy set-up to 'Completely random'.\n"
2100 "\t <b>3)</b> Increase the number of unit cells up to get rid of this message.\n\n", 1);
2104 add_reader_info (
"Object(s) at equivalent positions have been removed\n"
2105 "to ensure the consistency of the model\n"
2106 "when using <b>P</b>eriodic <b>B</b>oundary <b>C</b>onditions\n ", 1);
2114 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
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 stucture 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.