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/math_bspline.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Bspline
int norder; // the order of bezier base; norder >= 0
double Dx; // Dx: the interval of control node
double xi; // xi: the starting point
double *bezier; // bezier[n] = Bk[n]
double * bezier = nullptr; // bezier[n] = Bk[n]

public:
Bspline();
Expand Down
6 changes: 3 additions & 3 deletions source/source_base/math_chebyshev.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class Chebyshev
std::complex<REAL>* coefc_cpu = nullptr; //[CPU] expansion coefficient of each order

FFTW<REAL> fftw; // use for fftw
REAL* polytrace; //[CPU] w_n = \sum_i v^+ * T_n(A) * v, only
REAL* polytrace = nullptr; //[CPU] w_n = \sum_i v^+ * T_n(A) * v, only

bool getcoef_real; // coef_real has been calculated
bool getcoef_complex; // coef_complex has been calculated
Expand Down Expand Up @@ -248,7 +248,7 @@ class FFTW<double>
FFTW(const int norder2_in);
~FFTW();
void execute_fftw();
double* dcoef; //[norder2]
double* dcoef = nullptr; //[norder2]
fftw_complex* ccoef = nullptr;
fftw_plan coef_plan;
};
Expand All @@ -261,7 +261,7 @@ class FFTW<float>
FFTW(const int norder2_in);
~FFTW();
void execute_fftw();
float* dcoef; //[norder2]
float* dcoef = nullptr; //[norder2]
fftwf_complex* ccoef = nullptr;
fftwf_plan coef_plan;
};
Expand Down
8 changes: 4 additions & 4 deletions source/source_base/mcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ typedef struct ChunkS
#else
long long id; // 64bit allocation ID
#endif
char *function; //creating function
char *file; //file function is in
void *ptr; //pointer to allocation
char * function = nullptr; //creating function
char * file = nullptr; //file function is in
void * ptr = nullptr; //pointer to allocation
struct ChunkS *next, //next chunk (null if nonw)
*prev; //previous chunk (null if nonw)
}Chunk;
Expand Down Expand Up @@ -706,7 +706,7 @@ int MCD_sscanf(const char *str,const char *fmt,char*fun,char*file,int line,...)
void scan_args(const char *fmt,va_list argptr,char*fun,char*file,int line)
{
char **ptr;
void *dummy; // clear up the unused warning
void * dummy = nullptr; // clear up the unused warning

for(;*fmt;fmt++) {
if(*fmt!='%')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class BFCAllocator : public Allocator {
}

private:
BFCAllocator* allocator_; // The parent allocator
BFCAllocator* allocator_ = nullptr; // The parent allocator
};

using free_chunk_set_t = std::set<ChunkHandle, ChunkComparator>;
Expand Down
2 changes: 1 addition & 1 deletion source/source_basis/module_ao/ORB_nonlocal.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Numerical_Nonlocal
const int& nproj_in,
const Numerical_Nonlocal_Lm* ps_orbital_in);

Numerical_Nonlocal_Lm* Proj; ///< length: nproj(only store radial function )
Numerical_Nonlocal_Lm* Proj = nullptr; ///< length: nproj(only store radial function )

const double& get_rcut_max() const { return rcut_max; }
const int& get_nproj() const { return nproj; }
Expand Down
4 changes: 2 additions & 2 deletions source/source_basis/module_ao/ORB_nonlocal_lm.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ class Numerical_Nonlocal_Lm
double kcut;
double dk;

double* r_radial; //points of r
double* r_radial = nullptr; //points of r
double* k_radial = nullptr;

double* rab = nullptr;
double* beta_r; // |beta(r) * r>
double* beta_r = nullptr; // |beta(r) * r>
double* beta_k = nullptr;
};

Expand Down
6 changes: 3 additions & 3 deletions source/source_basis/module_ao/ORB_read.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,10 +466,10 @@ void LCAO_Orbitals::read_orb_file(std::ofstream& ofs_in, // GlobalV::ofs_running
{
ofs_in << " " << std::setw(12) << count + 1 << std::setw(3) << L << std::setw(3) << N;

double* radial; // radial mesh
double* psi; // radial local orbital
double* radial = nullptr; // radial mesh
double* psi = nullptr; // radial local orbital
double* psir; // psi * r
double* rab; // dr
double* rab = nullptr; // dr

// set the number of mesh and the interval distance.
ofs_in << std::setw(8) << meshr << std::setw(8) << dr;
Expand Down
4 changes: 2 additions & 2 deletions source/source_cell/setup_nonlocal.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class InfoNonlocal
///
///NON-LOCAL part for LCAO
///
Numerical_Nonlocal* Beta;/// nonlocal projectors (1-dimension array)
int *nproj; //mohan add 2010-12-19
Numerical_Nonlocal* Beta = nullptr;/// nonlocal projectors (1-dimension array)
int * nproj = nullptr; //mohan add 2010-12-19
int nprojmax; // mohan add 2010-03-07
double rcutmax_Beta; //caoyu add 2021-05-24
const double& get_rcutmax_Beta(void) const { return rcutmax_Beta; }
Expand Down
4 changes: 2 additions & 2 deletions source/source_esolver/esolver_fp.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ class ESolver_FP: public ESolver
//! charge density and potential are defined on dense grids,
//! but effective potential needs to be interpolated on smooth grids in order to compute Veff|psi>
ModulePW::PW_Basis* pw_rho = nullptr;
ModulePW::PW_Basis* pw_rhod; //! dense grid for USPP
ModulePW::PW_Basis_Big* pw_big; ///< [temp] pw_basis_big class
ModulePW::PW_Basis* pw_rhod = nullptr; //! dense grid for USPP
ModulePW::PW_Basis_Big* pw_big = nullptr; ///< [temp] pw_basis_big class

//! parallel for rho grid
Parallel_Grid Pgrid;
Expand Down
4 changes: 2 additions & 2 deletions source/source_hsolver/module_genelpa/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ void loadMatrix(const char FileName[], int nFull, double* a, int* desca, int bla
if (myid == ROOT_PROC)
matrixFile.open(FileName);

double* b; // buffer
double* b = nullptr; // buffer
const int MAX_BUFFER_SIZE = 1e9; // max buffer size is 1GB

int N = nFull;
Expand Down Expand Up @@ -179,7 +179,7 @@ void saveMatrix(const char FileName[], int nFull, double* a, int* desca, int bla
matrixFile.width(24);
}

double* b; // buffer
double* b = nullptr; // buffer
const int MAX_BUFFER_SIZE = 1e9; // max buffer size is 1GB

int N = nFull;
Expand Down
2 changes: 1 addition & 1 deletion source/source_lcao/force_stress_arrays.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class ForceStressArrays
// r_mu - r_nu
//----------------------------------------

double* DH_r;//zhengdy added 2017-07
double* DH_r = nullptr;//zhengdy added 2017-07

double* stvnl11 = nullptr;
double* stvnl12 = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion source/source_lcao/module_ri/ewald_Vq.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class Ewald_Vq
double ccp_rmesh_times;
LRI_CV<Tdata> cv;
Gaussian_Abfs gaussian_abfs;
const K_Vectors* p_kv;
const K_Vectors* p_kv = nullptr;
std::vector<ModuleBase::Vector3<double>> kvec_c;
// std::vector<double> wk;
MPI_Comm mpi_comm;
Expand Down
4 changes: 2 additions & 2 deletions source/source_lcao/module_rt/propagator_cn2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,10 +388,10 @@ void Propagator::compute_propagator_cn2_tensor(const int nlocal,

// 5. QR Factorization of A (Denominator)
int64_t tau_size = m_global + nb;
void* d_tau;
void* d_tau = nullptr;
cudaMallocAsync(&d_tau, tau_size * sizeof(std::complex<double>), cublas_res.stream);

int* d_info;
int* d_info = nullptr;
cudaMallocAsync(&d_info, sizeof(int), cublas_res.stream);
cudaMemsetAsync(d_info, 0, sizeof(int), cublas_res.stream);

Expand Down
2 changes: 1 addition & 1 deletion source/source_md/md_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class MD_base
int step_; ///< the MD step finished in current calculation
int step_rst_; ///< the MD step finished in previous calculations
int frozen_freedom_; ///< the fixed freedom of the system
double* allmass; ///< atom mass
double* allmass = nullptr; ///< atom mass
ModuleBase::Vector3<double>* pos; ///< atom displacements liuyu modify 2023-03-22
ModuleBase::Vector3<double>* vel; ///< atom velocity
ModuleBase::Vector3<int>* ionmbl; ///< atom is frozen or not
Expand Down
16 changes: 8 additions & 8 deletions source/source_md/nhchain.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ class Nose_Hoover : public MD_base

int tdof; ///< particle degree of freedom
double t_target=0.0;///< target temperature
double* mass_eta; ///< mass of thermostats coupled with particles
double* eta; ///< position of thermostats coupled with particles
double* v_eta; ///< velocity of thermostats coupled with particles
double* g_eta; ///< acceleration of thermostats coupled with particles
double* mass_eta = nullptr; ///< mass of thermostats coupled with particles
double* eta = nullptr; ///< position of thermostats coupled with particles
double* v_eta = nullptr; ///< velocity of thermostats coupled with particles
double* g_eta = nullptr; ///< acceleration of thermostats coupled with particles

int npt_flag; ///< whether NPT ensemble
double mass_omega[6]; ///< mass of lattice component
Expand All @@ -89,10 +89,10 @@ class Nose_Hoover : public MD_base
double p_target[6]; ///< target stress components
double p_hydro = 0.0; ///< target hydrostatic target pressure
double p_current[6] = {0.0}; ///< current stress after coupled
double* mass_peta; ///< mass of thermostats coupled with barostat
double* peta; ///< position of thermostats coupled with barostat
double* v_peta; ///< velocity of thermostats coupled with barostat
double* g_peta; ///< acceleration of thermostats coupled with barostat
double* mass_peta = nullptr; ///< mass of thermostats coupled with barostat
double* peta = nullptr; ///< position of thermostats coupled with barostat
double* v_peta = nullptr; ///< velocity of thermostats coupled with barostat
double* g_peta = nullptr; ///< acceleration of thermostats coupled with barostat
double mtk_term=0; ///< mtk correction
double md_tfreq; ///< Oscillation frequency, used to determine qmass of thermostats coupled with particles
double md_pfirst; ///< Initial pressure
Expand Down
4 changes: 2 additions & 2 deletions source/source_pw/module_pwdft/vl_pw.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ class pseudopot_cell_vl
const ModulePW::PW_Basis* rho_basis);

ModuleBase::matrix vloc; //(ntype,ngl),the local potential for each atom type(ntype,ngl)
bool *numeric; //[ntype], =true
bool * numeric = nullptr; //[ntype], =true

private:

double *zp; // (npsx),the charge of the pseudopotential
double * zp = nullptr; // (npsx),the charge of the pseudopotential

void allocate(const UnitCell& ucell,
const int ngg);
Expand Down
10 changes: 5 additions & 5 deletions source/source_relax/bfgs_basic.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ class BFGS_Basic
void reset_hessian(void);
void save_bfgs(void);

double* pos; // std::vector containing 3N coordinates of the system ( x )
double* grad; // std::vector containing 3N components of ( grad( V(x) ) )
double* move; // pos = pos_p + move.
double* pos = nullptr; // std::vector containing 3N coordinates of the system ( x )
double* grad = nullptr; // std::vector containing 3N components of ( grad( V(x) ) )
double* move = nullptr; // pos = pos_p + move.

double* pos_p; // p: previous
double* grad_p; // p: previous
double* pos_p = nullptr; // p: previous
double* grad_p = nullptr; // p: previous
double* move_p = nullptr;

public: // mohan update 2011-06-12
Expand Down
2 changes: 1 addition & 1 deletion source/source_relax/lbfgs.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class LBFGS
double energy; ///< Current system energy
double alpha_k; ///< Step size parameter

ModuleESolver::ESolver* solver; ///< Structure solver
ModuleESolver::ESolver* solver = nullptr; ///< Structure solver
std::vector<double> steplength;//the length of atoms displacement
std::vector<std::vector<double>> H;//Hessian matrix
std::vector<double> force0;//force in previous step
Expand Down
Loading