Exemple #1
0
static void get_conventional_lattice(double lattice[3][3],
				     SPGCONST Spacegroup *spacegroup)
{
  int i, j;
  double metric[3][3];
  Pointgroup pointgroup;

  pointgroup = ptg_get_pointgroup(spacegroup->pointgroup_number);

  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      lattice[i][j] = 0;
    }
  }

  mat_get_metric(metric, spacegroup->bravais_lattice);

  debug_print("bravais lattice\n");
  debug_print_matrix_d3(spacegroup->bravais_lattice);
  debug_print("%s\n", spacegroup->setting);

  switch (pointgroup.holohedry) {
  case TRICLI:
    set_tricli(lattice, metric);
    break;
  case MONOCLI: /* b-axis is the unique axis. */
    set_monocli(lattice, metric);
    break;
  case ORTHO:
    set_ortho(lattice, metric);
    break;
  case TETRA:
    set_tetra(lattice, metric);
    break;
  case TRIGO:
    if (spacegroup->setting[0] == 'R') {
      set_rhomb(lattice, metric);
    } else {
      set_trigo(lattice, metric);
    }
    break;
  case HEXA:
    set_trigo(lattice, metric);
    break;
  case CUBIC:
    set_cubic(lattice, metric);
    break;
  case HOLOHEDRY_NONE:
    break;
  }
}
Exemple #2
0
static int get_conventional_lattice(double lattice[3][3],
                                    const Holohedry holohedry,
                                    SPGCONST double bravais_lattice[3][3])
{
    int i, j;
    double metric[3][3];

    for (i = 0; i < 3; i++) {
        for (j = 0; j < 3; j++) {
            lattice[i][j] = 0;
        }
    }

    mat_get_metric(metric, bravais_lattice);

    switch (holohedry) {
    case TRICLI:
        mat_copy_matrix_d3(lattice, bravais_lattice);
        break;
    case MONOCLI: /* b-axis is the unique axis. */
        set_monocli(lattice, metric);
        break;
    case ORTHO:
        set_ortho(lattice, metric);
        break;
    case TETRA:
        set_tetra(lattice, metric);
        break;
    case RHOMB:
        set_rhomb(lattice, metric);
        break;
    case TRIGO:
        set_trigo(lattice, metric);
        break;
    case HEXA:
        set_trigo(lattice, metric);
        break;
    case CUBIC:
        set_cubic(lattice, metric);
        break;
    case NONE:
        break;
    }

    return 1;
}