static int test_spg_get_international(void) { double lattice[3][3] = {{4, 0, 0}, {0, 4, 0}, {0, 0, 3}}; double position[][3] = { {0, 0, 0}, {0.5, 0.5, 0.5}, {0.3, 0.3, 0}, {0.7, 0.7, 0}, {0.2, 0.8, 0.5}, {0.8, 0.2, 0.5}, }; int types[] = {1, 1, 2, 2, 2, 2}; int num_spg, num_atom = 6; char symbol[21]; num_spg = spg_get_international(symbol, lattice, position, types, num_atom, 1e-5); printf("*** spg_get_international ***:\n"); if ( num_spg > 0 ) { printf("%s (%d)\n", symbol, num_spg); return 0; } else { printf("Space group could not be found.\n"); return 1; } }
std::string spgw_get_international(geometry<VALTYPE,CELL> &inGeom, float symprec = 1e-7){ int num_atoms = inGeom.size(); auto latticev = new VALTYPE[3][3](); auto position = new VALTYPE[num_atoms][3](); auto types = new int[num_atoms](); get_spgdata_from_geom(inGeom,latticev,position,types); char symbol[21]; int num_spg = spg_get_international(symbol, latticev, position, types, num_atoms, symprec); return std::string(symbol); }
int FC_FUNC_(spglib_get_group_number, SPGLIB_GET_GROUP_NUMBER)(const double lattice[3][3], const double position[][3], const int types[], const int * num_atom, const double * symprec){ char symbol[11]; return spg_get_international(symbol, lattice, position, types, *num_atom, *symprec); }