CASM  1.1.0
A Clusters Approach to Statistical Mechanics
json_io.cc
Go to the documentation of this file.
2 
6 
7 namespace CASM {
8 
33  const auto &vm = sym_opt.vm();
34 
35  json.put_obj();
36  if (vm.count("desc")) {
37  json["desc"] = static_cast<bool>(vm.count("help")); // bool
38  }
39  if (vm.count("help")) {
40  json["help"] = static_cast<bool>(vm.count("help")); // bool
41  }
42  if (vm.count("lattice-point-group")) {
43  json["print_lattice_point_group"] =
44  static_cast<bool>(vm.count("lattice-point-group")); // bool
45  }
46  if (vm.count("factor-group")) {
47  json["print_factor_group"] =
48  static_cast<bool>(vm.count("factor-group")); // bool
49  }
50  if (vm.count("crystal-point-group")) {
51  json["print_crystal_point_group"] =
52  static_cast<bool>(vm.count("crystal-point-group")); // bool
53  }
54  if (vm.count("brief")) {
55  json["brief"] = static_cast<bool>(vm.count("brief")); // bool
56  }
57  if (vm.count("coord") && !vm["coord"].defaulted()) {
58  json["coordinate_mode"] = sym_opt.coordtype_str(); // string
59  }
60  if (vm.count("symmetrize")) {
61  json["symmetrize"] = sym_opt.poscar_path().string(); // string
62  }
63  if (vm.count("tol") && !vm["tol"].defaulted()) {
64  json["tol"] = sym_opt.tol(); // number
65  }
66  if (vm.count("dof-space-analysis")) {
67  json["dof_space_analysis"] =
68  static_cast<bool>(vm.count("dof-space-analysis")); // bool
69  }
70  if (vm.count("settings")) {
71  json["settings"] = sym_opt.settings_path().string(); // string
72  }
73  if (vm.count("input")) {
74  json["input"] = sym_opt.input_str(); // string
75  }
76  if (vm.count("scelnames")) {
77  json["scelnames"] = sym_opt.supercell_strs(); // vector<std::string>
78  }
79  if (vm.count("confignames")) {
80  json["confignames"] = sym_opt.config_strs(); // vector<std::string>
81  }
82  if (vm.count("selection")) {
83  json["selection"] = sym_opt.selection_path().string(); // std::string
84  }
85  if (vm.count("dofs")) {
86  json["dofs"] = sym_opt.dof_strs(); // vector<std::string>
87  }
88  if (vm.count("calc-wedge")) {
89  json["calc_wedge"] = static_cast<bool>(vm.count("calc-wedge")); // bool
90  }
91  return json;
92 }
93 } // namespace CASM
const std::vector< std::string > & config_strs() const
Definition: Handlers.cc:382
std::string input_str() const
Returns the path corresponding to add_input_suboption.
Definition: Handlers.cc:368
const std::vector< std::string > & supercell_strs() const
Returns the list of the supercells for add_scelnames_suboption()
Definition: Handlers.cc:390
const fs::path settings_path() const
Returns the path corresponding to add_settings_suboption.
Definition: Handlers.cc:364
po::variables_map & vm()
Get the variables map.
Definition: Handlers.cc:310
fs::path poscar_path() const
Definition: Handlers.hh:864
const fs::path & selection_path() const
Returns the string corresponding to add_config_suboption()
Definition: Handlers.cc:338
const std::string & coordtype_str() const
Return the coordinate type in the form of a string.
Definition: Handlers.cc:394
const std::vector< std::string > & dof_strs() const
Returns the names of the DoF type names for add_dofs_suboption()
Definition: Handlers.cc:403
jsonParser & put_obj()
Puts new empty JSON object.
Definition: jsonParser.hh:354
Main CASM namespace.
Definition: APICommand.hh:8
jsonParser & to_json(const ClexDescription &desc, jsonParser &json)