CASM  1.1.0
A Clusters Approach to Statistical Mechanics
ClexBasisWriter.hh
Go to the documentation of this file.
1 #ifndef CASM_ClexBasisWriter
2 #define CASM_ClexBasisWriter
3 
5 #include "casm/clex/ClexBasis.hh"
7 
8 namespace CASM {
9 
10 class ClexBasis;
11 class PrimNeighborList;
12 class ParamPackMixIn;
13 class OrbitFunctionTraits;
14 
15 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16 
18  public:
21  ClexBasisWriter(Structure const &_prim,
22  PARAM_PACK_TYPE const &param_pack_type);
23 
26  ClexBasisWriter(Structure const &_prim,
27  ParamPackMixIn const &parampack_mix_in);
28 
30  template <typename OrbitType>
31  void print_clexulator(std::string class_name, ClexBasis const &clex,
32  std::vector<OrbitType> const &_tree,
33  PrimNeighborList &_nlist, std::ostream &stream,
34  double xtal_tol);
35 
36  private:
37  void _initialize(Structure const &_prim,
38  ParamPackMixIn const &parampack_mix_in);
39 
40  std::vector<std::unique_ptr<FunctionVisitor> > const &
42  return m_site_visitors;
43  }
44 
45  std::vector<std::unique_ptr<FunctionVisitor> > const &
47  return m_clust_visitors;
48  }
49 
50  std::vector<std::unique_ptr<OrbitFunctionTraits> > const &_orbit_func_traits()
51  const {
52  return m_orbit_func_traits;
53  }
54 
56  template <typename OrbitType>
57  void print_param_pack(std::string class_name, ClexBasis const &clex,
58  std::vector<OrbitType> const &_tree,
59  PrimNeighborList &_nlist, std::ostream &stream,
60  std::string const &_indent) const;
61 
62  std::vector<std::unique_ptr<FunctionVisitor> > m_site_visitors;
63  std::vector<std::unique_ptr<FunctionVisitor> > m_clust_visitors;
64  std::vector<std::unique_ptr<OrbitFunctionTraits> > m_orbit_func_traits;
66 };
67 
68 namespace ClexBasisWriter_impl {
69 
71  std::string const &class_name, ClexBasis const &clex,
72  ParamPackMixIn const &_param_pack_mix_in,
73  std::vector<std::unique_ptr<OrbitFunctionTraits> > const &orbit_func_traits,
74  Index N_flower, std::string const &indent);
75 //*******************************************************************************************
76 
78  std::string const &class_name, ClexBasis const &clex,
79  std::string const &indent);
80 //*******************************************************************************************
81 
82 std::string clexulator_public_method_declarations(std::string const &class_name,
83  ClexBasis const &clex,
84  std::string const &indent);
85 //*******************************************************************************************
86 
87 template <typename OrbitType>
88 std::tuple<std::string, std::string> clexulator_orbit_function_strings(
89  std::string const &class_name, ClexBasis::BSetOrbit const &_bset_orbit,
90  OrbitType const &_clust_orbit,
91  std::function<std::string(Index, Index)> method_namer,
92  PrimNeighborList &_nlist,
93  std::vector<std::unique_ptr<FunctionVisitor> > const &visitors,
94  std::string const &indent);
95 //*******************************************************************************************
96 
100 
112 
119 
120 template <typename OrbitType>
121 std::tuple<std::string, std::string> clexulator_flower_function_strings(
122  std::string const &class_name, ClexBasis::BSetOrbit const &_bset_orbit,
123  OrbitType const &_clust_orbit,
124  std::function<std::string(Index, Index)> method_namer,
125  std::map<UnitCellCoord, std::set<UnitCellCoord> > const &_nhood,
126  PrimNeighborList &_nlist,
127  std::vector<std::unique_ptr<FunctionVisitor> > const &visitor,
128  std::string const &indent);
129 
130 //*******************************************************************************************
131 
132 template <typename OrbitType>
133 std::tuple<std::string, std::string> clexulator_dflower_function_strings(
134  std::string const &class_name, ClexBasis::BSetOrbit const &_bset_orbit,
135  ClexBasis::BSetOrbit const &_site_bases, OrbitType const &_clust_orbit,
136  std::function<std::string(Index, Index)> method_namer,
137  std::map<UnitCellCoord, std::set<UnitCellCoord> > const &_nhood,
138  PrimNeighborList &_nlist,
139  std::vector<std::unique_ptr<FunctionVisitor> > const &visitors,
140  FunctionVisitor const &prefactor_labeler, std::string const &indent);
141 //*******************************************************************************************
142 
144  std::string const &class_name, ClexBasis const &clex,
145  ParamPackMixIn const &_param_pack_mix_in, std::string const &indent);
146 
147 //*******************************************************************************************
148 
149 template <typename OrbitType>
151  std::string const &class_name, ClexBasis const &clex,
152  std::vector<OrbitType> const &_tree,
153  std::map<UnitCellCoord, std::set<UnitCellCoord> > const &_nhood,
154  PrimNeighborList &_nlist, ParamPackMixIn const &_param_pack_mix_in,
155  std::vector<std::string> const &orbit_method_names,
156  std::vector<std::vector<std::string> > const &flower_method_names,
157  std::vector<std::vector<std::string> > const &dflower_method_names,
158  std::string const &indent);
159 
160 //*******************************************************************************************
161 
162 template <typename OrbitType>
164  std::string const &class_name, ClexBasis const &clex,
165  std::vector<OrbitType> const &_tree,
166  std::vector<std::unique_ptr<OrbitFunctionTraits> > const &orbit_func_traits,
167  std::map<UnitCellCoord, std::set<UnitCellCoord> > const &_nhood,
168  PrimNeighborList &_nlist, std::string const &indent);
169 //*******************************************************************************************
170 
171 template <typename OrbitType>
173  std::string const &class_name, ClexBasis const &clex,
174  std::vector<OrbitType> const &_tree,
175  std::vector<std::unique_ptr<OrbitFunctionTraits> > const &orbit_func_traits,
176  std::map<UnitCellCoord, std::set<UnitCellCoord> > const &_nhood,
177  PrimNeighborList &_nlist, std::string const &indent);
178 
179 //*******************************************************************************************
180 
181 // Divide by multiplicity. Same result as evaluating correlations via orbitree.
182 template <typename OrbitType>
183 std::vector<std::string> orbit_function_cpp_strings(
184  ClexBasis::BSetOrbit _bset_orbit, // used as temporary
185  OrbitType const &_clust_orbit, PrimNeighborList &_nlist,
186  std::vector<std::unique_ptr<FunctionVisitor> > const &visitors);
187 //*******************************************************************************************
189 template <typename OrbitType>
190 std::vector<std::string> flower_function_cpp_strings(
191  ClexBasis::BSetOrbit _bset_orbit, // used as temporary
192  std::function<BasisSet(BasisSet const &)> _bset_transform,
193  OrbitType const &_clust_orbit,
194  std::map<UnitCellCoord, std::set<UnitCellCoord> > const &_nhood,
195  PrimNeighborList &_nlist,
196  std::vector<std::unique_ptr<FunctionVisitor> > const &_visitors,
197  UnitCellCoord const &_nbor);
198 
199 //*******************************************************************************************
200 
201 template <typename OrbitType>
202 void print_proto_clust_funcs(ClexBasis const &clex, std::ostream &out,
203  std::vector<OrbitType> const &_tree);
204 
205 //*******************************************************************************************
206 
207 template <typename OrbitIterType>
208 std::map<UnitCellCoord, std::set<UnitCellCoord> > dependency_neighborhood(
209  OrbitIterType begin, OrbitIterType end);
210 
211 //*******************************************************************************************
212 
213 template <typename UCCIterType, typename IntegralClusterSymCompareType>
214 std::set<UnitCellCoord> equiv_ucc(
215  UCCIterType begin, UCCIterType end, UnitCellCoord const &_pivot,
216  Structure const &_prim, IntegralClusterSymCompareType const &_sym_compare);
217 } // namespace ClexBasisWriter_impl
218 } // namespace CASM
219 
220 #endif
221 
std::vector< BasisSet > BSetOrbit
Definition: ClexBasis.hh:33
notstd::cloneable_ptr< ParamPackMixIn > m_param_pack_mix_in
std::vector< std::unique_ptr< FunctionVisitor > > const & _clust_function_visitors() const
void print_clexulator(std::string class_name, ClexBasis const &clex, std::vector< OrbitType > const &_tree, PrimNeighborList &_nlist, std::ostream &stream, double xtal_tol)
Print clexulator.
ClexBasisWriter(Structure const &_prim, PARAM_PACK_TYPE const &param_pack_type)
Construct ClexBasisWriter, collecting requisite DoF info from '_prim'.
void print_param_pack(std::string class_name, ClexBasis const &clex, std::vector< OrbitType > const &_tree, PrimNeighborList &_nlist, std::ostream &stream, std::string const &_indent) const
Print ClexParamPack specialization.
std::vector< std::unique_ptr< FunctionVisitor > > m_site_visitors
std::vector< std::unique_ptr< OrbitFunctionTraits > > const & _orbit_func_traits() const
std::vector< std::unique_ptr< OrbitFunctionTraits > > m_orbit_func_traits
std::vector< std::unique_ptr< FunctionVisitor > > m_clust_visitors
void _initialize(Structure const &_prim, ParamPackMixIn const &parampack_mix_in)
std::vector< std::unique_ptr< FunctionVisitor > > const & _site_function_visitors() const
ParamPackMixIn is interface class to control ClexParamPack portion of Clexulator printing Used primar...
The PrimNeighborList gives the coordinates of UnitCell that are neighbors of the origin UnitCell.
Definition: NeighborList.hh:39
Structure specifies the lattice and atomic basis of a crystal.
Definition: Structure.hh:30
Unit Cell Coordinates.
A 'cloneable_ptr' can be used in place of 'unique_ptr'.
std::tuple< std::string, std::string > clexulator_dflower_function_strings(std::string const &class_name, ClexBasis::BSetOrbit const &_bset_orbit, ClexBasis::BSetOrbit const &_site_bases, OrbitType const &_clust_orbit, std::function< std::string(Index, Index)> method_namer, std::map< UnitCellCoord, std::set< UnitCellCoord > > const &_nhood, PrimNeighborList &_nlist, std::vector< std::unique_ptr< FunctionVisitor > > const &visitors, FunctionVisitor const &prefactor_labeler, std::string const &indent)
void print_proto_clust_funcs(ClexBasis const &clex, std::ostream &out, std::vector< OrbitType > const &_tree)
std::string clexulator_constructor_definition(std::string const &class_name, ClexBasis const &clex, std::vector< OrbitType > const &_tree, std::map< UnitCellCoord, std::set< UnitCellCoord > > const &_nhood, PrimNeighborList &_nlist, ParamPackMixIn const &_param_pack_mix_in, std::vector< std::string > const &orbit_method_names, std::vector< std::vector< std::string > > const &flower_method_names, std::vector< std::vector< std::string > > const &dflower_method_names, std::string const &indent)
std::string clexulator_point_prepare_definition(std::string const &class_name, ClexBasis const &clex, std::vector< OrbitType > const &_tree, std::vector< std::unique_ptr< OrbitFunctionTraits > > const &orbit_func_traits, std::map< UnitCellCoord, std::set< UnitCellCoord > > const &_nhood, PrimNeighborList &_nlist, std::string const &indent)
std::set< UnitCellCoord > equiv_ucc(UCCIterType begin, UCCIterType end, UnitCellCoord const &_pivot, Structure const &_prim, IntegralClusterSymCompareType const &_sym_compare)
std::vector< std::string > flower_function_cpp_strings(ClexBasis::BSetOrbit _bset_orbit, std::function< BasisSet(BasisSet const &)> _bset_transform, OrbitType const &_clust_orbit, std::map< UnitCellCoord, std::set< UnitCellCoord > > const &_nhood, PrimNeighborList &_nlist, std::vector< std::unique_ptr< FunctionVisitor > > const &_visitors, UnitCellCoord const &_nbor)
nlist_index is the index of the basis site in the neighbor list
std::tuple< std::string, std::string > clexulator_flower_function_strings(std::string const &class_name, ClexBasis::BSetOrbit const &_bset_orbit, OrbitType const &_clust_orbit, std::function< std::string(Index, Index)> method_namer, std::map< UnitCellCoord, std::set< UnitCellCoord > > const &_nhood, PrimNeighborList &_nlist, std::vector< std::unique_ptr< FunctionVisitor > > const &visitor, std::string const &indent)
Print the flower function formulae for orbit.
std::map< UnitCellCoord, std::set< UnitCellCoord > > dependency_neighborhood(OrbitIterType begin, OrbitIterType end)
std::string clexulator_interface_declaration(std::string const &class_name, ClexBasis const &clex, ParamPackMixIn const &_param_pack_mix_in, std::string const &indent)
std::string clexulator_private_method_declarations(std::string const &class_name, ClexBasis const &clex, std::string const &indent)
std::string clexulator_member_declarations(std::string const &class_name, ClexBasis const &clex, ParamPackMixIn const &_param_pack_mix_in, std::vector< std::unique_ptr< OrbitFunctionTraits > > const &orbit_func_traits, Index N_flower, std::string const &indent)
std::tuple< std::string, std::string > clexulator_orbit_function_strings(std::string const &class_name, ClexBasis::BSetOrbit const &_bset_orbit, OrbitType const &_clust_orbit, std::function< std::string(Index, Index)> method_namer, PrimNeighborList &_nlist, std::vector< std::unique_ptr< FunctionVisitor > > const &visitors, std::string const &indent)
std::string clexulator_public_method_declarations(std::string const &class_name, ClexBasis const &clex, std::string const &indent)
std::vector< std::string > orbit_function_cpp_strings(ClexBasis::BSetOrbit _bset_orbit, OrbitType const &_clust_orbit, PrimNeighborList &_nlist, std::vector< std::unique_ptr< FunctionVisitor > > const &visitors)
std::string clexulator_global_prepare_definition(std::string const &class_name, ClexBasis const &clex, std::vector< OrbitType > const &_tree, std::vector< std::unique_ptr< OrbitFunctionTraits > > const &orbit_func_traits, std::map< UnitCellCoord, std::set< UnitCellCoord > > const &_nhood, PrimNeighborList &_nlist, std::string const &indent)
Main CASM namespace.
Definition: APICommand.hh:8
INDEX_TYPE Index
For long integer indexing:
Definition: definitions.hh:39