36 std::function<void(
const std::vector<Complex>&, std::vector<Real>&)>
to_real_space;
41namespace PreconditionerFactory {
45 return name ==
"none" || name ==
"kerker" || name ==
"local-tf";
49inline std::unique_ptr<Preconditioner>
create(
const std::string& name,
52 return std::make_unique<NoPreconditioner>();
54 if (name ==
"kerker") {
55 return std::make_unique<KerkerPreconditioner>(
58 if (name ==
"local-tf") {
59 return std::make_unique<LocalThomasFermiPreconditioner>(environment.
g_squared,
66 throw std::runtime_error(
"Unknown mixing preconditioner: '" + name +
67 "'. Supported values: 'none', 'kerker', 'local-tf' "
68 "(or 'default' to choose by smearing).");
std::unique_ptr< Preconditioner > create(const std::string &name, const PreconditionerEnvironment &environment)
Create a residual preconditioner by name.
bool is_supported(const std::string &name)
The names create() accepts, for validation and error messages.
Everything any preconditioner needs from the surrounding representation.
int first_nonzero_g_index
Real q0_squared
Screening wavevector squared / vacuum floor, in bohr⁻².
std::vector< Real > g_squared
|G|² per G-vector, in bohr⁻².
std::function< void(const std::vector< Real > &, std::vector< Complex > &)> to_reciprocal_space
std::function< void(std::vector< Real > &)> global_reduce
Sums real-space integrals over the ranks sharing this pool's grid.
std::function< void(const std::vector< Complex > &, std::vector< Real > &)> to_real_space