41 throw std::runtime_error(
42 "the record carries the spin-averaged Vxc(G) only, and VXC is per spin; "
43 "spin-polarized VXC export is not supported");
46 throw std::runtime_error(
"the mean-field record carries no exchange-correlation "
50 std::ofstream output_file(file_path, std::ios::binary);
51 if (!output_file.is_open()) {
52 throw std::runtime_error(
"cannot open " + file_path +
" for writing");
54 const std::vector<std::vector<Complex>> values_per_spin = {
58 log::info(
" Wrote BerkeleyGW exchange-correlation potential file: {}", file_path);
Writes VXC from a mean-field record; see the file comment.
void write_to_file(const std::string &file_path) const
Writes the file, or throws – before creating it – when the record cannot supply it.
BerkeleyGWExchangeCorrelationPotentialFile(const MeanFieldRecord &record)
BerkeleyGWExchangeCorrelationPotentialFile(const MeanFieldRecord &&)=delete
See BerkeleyGWChargeDensityFile: this holds a reference.
One per-spin field on the charge-density G-set, in RHO's layout; see the file comment.
void write(std::ofstream &output_file) const
Writes header, G-set and field to an open stream; throws if the field is not on the G-set.
void info(spdlog::format_string_t< Args... > fmt, Args &&... args)
int number_of_spin_components
std::vector< Complex > exchange_correlation_potential_g