1- #include " module_base/matrix3.h"
21#include " module_base/intarray.h"
3- // / @brief info of lattice
2+ #include " module_base/matrix3.h"
3+ // / @brief info of lattice
44struct Lattice
55{
6- std::string Coordinate; // "Direct" or "Cartesian" or "Cartesian_angstrom"
7- std::string latName; // Lattice name
8- double lat0; // Lattice constant(bohr)(a.u.)
9- double lat0_angstrom; // Lattice constant(angstrom)
10- double tpiba; // 2*pi / lat0;
11- double tpiba2; // tpiba ^ 2
12- double omega; // the volume of the unit cell
13- int * lc; // Change the lattice vectors or not
6+ std::string Coordinate = " Direct " ; // "Direct" or "Cartesian" or "Cartesian_angstrom"
7+ std::string latName = " none " ; // Lattice name
8+ double lat0 = 0.0 ; // Lattice constant(bohr)(a.u.)
9+ double lat0_angstrom = 0.0 ; // Lattice constant(angstrom)
10+ double tpiba = 0.0 ; // 2*pi / lat0;
11+ double tpiba2 = 0.0 ; // tpiba ^ 2
12+ double omega = 0.0 ; // the volume of the unit cell
13+ int * lc = new int [ 3 ]; // Change the lattice vectors or not
1414
15- ModuleBase::Matrix3 latvec; // Unitcell lattice vectors
16- ModuleBase::Vector3<double > a1, a2, a3; // Same as latvec, just at another form.
17- ModuleBase::Vector3<double > latcenter; // (a1+a2+a3)/2 the center of vector
18- ModuleBase::Matrix3 latvec_supercell; // Supercell lattice vectors
19- ModuleBase::Matrix3 G; // reciprocal lattice vector (2pi*inv(R) )
20- ModuleBase::Matrix3 GT; // traspose of G
21- ModuleBase::Matrix3 GGT; // GGT = G*GT
22- ModuleBase::Matrix3 invGGT; // inverse G
15+ ModuleBase::Matrix3 latvec = ModuleBase::Matrix3(); // Unitcell lattice vectors
16+ ModuleBase::Vector3<double > a1, a2, a3; // Same as latvec, just at another form.
17+ ModuleBase::Vector3<double > latcenter; // (a1+a2+a3)/2 the center of vector
18+ ModuleBase::Matrix3 latvec_supercell = ModuleBase::Matrix3(); // Supercell lattice vectors
19+ ModuleBase::Matrix3 G = ModuleBase::Matrix3(); // reciprocal lattice vector (2pi*inv(R) )
20+ ModuleBase::Matrix3 GT = ModuleBase::Matrix3(); // traspose of G
21+ ModuleBase::Matrix3 GGT = ModuleBase::Matrix3(); // GGT = G*GT
22+ ModuleBase::Matrix3 invGGT = ModuleBase::Matrix3(); // inverse G
23+
24+ ~Lattice ()
25+ {
26+ delete[] lc;
27+ }
2328};
2429
2530// ========================================================
@@ -37,13 +42,21 @@ struct Lattice
3742// / @brief usefull data and index maps
3843struct Statistics
3944{
40- int ntype;// number of atom species in UnitCell
41- int nat; // total number of atoms of all species in unitcell
42- int * iat2it; // iat==>it, distinguish a atom belong to which type
43- int * iat2ia; // iat==>ia
44- int * iwt2iat; // iwt ==> iat.
45- int * iwt2iw; // iwt ==> iw, Peize Lin add 2018-07-02
46- ModuleBase::IntArray itia2iat;// (it, ia)==>iat, the index in nat, add 2009-3-2 by mohan
47- int namax;// the max na among all atom species
48- int nwmax;// the max nw among all atom species
45+ int ntype = 0 ; // number of atom species in UnitCell
46+ int nat = 0 ; // total number of atoms of all species in unitcell
47+ int * iat2it = nullptr ; // iat==>it, distinguish a atom belong to which type
48+ int * iat2ia = nullptr ; // iat==>ia
49+ int * iwt2iat = nullptr ; // iwt ==> iat.
50+ int * iwt2iw = nullptr ; // iwt ==> iw, Peize Lin add 2018-07-02
51+ ModuleBase::IntArray itia2iat; // (it, ia)==>iat, the index in nat, add 2009-3-2 by mohan
52+ int namax = 0 ; // the max na among all atom species
53+ int nwmax = 0 ; // the max nw among all atom species
54+
55+ ~Statistics ()
56+ {
57+ delete[] iat2it;
58+ delete[] iat2ia;
59+ delete[] iwt2iat;
60+ delete[] iwt2iw;
61+ }
4962};
0 commit comments