@@ -101,7 +101,7 @@ void spinconstrain::SpinConstrain<std::complex<double>>::run_lambda_local_diagno
101101#ifndef __LCAO
102102 return ;
103103#else
104- if (PARAM . inp . basis_type != " lcao" ) return ;
104+ if (this -> basis_type_ != " lcao" ) return ;
105105 if (this ->nspin_ != 2 ) return ;
106106
107107 int nat = this ->get_nat ();
@@ -130,7 +130,7 @@ void spinconstrain::SpinConstrain<std::complex<double>>::run_lambda_local_diagno
130130 dynamic_cast <hamilt::DeltaSpin<hamilt::OperatorLCAO<std::complex <double >, double >>*>(this ->p_operator )
131131 ->update_lambda ();
132132
133- hsolver::HSolverLCAO<std::complex <double >> hsolver_t (this ->ParaV , PARAM . inp . ks_solver );
133+ hsolver::HSolverLCAO<std::complex <double >> hsolver_t (this ->ParaV , this -> ks_solver_ );
134134 hsolver_t .solve (hamilt_t , psi_t [0 ], this ->pelec , *this ->dm_ , *this ->pelec ->charge , this ->nspin_ , true );
135135 elecstate::calculate_weights (this ->pelec ->ekb , this ->pelec ->wg , this ->pelec ->klist ,
136136 this ->pelec ->eferm , this ->pelec ->f_en , this ->pelec ->nelec_spin ,
@@ -139,7 +139,7 @@ void spinconstrain::SpinConstrain<std::complex<double>>::run_lambda_local_diagno
139139
140140 // Cache subspace data at lambda_ref
141141 const int nk = psi_t ->get_nk ();
142- const int nbands = PARAM . inp . nbands ;
142+ const int nbands = this -> nbands_ ;
143143 const int nlocal = this ->ParaV ->nrow ;
144144 const int nn = nbands * nbands;
145145 this ->lcao_nbands_ = nbands;
@@ -706,7 +706,7 @@ void spinconstrain::SpinConstrain<std::complex<double>>::run_lambda_loop(int out
706706
707707 const bool nspin_ok = (this ->nspin_ == 2 );
708708
709- const bool accel_enabled = (PARAM . inp . basis_type == " lcao" ) &&
709+ const bool accel_enabled = (this -> basis_type_ == " lcao" ) &&
710710 nspin_ok &&
711711 (this ->sc_acceleration_mode_ != " off" ) &&
712712 (this ->sc_acceleration_rms_thr_ > 0.0 ) &&
@@ -754,7 +754,7 @@ void spinconstrain::SpinConstrain<std::complex<double>>::run_lambda_loop(int out
754754 this ->update_psi_charge (dnu_last_step.data (), rerun, true );
755755
756756 // [PW basis] Extra verification: re-compute Mi from scratch
757- if (PARAM . inp . basis_type == " pw" )
757+ if (this -> basis_type_ == " pw" )
758758 {
759759 this ->cal_mi_pw ();
760760 subtract_2d (this ->Mi_ , this ->target_mag_ , delta_spin);
@@ -1162,7 +1162,7 @@ void spinconstrain::SpinConstrain<std::complex<double>>::run_lambda_linear_scan(
11621162 // Only runs once when charge density is near convergence (drho < 1e-3)
11631163 // =============================================================
11641164#ifdef __LCAO
1165- if (PARAM . inp . basis_type == " lcao" && this ->nspin_ == 2
1165+ if (this -> basis_type_ == " lcao" && this ->nspin_ == 2
11661166 && this ->last_drho_ > 0 && this ->last_drho_ < 1e-3
11671167 && !this ->local_diag_run_ )
11681168 {
@@ -1186,7 +1186,7 @@ void spinconstrain::SpinConstrain<std::complex<double>>::run_lambda_linear_scan(
11861186 // Only runs when charge density is near convergence (drho < 1e-3)
11871187 // =============================================================
11881188#ifdef __LCAO
1189- if (PARAM . inp . basis_type == " lcao" && this ->nspin_ == 2 && this ->last_drho_ > 0 && this ->last_drho_ < 1e-3 )
1189+ if (this -> basis_type_ == " lcao" && this ->nspin_ == 2 && this ->last_drho_ > 0 && this ->last_drho_ < 1e-3 )
11901190 {
11911191 std::cout << " \n " << std::string (80 , ' =' ) << std::endl;
11921192 std::cout << " [DS-DIAG] === EIGENVALUE & Mi COMPARISON DIAGNOSTIC ===" << std::endl;
@@ -1204,7 +1204,7 @@ void spinconstrain::SpinConstrain<std::complex<double>>::run_lambda_linear_scan(
12041204 dynamic_cast <hamilt::DeltaSpin<hamilt::OperatorLCAO<std::complex <double >, double >>*>(this ->p_operator )
12051205 ->update_lambda ();
12061206
1207- hsolver::HSolverLCAO<std::complex <double >> hsolver_t (this ->ParaV , PARAM . inp . ks_solver );
1207+ hsolver::HSolverLCAO<std::complex <double >> hsolver_t (this ->ParaV , this -> ks_solver_ );
12081208 hsolver_t .solve (hamilt_t , psi_t [0 ], this ->pelec , *this ->dm_ , *this ->pelec ->charge , this ->nspin_ , true );
12091209 elecstate::calculate_weights (this ->pelec ->ekb , this ->pelec ->wg , this ->pelec ->klist ,
12101210 this ->pelec ->eferm , this ->pelec ->f_en , this ->pelec ->nelec_spin ,
@@ -1213,7 +1213,7 @@ void spinconstrain::SpinConstrain<std::complex<double>>::run_lambda_linear_scan(
12131213
12141214 // Cache subspace data
12151215 const int nk = psi_t ->get_nk ();
1216- const int nbands = PARAM . inp . nbands ;
1216+ const int nbands = this -> nbands_ ;
12171217 const int nlocal = this ->ParaV ->nrow ;
12181218 const int nn = nbands * nbands;
12191219 this ->lcao_nbands_ = nbands;
@@ -1485,7 +1485,7 @@ void spinconstrain::SpinConstrain<std::complex<double>>::run_lambda_scan_diagnos
14851485#ifndef __LCAO
14861486 return ;
14871487#else
1488- if (PARAM . inp . basis_type != " lcao" )
1488+ if (this -> basis_type_ != " lcao" )
14891489 {
14901490 std::cout << " [DS-DIAG] scan_diagnostic: only supported for LCAO basis" << std::endl;
14911491 return ;
@@ -1550,7 +1550,7 @@ void spinconstrain::SpinConstrain<std::complex<double>>::run_lambda_scan_diagnos
15501550 ->update_lambda ();
15511551 }
15521552
1553- hsolver::HSolverLCAO<std::complex <double >> hsolver_t (this ->ParaV , PARAM . inp . ks_solver );
1553+ hsolver::HSolverLCAO<std::complex <double >> hsolver_t (this ->ParaV , this -> ks_solver_ );
15541554 hsolver_t .solve (hamilt_t , psi_t [0 ], this ->pelec , *this ->dm_ , *this ->pelec ->charge , this ->nspin_ , true );
15551555 elecstate::calculate_weights (this ->pelec ->ekb , this ->pelec ->wg , this ->pelec ->klist ,
15561556 this ->pelec ->eferm , this ->pelec ->f_en , this ->pelec ->nelec_spin ,
@@ -1559,7 +1559,7 @@ void spinconstrain::SpinConstrain<std::complex<double>>::run_lambda_scan_diagnos
15591559
15601560 // Cache subspace data
15611561 const int nk = psi_t ->get_nk ();
1562- const int nbands = PARAM . inp . nbands ;
1562+ const int nbands = this -> nbands_ ;
15631563 const int nlocal = this ->ParaV ->nrow ;
15641564 int nn = nbands * nbands;
15651565 this ->lcao_nbands_ = nbands;
@@ -1729,7 +1729,7 @@ void spinconstrain::SpinConstrain<std::complex<double>>::run_lambda_scan_diagnos
17291729 ->update_lambda ();
17301730 }
17311731
1732- hsolver::HSolverLCAO<std::complex <double >> hsolver_full (this ->ParaV , PARAM . inp . ks_solver );
1732+ hsolver::HSolverLCAO<std::complex <double >> hsolver_full (this ->ParaV , this -> ks_solver_ );
17331733 hsolver_full.solve (hamilt_t , psi_t [0 ], this ->pelec , *this ->dm_ , *this ->pelec ->charge , this ->nspin_ , true );
17341734 elecstate::calculate_weights (this ->pelec ->ekb , this ->pelec ->wg , this ->pelec ->klist ,
17351735 this ->pelec ->eferm , this ->pelec ->f_en , this ->pelec ->nelec_spin ,
@@ -1809,7 +1809,7 @@ void spinconstrain::SpinConstrain<std::complex<double>>::run_trace_vs_dmr_diagno
18091809 int outer_step, double lambda_ref_ry)
18101810{
18111811#ifdef __LCAO
1812- if (PARAM . inp . basis_type != " lcao" ) return ;
1812+ if (this -> basis_type_ != " lcao" ) return ;
18131813 if (this ->nspin_ != 2 ) return ;
18141814
18151815 const int nat = this ->get_nat ();
@@ -1828,15 +1828,15 @@ void spinconstrain::SpinConstrain<std::complex<double>>::run_trace_vs_dmr_diagno
18281828 dynamic_cast <hamilt::DeltaSpin<hamilt::OperatorLCAO<std::complex <double >, double >>*>(this ->p_operator )
18291829 ->update_lambda ();
18301830
1831- hsolver::HSolverLCAO<std::complex <double >> hsolver_t (this ->ParaV , PARAM . inp . ks_solver );
1831+ hsolver::HSolverLCAO<std::complex <double >> hsolver_t (this ->ParaV , this -> ks_solver_ );
18321832 hsolver_t .solve (hamilt_t , psi_t [0 ], this ->pelec , *this ->dm_ , *this ->pelec ->charge , this ->nspin_ , true );
18331833 elecstate::calculate_weights (this ->pelec ->ekb , this ->pelec ->wg , this ->pelec ->klist ,
18341834 this ->pelec ->eferm , this ->pelec ->f_en , this ->pelec ->nelec_spin ,
18351835 this ->pelec ->skip_weights );
18361836 elecstate::calEBand (this ->pelec ->ekb , this ->pelec ->wg , this ->pelec ->f_en );
18371837
18381838 const int nk = psi_t ->get_nk ();
1839- const int nbands = PARAM . inp . nbands ;
1839+ const int nbands = this -> nbands_ ;
18401840 const int nlocal = this ->ParaV ->nrow ;
18411841 const int nn = nbands * nbands;
18421842 const int nloc_wfc = this ->ParaV ->nloc_wfc ;
0 commit comments