Loading...
Searching...
No Matches
q3::YAMLInputParser Class Reference

#include <yaml.hpp>

+ Inheritance diagram for q3::YAMLInputParser:

Public Member Functions

InputData parse (const std::string &filename) const override
 
- Public Member Functions inherited from q3::InputParser
virtual ~InputParser ()=default
 

Static Public Member Functions

static void parse_material (const nlohmann::json &material_json, InputData &data)
 Parse ESSE material JSON into InputData fields; parse_input() also reads --material here.
 

Detailed Description

Definition at line 30 of file yaml.hpp.

Member Function Documentation

◆ parse()

InputData q3::YAMLInputParser::parse ( const std::string &  filename) const
inlineoverridevirtual

Parse the given input file and return the populated InputData.

Same string-or-{length: ...} forms as the lattice-level units key, so inline materials parse identically to file-referenced material JSON.

Implements q3::InputParser.

Definition at line 32 of file yaml.hpp.

References parse_material(), q3::detail::read_json_file(), and q3::detail::resolve_path().

◆ parse_material()

static void q3::YAMLInputParser::parse_material ( const nlohmann::json &  material_json,
InputData &  data 
)
inlinestatic

Parse ESSE material JSON into InputData fields; parse_input() also reads --material here.

Explicit vectors: {"a": [ax,ay,az], "b": [...], "c": [...], "alat": 1.0, "units": "angstrom"} (ESSE shape).

The annotation on the vectors themselves is more specific than the enclosing lattice-level default, so it takes precedence.

Cubic lattices keep the Bravais-index construction (the ESSE "a" is the primitive vector length; convert to the conventional lattice constant alat).

General lattice from cell parameters a, b, c, alpha, beta, gamma (degrees). Missing lengths default to a; missing angles default to 90°, except gamma = 120° for HEX.

ESSE basis.constraints, as mat3ra-made writes them: per site id, true where a Cartesian component may move (pw.x if_pos 1).

Definition at line 277 of file yaml.hpp.

References q3::InputData::atoms, q3::constants::BOHR_RADIUS_ANGSTROM, q3::InputData::bravais_lattice_index, q3::InputData::cell_dimension_1, q3::get_lattice_vectors_from_cell_parameters(), q3::AtomSpecies::mass, q3::InputData::number_of_atoms, q3::InputData::number_of_species, q3::Atom::position, q3::InputData::set_free_lattice_vectors(), q3::InputData::species, q3::Atom::species_index, q3::AtomSpecies::symbol, and q3::AtomSpecies::valence_charge.

Referenced by parse(), and q3::substitute_material().


The documentation for this class was generated from the following file: