|
| 1 | +/** |
| 2 | + * @file atom_spec.h |
| 3 | + * @brief Atom class for storing atom information. |
| 4 | + */ |
1 | 5 | #ifndef ATOM_H |
2 | 6 | #define ATOM_H |
3 | 7 |
|
4 | 8 | #include "atom_pseudo.h" |
| 9 | + |
| 10 | +/** |
| 11 | + * @brief Atom class for storing atom information. |
| 12 | + */ |
5 | 13 | class Atom |
6 | 14 | { |
7 | 15 | public: |
8 | | - // constructor and destructor |
| 16 | + /** |
| 17 | + * @brief Constructor. |
| 18 | + */ |
9 | 19 | Atom(); |
| 20 | + |
| 21 | + /** |
| 22 | + * @brief Destructor. |
| 23 | + */ |
10 | 24 | ~Atom(); |
11 | 25 |
|
12 | | - Atom_pseudo ncpp; |
13 | | - double mass = 0.0; // the mass of atom |
14 | | - std::vector<ModuleBase::Vector3<int>> mbl; // whether the atoms can move or not |
15 | | - bool flag_empty_element = false; // whether is the empty element for bsse. Peize Lin add 2021.04.07 |
| 26 | + Atom_pseudo ncpp; ///< pseudopotential for this atom type |
| 27 | + double mass = 0.0; ///< the mass of atom |
| 28 | + std::vector<ModuleBase::Vector3<int>> mbl; ///< whether the atoms can move or not |
| 29 | + bool flag_empty_element = false; ///< whether is the empty element for bsse (Peize Lin add 2021.04.07) |
16 | 30 |
|
17 | | - std::vector<int> iw2m; // use iw to find m |
18 | | - std::vector<int> iw2n; // use iw to find n |
19 | | - std::vector<int> iw2l; // use iw to find L |
20 | | - std::vector<int> iw2_ylm; |
21 | | - std::vector<bool> iw2_new; |
22 | | - int nw = 0; // number of local orbitals (l,n,m) of this type |
| 31 | + std::vector<int> iw2m; ///< use iw to find m |
| 32 | + std::vector<int> iw2n; ///< use iw to find n |
| 33 | + std::vector<int> iw2l; ///< use iw to find L |
| 34 | + std::vector<int> iw2_ylm; ///< use iw to find ylm index |
| 35 | + std::vector<bool> iw2_new; ///< use iw to find new flag |
| 36 | + int nw = 0; ///< number of local orbitals (l,n,m) of this type |
23 | 37 |
|
| 38 | + /** |
| 39 | + * @brief Set index arrays. |
| 40 | + */ |
24 | 41 | void set_index(); |
25 | 42 |
|
26 | | - int type = 0; // Index of atom type |
27 | | - int na = 0; // Number of atoms in this type. |
| 43 | + int type = 0; ///< Index of atom type |
| 44 | + int na = 0; ///< Number of atoms in this type |
28 | 45 |
|
29 | | - int nwl = 0; // max L(Angular momentum) (for local basis) |
30 | | - double Rcut = 0.0; // pengfei Li 16-2-29 |
31 | | - std::vector<int> l_nchi; // number of chi for each L |
32 | | - int stapos_wf = 0; // start position of wave functions |
| 46 | + int nwl = 0; ///< max L(Angular momentum) (for local basis) |
| 47 | + double Rcut = 0.0; ///< cut-off radius (pengfei Li 16-2-29) |
| 48 | + std::vector<int> l_nchi; ///< number of chi for each L |
| 49 | + int stapos_wf = 0; ///< start position of wave functions |
33 | 50 |
|
34 | 51 | std::string label; ///< atomic symbol |
35 | | - std::vector<ModuleBase::Vector3<double>> tau; // Cartesian coordinates of each atom in this type. |
36 | | - std::vector<ModuleBase::Vector3<double>> dis; // direct displacements of each atom in this type in current step liuyu modift 2023-03-22 |
37 | | - std::vector<ModuleBase::Vector3<double>> taud; // Direct coordinates of each atom in this type. |
38 | | - std::vector<ModuleBase::Vector3<int>> boundary_shift; // record for periodic boundary adjustment. |
39 | | - std::vector<ModuleBase::Vector3<double>> vel; // velocities of each atom in this type. |
40 | | - std::vector<ModuleBase::Vector3<double>> force; // force acting on each atom in this type. |
41 | | - std::vector<ModuleBase::Vector3<double>> lambda; // Lagrange multiplier for each atom in this type. used in deltaspin |
42 | | - std::vector<ModuleBase::Vector3<int>> constrain; // constrain for each atom in this type. used in deltaspin |
43 | | - std::string label_orb; ///< atomic element symbol in the orbital file of lcao |
44 | | - |
45 | | - std::vector<double> mag; |
46 | | - std::vector<double> angle1; // spin angle, added by zhengdy-soc |
47 | | - std::vector<double> angle2; |
48 | | - std::vector<ModuleBase::Vector3<double>> m_loc_; |
49 | | - // Coulomb potential v(r) = z/r |
50 | | - // It is a local potentail, and has no non-local potential parts. |
| 52 | + std::vector<ModuleBase::Vector3<double>> tau; ///< Cartesian coordinates of each atom in this type |
| 53 | + std::vector<ModuleBase::Vector3<double>> dis; ///< direct displacements of each atom in this type in current step (liuyu modify 2023-03-22) |
| 54 | + std::vector<ModuleBase::Vector3<double>> taud; ///< Direct coordinates of each atom in this type |
| 55 | + std::vector<ModuleBase::Vector3<int>> boundary_shift; ///< record for periodic boundary adjustment |
| 56 | + std::vector<ModuleBase::Vector3<double>> vel; ///< velocities of each atom in this type |
| 57 | + std::vector<ModuleBase::Vector3<double>> force; ///< force acting on each atom in this type |
| 58 | + std::vector<ModuleBase::Vector3<double>> lambda; ///< Lagrange multiplier for each atom in this type, used in deltaspin |
| 59 | + std::vector<ModuleBase::Vector3<int>> constrain; ///< constrain for each atom in this type, used in deltaspin |
| 60 | + std::string label_orb; ///< atomic element symbol in the orbital file of lcao |
| 61 | + |
| 62 | + std::vector<double> mag; ///< magnetic moment |
| 63 | + std::vector<double> angle1; ///< spin angle, added by zhengdy-soc |
| 64 | + std::vector<double> angle2; ///< spin angle, added by zhengdy-soc |
| 65 | + std::vector<ModuleBase::Vector3<double>> m_loc_; ///< local magnetic moment |
| 66 | + |
| 67 | + /// @brief Coulomb potential v(r) = z/r |
| 68 | + /// It is a local potential, and has no non-local potential parts. |
51 | 69 | bool coulomb_potential = false; |
| 70 | + |
| 71 | + /** |
| 72 | + * @brief Print atom information. |
| 73 | + * |
| 74 | + * @param ofs output file stream |
| 75 | + */ |
52 | 76 | void print_Atom(std::ofstream& ofs); |
| 77 | + |
| 78 | + /** |
| 79 | + * @brief Update force. |
| 80 | + * |
| 81 | + * @param fcs force constant matrix |
| 82 | + */ |
53 | 83 | void update_force(ModuleBase::matrix& fcs); |
| 84 | + |
54 | 85 | #ifdef __MPI |
| 86 | + /** |
| 87 | + * @brief Broadcast atom data. |
| 88 | + */ |
55 | 89 | void bcast_atom(); |
| 90 | + |
| 91 | + /** |
| 92 | + * @brief Broadcast atom data (second version). |
| 93 | + */ |
56 | 94 | void bcast_atom2(); |
57 | 95 | #endif |
58 | 96 | }; |
|
0 commit comments