ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
spin_tag.h
Go to the documentation of this file.
1#ifndef MODULEIO_SPIN_TAG_H
2#define MODULEIO_SPIN_TAG_H
3
4#include <string>
5
6namespace ModuleIO
7{
8
12inline std::string make_spin_tag(const int is, const int nspin)
13{
14 if (nspin != 2 || is < 0)
15 {
16 return "";
17 }
18 if (is == 0)
19 {
20 return " (spin up )";
21 }
22 return " (spin down)";
23}
24
30inline std::string make_compact_spin_tag(const int is, const int nspin)
31{
32 if (nspin != 2 || is < 0)
33 {
34 return "";
35 }
36 if (is == 0)
37 {
38 return " (spin up)";
39 }
40 return " (spin down)";
41}
42
43} // namespace ModuleIO
44
45#endif
Internal helpers shared by the R-space sparse text writers. Declared here (instead of duplicated in e...
Definition csr_reader.cpp:8
std::string make_compact_spin_tag(const int is, const int nspin)
Definition spin_tag.h:30
std::string make_spin_tag(const int is, const int nspin)
Definition spin_tag.h:12