Skip to content

Commit

Permalink
[fix] Fixed bug in direct XML parsing of UPF v2 PPs
Browse files Browse the repository at this point in the history
  • Loading branch information
abussy committed Jun 17, 2024
1 parent c871046 commit 4d4c951
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/unit_cell/atom_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,12 @@ Atom_type::read_pseudo_uspp(pugi::xml_node const& upf)

local_potential(vec_from_str<double>(upf.child("PP_LOCAL").child_value(), 0.5));

ps_core_charge_density(vec_from_str<double>(upf.child("PP_NLCC").child_value()));
if (header.attribute("core_correction").as_bool()) {
ps_core_charge_density(vec_from_str<double>(upf.child("PP_NLCC").child_value()));
} else {
ps_core_charge_density(std::vector<double>(rgrid.size(), 0.0));
}


ps_total_charge_density(vec_from_str<double>(upf.child("PP_RHOATOM").child_value()));

Expand Down

0 comments on commit 4d4c951

Please sign in to comment.