CASM  1.1.0
A Clusters Approach to Statistical Mechanics
FillSupercell.hh
Go to the documentation of this file.
1 #ifndef CASM_FillSupercell
2 #define CASM_FillSupercell
3 
4 #include <memory>
5 #include <vector>
6 
8 
9 namespace CASM {
10 
11 namespace xtal {
12 class Lattice;
13 }
14 class Configuration;
15 class Supercell;
16 class SymOp;
17 
25 bool is_valid_sub_configuration(xtal::Lattice const &sub_configuration_lattice,
26  Supercell const &supercell);
27 
35 Configuration fill_supercell(
36  Configuration const &motif,
37  std::shared_ptr<Supercell const> const &shared_supercell);
38 
47 Configuration fill_supercell(Configuration const &motif,
48  Supercell const &supercell);
49 
55 Configuration fill_supercell(
56  SymOp const &symop, Configuration const &motif,
57  std::shared_ptr<Supercell const> const &shared_supercell);
58 
65 Configuration fill_supercell(SymOp const &symop, Configuration const &motif,
66  Supercell const &supercell);
67 
69 template <typename ConfigOutputIterator>
70 ConfigOutputIterator make_all_super_configurations(
71  Configuration const &configuration,
72  std::shared_ptr<Supercell const> shared_supercell,
73  ConfigOutputIterator result);
74 
91  public:
96  FillSupercell(std::shared_ptr<Supercell const> const &_shared_supercell);
97 
102  FillSupercell(Supercell const &_supercell);
103 
114  Configuration operator()(Configuration const &motif) const;
115 
118  Configuration operator()(SymOp const &_symop,
119  Configuration const &motif) const;
120 
123  const SymOp *find_symop(xtal::Lattice const &_motif_lattice) const;
124 
126  const SymOp &symop() const { return *m_symop_ptr; }
127 
128  private:
129  void _init(Supercell const &_motif_scel) const;
130 
131  std::shared_ptr<Supercell const> m_shared_supercell;
133 
134  // These mutable members are used by `operator()`. They are mutable members
135  // instead of temporary variables so they can be reused if FillSupercell is
136  // called repeatedly on motif Configuration from the same Supercell.
137 
138  mutable SymOp const *m_symop_ptr;
139  mutable Supercell const *m_motif_supercell;
140  mutable std::vector<std::vector<Index> > m_index_table;
141 };
142 } // namespace CASM
143 
144 #endif
Supercell const * m_motif_supercell
const SymOp & symop() const
Returns the SymOp used by operator()
FillSupercell(std::shared_ptr< Supercell const > const &_shared_supercell)
Constructor.
SymOp const * m_symop_ptr
void _init(Supercell const &_motif_scel) const
Configuration operator()(Configuration const &motif) const
const SymOp * find_symop(xtal::Lattice const &_motif_lattice) const
Find first SymOp in the prim factor group such that apply(op, motif) can be used to fill the Supercel...
std::vector< std::vector< Index > > m_index_table
Supercell const * m_supercell_ptr
std::shared_ptr< Supercell const > m_shared_supercell
Represents a supercell of the primitive parent crystal structure.
Definition: Supercell.hh:51
SymOp is the Coordinate representation of a symmetry operation it keeps fraction (FRAC) and Cartesian...
Definition: SymOp.hh:28
Main CASM namespace.
Definition: APICommand.hh:8
Configuration fill_supercell(Configuration const &motif, std::shared_ptr< Supercell const > const &shared_supercell)
bool is_valid_sub_configuration(xtal::Lattice const &sub_configuration_lattice, Supercell const &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.