@@ -72,6 +72,8 @@ class Test_SETGRAD : public testing::Test
7272 ucell.atoms [0 ].taud [1 ] = 0.0 ;
7373 ucell.atoms [0 ].taud [2 ] = 0.0 ;
7474
75+ ucell.atoms [0 ].tau .resize (nat);
76+
7577 ucell.lc [0 ] = 1 ;
7678 ucell.lc [1 ] = 1 ;
7779 ucell.lc [2 ] = 1 ;
@@ -105,11 +107,13 @@ class Test_SETGRAD : public testing::Test
105107 ucell.latvec .Identity ();
106108 input.fixed_axes = " a" ; // anything other than "None"
107109 input.fixed_ibrav = true ;
110+ ucell.latName = " sc" ;
108111 ucell.lc [0 ] = 0 ;
109112 ucell.lc [1 ] = 0 ;
110113 ucell.lc [2 ] = 0 ;
111114 rl.init_relax (nat);
112115 rl.relax_step (ucell,force_in,stress_in,0.0 );
116+
113117 push_result ();
114118 }
115119
@@ -167,7 +171,6 @@ class Test_RELAX : public testing::Test
167171 this ->setup_cell ();
168172
169173 ModuleBase::matrix force_in, stress_in;
170-
171174 force_in.create (nat,3 );
172175 stress_in.create (3 ,3 );
173176
@@ -192,6 +195,7 @@ class Test_RELAX : public testing::Test
192195
193196 energy_file >> energy;
194197
198+ PARAM.input .fixed_ibrav = false ;
195199 rl.relax_step (ucell,force_in,stress_in,energy);
196200
197201 result.push_back (ucell.atoms [0 ].taud [0 ].x );
@@ -253,6 +257,7 @@ class Test_RELAX : public testing::Test
253257 int na = ucell.atoms [i].na ;
254258 ucell.atoms [i].mbl .resize (na);
255259 ucell.atoms [i].taud .resize (na);
260+ ucell.atoms [i].tau .resize (na);
256261 for (int j=0 ;j<na;j++)
257262 {
258263 ucell.atoms [i].mbl [j] = {1 ,1 ,1 };
0 commit comments