CASM  1.1.0
A Clusters Approach to Statistical Mechanics
ClexBasis_stream_io.cc
Go to the documentation of this file.
2 
4 #include "casm/casm_io/Log.hh"
7 #include "casm/clex/PrimClex.hh"
11 
12 namespace CASM {
13 
15  Log &_log, std::shared_ptr<Structure const> _shared_prim,
16  ClexBasisSpecs const &_basis_set_specs, bool align,
18  : m_shared_prim(_shared_prim),
19  m_basis_set_specs(_basis_set_specs),
20  m_log(_log),
21  m_align(align),
22  m_orbit_printer_opt(_opt) {}
23 
26  std::shared_ptr<Structure const> const &shared_prim,
27  ClexBasisSpecs const &basis_set_specs, bool align,
28  OrbitPrinterOptions opt) {
29  ClexBasisFunctionPrinter printer{log, shared_prim, basis_set_specs, align,
30  opt};
31  for_all_orbits(*basis_set_specs.cluster_specs, log, printer);
32 }
33 
36  std::string basis_set_name, bool align,
37  OrbitPrinterOptions opt) {
38  auto const &shared_prim = primclex.shared_prim();
39  auto const &basis_set_specs = primclex.basis_set_specs(basis_set_name);
40  auto const &cluster_specs = *basis_set_specs.cluster_specs;
41 
42  std::vector<IntegralCluster> prototypes;
43  jsonParser clust_json{primclex.dir().clust(basis_set_name)};
44  read_clust(std::back_inserter(prototypes), clust_json, *shared_prim);
45 
46  ClexBasisFunctionPrinter printer{log, shared_prim, basis_set_specs, align,
47  opt};
48  for_all_orbits(cluster_specs, prototypes, printer);
49 }
50 
51 } // namespace CASM
std::shared_ptr< Structure const > shared_prim
ClexBasisFunctionPrinter(Log &_log, std::shared_ptr< Structure const > _shared_prim, ClexBasisSpecs const &_basis_set_specs, bool align, OrbitPrinterOptions _opt=OrbitPrinterOptions())
fs::path clust(std::string bset) const
Definition: Log.hh:48
PrimClex is the top-level data structure for a CASM project.
Definition: PrimClex.hh:55
const DirectoryStructure & dir() const
Access DirectoryStructure object. Throw if not set.
Definition: PrimClex.cc:230
ClexBasisSpecs const & basis_set_specs(std::string const &basis_set_name) const
Definition: PrimClex.cc:344
std::shared_ptr< PrimType const > const & shared_prim() const
Access to the primitive Structure as a shared resource.
Definition: PrimClex.cc:264
Main CASM namespace.
Definition: APICommand.hh:8
void for_all_orbits(ClusterSpecs const &cluster_specs, std::vector< IntegralCluster > const &generating_elements, FunctorType const &f)
Log & log()
Definition: Log.hh:424
void print_basis_functions(Log &log, std::shared_ptr< Structure const > const &shared_prim, ClexBasisSpecs const &basis_set_specs, bool align, OrbitPrinterOptions opt=OrbitPrinterOptions())
Pretty-print basis functions – generate, then print.
ClusterOutputIterator read_clust(ClusterOutputIterator result, const jsonParser &json, const Structure &prim, const SymGroup &generating_grp, const SymCompareType &sym_compare)
Read JSON containing Orbit<SymCompareType> prototypes.
PrimClex * primclex
Definition: settings.cc:135
Provides parameters for constructing a cluster expansion basis (ClexBasis)
notstd::cloneable_ptr< ClusterSpecs > cluster_specs