41 const std::string& format =
"") {
43 if (!format.empty()) {
44 if (
const InputFormat* named = registry.find(format))
46 throw std::runtime_error(
"Unknown input format '" + format +
47 "'; expected one of: " + registry.canonical_names(
", "));
51 throw std::runtime_error(
52 "No registered input format recognises '" + filename +
53 "'; the formats this build reads are: " + registry.canonical_names(
", "));
58 const std::string& format =
"") {
86 if (material.
atoms.size() != input.
atoms.size())
87 throw std::runtime_error(
"--material " + material_file +
" has " +
88 std::to_string(material.
atoms.size()) +
" atoms; the input has " +
89 std::to_string(input.
atoms.size()));
91 throw std::runtime_error(
"--material " + material_file +
" must give lattice.vectors");
93 for (
int row = 0; row < 3; ++row)
96 for (
size_t atom_index = 0; atom_index < input.
atoms.size(); ++atom_index)
97 input.
atoms[atom_index].position = material.
atoms[atom_index].position;
127 log::info(
" Calculation '{}' runs as one SCF at this geometry, starting from a saved "
128 "density when one fits: a step of the relaxation q3.workflows."
129 "run_relax_workflow / run_vc_relax_workflow drives",
139 character =
static_cast<char>(std::tolower(
static_cast<unsigned char>(character)));
nlohmann::json read_json_file(const std::string &path)
void info(spdlog::format_string_t< Args... > fmt, Args &&... args)
std::unique_ptr< InputParser > create_input_parser(const std::string &filename, const std::string &format="")
Create the input parser for this path, or for the format --format names.
void substitute_material(InputData &input, const std::string &material_file)
InputData parse_input(const std::string &filename, const std::string &format="")
const InputFormat * detect_input_format(const std::filesystem::path &path)
std::string functional_from_pseudopotentials(const std::vector< AtomSpecies > &species, const std::string &pseudopotential_directory)
const InputFormat * format_claiming_directory(const std::filesystem::path &directory)
std::string resolve_argument_less_input()
Registry< InputFormat > & input_format_registry()
The registry every entry point reads input formats from.
const InputFormat & input_format_for(const std::string &filename, const std::string &format="")
3×3 matrix stored row-major: row i = mat[i]