Skip to content

Commit 9c1a061

Browse files
mohanchenabacus_fixer
andauthored
Refactor the test directories of 02_NAO_Gamma and 03_NAO_multik, and several related output formats (#6973)
* Refactor: Encapsulate timer functionality in timer_wrapper.h * Refactor timer code and clean_esolver function 1. Remove #ifdef __MPI from timer code, encapsulate in timer_wrapper.h 2. Move ESolver clean logic to after_all_runners method 3. Replace clean_esolver calls with direct delete p_esolver 4. Remove #ifdef __MPI from delete p_esolver 5. Add Cblacs_exit(1) in after_all_runners for LCAO calculations * add module_energy directory * updates * Rename json_output to module_json and move para_json files, update include paths * Update CMakeLists.txt: change json_output to module_json * Fix CMakeLists.txt: update source_io file paths to module_output directory * Fix csr_reader.h include paths: update to module_output directory * fix bugs related to libxc * fix * fix * fix several CMakeLists * update CMake and other test files * update cmakelists * fix bugs * Fix: Correct para_json.cpp path in test CMakeLists.txt * fix cmake * fix * fix * fix * fix * fix * json! * small updates of mulliken file format * update mulliken charge output nspin=1 * Fix: Create symbolic link 'abacus' for test compatibility * update mulliken output * update mulliken spin 2 * update mulliken 4 * mulliken for spin 1 * update mulliken and refs * update mulliken test to match new output format * update pchg * update mulliken test * update directories in 02_NAO_Gamma * change the directories in 02_NAO_Gamma to make it more clear * exclude a test * Update INPUT files: replace tabs with spaces and align columns * update write_dmk.cpp * update out_dmr_dmk example in 03 * fix write_dmk_test.cpp * fix bug * update write_dmk.cpp * update write_dmk * update * update dmr output format, and change all the output of sparsematrix format * update dmrs1_nap.csr.ref * fix reader of dmr matrix * fix bug, now it works! * update format * add spin information in dmr * update example in 03: scf_in_dmr_GaAs * add reference data * update example in 03: scf_in_dmr_Si * add example: scf_in_dmr_Si_spin2_hasbug * update example 03: scf_out_dmr_dmk_pot * change pot from int to vector! * fix bug about out_pot * update potential, now it works with 2 parameters * fix bug, out_chg 2 now supports precision control of chginit.cube file! * fix tests * fix example * fix example reference data * update tab of write_HS.hpp * replace tab with blank in write_HS_R.cpp * fix elf test * delete 40_NO_ELF test * update nscf_out_pot test * update pot in nscf_out_pot * update md_out_syns test * update meta-gga output charge density and kinetic energy density * update test chg tau in metagga * update examples * fix tests! * update 03 CASES_CPU.txt * fix 03 scf_in_dmr_GaAs test * update 02 CASES_CPU.txt * fix 054 test in 01 * fix another test scf_out_elf in 01 * fix ldos test * fix test in scf_out_chg_tau * fix two tests in OFDFT * update deepks examples * fix the unittest of csr_reader.cpp * fix sparse_matrix.cpp unit tests * fix read_input_item_test.cpp * fix dmk * comment out read_dmk * fix rho_io test * fix bug * update unitcell, about changing none to user_defined_lattice * fix scf_in_dmr_GaAs * temporaly remove csr reader test in Hcontainer, will add back later --------- Co-authored-by: abacus_fixer <mohanchen@pku.eud.cn>
1 parent 46bd897 commit 9c1a061

File tree

364 files changed

+5936
-5039
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

364 files changed

+5936
-5039
lines changed

source/Makefile.Objects

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,7 @@ OBJS_IO=module_parameter/input_conv.o\
590590
orb_io.o\
591591
cal_pLpR.o\
592592
filename.o\
593+
ucell_io.o\
593594

594595
OBJS_IO_LCAO=cal_r_overlap_R.o\
595596
write_orb_info.o\

source/source_cell/read_atom_species.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ bool read_lattice_constant(std::ifstream& ifa,
162162
// Read in latticies vector
163163
//===========================
164164

165-
if(latName=="none")
165+
if(latName=="user_defined_lattice")
166166
{
167167
// check the existence of keyword "LATTICE_PARAMETERS"
168168
if (ModuleBase::GlobalFunc::SCAN_LINE_BEGIN(ifa,

source/source_cell/test/unitcell_test.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ using UcellDeathTest = UcellTest;
172172
TEST_F(UcellTest, Constructor)
173173
{
174174
EXPECT_EQ(ucell->Coordinate, "Direct");
175-
EXPECT_EQ(ucell->latName, "none");
175+
EXPECT_EQ(ucell->latName, "user_defined_lattice");
176176
EXPECT_DOUBLE_EQ(ucell->lat0, 0.0);
177177
EXPECT_DOUBLE_EQ(ucell->lat0_angstrom, 0.0);
178178
EXPECT_EQ(ucell->ntype, 0);
@@ -547,7 +547,7 @@ TEST_F(UcellTest, RemakeCell)
547547

548548
TEST_F(UcellDeathTest, RemakeCellWarnings)
549549
{
550-
std::vector<std::string> latname_in = {"none", "trigonal", "bacm", "triclinic", "arbitrary"};
550+
std::vector<std::string> latname_in = {"user_defined_lattice", "trigonal", "bacm", "triclinic", "arbitrary"};
551551
for (int i = 0; i < latname_in.size(); ++i)
552552
{
553553
ucell->latvec.e11 = 10.0;
@@ -563,7 +563,7 @@ TEST_F(UcellDeathTest, RemakeCellWarnings)
563563
testing::internal::CaptureStdout();
564564
EXPECT_EXIT(unitcell::remake_cell(ucell->lat), ::testing::ExitedWithCode(1), "");
565565
std::string output = testing::internal::GetCapturedStdout();
566-
if (latname_in[i] == "none")
566+
if (latname_in[i] == "user_defined_lattice")
567567
{
568568
EXPECT_THAT(output, testing::HasSubstr("to use fixed_ibrav, latname must be provided"));
569569
}

source/source_cell/unitcell_data.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
struct Lattice
88
{
99
std::string Coordinate = "Direct"; // "Direct" or "Cartesian" or "Cartesian_angstrom"
10-
std::string latName = "none"; // Lattice name
10+
std::string latName = "user_defined_lattice"; // Lattice name
1111
double lat0 = 0.0; // Lattice constant(bohr)(a.u.)
1212
double lat0_angstrom = 0.0; // Lattice constant(angstrom)
1313
double tpiba = 0.0; // 2*pi / lat0;
@@ -64,4 +64,4 @@ struct Statistics
6464
}
6565
};
6666

67-
#endif
67+
#endif

0 commit comments

Comments
 (0)