Loading...
Searching...
No Matches
factory.hpp
Go to the documentation of this file.
1#pragma once
2
3/**
4 * Factory for planewave Kohn-Sham charge density checkpoint writers.
5 *
6 * Supported formats: "qe" (Fortran unformatted, default).
7 */
8
9#include <memory>
10#include <stdexcept>
11#include <string>
12
15
16namespace q3 {
17
18inline std::unique_ptr<PlanewaveKohnShamChargeDensityCheckpoint>
20 const std::string& format = "qe") {
21 if (format == "qe") {
22 return std::make_unique<QEPlanewaveKohnShamChargeDensityCheckpoint>(scf_state);
23 }
24 throw std::runtime_error("Unknown charge density checkpoint format: " + format);
25}
26
27} // namespace q3
std::unique_ptr< PlanewaveKohnShamChargeDensityCheckpoint > create_charge_density_checkpoint(const NormConservingPlanewaveKohnShamSCFState &scf_state, const std::string &format="qe")
Definition factory.hpp:19