From 44517ccec56c2e80e3e6eee62efcce120ab1b59c Mon Sep 17 00:00:00 2001 From: Zijie Yu <159112930+Fisheory@users.noreply.github.com> Date: Tue, 16 Apr 2024 13:01:18 +0800 Subject: [PATCH 1/2] Update bessel_basis.cpp Change pointers to vectors --- source/module_io/bessel_basis.cpp | 51 ++++++++++++++++++------------- 1 file changed, 30 insertions(+), 21 deletions(-) diff --git a/source/module_io/bessel_basis.cpp b/source/module_io/bessel_basis.cpp index ac931db7fa..fe89f5371b 100644 --- a/source/module_io/bessel_basis.cpp +++ b/source/module_io/bessel_basis.cpp @@ -5,6 +5,7 @@ #include "module_base/parallel_common.h" #include "module_base/timer.h" #include "module_hamilt_pw/hamilt_pwdft/global.h" +#include Bessel_Basis::Bessel_Basis() { @@ -194,13 +195,20 @@ void Bessel_Basis::init_TableOne( ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "dr",dr); // allocate rmesh and Jlk and eigenvalue of Jlq - double *r = new double[rmesh]; - double *rab = new double[rmesh]; - double *jle = new double[rmesh]; - double *jlk = new double[rmesh]; - double *g = new double[rmesh]; // smooth function - double *function = new double[rmesh]; - double *en = new double[ecut_number]; + // double *r = new double[rmesh]; + // double *rab = new double[rmesh]; + // double *jle = new double[rmesh]; + // double *jlk = new double[rmesh]; + // double *g = new double[rmesh]; // smooth function + // double *function = new double[rmesh]; + // double *en = new double[ecut_number]; + std::vector r(rmesh); + std::vector rab(rmesh); + std::vector jle(rmesh); + std::vector jlk(rmesh); + std::vector g(rmesh); + std::vector function(rmesh); + std::vector en(rmesh); for(int ir=0; ir Date: Wed, 17 Apr 2024 11:36:22 +0800 Subject: [PATCH 2/2] Update bessel_basis.cpp --- source/module_io/bessel_basis.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/module_io/bessel_basis.cpp b/source/module_io/bessel_basis.cpp index fe89f5371b..0a7f0c2ad2 100644 --- a/source/module_io/bessel_basis.cpp +++ b/source/module_io/bessel_basis.cpp @@ -208,7 +208,7 @@ void Bessel_Basis::init_TableOne( std::vector jlk(rmesh); std::vector g(rmesh); std::vector function(rmesh); - std::vector en(rmesh); + std::vector en(ecut_number); for(int ir=0; ir