1 #ifndef CASM_ClexBasisWriter
2 #define CASM_ClexBasisWriter
11 class PrimNeighborList;
13 class OrbitFunctionTraits;
30 template <
typename OrbitType>
32 std::vector<OrbitType>
const &_tree,
40 std::vector<std::unique_ptr<FunctionVisitor> >
const &
45 std::vector<std::unique_ptr<FunctionVisitor> >
const &
56 template <
typename OrbitType>
58 std::vector<OrbitType>
const &_tree,
60 std::string
const &_indent)
const;
68 namespace ClexBasisWriter_impl {
71 std::string
const &class_name,
ClexBasis const &clex,
73 std::vector<std::unique_ptr<OrbitFunctionTraits> >
const &orbit_func_traits,
74 Index N_flower, std::string
const &indent);
78 std::string
const &class_name,
ClexBasis const &clex,
79 std::string
const &indent);
84 std::string
const &indent);
87 template <
typename OrbitType>
90 OrbitType
const &_clust_orbit,
91 std::function<std::string(
Index,
Index)> method_namer,
93 std::vector<std::unique_ptr<FunctionVisitor> >
const &visitors,
94 std::string
const &indent);
120 template <
typename OrbitType>
123 OrbitType
const &_clust_orbit,
124 std::function<std::string(
Index,
Index)> method_namer,
125 std::map<
UnitCellCoord, std::set<UnitCellCoord> >
const &_nhood,
127 std::vector<std::unique_ptr<FunctionVisitor> >
const &visitor,
128 std::string
const &indent);
132 template <
typename OrbitType>
136 std::function<std::string(
Index,
Index)> method_namer,
137 std::map<
UnitCellCoord, std::set<UnitCellCoord> >
const &_nhood,
139 std::vector<std::unique_ptr<FunctionVisitor> >
const &visitors,
144 std::string
const &class_name,
ClexBasis const &clex,
145 ParamPackMixIn const &_param_pack_mix_in, std::string
const &indent);
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,
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);
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,
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,
182 template <
typename OrbitType>
186 std::vector<std::unique_ptr<FunctionVisitor> >
const &visitors);
189 template <
typename OrbitType>
193 OrbitType
const &_clust_orbit,
194 std::map<
UnitCellCoord, std::set<UnitCellCoord> >
const &_nhood,
196 std::vector<std::unique_ptr<FunctionVisitor> >
const &_visitors,
201 template <
typename OrbitType>
203 std::vector<OrbitType>
const &_tree);
207 template <
typename OrbitIterType>
209 OrbitIterType begin, OrbitIterType end);
213 template <
typename UCCIterType,
typename IntegralClusterSymCompareType>
215 UCCIterType begin, UCCIterType end,
UnitCellCoord const &_pivot,
216 Structure const &_prim, IntegralClusterSymCompareType
const &_sym_compare);
std::vector< BasisSet > BSetOrbit
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 ¶m_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 ¶mpack_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.
Structure specifies the lattice and atomic basis of a crystal.
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)
INDEX_TYPE Index
For long integer indexing: