CASM  1.1.0
A Clusters Approach to Statistical Mechanics
MagSpinDoFTraits.hh
Go to the documentation of this file.
1 #ifndef CASM_MagSpinDoFTraits
2 #define CASM_MagSpinDoFTraits
7 
8 namespace CASM {
9 namespace DoF_impl {
10 
11 struct MagSpinDoFSpecs : public DoFSpecs {
13  MagSpinDoFSpecs(std::string _flavor_name, Index _max_poly_order = -1)
14  : max_poly_order(_max_poly_order), m_flavor_name(_flavor_name) {}
15 
17 
19 
20  private:
21  std::string m_flavor_name;
22 
23  std::string _name() const override { return m_flavor_name + "magspin"; }
24 };
25 
27  public:
28  // Initialize with particular 'flavor' of magnetic spin. Options are:
29  // collinear: "C" and "Cunit"
30  // non-collinear (w/o spin-orbit): "NC" and "NCunit"
31  // non-collinear (with spin-orbit): "SO" and "SOunit"
32  MagSpinDoFTraits(std::string const &flavor_name)
33  : DoFType::Traits(AnisoValTraits(flavor_name + "magspin"), true) {}
34 
37  std::vector<BasisSet> construct_site_bases(
38  Structure const &_prim,
39  std::vector<Orbit<PrimPeriodicSymCompare<IntegralCluster> > > &_asym_unit,
40  BasisFunctionSpecs const &_basis_function_specs) const override;
41 
43  Structure const &prim) const override;
44 
45  void dof_specs_to_json(BasisFunctionSpecs const &basis_function_specs,
46  jsonParser &json,
47  Structure const &prim) const override;
48 
49  protected:
50  DoFType::Traits *_clone() const override {
51  return new MagSpinDoFTraits(*this);
52  }
53 };
54 } // namespace DoF_impl
55 
56 namespace DoFType {
61 DoF_impl::MagSpinDoFTraits magspin(std::string const &flavor_name);
62 
70 std::unique_ptr<DoFSpecs> magspin_specs(std::string const &flavor_name,
71  Index max_poly_order);
72 } // namespace DoFType
73 
74 // -- MagSpinDoFSpecs IO --
75 
86  const Structure &prim);
87 
97 void to_json(const DoF_impl::MagSpinDoFSpecs &occ_specs, jsonParser &json);
98 
99 } // namespace CASM
100 #endif
Specifies traits of (possibly) anisotropic crystal properties.
void parse_dof_specs(InputParser< BasisFunctionSpecs > &parser, Structure const &prim) const override
DoFType::Traits * _clone() const override
std::vector< BasisSet > construct_site_bases(Structure const &_prim, std::vector< Orbit< PrimPeriodicSymCompare< IntegralCluster > > > &_asym_unit, BasisFunctionSpecs const &_basis_function_specs) const override
Construct the site basis (if DOF_MODE is LOCAL) for a DoF, given its site.
MagSpinDoFTraits(std::string const &flavor_name)
void dof_specs_to_json(BasisFunctionSpecs const &basis_function_specs, jsonParser &json, Structure const &prim) const override
Output DoF-specific basis function specs to json. Default does nothing.
Collection of all the traits specific to a DoF type.
Definition: DoFTraits.hh:59
Traits(AnisoValTraits const &_val_traits, bool _requires_site_basis=false)
Definition: DoFTraits.hh:63
An Orbit of Element.
Definition: Orbit.hh:43
Structure specifies the lattice and atomic basis of a crystal.
Definition: Structure.hh:30
#define CLONEABLE(T)
std::unique_ptr< DoFSpecs > magspin_specs(std::string const &flavor_name, Index max_poly_order)
DoF_impl::MagSpinDoFTraits magspin(std::string const &flavor_name)
Main CASM namespace.
Definition: APICommand.hh:8
jsonParser & to_json(const ClexDescription &desc, jsonParser &json)
INDEX_TYPE Index
For long integer indexing:
Definition: definitions.hh:39
void parse(InputParser< ConfigEnumOptions > &parser, std::string method_name, PrimClex const &primclex, DataFormatterDictionary< Configuration > const &dict)
Specify how to construct basis functions.
std::string _name() const override
MagSpinDoFSpecs(std::string _flavor_name, Index _max_poly_order=-1)
Constructor for any SITE_BASIS_FUNCTION_TYPE.