Skip to content

Commit 239cc0a

Browse files
authored
Refactor symmetr.cpp, update some output formats in surfchem, etc. (#6052)
* update symmetry output format * update symmetry * update symmetry * refactor symmetry.cpp * update Makefile.Objects * update cmakelists * update symmetry files * update outputs * update k point * update output of surfchem * update documents about KPT.info * update symmetry files
1 parent 924d29d commit 239cc0a

File tree

24 files changed

+2192
-2338
lines changed

24 files changed

+2192
-2338
lines changed

docs/quick_start/output.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ For a complete list of input parameters, please consult this [instruction](../ad
1414

1515
`running_scf.log` contains information on nearly all function calls made during the execution of ABACUS.
1616

17-
## *KPT*
17+
## *KPT.info*
1818

1919
This file contains the information of all generated k-points, as well as the list of k-points actually used for calculations after considering symmetry.
2020

@@ -39,4 +39,4 @@ ABACUS generates a `.cif` format structure file based on the input file `STRU`,
3939

4040
## *warning.log*
4141

42-
The file contains all the warning messages generated during the ABACUS run.
42+
The file contains all the warning messages generated during the ABACUS run.

source/Makefile.Objects

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,14 @@ OBJS_SURCHEM=surchem.o\
461461

462462
OBJS_SYMMETRY=symm_other.o\
463463
symmetry_basic.o\
464+
symm_analysis.o\
465+
symm_check.o\
466+
symm_getgroup.o\
467+
symm_hermite.o\
468+
symm_lattice.o\
469+
symm_magnetic.o\
470+
symm_pricell.o\
471+
symm_rho.o\
464472
symmetry.o\
465473

466474
OBJS_XC=xc_functional.o\

source/module_cell/klist.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ void K_Vectors::set(const UnitCell& ucell,
134134
{
135135
// output kpoints file
136136
std::stringstream skpt;
137-
skpt << PARAM.globalv.global_readin_dir << "kpoints";
137+
skpt << PARAM.globalv.global_out_dir << "KPT.info"; //mohan modified 20250325
138138
std::ofstream ofkpt(skpt.str().c_str()); // clear kpoints
139139
ofkpt << skpt2 << skpt1;
140140
ofkpt.close();
@@ -635,9 +635,9 @@ void K_Vectors::ibz_kpoint(const ModuleSymmetry::Symmetry& symm,
635635
recip_brav_name,
636636
ucell.atoms,
637637
false,
638-
nullptr);
639-
GlobalV::ofs_running << "(for reciprocal lattice: )" << std::endl;
640-
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "BRAVAIS TYPE", recip_brav_type);
638+
nullptr);
639+
GlobalV::ofs_running << "\n For reciprocal-space lattice:" << std::endl;
640+
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "BRAVAIS TYPE", recip_brav_type);
641641
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "BRAVAIS LATTICE NAME", recip_brav_name);
642642
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "ibrav", recip_brav_type);
643643

@@ -680,7 +680,7 @@ void K_Vectors::ibz_kpoint(const ModuleSymmetry::Symmetry& symm,
680680
ucell.atoms,
681681
false,
682682
nullptr);
683-
GlobalV::ofs_running << "(for k-lattice: )" << std::endl;
683+
GlobalV::ofs_running << "\n For k vectors:" << std::endl;
684684
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "BRAVAIS TYPE", k_brav_type);
685685
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "BRAVAIS LATTICE NAME", k_brav_name);
686686
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "ibrav", k_brav_type);
@@ -989,7 +989,7 @@ void K_Vectors::ibz_kpoint(const ModuleSymmetry::Symmetry& symm,
989989
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "nkstot_ibz", nkstot_ibz);
990990

991991
table.clear();
992-
table += "K-POINTS REDUCTION ACCORDING TO SYMMETRY\n";
992+
table += "\n K-POINTS REDUCTION ACCORDING TO SYMMETRY:\n";
993993
table += FmtCore::format("%8s%12s%12s%12s%8s%8s\n", "IBZ", "DIRECT_X", "DIRECT_Y", "DIRECT_Z", "WEIGHT", "ibz2bz");
994994
for (int ik = 0; ik < nkstot_ibz; ik++)
995995
{
@@ -1094,7 +1094,7 @@ void K_Vectors::set_both_kvec(const ModuleBase::Matrix3& G, const ModuleBase::Ma
10941094
kd_done = true;
10951095
}
10961096
std::string table;
1097-
table += "K-POINTS DIRECT COORDINATES\n";
1097+
table += " K-POINTS DIRECT COORDINATES\n";
10981098
table += FmtCore::format("%8s%12s%12s%12s%8s\n", "KPOINTS", "DIRECT_X", "DIRECT_Y", "DIRECT_Z", "WEIGHT");
10991099
for (int i = 0; i < nkstot; i++)
11001100
{
@@ -1331,7 +1331,7 @@ void K_Vectors::print_klists(std::ofstream& ofs)
13311331
ModuleBase::WARNING_QUIT("print_klists", "nkstot < nks");
13321332
}
13331333
std::string table;
1334-
table += "K-POINTS CARTESIAN COORDINATES\n";
1334+
table += " K-POINTS CARTESIAN COORDINATES\n";
13351335
table += FmtCore::format("%8s%12s%12s%12s%8s\n", "KPOINTS", "CARTESIAN_X", "CARTESIAN_Y", "CARTESIAN_Z", "WEIGHT");
13361336
for (int i = 0; i < nks; i++)
13371337
{
@@ -1345,7 +1345,7 @@ void K_Vectors::print_klists(std::ofstream& ofs)
13451345
GlobalV::ofs_running << "\n" << table << std::endl;
13461346

13471347
table.clear();
1348-
table += "K-POINTS DIRECT COORDINATES\n";
1348+
table += " K-POINTS DIRECT COORDINATES\n";
13491349
table += FmtCore::format("%8s%12s%12s%12s%8s\n", "KPOINTS", "DIRECT_X", "DIRECT_Y", "DIRECT_Z", "WEIGHT");
13501350
for (int i = 0; i < nks; i++)
13511351
{

source/module_cell/module_symmetry/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ add_library(
33
OBJECT
44
symm_other.cpp
55
symmetry_basic.cpp
6+
symm_analysis.cpp
7+
symm_check.cpp
8+
symm_getgroup.cpp
9+
symm_hermite.cpp
10+
symm_lattice.cpp
11+
symm_magnetic.cpp
12+
symm_pricell.cpp
13+
symm_rho.cpp
614
symmetry.cpp
715
)
816

0 commit comments

Comments
 (0)