CASM  1.1.0
A Clusters Approach to Statistical Mechanics
ClexBasisSpecs_json_io.cc
Go to the documentation of this file.
2 
12 
13 namespace CASM {
14 
16  std::shared_ptr<Structure const> shared_prim,
17  ParsingDictionary<DoFType::Traits> const *dof_dict) {
18  auto bfuncs_subparser = parser.subparse<BasisFunctionSpecs>(
19  "basis_function_specs", *shared_prim, dof_dict);
20 
21  auto cspecs_subparser =
22  parser.subparse<ClusterSpecs>("cluster_specs", shared_prim);
23 
24  if (parser.valid()) {
25  parser.value = notstd::make_unique<ClexBasisSpecs>(
26  *bfuncs_subparser->value, std::move(cspecs_subparser->value));
27  }
28 }
29 
30 jsonParser &to_json(ClexBasisSpecs const &basis_set_specs, jsonParser &json,
31  Structure const &prim,
32  ParsingDictionary<DoFType::Traits> const *dof_dict) {
33  to_json(basis_set_specs.basis_function_specs, json["basis_function_specs"],
34  prim, dof_dict);
35  to_json(*basis_set_specs.cluster_specs, json["cluster_specs"]);
36  return json;
37 }
38 } // namespace CASM
std::shared_ptr< Structure const > shared_prim
std::shared_ptr< InputParser< RequiredType > > subparse(fs::path option, Args &&... args)
std::unique_ptr< T > value
Definition: InputParser.hh:234
Parsing dictionary for obtaining the correct MoleculeAttribute given a name.
Structure specifies the lattice and atomic basis of a crystal.
Definition: Structure.hh:30
Main CASM namespace.
Definition: APICommand.hh:8
jsonParser & to_json(const ClexDescription &desc, jsonParser &json)
void parse(InputParser< ConfigEnumOptions > &parser, std::string method_name, PrimClex const &primclex, DataFormatterDictionary< Configuration > const &dict)
Specify how to construct basis functions.
Provides parameters for constructing a cluster expansion basis (ClexBasis)
notstd::cloneable_ptr< ClusterSpecs > cluster_specs
BasisFunctionSpecs basis_function_specs
bool valid() const
Return true if this and and all subparsers are valid.
Definition: InputParser.cc:56