Skip to content

Commit 274477a

Browse files
authored
Fix some output information typo (#6133)
* fix two typos in manual * update output information * fix auto tests * fix typos and unittests
1 parent 072d03e commit 274477a

File tree

8 files changed

+42
-33
lines changed

8 files changed

+42
-33
lines changed

docs/advanced/input_files/input-main.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1705,8 +1705,7 @@ These variables are used to control the output of properties.
17051705
- **Description**: Whether to output the density of states (DOS). For more information, refer to the [dos.md](../elec_properties/dos.md).
17061706
- 0: no output
17071707
- 1: output the density of states (DOS)
1708-
- 2:
1709-
- lcao-only: output the density of states (DOS) and the projected density of states (PDOS)
1708+
- 2: (lcao-only) output the density of states (DOS) and the projected density of states (PDOS)
17101709
- **Default**: 0
17111710

17121711
### out_ldos
@@ -3888,12 +3887,6 @@ These variables are used to control berry phase and wannier90 interface paramete
38883887
- 1: Yes.
38893888
- **Default**: 0
38903889

3891-
- **Type**: Boolean
3892-
- **Description**: Specify whether to set the colorful output in terminal.
3893-
- 0: No.
3894-
- 1: Yes.
3895-
- **Default**: 0
3896-
38973890
### test_skip_ewald
38983891

38993892
- **Type**: Boolean

source/module_base/tool_quit.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ void WARNING_QUIT(const std::string &file,const std::string &description,int ret
7171
std::cout << " ---------------------------------------------------------" << std::endl;
7272
std::cout << " !NOTICE! " << std::endl;
7373
std::cout << " ---------------------------------------------------------" << std::endl;
74+
std::cout << " For detailed manual of ABACUS, please see the website" << std::endl;
75+
std::cout << " https://abacus.deepmodeling.com" << std::endl;
76+
std::cout << " For any questions, propose issues on the website" << std::endl;
77+
std::cout << " https://github.com/deepmodeling/abacus-develop/issues" << std::endl;
7478

7579
#else
7680
std::cout << " " << std::endl;
@@ -81,6 +85,10 @@ void WARNING_QUIT(const std::string &file,const std::string &description,int ret
8185
std::cout << " " << description << std::endl;
8286
std::cout << " CHECK IN FILE : " << PARAM.globalv.global_out_dir << "warning.log" << std::endl;
8387
std::cout << " " << std::endl;
88+
std::cout << " For detailed manual of ABACUS, please see the website" << std::endl;
89+
std::cout << " https://abacus.deepmodeling.com" << std::endl;
90+
std::cout << " For any questions, propose issues on the website" << std::endl;
91+
std::cout << " https://github.com/deepmodeling/abacus-develop/issues" << std::endl;
8492
std::cout << " ---------------------------------------------------------" << std::endl;
8593
std::cout << " !NOTICE! " << std::endl;
8694
std::cout << " ---------------------------------------------------------" << std::endl;
@@ -93,6 +101,10 @@ void WARNING_QUIT(const std::string &file,const std::string &description,int ret
93101
GlobalV::ofs_running << " " << description << std::endl;
94102
GlobalV::ofs_running << " CHECK IN FILE : " << PARAM.globalv.global_out_dir << "warning.log" << std::endl;
95103
GlobalV::ofs_running << std::endl;
104+
GlobalV::ofs_running << " For detailed manual of ABACUS, please see the website" << std::endl;
105+
GlobalV::ofs_running << " https://abacus.deepmodeling.com" << std::endl;
106+
GlobalV::ofs_running << " For any questions, propose issues on the website" << std::endl;
107+
GlobalV::ofs_running << " https://github.com/deepmodeling/abacus-develop/issues" << std::endl;
96108
GlobalV::ofs_running << " ---------------------------------------------------------" << std::endl;
97109
GlobalV::ofs_running << " NOTICE " << std::endl;
98110
GlobalV::ofs_running << " ---------------------------------------------------------" << std::endl;

source/module_cell/cell_index.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,12 @@ int CellIndex::iw2l(int iat, int iw)
178178
iw -= blockSize;
179179
if (iw < 0)
180180
{
181-
ModuleBase::WARNING_QUIT("CellIndex::iw2l", "iw out of range [0, nw)");
181+
ModuleBase::WARNING_QUIT("CellIndex::iw2l", "localized wave funciton index out of range [0, nw)");
182182
}
183183
}
184184
if (iw >= 0)
185185
{
186-
ModuleBase::WARNING_QUIT("CellIndex::iw2l", "iw out of range [0, nw)");
186+
ModuleBase::WARNING_QUIT("CellIndex::iw2l", "localized wave funciton index out of range [0, nw)");
187187
}
188188
throw std::out_of_range(std::string(__FILE__)+" line "+std::to_string(__LINE__));
189189
}
@@ -203,12 +203,12 @@ int CellIndex::iw2z(int iat, int iw)
203203
iw -= blockSize;
204204
if (iw < 0)
205205
{
206-
ModuleBase::WARNING_QUIT("CellIndex::iw2l", "iw out of range [0, nw)");
206+
ModuleBase::WARNING_QUIT("CellIndex::iw2l", "localized wave funciton index out of range [0, nw)");
207207
}
208208
}
209209
if (iw >= 0)
210210
{
211-
ModuleBase::WARNING_QUIT("CellIndex::iw2l", "iw out of range [0, nw)");
211+
ModuleBase::WARNING_QUIT("CellIndex::iw2l", "localized wave funciton index out of range [0, nw)");
212212
}
213213
throw std::out_of_range(std::string(__FILE__)+" line "+std::to_string(__LINE__));
214214
}
@@ -228,12 +228,12 @@ int CellIndex::iw2m(int iat, int iw)
228228
iw -= blockSize;
229229
if (iw < 0)
230230
{
231-
ModuleBase::WARNING_QUIT("CellIndex::iw2l", "iw out of range [0, nw)");
231+
ModuleBase::WARNING_QUIT("CellIndex::iw2l", "localized wave funciton index out of range [0, nw)");
232232
}
233233
}
234234
if (iw >= 0)
235235
{
236-
ModuleBase::WARNING_QUIT("CellIndex::iw2l", "iw out of range [0, nw)");
236+
ModuleBase::WARNING_QUIT("CellIndex::iw2l", "localized wave funciton index out of range [0, nw)");
237237
}
238238
throw std::out_of_range(std::string(__FILE__)+" line "+std::to_string(__LINE__));
239239
}
@@ -291,4 +291,4 @@ void CellIndex::write_orb_info(std::string out_dir)
291291
out << std::setw(5) << "#sym" << std::setw(2) << "=" << std::setw(2) << "Symmetry name of real orbital"
292292
<< std::endl;
293293
out.close();
294-
}
294+
}

source/module_cell/read_atom_species.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ bool read_atom_species(std::ifstream& ifa,
6262
}
6363
else
6464
{
65-
GlobalV::ofs_warning << "unrecongnized pseudopotential type: "
65+
GlobalV::ofs_warning << "unrecognized pseudopotential type: "
6666
<< one_string << ", check your STRU file." << std::endl;
67-
ModuleBase::WARNING_QUIT("read_atom_species", "unrecongnized pseudo type.");
67+
ModuleBase::WARNING_QUIT("read_atom_species", "unrecognized pseudopotential type.");
6868
}
6969
}
7070

@@ -141,7 +141,7 @@ bool read_lattice_constant(std::ifstream& ifa,
141141
ModuleBase::GlobalFunc::READ_VALUE(ifa, lat0);
142142
if(lat0<=0.0)
143143
{
144-
ModuleBase::WARNING_QUIT("read_atom_species","lat0<=0.0");
144+
ModuleBase::WARNING_QUIT("read_atom_species","lattice constant <= 0.0");
145145
}
146146
lat0_angstrom = lat0 * 0.529177;
147147
ModuleBase::GlobalFunc::OUT(ofs_running,"lattice constant (Bohr)",lat0);
@@ -170,7 +170,7 @@ bool read_lattice_constant(std::ifstream& ifa,
170170
if( !ModuleBase::GlobalFunc::SCAN_LINE_BEGIN(ifa, "LATTICE_VECTORS") )
171171
{
172172
ModuleBase::WARNING_QUIT("unitcell::read_lattice_constant",
173-
"Please set LATTICE_VECTORS in STRU file");
173+
"Please set LATTICE_VECTORS in the STRU file");
174174
}
175175
else if( ModuleBase::GlobalFunc::SCAN_LINE_BEGIN(ifa, "LATTICE_VECTORS") )
176176
{

source/module_cell/read_atoms.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ bool unitcell::read_atom_positions(UnitCell& ucell,
180180
mv.y = true ;
181181
mv.z = true ;
182182
ucell.atoms[it].vel[ia].set(0,0,0);
183-
ucell.atoms[it].mag[ia]=ucell.magnet.start_magnetization[it];//if this line is used, default startmag_type would be 2
183+
ucell.atoms[it].mag[ia]=ucell.magnet.start_magnetization[it];
184+
//if this line is used, default startmag_type would be 2
184185
ucell.atoms[it].angle1[ia]=0;
185186
ucell.atoms[it].angle2[ia]=0;
186187
ucell.atoms[it].m_loc_[ia].set(0,0,0);
@@ -547,7 +548,7 @@ bool unitcell::read_atom_positions(UnitCell& ucell,
547548
//check if any atom can move in MD
548549
if(!ucell.if_atoms_can_move() && PARAM.inp.calculation=="md" && PARAM.inp.esolver_type!="tddft")
549550
{
550-
ModuleBase::WARNING("read_atoms", "no atom can move in MD!");
551+
ModuleBase::WARNING("read_atoms", "no atoms can move in MD simulations!");
551552
return false;
552553
}
553554

@@ -556,7 +557,7 @@ bool unitcell::read_atom_positions(UnitCell& ucell,
556557

557558
if (ucell.nat == 0)
558559
{
559-
ModuleBase::WARNING("read_atom_positions","no atom in the system!");
560+
ModuleBase::WARNING("read_atom_positions","no atoms found in the system!");
560561
return false;
561562
}
562563

source/module_cell/test/unitcell_test.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Magnetism::~Magnetism()
108108
* - ReadAtomSpecies
109109
* - read_atom_species(): a successful case
110110
* - ReadAtomSpeciesWarning1
111-
* - read_atom_species(): unrecongnized pseudo type.
111+
* - read_atom_species(): unrecognized pseudopotential type.
112112
* - ReadAtomSpeciesWarning2
113113
* - read_atom_species(): lat0<=0.0
114114
* - ReadAtomSpeciesWarning3
@@ -149,7 +149,7 @@ Magnetism::~Magnetism()
149149
* - ReadAtomPositionsWarning4
150150
* - read_atom_positions(): mismatch in atom number for atom type
151151
* - ReadAtomPositionsWarning5
152-
* - read_atom_positions(): no atom can move in MD!
152+
* - read_atom_positions(): no atoms can move in MD simulations!
153153
*/
154154

155155
// mock function
@@ -1192,7 +1192,7 @@ TEST_F(UcellTestReadStru, ReadAtomSpeciesWarning1)
11921192
testing::internal::CaptureStdout();
11931193
EXPECT_EXIT(unitcell::read_atom_species(ifa, ofs_running,*ucell), ::testing::ExitedWithCode(1), "");
11941194
output = testing::internal::GetCapturedStdout();
1195-
EXPECT_THAT(output, testing::HasSubstr("unrecongnized pseudo type."));
1195+
EXPECT_THAT(output, testing::HasSubstr("unrecognized pseudopotential type."));
11961196
ofs_running.close();
11971197
ifa.close();
11981198
//remove("read_atom_species.txt");
@@ -1210,7 +1210,7 @@ TEST_F(UcellTestReadStru, ReadLatticeConstantWarning1)
12101210
testing::internal::CaptureStdout();
12111211
EXPECT_EXIT(unitcell::read_lattice_constant(ifa, ofs_running,ucell->lat), ::testing::ExitedWithCode(1), "");
12121212
output = testing::internal::GetCapturedStdout();
1213-
EXPECT_THAT(output, testing::HasSubstr("lat0<=0.0"));
1213+
EXPECT_THAT(output, testing::HasSubstr("lattice constant <= 0.0"));
12141214
ofs_running.close();
12151215
ifa.close();
12161216
remove("read_atom_species.tmp");
@@ -1908,7 +1908,7 @@ TEST_F(UcellTestReadStru, ReadAtomPositionsWarning5)
19081908
std::ifstream ifs_tmp;
19091909
ifs_tmp.open("read_atom_positions.warn");
19101910
std::string str((std::istreambuf_iterator<char>(ifs_tmp)), std::istreambuf_iterator<char>());
1911-
EXPECT_THAT(str, testing::HasSubstr("read_atoms warning : no atom can move in MD!"));
1911+
EXPECT_THAT(str, testing::HasSubstr("read_atoms warning : no atoms can move in MD simulations!"));
19121912
ifs_tmp.close();
19131913
remove("read_atom_positions.tmp");
19141914
remove("read_atom_positions.warn");

source/module_cell/unitcell.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,15 @@
2525
#endif
2626

2727
#include "update_cell.h"
28-
UnitCell::UnitCell() {
28+
UnitCell::UnitCell()
29+
{
2930
itia2iat.create(1, 1);
3031
}
3132

32-
UnitCell::~UnitCell() {
33-
if (set_atom_flag) {
33+
UnitCell::~UnitCell()
34+
{
35+
if (set_atom_flag)
36+
{
3437
delete[] atoms;
3538
}
3639
}
@@ -511,7 +514,7 @@ void UnitCell::setup(const std::string& latname_in,
511514
} else {
512515
ModuleBase::WARNING_QUIT(
513516
"Input",
514-
"fixed_axes should be None,volume,shape,a,b,c,ab,ac,bc or abc!");
517+
"fixed_axes should be none, volume, shape, a, b, c, ab, ac, bc or abc!");
515518
}
516519
return;
517520
}

source/module_cell/update_cell.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ void setup_cell_after_vc(UnitCell& ucell, std::ofstream& log) {
292292
pow(ucell.lat0, 3);
293293
if (ucell.omega <= 0)
294294
{
295-
ModuleBase::WARNING_QUIT("setup_cell_after_vc", "omega <= 0 .");
295+
ModuleBase::WARNING_QUIT("setup_cell_after_vc", "Cell volume <= 0 .");
296296
} else {
297297
log << std::endl;
298298
ModuleBase::GlobalFunc::OUT(log, "Volume (Bohr^3)", ucell.omega);
@@ -491,4 +491,4 @@ void periodic_boundary_adjustment(Atom* atoms,
491491
return;
492492
}
493493

494-
} // namespace unitcell
494+
} // namespace unitcell

0 commit comments

Comments
 (0)