Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/source_base/mcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ int MCD_sscanf(const char *str,const char *fmt,char*fun,char*file,int line,...)
/* scanf etc helper function */
void scan_args(const char *fmt,va_list argptr,char*fun,char*file,int line)
{
char **ptr;
char ** ptr = nullptr;
void * dummy = nullptr; // clear up the unused warning

for(;*fmt;fmt++) {
Expand Down
2 changes: 1 addition & 1 deletion source/source_lcao/module_deepks/LCAO_deepks.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class LCAO_Deepks
std::vector<torch::Tensor> pdm;

/// dE/dD, autograd from loaded model(E: Ry)
double** gedm; //[tot_Inl][(2l+1)*(2l+1)]
double** gedm = nullptr; //[tot_Inl][(2l+1)*(2l+1)]

// functions for hr status: 1. get value; 2. set value;
int get_hr_cal()
Expand Down
2 changes: 1 addition & 1 deletion source/source_lcao/module_gint/gint_rho.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Gint_rho : public Gint
const bool is_dm_symm_;

// output
double **rho_;
double ** rho_ = nullptr;

// Intermediate variables
std::vector<HContainer<double>> dm_gint_vec_;
Expand Down
2 changes: 1 addition & 1 deletion source/source_lcao/module_gint/gint_rho_gpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Gint_rho_gpu: public Gint
const bool is_dm_symm_;

// output
double **rho_;
double ** rho_ = nullptr;

// Intermediate variables
std::vector<HContainer<double>> dm_gint_vec_;
Expand Down
2 changes: 1 addition & 1 deletion source/source_lcao/module_gint/gint_tau.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Gint_tau : public Gint
const int nspin_;

// output
double **kin_;
double ** kin_ = nullptr;

// Intermediate variables
std::vector<HContainer<double>> dm_gint_vec_;
Expand Down
2 changes: 1 addition & 1 deletion source/source_lcao/module_gint/gint_tau_gpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Gint_tau_gpu : public Gint
const int nspin_;

// output
double **kin_;
double ** kin_ = nullptr;

// Intermediate variables
std::vector<HContainer<double>> dm_gint_vec_;
Expand Down
6 changes: 3 additions & 3 deletions source/source_lcao/module_lr/lr_spectrum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ ModuleBase::Vector3<double> LR::LR_Spectrum<double>::cal_transition_dipole_istat
for (int is = 0;is < this->nspin_x;++is)
{
// 2. transition density
double** rho_trans;
double** rho_trans = nullptr;
LR_Util::_allocate_2order_nested_ptr(rho_trans, 1, this->rho_basis.nrxx);
ModuleBase::GlobalFunc::ZEROS(rho_trans[0], this->rho_basis.nrxx);
ModuleGint::cal_gint_rho({ DM_trans.get_DMR_vector().at(is) }, 1, rho_trans, false);
Expand Down Expand Up @@ -90,8 +90,8 @@ ModuleBase::Vector3<std::complex<double>> LR::LR_Spectrum<std::complex<double>>:
for (int is = 0;is < this->nspin_x;++is)
{
// 2. transition density
double** rho_trans_real;
double** rho_trans_imag;
double** rho_trans_real = nullptr;
double** rho_trans_imag = nullptr;
LR_Util::_allocate_2order_nested_ptr(rho_trans_real, 1, this->rho_basis.nrxx);
LR_Util::_allocate_2order_nested_ptr(rho_trans_imag, 1, this->rho_basis.nrxx);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace LR

// 2. transition electron density
// \f[ \tilde{\rho}(r)=\sum_{\mu_j, \mu_b}\tilde{\rho}_{\mu_j,\mu_b}\phi_{\mu_b}(r)\phi_{\mu_j}(r) \f]
double** rho_trans;
double** rho_trans = nullptr;
const int& nrxx = this->pot.lock()->nrxx;
LR_Util::_allocate_2order_nested_ptr(rho_trans, 1, nrxx); // currently gint_kernel_rho uses PARAM.inp.nspin, it needs refactor
ModuleBase::GlobalFunc::ZEROS(rho_trans[0], nrxx);
Expand Down Expand Up @@ -90,7 +90,7 @@ namespace LR


// 2. transition electron density
double** rho_trans;
double** rho_trans = nullptr;
const int& nrxx = this->pot.lock()->nrxx;

LR_Util::_allocate_2order_nested_ptr(rho_trans, 1, nrxx); // nspin=1 for transition density
Expand Down
2 changes: 1 addition & 1 deletion source/source_lcao/module_lr/potentials/xc_kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ LR::KernelXC::KernelXC(const ModulePW::PW_Basis& rho_basis,
if (lr_init_xc_kernel[0] == "from_charge_file")
{
assert(lr_init_xc_kernel.size() >= 2);
double** rho_for_fxc;
double** rho_for_fxc = nullptr;
LR_Util::_allocate_2order_nested_ptr(rho_for_fxc, nspin, nrxx);
double ef = 0.0;
int prenspin = 1;
Expand Down
Loading