Skip to content

Commit d8fee18

Browse files
committed
Revert "modify the reszie of the atom_mass"
This reverts commit f9cc2b9.
1 parent 3479a4e commit d8fee18

File tree

2 files changed

+16
-18
lines changed

2 files changed

+16
-18
lines changed

source/module_cell/read_atom_species.cpp

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ bool read_atom_species(std::ifstream& ifa,
1818
delete[] ucell.orbital_fn;
1919
ucell.orbital_fn = new std::string[ntype]; // filename of orbitals
2020
std::string word;
21-
std::string one_line;
22-
std::string one_string;
23-
std::stringstream ss;
2421

2522
//==========================================
2623
// read in information of each type of atom
@@ -31,10 +28,12 @@ bool read_atom_species(std::ifstream& ifa,
3128
ModuleBase::GlobalFunc::OUT(ofs_running,"ntype",ntype);
3229
for (int i = 0;i < ntype;i++)
3330
{
31+
std::string one_line;
32+
std::string one_string;
3433
std::getline(ifa, one_line);
34+
std::stringstream ss;
3535
ss << one_line;
36-
ss >> ucell.atom_label[i]
37-
ss >> ucell.atom_mass[i];
36+
ss >> ucell.atom_label[i] >> ucell.atom_mass[i];
3837
ucell.pseudo_fn[i] = "auto";
3938
ucell.pseudo_type[i] = "auto";
4039

@@ -103,8 +102,10 @@ bool read_atom_species(std::ifstream& ifa,
103102
ucell.descriptor_file = PARAM.inp.orbital_dir + ucell.orbital_fn[0];
104103
}
105104
}
106-
#ifdef (__LCAO) && (__MPI) && (__EXX)
105+
#ifdef __LCAO
107106
// Peize Lin add 2016-09-23
107+
#ifdef __MPI
108+
#ifdef __EXX
108109
if( GlobalC::exx_info.info_global.cal_exx || PARAM.inp.rpa )
109110
{
110111
if( ModuleBase::GlobalFunc::SCAN_BEGIN(ifa, "ABFS_ORBITAL") )
@@ -117,6 +118,9 @@ bool read_atom_species(std::ifstream& ifa,
117118
}
118119
}
119120
}
121+
122+
#endif // __EXX
123+
#endif // __MPI
120124
#endif // __LCAO
121125
return true;
122126
}
@@ -137,28 +141,27 @@ bool read_lattice_constant(std::ifstream& ifa,
137141
ModuleBase::GlobalFunc::READ_VALUE(ifa, lat0);
138142
if(lat0<=0.0)
139143
{
140-
ModuleBase::WARNING_QUIT("read_lattice_constant","lat0<=0.0");
144+
ModuleBase::WARNING_QUIT("read_atom_species","lat0<=0.0");
141145
}
142146
lat0_angstrom = lat0 * 0.529177;
143-
lat.tpiba = ModuleBase::TWO_PI / lat0;
144-
lat.tpiba2 = lat.tpiba * lat.tpiba;
145147
ModuleBase::GlobalFunc::OUT(ofs_running,"lattice constant (Bohr)",lat0);
146148
ModuleBase::GlobalFunc::OUT(ofs_running,"lattice constant (Angstrom)",lat0_angstrom);
147-
149+
lat.tpiba = ModuleBase::TWO_PI / lat0;
150+
lat.tpiba2 = lat.tpiba * lat.tpiba;
148151
}
149152

150153
//===========================
151154
// Read in latticies vector
152155
//===========================
156+
153157
if(latName=="none")
154158
{
155159
if (ModuleBase::GlobalFunc::SCAN_BEGIN(ifa,
156160
"LATTICE_PARAMETERS",
157161
true,
158162
false))
159163
{
160-
ModuleBase::WARNING_QUIT("unitcell::read_lattice_constant",
161-
"do not use LATTICE_PARAMETERS without explicit specification of lattice type");
164+
ModuleBase::WARNING_QUIT("unitcell::read_lattice_constant","do not use LATTICE_PARAMETERS without explicit specification of lattice type");
162165
}
163166
if( !ModuleBase::GlobalFunc::SCAN_BEGIN(ifa, "LATTICE_VECTORS") )
164167
{
@@ -184,8 +187,7 @@ bool read_lattice_constant(std::ifstream& ifa,
184187
true,
185188
false))
186189
{
187-
ModuleBase::WARNING_QUIT("unitcell::read_lattice_constant",
188-
"do not use LATTICE_VECTORS along with explicit specification of lattice type");
190+
ModuleBase::WARNING_QUIT("unitcell::read_lattice_constant","do not use LATTICE_VECTORS along with explicit specification of lattice type");
189191
}
190192
if(latName=="sc")
191193
{//simple-cubic, ibrav = 1

source/module_cell/unitcell.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -331,10 +331,6 @@ void UnitCell::setup_cell(const std::string& fn, std::ofstream& log) {
331331
bool ok2 = true;
332332

333333
// (3) read in atom information
334-
this->atom_mass.resize(ntype);
335-
this->atom_label.resize(ntype);
336-
this->pseudo_fn.resize(ntype);
337-
this->pseudo_type.resize(ntype);
338334
if (GlobalV::MY_RANK == 0) {
339335
// open "atom_unitcell" file.
340336
std::ifstream ifa(fn.c_str(), std::ios::in);

0 commit comments

Comments
 (0)