18 std::shared_ptr<Structure const> open_shared_prim(fs::path root) {
20 return std::make_shared<Structure const>(
21 read_prim(settings.dir().prim(), settings.crystallography_tol()));
27 std::string
description =
"Get information about a prim structure.\n\n";
29 std::string custom_options =
30 " prim: JSON object (optional, default=prim of current project) \n"
31 " See `casm format --prim` for details on the prim format.\n\n"
33 " properties: array of string (optional, default=[]) \n"
34 " An array of strings specifying which prim properties to output. \n"
35 " The default value of an empty array will print all properties. \n"
36 " The allowed options are: \n\n";
39 auto dict = make_dictionary<std::shared_ptr<Structure const>>();
53 std::runtime_error error_if_invalid{
"Error reading PrimInfo input"};
56 if (parser.self.contains(
"prim")) {
61 shared_prim = std::make_shared<Structure const>(basic_structure);
72 }
catch (std::exception &e) {
73 parser.insert_error(
"prim", e.what());
76 std::stringstream msg;
77 msg <<
"Error in PrimInfo: No \"prim\" in input and no project provided "
79 parser.insert_error(
"prim", msg.str());
87 auto dict = make_dictionary<std::shared_ptr<Structure const>>();
89 for (
auto it = dict.begin(); it != dict.end(); ++it) {
99 log << json << std::endl;
std::shared_ptr< Structure const > shared_prim
PrimClex is the top-level data structure for a CASM project.
void run(jsonParser const &json_options, PrimClex const *primclex=nullptr) const override
Run prim info method.
std::string name() const override
Enumeration method name (i.e. "prim", "supercell", "dof_space", etc.)
std::string desc() const override
BasicStructure specifies the lattice and atomic basis of a crystal.
ProjectSettings open_project_settings(fs::path path_in_project)
ConfigIO::GenericConfigFormatter< jsonParser > properties()
std::string description(const SymOp &op, const xtal::Lattice &lat, SymInfoOptions opt=SymInfoOptions())
Print SymInfo to string.
xtal::BasicStructure read_prim(fs::path filename, double xtal_tol, ParsingDictionary< AnisoValTraits > const *_aniso_val_dict=nullptr)
fs::path find_casmroot(const fs::path &cwd)
void report_and_throw_if_invalid(KwargsParser const &parser, Log &log, ErrorType error)