CASM  1.1.0
A Clusters Approach to Statistical Mechanics
ScelEnum.cc
Go to the documentation of this file.
1 #include "casm/clex/ScelEnum.hh"
2 
8 
9 namespace CASM {
10 
12 template <>
14  return true;
15 }
16 
26  std::shared_ptr<const Structure> const &shared_prim,
27  const xtal::ScelEnumProps &enum_props)
28  : m_shared_prim(shared_prim) {
29  auto const &pg = m_shared_prim->point_group();
31  pg.begin(), pg.end(), m_shared_prim->lattice(), enum_props));
32 
33  m_lat_it = m_lattice_enum->begin();
34  m_lat_end = m_lattice_enum->end();
35 
36  if (m_lat_it != m_lat_end) {
37  double xtal_tol = m_shared_prim->lattice().tol();
38  Lattice canonical_lattice =
39  xtal::canonical::equivalent(*m_lat_it, pg, xtal_tol);
40  m_current =
41  notstd::make_unique<Supercell>(m_shared_prim, canonical_lattice);
42  this->_initialize(&(*m_current));
43  } else {
44  this->_invalidate();
45  }
46 }
47 
48 std::string ScelEnumByProps::name() const {
50 }
51 
52 const std::string ScelEnumByProps::enumerator_name = "ScelEnumByProps";
53 
56  ++m_lat_it;
57 
58  if (m_lat_it != m_lat_end) {
59  double xtal_tol = m_shared_prim->lattice().tol();
60  auto const &pg = m_shared_prim->point_group();
61  Lattice canonical_lattice =
62  xtal::canonical::equivalent(*m_lat_it, pg, xtal_tol);
63  m_current =
64  notstd::make_unique<Supercell>(m_shared_prim, canonical_lattice);
65  this->_initialize(&(*m_current));
66  this->_increment_step();
67  } else {
68  this->_invalidate();
69  }
70 }
71 
72 } // namespace CASM
std::shared_ptr< Structure const > shared_prim
notstd::cloneable_ptr< Supercell > m_current
Definition: ScelEnum.hh:52
std::unique_ptr< xtal::SuperlatticeEnumerator > m_lattice_enum
Definition: ScelEnum.hh:54
xtal::SuperlatticeEnumerator::const_iterator m_lat_it
Definition: ScelEnum.hh:55
ScelEnumByProps(std::shared_ptr< const Structure > const &shared_prim, const xtal::ScelEnumProps &enum_props)
Construct with shared prim Structure and ScelEnumProps settings.
Definition: ScelEnum.cc:25
std::string name() const override
Derived enumerators must implement name, via ENUM_MEMBERS.
Definition: ScelEnum.cc:48
std::shared_ptr< Structure const > m_shared_prim
Definition: ScelEnum.hh:51
void increment() override
Implements increment over supercells.
Definition: ScelEnum.cc:55
static const std::string enumerator_name
Definition: ScelEnum.hh:45
xtal::SuperlatticeEnumerator::const_iterator m_lat_end
Definition: ScelEnum.hh:56
void _invalidate()
Call if enumeration complete.
Definition: Enumerator.hh:159
void _increment_step()
Increment current step value.
Definition: Enumerator.hh:153
Data structure for holding supercell enumeration properties.
A fake container of supercell matrices.
bool is_guaranteed_for_database_insert(ConfigEnumAllOccupations const &enumerator)
Lattice equivalent(Lattice const &in_lat, SymOpVector const &point_grp, double compare_tol)
Main CASM namespace.
Definition: APICommand.hh:8