Skip to content

Commit 07adf22

Browse files
committed
< feature > added a new parameter: out_element_info
whether or not output information of each element: default 0 // no output 1 // output all information of each element including local and nonlocal part in pseudopotential each orbital files of atom < range >input & module_cell & module_orbital & global_variable
1 parent f435464 commit 07adf22

File tree

9 files changed

+20
-8
lines changed

9 files changed

+20
-8
lines changed

source/input.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ void Input::Default(void)
265265
dos_edelta_ev = 0.01;//(ev)
266266
dos_scale = 0.01;
267267
b_coef = 0.07;
268+
out_element_info = false;
268269
//----------------------------------------------------------
269270
// LCAO
270271
//----------------------------------------------------------
@@ -1091,6 +1092,10 @@ bool Input::Read(const std::string &fn)
10911092
else if (strcmp("out_alllog", word) == 0)
10921093
{
10931094
read_value(ifs, out_alllog);
1095+
}
1096+
else if (strcmp("out_element_info", word) == 0)
1097+
{
1098+
read_value(ifs, out_element_info);
10941099
}
10951100
else if (strcmp("dos_emin_ev", word) == 0)
10961101
{
@@ -2234,6 +2239,7 @@ void Input::Bcast()
22342239
Parallel_Common::bcast_int( out_r_matrix ); // jingan add 2019-8-14
22352240
Parallel_Common::bcast_bool( out_lowf );
22362241
Parallel_Common::bcast_bool( out_alllog );
2242+
Parallel_Common::bcast_bool( out_element_info );
22372243

22382244
Parallel_Common::bcast_double( dos_emin_ev );
22392245
Parallel_Common::bcast_double( dos_emax_ev );

source/input.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ class Input
229229
int out_r_matrix; // jingan add 2019-8-14, output r(R) matrix.
230230
bool out_lowf; // output the wave functions in local basis.
231231
bool out_alllog; // output all logs.
232+
bool out_element_info; // output infomation of all element
232233

233234
double dos_emin_ev;
234235
double dos_emax_ev;

source/input_conv.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ void Input_Conv::Convert(void)
8383
GlobalV::PRESS1 = INPUT.press1;
8484
GlobalV::PRESS2 = INPUT.press2;
8585
GlobalV::PRESS3 = INPUT.press3;
86+
GlobalV::out_element_info = INPUT.out_element_info;
8687
#ifdef __LCAO
8788
Force_Stress_LCAO::force_invalid_threshold_ev = INPUT.force_thr_ev2;
8889
#endif

source/module_base/global_variable.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,4 +185,6 @@ bool out_descriptor = false; //caoyu add 2021-10-16 for DeePKS
185185
bool deepks_scf = false; //caoyu add 2021-10-16 for DeePKS
186186

187187
int vnl_method = 1; //set defauld vnl method as old, added by zhengdy 2021-10-11
188+
189+
bool out_element_info = false; //added by zhengdy 2021-11-26
188190
}

source/module_base/global_variable.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,5 +203,7 @@ extern bool deepks_scf; //caoyu add 2021-10-16 for DeePKS
203203
//method for dealing with non-local potential in Hamiltonian matrix, 0 for old, 1 for new
204204
extern int vnl_method;
205205

206+
//whether or not output information for each element
207+
extern bool out_element_info;
206208
}
207209
#endif

source/module_cell/setup_nonlocal.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ void InfoNonlocal::Set_NonLocal(
7979
dk,
8080
dr_uniform); // delta k mesh in reciprocal space
8181

82-
tmpBeta_lm[p1].plot(GlobalV::MY_RANK);
82+
if(GlobalV::out_element_info)tmpBeta_lm[p1].plot(GlobalV::MY_RANK);
8383

8484
delete[] beta_r;
8585

@@ -189,7 +189,7 @@ void InfoNonlocal::Set_NonLocal(
189189
dk,
190190
dr_uniform); // delta k mesh in reciprocal space
191191

192-
tmpBeta_lm[p1].plot(GlobalV::MY_RANK);
192+
if(GlobalV::out_element_info)tmpBeta_lm[p1].plot(GlobalV::MY_RANK);
193193

194194
delete[] beta_r;
195195
}
@@ -443,7 +443,7 @@ void InfoNonlocal::Read_NonLocal(
443443
dk,
444444
dr_uniform); // delta k mesh in reciprocal space
445445

446-
tmpBeta_lm[p1].plot(my_rank);
446+
if(GlobalV::out_element_info)tmpBeta_lm[p1].plot(my_rank);
447447

448448
delete[] radial_ps;
449449
delete[] rab_ps;

source/module_cell/unitcell_pseudo.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ void UnitCell_pseudo::setup_cell(
9999
ok2 = this->read_atom_positions(ifa, log, GlobalV::ofs_warning);
100100
#endif
101101

102-
if(ok2)
102+
if(ok2&&GlobalV::out_element_info)
103103
{
104104
for(int i=0;i<this->ntype;i++)
105105
{
@@ -197,7 +197,7 @@ void UnitCell_pseudo::setup_cell(
197197

198198
this->read_cell_pseudopots(s_pseudopot_dir, log);
199199

200-
if(GlobalV::MY_RANK == 0)
200+
if(GlobalV::MY_RANK == 0 && GlobalV::out_element_info)
201201
{
202202
for(int it=0; it<this->ntype; it++)
203203
{
@@ -380,7 +380,7 @@ void UnitCell_pseudo::setup_cell_classic(
380380
#else
381381
ok2 = this->read_atom_positions(ifa, ofs_running, ofs_warning);
382382
#endif
383-
if(ok2)
383+
if(ok2&&GlobalV::out_element_info)
384384
{
385385
for(int i=0;i<this->ntype;i++)
386386
{

source/module_orbital/ORB_read.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ void LCAO_Orbitals::read_orb_file(
556556
this->kmesh,
557557
this->dk,
558558
this->dr_uniform,
559-
true,
559+
GlobalV::out_element_info,
560560
true,
561561
force_flag); // delta k mesh in reciprocal space
562562

source/src_pw/VL_in_pw.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ void pseudopot_cell_vl::vloc_of_g(
205205
void pseudopot_cell_vl::print_vloc(void)const
206206
{
207207
if(GlobalV::MY_RANK!=0) return; //mohan fix bug 2011-10-13
208-
bool check_vl = true;
208+
bool check_vl = GlobalV::out_element_info;
209209
if(check_vl)
210210
{
211211
for(int it=0; it<GlobalC::ucell.ntype; it++)

0 commit comments

Comments
 (0)