Skip to content

Commit beeb256

Browse files
Refactor:Remove the read_atom_species and add read_lattice_constant (#5828)
* modify cheack_tau * change the cheak_tau * modify the read_atom_species * upadte the file * fix unittest bug * add objs * modify the atom_label and atom_mass * modify compile bug * modify the reszie of the atom_mass * fix compile bug * [pre-commit.ci lite] apply automatic fixes * Revert "fix compile bug" This reverts commit 9a51ca3. * Revert "modify the reszie of the atom_mass" This reverts commit f9cc2b9. * update the resize * fix unitest bug * change the compile bug --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
1 parent 2ebc9bb commit beeb256

File tree

34 files changed

+652
-610
lines changed

34 files changed

+652
-610
lines changed

source/Makefile.Objects

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ OBJS_CELL=atom_pseudo.o\
189189
check_atomic_stru.o\
190190
update_cell.o\
191191
bcast_cell.o\
192+
read_stru.o\
193+
read_atom_species.o\
192194

193195
OBJS_DEEPKS=LCAO_deepks.o\
194196
deepks_force.o\

source/module_cell/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ add_library(
2525
check_atomic_stru.cpp
2626
update_cell.cpp
2727
bcast_cell.cpp
28+
read_stru.cpp
29+
read_atom_species.cpp
2830
)
2931

3032
if(ENABLE_COVERAGE)

source/module_cell/module_neighbor/test/prepare_unitcell.h

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,12 @@ class UcellTestPrepare
7676
this->lmaxmax,
7777
this->init_vel,
7878
this->fixed_axes);
79-
delete[] ucell->atom_label;
80-
delete[] ucell->atom_mass;
81-
delete[] ucell->pseudo_fn;
82-
delete[] ucell->pseudo_type;
8379

8480
delete[] ucell->magnet.start_magnetization; //mag set here
85-
ucell->atom_label = new std::string[ucell->ntype];
86-
ucell->atom_mass = new double[ucell->ntype];
87-
ucell->pseudo_fn = new std::string[ucell->ntype];
88-
ucell->pseudo_type = new std::string[ucell->ntype];
81+
ucell->atom_label.resize(ucell->ntype);
82+
ucell->atom_mass.resize(ucell->ntype);
83+
ucell->pseudo_fn.resize(ucell->ntype);
84+
ucell->pseudo_type.resize(ucell->ntype);
8985
ucell->orbital_fn.resize(ucell->ntype);
9086
ucell->magnet.start_magnetization = new double[ucell->ntype]; //mag set here
9187
ucell->magnet.ux_[0] = 0.0; // ux_ set here

0 commit comments

Comments
 (0)