@@ -105,7 +105,8 @@ TEST_F(MD_func_test, RescaleVel)
105105TEST_F (MD_func_test, compute_stress)
106106{
107107 const ModuleBase::Vector3<double > test_velocity (0.1 , 0.2 , 0.3 );
108- MDCell mdcell (ucell, 0.0 , 0.0 , ModuleBase::world_communication_domain ());
108+ MDCell mdcell;
109+ mdcell.initialize_from_unitcell (ucell, 0.0 , 0.0 , ModuleBase::world_communication_domain ());
109110 for (LocalAtom& atom : mdcell.mutable_owned_atoms ())
110111 {
111112 atom.vel = test_velocity;
@@ -124,7 +125,8 @@ TEST_F(MD_func_test, compute_stress)
124125
125126TEST_F (MD_func_test, dump_info)
126127{
127- MDCell mdcell (ucell, 0.0 , 0.0 , ModuleBase::world_communication_domain ());
128+ MDCell mdcell;
129+ mdcell.initialize_from_unitcell (ucell, 0.0 , 0.0 , ModuleBase::world_communication_domain ());
128130 for (LocalAtom& atom : mdcell.mutable_owned_atoms ())
129131 {
130132 atom.vel = ModuleBase::Vector3<double >(0.0 , 0.0 , 0.0 );
@@ -309,7 +311,8 @@ TEST_F(MD_func_test, current_md_info_mdcell_accepts_step_only_restart)
309311 file << 123 ;
310312 file.close ();
311313
312- MDCell mdcell (ucell, 0.0 , 0.0 , ModuleBase::world_communication_domain ());
314+ MDCell mdcell;
315+ mdcell.initialize_from_unitcell (ucell, 0.0 , 0.0 , ModuleBase::world_communication_domain ());
313316 int istep = -1 ;
314317 double temperature = 0.0 ;
315318 MD_func::current_md_info (mdcell, " ./" , istep, temperature);
@@ -321,7 +324,8 @@ TEST_F(MD_func_test, current_md_info_mdcell_accepts_step_only_restart)
321324
322325TEST_F (MD_func_test, global_dof_mdcell)
323326{
324- MDCell mdcell (ucell, 0.0 , 0.0 , ModuleBase::world_communication_domain ());
327+ MDCell mdcell;
328+ mdcell.initialize_from_unitcell (ucell, 0.0 , 0.0 , ModuleBase::world_communication_domain ());
325329 EXPECT_EQ (MD_func::global_dof (mdcell), 9 );
326330
327331 for (LocalAtom& atom : mdcell.mutable_owned_atoms ())
@@ -333,7 +337,8 @@ TEST_F(MD_func_test, global_dof_mdcell)
333337
334338TEST_F (MD_func_test, current_step_warning)
335339{
336- MDCell mdcell (ucell, 0.0 , 0.0 , ModuleBase::world_communication_domain ());
340+ MDCell mdcell;
341+ mdcell.initialize_from_unitcell (ucell, 0.0 , 0.0 , ModuleBase::world_communication_domain ());
337342 int istep = 0 ;
338343 double temperature = 0.0 ;
339344 EXPECT_EXIT (MD_func::current_md_info (mdcell, " ./" , istep, temperature), ::testing::ExitedWithCode (1 ), " " );
0 commit comments