CASM  1.1.0
A Clusters Approach to Statistical Mechanics
stream_io_impl.hh
Go to the documentation of this file.
1 #ifndef CASM_app_enum_stream_io_impl
2 #define CASM_app_enum_stream_io_impl
3 
5 #include "casm/casm_io/Log.hh"
11 
12 namespace CASM {
13 
31 template <typename PermuteIteratorIt>
32 void print_dof_space(Log &log, DoFSpace const &dof_space,
33  std::string const &identifier,
34  ConfigEnumInput const &input_state,
35  PermuteIteratorIt permute_begin,
36  PermuteIteratorIt permute_end, bool sym_axes,
37  bool calc_wedges) {
38  log.subsection();
40  log << std::endl;
41  if (!sym_axes) {
42  log.begin(std::string("DoF space: ") + identifier);
43  jsonParser json;
44  to_json(dof_space, json);
45  log << json << std::endl << std::endl;
46  } else {
47  log.begin(std::string("DoF space and symmetry report: ") + identifier);
48  log << "For large spaces this may be slow... basis shape = ["
49  << dof_space.basis().rows() << ", " << dof_space.basis().cols() << "]"
50  << std::endl;
51 
53  dof_space, input_state, permute_begin, permute_end, calc_wedges);
54 
55  log << "Symmetry report complete" << std::endl;
56 
57  // TODO: specialized print to stream instead of JSON to stream?
58  jsonParser json;
59  to_json(dof_space, json, identifier, input_state, sym_report);
60  log << json << std::endl << std::endl;
61  }
62  log.end_section();
63 }
64 
65 template <typename NamedInitialStatesType>
67  NamedInitialStatesType const &named_initial_states) {
68  log.indent() << "# of initial enumeration states: "
69  << named_initial_states.size() << std::endl;
71  log.indent() << "initial enumeration states:" << std::endl;
73  for (auto const &named_initial_state : named_initial_states) {
74  log.indent() << named_initial_state.first << std::endl;
75  }
77  log.end_section();
78 }
79 } // namespace CASM
80 
81 #endif
Eigen::MatrixXd const & basis() const
Definition: DoFSpace.cc:227
Definition: Log.hh:48
void end_section()
End a section.
Definition: Log.hh:192
void begin_section()
Begin a section, without header.
Definition: Log.hh:158
Log & subsection()
Create a subsection.
Definition: Log.hh:186
Log & indent()
Definition: Log.hh:289
void begin(const std::string &what)
Definition: Log.hh:114
void increase_indent()
Definition: Log.hh:277
static const int verbose
Definition: Log.hh:53
void decrease_indent()
Definition: Log.hh:279
Main CASM namespace.
Definition: APICommand.hh:8
VectorSpaceSymReport vector_space_sym_report(DoFSpace const &dof_space, SupercellSymInfo const &sym_info, std::vector< PermuteIterator > const &group, bool calc_wedges=false)
Make VectorSpaceSymReport.
Definition: DoFSpace.cc:560
jsonParser & to_json(const ClexDescription &desc, jsonParser &json)
void print_initial_states(Log &log, NamedInitialStatesType const &named_initial_states)
Log & log()
Definition: Log.hh:424
void print_dof_space(Log &log, DoFSpace const &dof_space, std::string const &identifier, ConfigEnumInput const &input_state, PermuteIteratorIt permute_begin, PermuteIteratorIt permute_end, bool sym_axes, bool calc_wedges)
Print DoFSpace information.
Summary of data associated with the action of a symmetry group on a vector space.
Definition: SymRepTools.hh:185