@@ -86,52 +86,7 @@ void Grid_Technique::cal_nnrg()
8686 this ->nlocdimg [iat] += nelement;
8787 this ->nad [iat]++;
8888 ++count;
89-
90- /*
91- ofs << std::setw(10) << iat << std::setw(10) << iat2
92- << std::setw(10) << GlobalC::GridD.getBox(ad).x
93- << std::setw(10) << GlobalC::GridD.getBox(ad).y
94- << std::setw(10) << GlobalC::GridD.getBox(ad).z
95- << std::setw(20) << distance << std::endl;
96- */
9789 }
98- // there is another possibility that i and j are adjacent atoms.
99- // which is that <i|beta> are adjacents while <beta|j> are also
100- // adjacents, these considerations are only considered in k-point
101- // algorithm,
102- // mohan fix bug 2012-07-03
103- /*
104- else if(distance >= rcut)
105- {
106- for (int ad0 = 0; ad0 < GlobalC::GridD.getAdjacentNum()+1; ++ad0)
107- {
108- const int T0 = GlobalC::GridD.getType(ad0);
109- const int I0 = GlobalC::GridD.getNatom(ad0);
110- const int iat0 = GlobalC::ucell.itia2iat(T0, I0);
111- const int start0 = GlobalC::ucell.itiaiw2iwt(T0, I0, 0);
112-
113- tau0 = GlobalC::GridD.getAdjacentTau(ad0);
114- dtau1 = tau0 - tau1;
115- dtau2 = tau0 - tau2;
116-
117- double distance1 = dtau1.norm() * GlobalC::ucell.lat0;
118- double distance2 = dtau2.norm() * GlobalC::ucell.lat0;
119-
120- double rcut1 = GlobalC::ORB.Phi[T1].getRcut() + GlobalC::ucell.infoNL.Beta[T0].get_rcut_max();
121- double rcut2 = GlobalC::ORB.Phi[T2].getRcut() + GlobalC::ucell.infoNL.Beta[T0].get_rcut_max();
122-
123- if( distance1 < rcut1 && distance2 < rcut2 )
124- {
125- const int nelement = atom1->nw * atom2->nw;
126- this->nnrg += nelement;
127- this->nlocdimg[iat] += nelement;
128- this->nad[iat]++;
129- ++count;
130- break;
131- } // dis1, dis2
132- }//ad0
133- }//distance
134- */
13590 }// end iat2
13691 }// end ad
13792// GlobalV::ofs_running << " iat=" << iat << " nlocstartg=" << nlocstartg[iat] << " nad=" << nad[iat] << std::endl;
@@ -181,9 +136,6 @@ void Grid_Technique::cal_nnrg()
181136 }
182137 allocate_find_R2 = true ;
183138
184- // GlobalV::ofs_running << std::setw(5) << "b1" << std::setw(5) << "b2" << std::setw(5) << "b3"
185- // << std::setw(8) << "iat" << std::setw(8) << "ad" << std::setw(8) << "iat2"
186- // << std::setw(8) << "find_R2" << std::setw(8) << "find_R2st" << std::setw(8) << "dis" << std::endl;
187139 for (int T1 = 0 ; T1 < GlobalC::ucell.ntype ; T1++)
188140 {
189141 for (int I1 = 0 ; I1 < GlobalC::ucell.atoms [T1].na ; I1++)
@@ -203,7 +155,6 @@ void Grid_Technique::cal_nnrg()
203155 const int I2 = GlobalC::GridD.getNatom (ad);
204156 const int iat2 = GlobalC::ucell.itia2iat (T2,I2);
205157
206-
207158 // if this atom is in this processor.
208159 if (this ->in_this_processor [iat])
209160 {
@@ -216,28 +167,6 @@ void Grid_Technique::cal_nnrg()
216167 const int b1 = GlobalC::GridD.getBox (ad).x ;
217168 const int b2 = GlobalC::GridD.getBox (ad).y ;
218169 const int b3 = GlobalC::GridD.getBox (ad).z ;
219-
220- // for test
221- /*
222- if( this->cal_RindexAtom(b1, b2, b3, iat2) == 232 )
223- {
224- std::cout << " ====== nnrg =========" << std::endl;
225- std::cout << " index=" << cal_RindexAtom(b1, b2, b3, iat2) << std::endl;
226- std::cout << " iat=" << iat << " iat2=" << iat2 << std::endl;
227- std::cout << " R1 = " << tau1.x << " " << tau1.y << " " << tau1.z << std::endl;
228- std::cout << " R2 = " << GlobalC::GridD.getAdjacentTau(ad).x
229- << " " << GlobalC::GridD.getAdjacentTau(ad).y
230- << " " << GlobalC::GridD.getAdjacentTau(ad).z << std::endl;
231- std::cout << std::setprecision(25);
232- std::cout << " distance = " << distance << std::endl;
233- std::cout << " box = " << b1 << " " << b2 << " " << b3 << std::endl;
234- std::cout << " rcut = " << rcut << std::endl;
235- }
236- */
237-
238-
239- // std::cout << " iat=" << iat << " find_R2=" << this->cal_RindexAtom(b1, b2, b3, iat2) <<
240- // " b1=" << b1 << " b2=" << b2 << " b3=" << b3 << " iat2=" << iat2 << " distance=" << distance << std::endl;
241170
242171 // mohan fix bug 2011-06-26, should be '<', not '<='
243172 // if(distance < rcut)
@@ -258,19 +187,6 @@ void Grid_Technique::cal_nnrg()
258187 find_R2[iat][count] = this ->cal_RindexAtom (b1, b2, b3, iat2);
259188
260189
261- /* if(iat==50 && iat2==96)
262- {
263- GlobalV::ofs_running << " ************** iat=" << iat << " count=" << count << " find_R2=" << find_R2[iat][count] <<
264- " b1=" << b1 << " b2=" << b2 << " b3=" << b3 << " iat2=" << iat2 << " distance=" << distance
265- << " rcut=" << rcut <<std::endl;
266- }
267- else if(find_R2[iat][count]==10536)
268- {
269- GlobalV::ofs_running << " ************** iat=" << iat << " count=" << count << " find_R2=" << find_R2[iat][count] <<
270- " b1=" << b1 << " b2=" << b2 << " b3=" << b3 << " iat2=" << iat2 << " distance=" << distance
271- << " rcut=" << rcut <<std::endl;
272- }*/
273-
274190 // find_R2st
275191 // note: the first must be zero.
276192 // find_R2st: start position of each adjacen atom.
@@ -287,21 +203,6 @@ void Grid_Technique::cal_nnrg()
287203 }
288204 }
289205
290- // ---------
291- // for test
292- // ---------
293- /*
294- GlobalV::ofs_running << " print find_R2 " << std::endl;
295- for(int i=0; i<GlobalC::ucell.nat; i++)
296- {
297- for(int j=0; j<nad[i]; j++)
298- {
299- GlobalV::ofs_running << " i=" << i << " j=" << j << " find_R2=" << find_R2[i][j] << std::endl;
300- }
301- }
302- GlobalV::ofs_running << std::endl;
303- */
304-
305206 return ;
306207}
307208
@@ -330,25 +231,10 @@ void Grid_Technique::cal_max_box_index(void)
330231 }
331232 }
332233
333- /*
334- ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"maxB1",maxB1);
335- ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"maxB2",maxB2);
336- ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"maxB3",maxB3);
337- ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"minB1",minB1);
338- ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"minB2",minB2);
339- ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"minB3",minB3);
340- */
341-
342234 nB1 = maxB1-minB1+1 ;
343235 nB2 = maxB2-minB2+1 ;
344236 nB3 = maxB3-minB3+1 ;
345237
346- /*
347- ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"nB1",nB1);
348- ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"nB2",nB2);
349- ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"nB3",nB3);
350- */
351-
352238 nbox = nB1 * nB2 * nB3;
353239
354240 // ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"nbox",nbox);
0 commit comments