CASM  1.1.0
A Clusters Approach to Statistical Mechanics
ConfigEnumInput.cc
Go to the documentation of this file.
1 #include "casm/clex/Supercell.hh"
5 
6 namespace CASM {
7 
14  : m_configuration(_configuration) {
16 }
17 
24  : ConfigEnumInput(Configuration::zeros(_supercell)) {}
25 
31  Configuration const &_configuration,
32  std::set<Index> const &_site_index_selection = {})
33  : m_site_index_selection(_site_index_selection),
34  m_configuration(_configuration) {}
35 
44  Supercell const &_supercell,
45  std::set<Index> const &_site_index_selection = {})
46  : ConfigEnumInput(Configuration::zeros(_supercell), _site_index_selection) {
47 }
48 
50  return m_configuration;
51 }
52 
53 // /// (deprecated) Prefer using configuration()
54 // Configuration const &ConfigEnumInput::config() const {
55 // return configuration();
56 // }
57 //
58 // /// (deprecated) Prefer using configuration()
59 // Supercell const &ConfigEnumInput::supercell() const {
60 // return configuration().supercell();
61 // }
62 //
63 // /// (deprecated) Prefer using configuration()
64 // ConfigDoF const &ConfigEnumInput::configdof() const {
65 // return configuration().configdof();
66 // }
67 
68 std::set<Index> const &ConfigEnumInput::sites() const {
70 }
71 
73 
75  for (Index i = 0; i < configuration().size(); ++i)
76  m_site_index_selection.insert(i);
77 }
78 
80  m_site_index_selection.insert(site_index);
81 }
82 
83 void ConfigEnumInput::select_site(UnitCellCoord const &site_uccord) {
84  auto const &converter =
86  m_site_index_selection.insert(converter(site_uccord));
87 }
88 
89 void ConfigEnumInput::select_sublattice(Index sublattice_index) {
90  Index b = sublattice_index;
92  for (Index i = b * V; i < (b + 1) * V; ++i) {
93  m_site_index_selection.insert(i);
94  }
95 }
96 
100 std::vector<PermuteIterator> make_invariant_subgroup(
101  ConfigEnumInput const &config_enum_input) {
102  std::vector<PermuteIterator> factor_group =
103  config_enum_input.configuration().factor_group();
104  return make_invariant_subgroup(config_enum_input, factor_group.begin(),
105  factor_group.end());
106 }
107 
109 } // namespace CASM
std::set< Index > m_site_index_selection
Configuration m_configuration
static Configuration zeros(const std::shared_ptr< Supercell const > &_supercell_ptr)
const Supercell & supercell() const
Get the Supercell for this Configuration.
Index size() const
Returns number of sites, NOT the number of primitives that fit in here.
std::vector< PermuteIterator > factor_group() const
Returns the subgroup of the Supercell factor group that leaves the Configuration unchanged.
Represents a supercell of the primitive parent crystal structure.
Definition: Supercell.hh:51
Index volume() const
Return number of primitive cells that fit inside of *this.
Definition: Supercell.cc:227
const SupercellSymInfo & sym_info() const
Definition: Supercell.cc:265
const xtal::UnitCellCoordIndexConverter & unitcellcoord_index_converter() const
UnitCellCoordIndexConverter for this superstructure/primstructure pair Used to convert from lattice t...
Unit Cell Coordinates.
ConfigEnumInput(Configuration const &_configuration)
Construct with a Configuration and all sites selected.
void select_site(Index site_index)
std::set< Index > const & sites() const
Configuration const & configuration() const
void clear_sites()
Clear site selection. After condition is no sites are selected.
std::vector< PermuteIterator > make_invariant_subgroup(ConfigEnumInput const &config_enum_input)
void select_sublattice(Index sublattice_index)
Select all sites on a sublattice.
SharedPrimFormatter< jsonParser > factor_group()
Main CASM namespace.
Definition: APICommand.hh:8
INDEX_TYPE Index
For long integer indexing:
Definition: definitions.hh:39