diff options
Diffstat (limited to 'src/symcoord.c')
| -rw-r--r-- | src/symcoord.c | 115 |
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 | |||
| 3 | static Cube antindex_coud_sym16(uint64_t ind); | 7 | static Cube antindex_coud_sym16(uint64_t ind); |
| 4 | static Cube antindex_cp_sym16(uint64_t ind); | 8 | static Cube antindex_cp_sym16(uint64_t ind); |
| 5 | static Cube antindex_eofbepos_sym16(uint64_t ind); | 9 | static Cube antindex_eofbepos_sym16(uint64_t ind); |
| @@ -14,8 +18,13 @@ static uint64_t index_drud_sym16(Cube cube); | |||
| 14 | static uint64_t index_drudfin_noE_sym16(Cube cube); | 18 | static uint64_t index_drudfin_noE_sym16(Cube cube); |
| 15 | static uint64_t index_khuge(Cube cube); | 19 | static uint64_t index_khuge(Cube cube); |
| 16 | 20 | ||
| 21 | static int transfinder_drud_sym16(uint64_t ind, Trans *ret); | ||
| 22 | static int transfinder_drudfin_noE_sym16(uint64_t ind, Trans *ret); | ||
| 23 | static int transfinder_khuge(uint64_t ind, Trans *ret); | ||
| 24 | |||
| 17 | static void gensym(SymData *sd); | 25 | static void gensym(SymData *sd); |
| 18 | static bool read_symdata_file(SymData *sd); | 26 | static bool read_symdata_file(SymData *sd); |
| 27 | static int selfsims(SymData *sd, uint64_t ind, Trans *ret); | ||
| 19 | static bool write_symdata_file(SymData *sd); | 28 | static 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 | |||
| 69 | coord_eofbepos_sym16 = { | 78 | coord_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 | ||
| 76 | Coordinate | 83 | Coordinate |
| 77 | coord_coud_sym16 = { | 84 | coord_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 | ||
| 84 | Coordinate | 89 | Coordinate |
| 85 | coord_cp_sym16 = { | 90 | coord_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 | ||
| 92 | Coordinate | 95 | Coordinate |
| 93 | coord_drud_sym16 = { | 96 | coord_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 | ||
| 101 | Coordinate | 103 | Coordinate |
| 102 | coord_drudfin_noE_sym16 = { | 104 | coord_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 | ||
| 110 | Coordinate | 111 | Coordinate |
| 111 | coord_khuge = { | 112 | coord_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 | ||
| 232 | static int | ||
| 233 | transfinder_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 | |||
| 254 | static int | ||
| 255 | transfinder_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 | |||
| 276 | static int | ||
| 277 | transfinder_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 | ||
| 234 | static void | 300 | static void |
| @@ -320,6 +386,25 @@ read_symdata_file(SymData *sd) | |||
| 320 | return r; | 386 | return r; |
| 321 | } | 387 | } |
| 322 | 388 | ||
| 389 | static int | ||
| 390 | selfsims(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 | |||
| 323 | static bool | 408 | static bool |
| 324 | write_symdata_file(SymData *sd) | 409 | write_symdata_file(SymData *sd) |
| 325 | { | 410 | { |
