Skip to content

Commit 078c9fe

Browse files
committed
Fix: error in CI test
1 parent 0e550da commit 078c9fe

File tree

14 files changed

+20
-18
lines changed

14 files changed

+20
-18
lines changed

source/module_io/json_output/init_info.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ void gen_stru(UnitCell* ucell)
102102
std::string* label = ucell->atom_label;
103103
for (int i = 0; i < ntype; i++)
104104
{
105-
ModuleBase::Vector3<double>* tau = ucell->atoms[i].tau;
105+
ModuleBase::Vector3<double>* tau = ucell->atoms[i].tau.data();
106106
int na = ucell->atoms[i].na;
107107
for (int j = 0; j < na; j++)
108108
{

source/module_io/json_output/output_info.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ namespace Json
9494
int ntype = ucell->ntype;
9595
double lat0 = ucell->lat0;
9696
for(int i=0;i<ntype;i++){
97-
ModuleBase::Vector3<double>* tau = ucell->atoms[i].tau;
97+
ModuleBase::Vector3<double>* tau = ucell->atoms[i].tau.data();
9898
int na = ucell->atoms[i].na;
9999
for(int j=0;j<na;j++){
100100
Json::jsonValue coordinateArray(JarrayType);

source/module_io/json_output/test/para_json_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,8 @@ TEST(AbacusJsonTest, Init_stru_test)
355355
atomlist[i].na = 2;
356356
atomlist[i].label = "Fe";
357357
ucell.pseudo_fn[i] = "si.ufp";
358-
ucell.atoms[i].tau = new ModuleBase::Vector3<double>[2];
359-
atomlist[i].mag = new double[2];
358+
ucell.atoms[i].tau.resize(2);
359+
atomlist[i].mag.resize(2);
360360
for (int j = 0; j < atomlist[i].na; j++)
361361
{
362362
atomlist[i].mag[j] = j * 131;

source/module_io/read_input_item_exx_dftu.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ void ReadInput::item_dftu()
400400
item.reset_value = [](const Input_Item& item, Parameter& para) {
401401
if ((para.input.dft_plus_u == 1 || para.input.sc_mag_switch) && para.input.onsite_radius == 0.0)
402402
{
403-
// autoset onsite_radius to 3.0 as default
403+
// autoset onsite_radius to 3.0 as default, this default value comes from the systematic atomic magnetism test
404404
para.input.onsite_radius = 3.0;
405405
}
406406
};

source/module_io/read_input_item_other.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ void ReadInput::item_others()
1919
item.check_value = [](const Input_Item& item, const Parameter& para) {
2020
if (para.input.sc_mag_switch)
2121
{
22-
//ModuleBase::WARNING_QUIT("ReadInput",
23-
// "This feature is not stable yet and might lead to "
24-
// "erroneous results.\n"
25-
// " Please wait for the official release version.");
22+
ModuleBase::WARNING_QUIT("ReadInput",
23+
"This feature is not stable yet and might lead to "
24+
"erroneous results.\n"
25+
" Please wait for the official release version.");
2626
// if (para.input.nspin != 4 && para.input.nspin != 2)
2727
// {
2828
// ModuleBase::WARNING_QUIT("ReadInput", "nspin must be 2 or
@@ -129,8 +129,7 @@ void ReadInput::item_others()
129129
}
130130
{
131131
Input_Item item("sc_scf_thr");
132-
item.annotation = "Minimum number of outer scf loop before "
133-
"initializing lambda loop";
132+
item.annotation = "Density error threshold for inner loop of spin-constrained SCF";
134133
read_sync_double(input.sc_scf_thr);
135134
item.check_value = [](const Input_Item& item, const Parameter& para) {
136135
if (para.input.sc_scf_thr <= 0.0)

source/module_io/test/support/INPUT

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,4 +389,3 @@ nsc_min 4 #Minimum number of spin-constrained iteration
389389
sc_scf_nmin 4 #Minimum number of outer scf loop before initializing lambda loop
390390
alpha_trial 0.02 #Initial trial step size for lambda in eV/uB^2
391391
sccut 4 #Maximal step size for lambda in eV/uB
392-
sc_file sc.json #file name for parameters used in non-collinear spin-constrained DFT (json format)

source/module_io/test_serial/read_input_item_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1448,7 +1448,7 @@ TEST_F(InputTest, Item_test2)
14481448
param.input.onsite_radius = 0.0;
14491449
param.input.dft_plus_u = 1;
14501450
it->second.reset_value(it->second, param);
1451-
EXPECT_EQ(param.input.onsite_radius, 5.0);
1451+
EXPECT_EQ(param.input.onsite_radius, 3.0);
14521452
}
14531453
{ // hubbard_u
14541454
auto it = find_label("hubbard_u", readinput.input_lists);
@@ -1588,7 +1588,7 @@ TEST_F(InputTest, Item_test2)
15881588
}
15891589
{ // sc_scf_thr
15901590
auto it = find_label("sc_scf_thr", readinput.input_lists);
1591-
param.input.sc_scf_thr = 1e-3;
1591+
param.input.sc_scf_thr = -1e-3;
15921592
testing::internal::CaptureStdout();
15931593
EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(0), "");
15941594
output = testing::internal::GetCapturedStdout();

source/module_io/test_serial/rho_io_test.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ TEST_F(RhoIOTest, Write)
111111
ucell->atoms[0].tau[0] = ModuleBase::Vector3<double>(0.0, 0.0, 0.0);
112112
ucell->atoms[0].tau[1] = ModuleBase::Vector3<double>(-0.75, 0.75, 0.75);
113113
ucell->atoms[0].ncpp.zv = 4;
114-
ucell->atoms[1].ncpp.zv = 4;
115114
Parallel_Grid pgrid(nx, ny, nz, nz, nrxx, nz, 1);
116115
ModuleIO::read_vdata_palgrid(pgrid, my_rank, ofs_running, "support/SPIN1_CHG.cube", rho[0], ucell->nat);
117116
ModuleIO::write_vdata_palgrid(pgrid, rho[0], 0, nspin, 0, "test_write_vdata_palgrid.cube", 0.461002, ucell, 11, 1);

source/module_psi/test/psi_initializer_unit_test.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,9 @@ class PsiIntializerUnitTest : public ::testing::Test {
153153
this->p_ucell->atoms[0].angle1.resize(1, 0.0);
154154
this->p_ucell->atoms[0].angle2.resize(1, 0.0);
155155
// atom position
156-
this->p_ucell->atoms[0].tau[0] = {0.0, 0.0, 0.0};
157-
this->p_ucell->atoms[0].taud[0] = {0.25, 0.25, 0.25};
158-
this->p_ucell->atoms[0].mbl[0] = {0, 0, 0};
156+
this->p_ucell->atoms[0].tau.resize(1, {0.0, 0.0, 0.0});
157+
this->p_ucell->atoms[0].taud.resize(1, {0.25, 0.25, 0.25});
158+
this->p_ucell->atoms[0].mbl.resize(1, {0, 0, 0});
159159
// atom pseudopotential
160160
if(this->p_ucell->pseudo_fn != nullptr) { delete[] this->p_ucell->pseudo_fn;
161161
}

tests/integrate/260_NO_DJ_PK_PU_AFM_URAMPING/INPUT

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,6 @@ dft_plus_u 1
3131
orbital_corr 2 -1
3232
hubbard_u 5.0 0.0
3333
uramping 2.5
34+
onsite_radius 5.0
3435
pseudo_dir ../../PP_ORB
3536
orbital_dir ../../PP_ORB

0 commit comments

Comments
 (0)