1 #ifndef CASM_FillSupercell_impl
2 #define CASM_FillSupercell_impl
26 template <
typename ConfigOutputIterator>
29 std::shared_ptr<Supercell const> shared_supercell,
30 ConfigOutputIterator result) {
51 auto const &prim = shared_supercell->prim();
54 SymGroup const &super_group = prim.factor_group();
71 auto generates_unique_prim_config_lattice_wrt_supercell_factor_group =
72 [&](
SymOp const &super_group_op) {
73 for (
auto const &invariant_subgroup_op :
74 prim_config_lattice_invariant_subgroup) {
76 if ((subgroup_op * super_group_op * invariant_subgroup_op).index() <
77 super_group_op.index()) {
90 auto find_supercell_factor_group_op_such_that_product_fills_supercell =
91 [&](
SymOp const &super_group_op) {
92 auto const &super_lattice = shared_supercell->lattice();
93 auto const &prim_config_lattice =
95 double xtal_tol = prim_config_lattice.
tol();
98 for (; it != end; ++it) {
99 auto test_op = (*it) * super_group_op;
110 for (
auto const &super_group_op : super_group) {
111 if (generates_unique_prim_config_lattice_wrt_supercell_factor_group(
114 find_supercell_factor_group_op_such_that_product_fills_supercell(
118 (*it) * super_group_op, primitive_configuration, shared_supercell);
120 for (
auto const &equivalent_configuration : enumerator) {
121 *result++ = equivalent_configuration;
SupercellSymInfo const & supercell_sym_info
Enumerate all equivalent Configurations obtained by permuations in a Supercell.
Configuration primitive() const
Return the primitive Configuration.
const Lattice & ideal_lattice() const
SymGroup const & factor_group() const
Subgroup of primitive-cell factor group operations that leave supercell lattice invariant.
SymGroup is a collection of symmetry operations that satisfy the group property The symmetry operatio...
SymOp is the Coordinate representation of a symmetry operation it keeps fraction (FRAC) and Cartesian...
std::pair< bool, Eigen::Matrix3d > is_superlattice(const Lattice &scel, const Lattice &unit, double tol)
Check if scel is a superlattice of unitcell unit and some integer transformation matrix T.
xtal::Coordinate copy_apply(const xtal::SymOp &op, xtal::Coordinate coord)
Copy and apply SymOp to a Coordinate.
SymGroup invariant_subgroup(const SymGroup &super_group, const xtal::Lattice &lat)
Returns the subgroup of the given group that keeps the lattice invariant.
Configuration fill_supercell(Configuration const &motif, std::shared_ptr< Supercell const > const &shared_supercell)
ConfigOutputIterator make_all_super_configurations(Configuration const &configuration, std::shared_ptr< Supercell const > shared_supercell, ConfigOutputIterator result)
Make all super configurations that fill a particular supercell.