Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions examples/compensating_charge/Pt-slab/running_scf.ref
Original file line number Diff line number Diff line change
Expand Up @@ -55,33 +55,6 @@
L=1, number of zeta = 1
L=2, number of zeta = 1
number of atom for this type = 27
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE

TOTAL ATOM NUMBER = 27

Expand Down
27 changes: 0 additions & 27 deletions examples/dipole_correction/Pt-slab/running_scf.ref1
Original file line number Diff line number Diff line change
Expand Up @@ -56,33 +56,6 @@
L=1, number of zeta = 1
L=2, number of zeta = 1
number of atom for this type = 27
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE

TOTAL ATOM NUMBER = 27

Expand Down
27 changes: 0 additions & 27 deletions examples/dipole_correction/Pt-slab/running_scf.ref2
Original file line number Diff line number Diff line change
Expand Up @@ -56,33 +56,6 @@
L=1, number of zeta = 1
L=2, number of zeta = 1
number of atom for this type = 27
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE

TOTAL ATOM NUMBER = 27

Expand Down
27 changes: 0 additions & 27 deletions examples/electric_field/Pt-slab/running_scf.ref
Original file line number Diff line number Diff line change
Expand Up @@ -56,33 +56,6 @@
L=1, number of zeta = 1
L=2, number of zeta = 1
number of atom for this type = 27
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE
start magnetization = FALSE

TOTAL ATOM NUMBER = 27

Expand Down
2 changes: 0 additions & 2 deletions examples/hse/lcao_Si2/running_scf.log_ref
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@
L=1, number of zeta = 2
L=2, number of zeta = 1
number of atom for this type = 2
start magnetization = FALSE
start magnetization = FALSE

TOTAL ATOM NUMBER = 2

Expand Down
8 changes: 2 additions & 6 deletions source/module_base/global_function.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,15 @@ void OUT(std::ofstream &ofs,const std::string &name,const T &a)
template <class T>
void OUT(std::ofstream &ofs,const std::string &name,const T &x, const T&y)
{
std::stringstream name2;
name2 << "[" << name << "]";
ofs<< " " << std::setw(40) <<name2.str() << " = " << x << ", " << y << std::endl;
ofs<< " " << std::setw(40) <<name << " = [ " << x << ", " << y <<" ]" << std::endl;
// ofs << " " << name << a << std::endl;
return;
}

template <class T>
void OUT(std::ofstream &ofs,const std::string &name,const T &x, const T &y, const T &z)
{
std::stringstream name2;
name2 << "[" << name << "]";
ofs<< " " << std::setw(40) <<name2.str() << " = " << x << ", " << y << ", " << z << std::endl;
ofs<< " " << std::setw(40) <<name << " = [ " << x << ", " << y << ", " << z <<" ]" << std::endl;
return;
}

Expand Down
4 changes: 2 additions & 2 deletions source/module_base/test/global_function_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,9 @@ TEST_F(GlobalFunctionTest, OutV3)
ofs.close();
ifs.open("tmp");
getline(ifs, output);
EXPECT_THAT(output, testing::HasSubstr("[grid] = 100, 125, 375"));
EXPECT_THAT(output, testing::HasSubstr("grid = [ 100, 125, 375 ]"));
getline(ifs, output);
EXPECT_THAT(output, testing::HasSubstr("[direct] = 1.1, 2.2, 3.3"));
EXPECT_THAT(output, testing::HasSubstr("direct = [ 1.1, 2.2, 3.3 ]"));
ifs.close();
}
// P for parameters
Expand Down
37 changes: 29 additions & 8 deletions source/module_cell/read_atoms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -654,19 +654,40 @@ bool UnitCell::read_atom_positions(std::ifstream &ifpos, std::ofstream &ofs_runn
atoms[it].m_loc_[ia].z = atoms[it].mag[ia];
}

ModuleBase::GlobalFunc::OUT(ofs_running, "noncollinear magnetization_x",atoms[it].m_loc_[ia].x);
ModuleBase::GlobalFunc::OUT(ofs_running, "noncollinear magnetization_y",atoms[it].m_loc_[ia].y);
ModuleBase::GlobalFunc::OUT(ofs_running, "noncollinear magnetization_z",atoms[it].m_loc_[ia].z);
//print only ia==0 && mag>0 to avoid too much output
//print when ia!=0 && mag[ia] != mag[0] to avoid too much output
if(ia==0 || (ia!=0
&& (atoms[it].m_loc_[ia].x != atoms[it].m_loc_[0].x
|| atoms[it].m_loc_[ia].y != atoms[it].m_loc_[0].y
|| atoms[it].m_loc_[ia].z != atoms[it].m_loc_[0].z)))
{
//use a stringstream to generate string: "concollinear magnetization of element it is:"
std::stringstream ss;
ss << "magnetization of element " << it+1;
if(ia!=0)
{
ss<<" (atom"<<ia+1<<")";
}
ModuleBase::GlobalFunc::OUT(ofs_running, ss.str(),atoms[it].m_loc_[ia].x, atoms[it].m_loc_[ia].y, atoms[it].m_loc_[ia].z);
}
ModuleBase::GlobalFunc::ZEROS(magnet.ux_ ,3);
}
else if(GlobalV::NSPIN==2)
{
atoms[it].m_loc_[ia].x = atoms[it].mag[ia];
ModuleBase::GlobalFunc::OUT(ofs_running, "start magnetization",atoms[it].mag[ia]);
}
else if(GlobalV::NSPIN==1)
{
ModuleBase::GlobalFunc::OUT(ofs_running, "start magnetization","FALSE");
//print only ia==0 && mag>0 to avoid too much output
//print when ia!=0 && mag[ia] != mag[0] to avoid too much output
if(ia==0 || (ia!=0 && atoms[it].mag[ia] != atoms[it].mag[0]))
{
//use a stringstream to generate string: "cocollinear magnetization of element it is:"
std::stringstream ss;
ss << "magnetization of element " << it+1;
if(ia!=0)
{
ss<<" (atom"<<ia+1<<")";
}
ModuleBase::GlobalFunc::OUT(ofs_running, ss.str(),atoms[it].mag[ia]);
}
}


Expand Down