CASM  1.1.0
A Clusters Approach to Statistical Mechanics
IntegralCluster.hh
Go to the documentation of this file.
1 #ifndef CASM_IntegralCluster
2 #define CASM_IntegralCluster
3 
4 #include <vector>
5 
8 
9 namespace CASM {
10 
11 class Structure;
12 
25 /* -- IntegralCluster ------------------------------------- */
26 
27 class IntegralCluster;
28 
30 template <>
33  // typedef Index size_type;
34  // static const std::string name;
35 };
36 
38  : public xtal::Translatable<GenericCluster<CRTPBase<IntegralCluster>>> {
39  public:
42  using Base::Element;
43  using Base::size_type;
44 
46 
47  template <typename Iterator>
48  IntegralCluster(PrimType const &prim, Iterator begin, Iterator end);
49 
50  const PrimType &prim() const;
51 
53  std::vector<Element> &elements();
54 
56  const std::vector<Element> &elements() const;
57 
60 
63 
64  protected:
66 
67  private:
68  std::vector<xtal::UnitCellCoord> m_element;
70 };
71 
72 template <typename Iterator>
73 IntegralCluster::IntegralCluster(PrimType const &prim, Iterator begin,
74  Iterator end)
75  : m_element(begin, end), m_prim_ptr(&prim) {}
76 } // namespace CASM
77 
78 #endif
A CRTP base class for a cluster of anything.
iterator end()
Iterator to the past-the-last element in the cluster.
traits< MostDerived >::Element Element
iterator begin()
Iterator to first element in the cluster.
IntegralCluster & operator+=(xtal::UnitCell trans)
Translate the cluster by a UnitCell translation.
std::vector< xtal::UnitCellCoord > m_element
const PrimType * m_prim_ptr
std::vector< Element > & elements()
Access vector of elements.
const PrimType & prim() const
IntegralCluster(PrimType const &prim)
xtal::Translatable< GenericCluster< CRTPBase< IntegralCluster > > > Base
xtal::Coordinate coordinate(size_type i) const
Return the coordinate corresponding to element(i)
Structure specifies the lattice and atomic basis of a crystal.
Definition: Structure.hh:30
Represents cartesian and fractional coordinates.
Definition: Coordinate.hh:34
Unit Cell Coordinates.
Unit Cell Indices.
Main CASM namespace.
Definition: APICommand.hh:8
CRTP class to implement '-=', '+', and '-' in terms of '+='.