CASM  1.1.0
A Clusters Approach to Statistical Mechanics
ClexBasis.hh
Go to the documentation of this file.
1 #ifndef CLEXBASIS_HH
2 #define CLEXBASIS_HH
3 
4 #include <string>
5 
12 #include "casm/global/enum.hh"
14 
15 namespace CASM {
16 namespace xtal {
17 class Site;
18 class BasicStructure;
19 class UnitCell;
20 } // namespace xtal
21 using xtal::BasicStructure;
22 using xtal::Site;
23 using xtal::UnitCell;
24 
25 namespace DoFType {
26 class Traits;
27 }
28 class PrimNeighborList;
29 class ClexBasisBuilder;
30 
31 class ClexBasis {
32  public:
33  typedef std::vector<BasisSet> BSetOrbit;
34  typedef std::vector<BSetOrbit>::const_iterator BSetOrbitIterator;
35 
37  typedef std::shared_ptr<const Structure> PrimType_ptr;
38 
49  ClexBasis(PrimType_ptr _prim_ptr, ClexBasisSpecs const &_basis_set_specs,
50  ParsingDictionary<DoFType::Traits> const *_dof_dict);
51 
52  PrimType const &prim() const;
53 
54  PrimType_ptr shared_prim() const;
55 
56  ClexBasisSpecs const &basis_set_specs() const;
57 
59 
60  DoFType::Traits const &lookup_dof_type_traits(std::string const &key) const;
61 
63  Index n_sublat() const;
64 
66  Index n_orbits() const;
67 
69  Index n_functions() const;
70 
73  BasisSet const &clust_basis(Index orbit_ind, Index equiv_ind) const {
74  return m_bset_tree[orbit_ind][equiv_ind];
75  }
76 
78  BSetOrbit const &bset_orbit(Index orbit_ind) const {
79  return m_bset_tree[orbit_ind];
80  }
81 
83  BSetOrbitIterator begin() const { return m_bset_tree.cbegin(); }
84 
86  BSetOrbitIterator cbegin() const { return m_bset_tree.cbegin(); }
87 
89  BSetOrbitIterator end() const { return m_bset_tree.cbegin(); }
90 
92  BSetOrbitIterator cend() const { return m_bset_tree.cbegin(); }
93 
95  std::map<DoFKey, std::vector<BasisSet> > const &site_bases() const {
96  return m_site_bases;
97  }
98 
100  std::map<DoFKey, std::vector<BasisSet> > const &global_bases() const {
101  return m_global_bases;
102  }
103 
109  template <typename OrbitIterType>
110  void generate(OrbitIterType _begin, OrbitIterType _end);
111 
112  private:
113  template <typename OrbitType>
114  BasisSet _construct_prototype_basis(OrbitType const &_orbit,
115  std::vector<DoFKey> const &local_keys,
116  std::vector<DoFKey> const &global_keys,
117  Index max_poly_order) const;
118 
120  void _populate_site_bases();
121 
123 
125 
127 
130 
132  // std::vector<OrbitType> m_orbitree
133 
135  std::vector<BSetOrbit> m_bset_tree;
136 
140  std::map<DoFKey, std::vector<BasisSet> > m_site_bases;
141 
143  std::map<DoFKey, std::vector<BasisSet> > m_global_bases;
144 };
145 
149 Index print_clust_basis(std::ostream &stream, BasisSet _clust_basis,
150  IntegralCluster const &_prototype, Index func_ind = 0,
151  int space = 18, char delim = '\n');
152 
153 template <typename OrbitType>
154 void print_proto_clust_funcs(ClexBasis const &_clex_basis, std::ostream &out,
155  BasicStructure const &_prim,
156  std::vector<OrbitType> const &_tree);
157 
158 namespace ClexBasis_impl {
159 std::vector<DoFKey> extract_dof_types(Structure const &_prim);
160 
161 template <typename OrbitType>
162 BasisSet construct_proto_dof_basis(OrbitType const &_orbit,
163  BasisSet::ArgList const &site_dof_sets);
164 
165 // template<typename UCCIterType, typename IntegralClusterSymCompareType>
166 // std::map<UnitCellCoord, std::set<UnitCellCoord> > unique_ucc(UCCIterType
167 // begin, UCCIterType end, IntegralClusterSymCompareType const &sym_compare);
168 } // namespace ClexBasis_impl
169 } // namespace CASM
170 
171 #endif
std::map< DoFKey, std::vector< BasisSet > > m_global_bases
Dictionary of all global BasisSets, initialized.
Definition: ClexBasis.hh:143
std::vector< BSetOrbit >::const_iterator BSetOrbitIterator
Definition: ClexBasis.hh:34
std::shared_ptr< const Structure > PrimType_ptr
Definition: ClexBasis.hh:37
std::map< DoFKey, std::vector< BasisSet > > m_site_bases
Dictionary of all site BasisSets, initialized on construction m_site_basis[DOF][b] gives site basis f...
Definition: ClexBasis.hh:140
notstd::cloneable_ptr< ClexBasisBuilder > m_basis_builder
pointer to class that constructs cluster functions
Definition: ClexBasis.hh:129
Index n_orbits() const
Total number of BasisSet orbits.
Definition: ClexBasis.cc:93
BSetOrbitIterator end() const
Const past-the-end iterator for BasisSet orbits.
Definition: ClexBasis.hh:89
void generate(OrbitIterType _begin, OrbitIterType _end)
generate clust_basis for all equivalent clusters in
BSetOrbitIterator cend() const
Const past-the-end iterator for BasisSet orbits.
Definition: ClexBasis.hh:92
std::map< DoFKey, std::vector< BasisSet > > const & site_bases() const
Const access to dictionary of all site BasisSets.
Definition: ClexBasis.hh:95
std::vector< BasisSet > BSetOrbit
Definition: ClexBasis.hh:33
BasisSet _construct_prototype_basis(OrbitType const &_orbit, std::vector< DoFKey > const &local_keys, std::vector< DoFKey > const &global_keys, Index max_poly_order) const
BSetOrbitIterator cbegin() const
Const iterator to first BasisSet orbit.
Definition: ClexBasis.hh:86
PrimType_ptr m_prim_ptr
Definition: ClexBasis.hh:122
PrimType_ptr shared_prim() const
Definition: ClexBasis.cc:73
ClexBasis(PrimType_ptr _prim_ptr, ClexBasisSpecs const &_basis_set_specs, ParsingDictionary< DoFType::Traits > const *_dof_dict)
Definition: ClexBasis.cc:31
ParsingDictionary< DoFType::Traits > const * dof_dict() const
Definition: ClexBasis.cc:79
std::map< DoFKey, std::vector< BasisSet > > const & global_bases() const
Const access to dictionary of all global BasisSets.
Definition: ClexBasis.hh:100
ParsingDictionary< DoFType::Traits > const * m_dof_dict
Definition: ClexBasis.hh:126
Index n_sublat() const
Total number of basis sites in primitive cell.
Definition: ClexBasis.cc:90
std::vector< BSetOrbit > m_bset_tree
Collection of all cluster orbits (are we keeping this?)
Definition: ClexBasis.hh:135
void _populate_site_bases()
Performs heavy lifting for populating site bases in m_site_bases.
Definition: ClexBasis.cc:107
BSetOrbitIterator begin() const
Const iterator to first BasisSet orbit.
Definition: ClexBasis.hh:83
PrimType const & prim() const
Definition: ClexBasis.cc:71
Index n_functions() const
Total number of basis functions.
Definition: ClexBasis.cc:96
BasisSet const & clust_basis(Index orbit_ind, Index equiv_ind) const
Const access of clust basis of orbit.
Definition: ClexBasis.hh:73
ClexBasisSpecs const & basis_set_specs() const
Definition: ClexBasis.cc:75
Structure PrimType
Definition: ClexBasis.hh:36
DoFType::Traits const & lookup_dof_type_traits(std::string const &key) const
Definition: ClexBasis.cc:83
ClexBasisSpecs m_basis_set_specs
Definition: ClexBasis.hh:124
BSetOrbit const & bset_orbit(Index orbit_ind) const
Const access of BSetOrbit of orbit.
Definition: ClexBasis.hh:78
Collection of all the traits specific to a DoF type.
Definition: DoFTraits.hh:59
Parsing dictionary for obtaining the correct MoleculeAttribute given a name.
Structure specifies the lattice and atomic basis of a crystal.
Definition: Structure.hh:30
BasicStructure specifies the lattice and atomic basis of a crystal.
A 'cloneable_ptr' can be used in place of 'unique_ptr'.
BasisSet construct_proto_dof_basis(OrbitType const &_orbit, BasisSet::ArgList const &site_dof_sets)
std::vector< DoFKey > extract_dof_types(Structure const &_prim)
Main CASM namespace.
Definition: APICommand.hh:8
Index print_clust_basis(std::ostream &stream, BasisSet _clust_basis, IntegralCluster const &_prototype, Index func_ind=0, int space=18, char delim='\n')
Definition: ClexBasis.cc:44
void print_proto_clust_funcs(ClexBasis const &_clex_basis, std::ostream &out, BasicStructure const &_prim, std::vector< OrbitType > const &_tree)
INDEX_TYPE Index
For long integer indexing:
Definition: definitions.hh:39
Provides parameters for constructing a cluster expansion basis (ClexBasis)