TRIQS/triqs_modest 3.3.0
Modular Electronic Structure Toolkit
Loading...
Searching...
No Matches
utils.hpp
Go to the documentation of this file.
1// Copyright (c) 2025--present, The Simons Foundation
2// This file is part of TRIQS/modest and is licensed under the terms of GPLv3 or later.
3// SPDX-License-Identifier: GPL-3.0-or-later
4// See LICENSE in the root of this distribution for details.
5
6#pragma once
7#include "../utils/defs.hpp"
8#include <string>
9#include <stdexcept>
10
11namespace triqs::modest {
12
15
16 namespace dft_tools {
17
22 inline DFTCode dft_code_to_enum(std::string const &code) {
23 if (code == "wien2k") return DFTCode::Wien2k;
24 if (code == "vasp") return DFTCode::VASP;
25 if (code == "w90") return DFTCode::W90;
26 if (code == "elk") return DFTCode::Elk;
27 if (code == "hk") return DFTCode::Hk;
28 if (code == "qe") return DFTCode::QuantumEspresso;
29 throw std::runtime_error{"Not a valid dft_code: " + code};
30 }
31
32 } // namespace dft_tools
33
34} // namespace triqs::modest
DFTCode dft_code_to_enum(std::string const &code)
Definition utils.hpp:22
DFTCode
Enumeration of supported DFT codes.
Definition utils.hpp:14