Skip to content

Commit d11d4c7

Browse files
committed
fix a bug and delete a redundant operation
1 parent 6c488db commit d11d4c7

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

source/module_hamilt_lcao/module_gint/new_grid_tech/gint_atom.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ void GintAtom::set_phi_dphi(
125125
{
126126
// if the distance is larger than the cutoff radius,
127127
// the wave function values are all zeros
128+
if(phi != nullptr)
129+
{
130+
ModuleBase::GlobalFunc::ZEROS(phi + im * stride, atom_->nw);
131+
}
128132
ModuleBase::GlobalFunc::ZEROS(dphi_x + im * stride, atom_->nw);
129133
ModuleBase::GlobalFunc::ZEROS(dphi_y + im * stride, atom_->nw);
130134
ModuleBase::GlobalFunc::ZEROS(dphi_z + im * stride, atom_->nw);

source/module_hamilt_lcao/module_gint/new_grid_tech/phi_operator.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ void PhiOperator::phi_mul_dm(
136136

137137
void PhiOperator::phi_mul_vldr3(const double* vl, const double dr3, const double* phi, double* result) const
138138
{
139-
ModuleBase::GlobalFunc::ZEROS(result, rows_ * cols_);
140139
int idx = 0;
141140
for(int i = 0; i < biggrid_->get_mgrids_num(); i++)
142141
{

0 commit comments

Comments
 (0)