aboutsummaryrefslogtreecommitdiff
path: root/src/symcoord.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/symcoord.c')
-rw-r--r--src/symcoord.c115
1 files changed, 100 insertions, 15 deletions
diff --git a/src/symcoord.c b/src/symcoord.c
index 798a946..038449a 100644
--- a/src/symcoord.c
+++ b/src/symcoord.c
@@ -1,5 +1,9 @@
1#include "symcoord.h" 1#include "symcoord.h"
2 2
3/* These constants have been computed generating the respective SymData */
4#define CLASSES_CP_16 2768
5#define CLASSES_EOFBEPOS_16 64430
6
3static Cube antindex_coud_sym16(uint64_t ind); 7static Cube antindex_coud_sym16(uint64_t ind);
4static Cube antindex_cp_sym16(uint64_t ind); 8static Cube antindex_cp_sym16(uint64_t ind);
5static Cube antindex_eofbepos_sym16(uint64_t ind); 9static Cube antindex_eofbepos_sym16(uint64_t ind);
@@ -14,8 +18,13 @@ static uint64_t index_drud_sym16(Cube cube);
14static uint64_t index_drudfin_noE_sym16(Cube cube); 18static uint64_t index_drudfin_noE_sym16(Cube cube);
15static uint64_t index_khuge(Cube cube); 19static uint64_t index_khuge(Cube cube);
16 20
21static int transfinder_drud_sym16(uint64_t ind, Trans *ret);
22static int transfinder_drudfin_noE_sym16(uint64_t ind, Trans *ret);
23static int transfinder_khuge(uint64_t ind, Trans *ret);
24
17static void gensym(SymData *sd); 25static void gensym(SymData *sd);
18static bool read_symdata_file(SymData *sd); 26static bool read_symdata_file(SymData *sd);
27static int selfsims(SymData *sd, uint64_t ind, Trans *ret);
19static bool write_symdata_file(SymData *sd); 28static bool write_symdata_file(SymData *sd);
20 29
21/* Transformation groups and symmetry data ***********************************/ 30/* Transformation groups and symmetry data ***********************************/
@@ -69,51 +78,42 @@ Coordinate
69coord_eofbepos_sym16 = { 78coord_eofbepos_sym16 = {
70 .index = index_eofbepos_sym16, 79 .index = index_eofbepos_sym16,
71 .cube = antindex_eofbepos_sym16, 80 .cube = antindex_eofbepos_sym16,
72 .ntrans = 16,
73 .trans = trans_group_udfix,
74}; 81};
75 82
76Coordinate 83Coordinate
77coord_coud_sym16 = { 84coord_coud_sym16 = {
78 .index = index_coud_sym16, 85 .index = index_coud_sym16,
79 .cube = antindex_coud_sym16, 86 .cube = antindex_coud_sym16,
80 .ntrans = 16,
81 .trans = trans_group_udfix,
82}; 87};
83 88
84Coordinate 89Coordinate
85coord_cp_sym16 = { 90coord_cp_sym16 = {
86 .index = index_cp_sym16, 91 .index = index_cp_sym16,
87 .cube = antindex_cp_sym16, 92 .cube = antindex_cp_sym16,
88 .ntrans = 16,
89 .trans = trans_group_udfix,
90}; 93};
91 94
92Coordinate 95Coordinate
93coord_drud_sym16 = { 96coord_drud_sym16 = {
94 .index = index_drud_sym16, 97 .index = index_drud_sym16,
95 .cube = antindex_drud_sym16, 98 .cube = antindex_drud_sym16,
96 .max = POW3TO7 * 64430, 99 .max = POW3TO7 * CLASSES_EOFBEPOS_16,
97 .ntrans = 16, 100 .trans = transfinder_drud_sym16,
98 .trans = trans_group_udfix,
99}; 101};
100 102
101Coordinate 103Coordinate
102coord_drudfin_noE_sym16 = { 104coord_drudfin_noE_sym16 = {
103 .index = index_drudfin_noE_sym16, 105 .index = index_drudfin_noE_sym16,
104 .cube = antindex_drudfin_noE_sym16, 106 .cube = antindex_drudfin_noE_sym16,
105 .max = FACTORIAL8 * 2768, 107 .max = FACTORIAL8 * CLASSES_CP_16,
106 .ntrans = 16, 108 .trans = transfinder_drudfin_noE_sym16,
107 .trans = trans_group_udfix,
108}; 109};
109 110
110Coordinate 111Coordinate
111coord_khuge = { 112coord_khuge = {
112 .index = index_khuge, 113 .index = index_khuge,
113 .cube = antindex_khuge, 114 .cube = antindex_khuge,
114 .max = POW3TO7 * FACTORIAL4 * 64430, 115 .max = POW3TO7 * FACTORIAL4 * CLASSES_EOFBEPOS_16,
115 .ntrans = 16, 116 .trans = transfinder_khuge,
116 .trans = trans_group_udfix,
117}; 117};
118 118
119/* Functions *****************************************************************/ 119/* Functions *****************************************************************/
@@ -229,6 +229,72 @@ index_khuge(Cube cube)
229 return a * POW3TO7 + c.coud; 229 return a * POW3TO7 + c.coud;
230} 230}
231 231
232static int
233transfinder_drud_sym16(uint64_t ind, Trans *ret)
234{
235 uint64_t i, trueind;
236 int j;
237 static bool initialized = false;
238 static int naux[CLASSES_EOFBEPOS_16];
239 static Trans retaux[CLASSES_EOFBEPOS_16][NTRANS];
240
241 if (!initialized) {
242 for (i = 0; i < CLASSES_EOFBEPOS_16; i++)
243 naux[i] = selfsims(&sd_eofbepos_16, i, retaux[i]);
244
245 initialized = true;
246 }
247
248 trueind = ind/POW3TO7;
249 for (j = 0; j < naux[trueind]; j++)
250 ret[j] = retaux[trueind][j];
251 return naux[trueind];
252}
253
254static int
255transfinder_drudfin_noE_sym16(uint64_t ind, Trans *ret)
256{
257 uint64_t i, trueind;
258 int j;
259 static bool initialized = false;
260 static int naux[CLASSES_CP_16];
261 static Trans retaux[CLASSES_CP_16][NTRANS];
262
263 if (!initialized) {
264 for (i = 0; i < CLASSES_CP_16; i++)
265 naux[i] = selfsims(&sd_cp_16, i, retaux[i]);
266
267 initialized = true;
268 }
269
270 trueind = ind/FACTORIAL8;
271 for (j = 0; j < naux[trueind]; j++)
272 ret[j] = retaux[trueind][j];
273 return naux[trueind];
274}
275
276static int
277transfinder_khuge(uint64_t ind, Trans *ret)
278{
279 uint64_t i, trueind;
280 int j;
281 static bool initialized = false;
282 static int naux[CLASSES_EOFBEPOS_16];
283 static Trans retaux[CLASSES_EOFBEPOS_16][NTRANS];
284
285 if (!initialized) {
286 for (i = 0; i < CLASSES_EOFBEPOS_16; i++)
287 naux[i] = selfsims(&sd_eofbepos_16, i, retaux[i]);
288
289 initialized = true;
290 }
291
292 trueind = ind/(FACTORIAL4*POW3TO7);
293 for (j = 0; j < naux[trueind]; j++)
294 ret[j] = retaux[trueind][j];
295 return naux[trueind];
296}
297
232/* Other functions ***********************************************************/ 298/* Other functions ***********************************************************/
233 299
234static void 300static void
@@ -320,6 +386,25 @@ read_symdata_file(SymData *sd)
320 return r; 386 return r;
321} 387}
322 388
389static int
390selfsims(SymData *sd, uint64_t ind, Trans *ret)
391{
392 Cube cube, tcube;
393 int i, n;
394 uint64_t indnosym;
395
396 cube = sd->sym_coord->cube(ind);
397 indnosym = sd->coord->index(cube);
398 n = 0;
399 for (i = 0; i < sd->ntrans; i++) {
400 tcube = apply_trans(sd->trans[i], cube);
401 if (sd->coord->index(tcube) == indnosym)
402 ret[n++] = sd->trans[i];
403 }
404
405 return n;
406}
407
323static bool 408static bool
324write_symdata_file(SymData *sd) 409write_symdata_file(SymData *sd)
325{ 410{

Generated with cgit - Back to sebastiano.tronto.net