MCPcopy Create free account
hub / github.com/SZAILAB/MaterialDFT-Demo / parse_potcar

Function parse_potcar

cpp_core/src/potcar_parser.cpp:983–996  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

981} // namespace
982
983std::vector<PotcarDataset> parse_potcar(const std::string& potcar_path) {
984 const std::string text = read_file_to_string(potcar_path);
985 const auto blocks = split_datasets(text);
986 if (blocks.empty()) {
987 throw std::runtime_error("parse_potcar: no dataset blocks found");
988 }
989
990 std::vector<PotcarDataset> datasets;
991 datasets.reserve(blocks.size());
992 for (std::size_t i = 0; i < blocks.size(); ++i) {
993 datasets.push_back(parse_dataset_block(blocks[i], i));
994 }
995 return datasets;
996}
997
998std::vector<int> flatten_potcar_projector_l_values(const PotcarDataset& dataset) {
999 std::vector<int> projector_l;

Calls 5

split_datasetsFunction · 0.85
parse_dataset_blockFunction · 0.85
sizeMethod · 0.80
read_file_to_stringFunction · 0.70
emptyMethod · 0.45