ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
sep_cell.h
Go to the documentation of this file.
1// The Sep_Cell class is container for Sep potential.
2
3#ifndef SEP_CELL
4#define SEP_CELL
5
6#include "source_cell/sep.h"
7
8#include <fstream>
9#include <string>
10#include <vector>
11
13{
14 public:
15 Sep_Cell() noexcept;
16 ~Sep_Cell() noexcept;
17
18 // Sets the number of atom types and initializes internal vectors
19 void init(const int ntype_in);
20
21 void set_omega(const double omega_in, const double tpiba2_in);
22
23 // Reads self potentials from STRU file and xx.sep files
24 // Returns true if successful, false otherwise
25 int read_sep_potentials(std::ifstream& ifpos,
26 const std::string& pp_dir,
27 std::ofstream& ofs_running,
28 std::vector<std::string>& ucell_atom_label);
29
30#ifdef __MPI
31 // Broadcasts the Sep_Cell object to all processes
32 void bcast_sep_cell();
33#endif // __MPI
34
35 // Getter methods
36 const std::vector<SepPot>& get_seps() const
37 {
38 return seps;
39 }
40 int get_ntype() const
41 {
42 return ntype;
43 }
44 const std::vector<bool>& get_sep_enable() const
45 {
46 return sep_enable;
47 }
48
49 double get_omega() const
50 {
51 return omega;
52 }
53
54 double get_tpiba2() const
55 {
56 return tpiba2;
57 }
58
59 private:
60 std::vector<SepPot> seps; // Self potentials for each atom type
61 int ntype; // number of atom types
62 std::vector<bool> sep_enable; // Whether self potential is enabled for each atom type
63
64 // unit cell data for VSep
65 double omega; // unit cell Volume
66 double tpiba2; // tpiba ^ 2
67};
68
69// namespace GlobalC
70// {
71// extern Sep_Cell sep_cell;
72// }
73
74#endif // SEP_CEll
Definition sep_cell.h:13
double tpiba2
Definition sep_cell.h:66
void set_omega(const double omega_in, const double tpiba2_in)
Definition sep_cell.cpp:31
void init(const int ntype_in)
Definition sep_cell.cpp:23
const std::vector< bool > & get_sep_enable() const
Definition sep_cell.h:44
double get_tpiba2() const
Definition sep_cell.h:54
~Sep_Cell() noexcept
Definition symmetry_test_analysis.cpp:40
Sep_Cell() noexcept
Definition symmetry_test_analysis.cpp:39
const std::vector< SepPot > & get_seps() const
Definition sep_cell.h:36
void bcast_sep_cell()
Definition sep_cell.cpp:102
std::vector< SepPot > seps
Definition sep_cell.h:60
std::vector< bool > sep_enable
Definition sep_cell.h:62
double get_omega() const
Definition sep_cell.h:49
double omega
Definition sep_cell.h:65
int get_ntype() const
Definition sep_cell.h:40
int ntype
Definition sep_cell.h:61
int read_sep_potentials(std::ifstream &ifpos, const std::string &pp_dir, std::ofstream &ofs_running, std::vector< std::string > &ucell_atom_label)
Definition sep_cell.cpp:48