@@ -142,53 +142,6 @@ void DeePKS_domain::cal_gdmx(const int lmaxd,
142142 return ;
143143}
144144
145- void DeePKS_domain::check_gdmx (const torch::Tensor& gdmx)
146- {
147- std::stringstream ss;
148- std::ofstream ofs_x;
149- std::ofstream ofs_y;
150- std::ofstream ofs_z;
151-
152- ofs_x << std::setprecision (10 );
153- ofs_y << std::setprecision (10 );
154- ofs_z << std::setprecision (10 );
155-
156- // size: [3][natom][inlmax][nm][nm]
157- auto size = gdmx.sizes ();
158- auto accessor = gdmx.accessor <double , 5 >();
159- for (int ia = 0 ; ia < size[1 ]; ia++)
160- {
161- ss.str (" " );
162- ss << " gdmx_" << ia << " .dat" ;
163- ofs_x.open (ss.str ().c_str ());
164- ss.str (" " );
165- ss << " gdmy_" << ia << " .dat" ;
166- ofs_y.open (ss.str ().c_str ());
167- ss.str (" " );
168- ss << " gdmz_" << ia << " .dat" ;
169- ofs_z.open (ss.str ().c_str ());
170-
171- for (int inl = 0 ; inl < size[2 ]; inl++)
172- {
173- for (int m1 = 0 ; m1 < size[3 ]; m1++)
174- {
175- for (int m2 = 0 ; m2 < size[4 ]; m2++)
176- {
177- ofs_x << accessor[0 ][ia][inl][m1][m2] << " " ;
178- ofs_y << accessor[1 ][ia][inl][m1][m2] << " " ;
179- ofs_z << accessor[2 ][ia][inl][m1][m2] << " " ;
180- }
181- }
182- ofs_x << std::endl;
183- ofs_y << std::endl;
184- ofs_z << std::endl;
185- }
186- ofs_x.close ();
187- ofs_y.close ();
188- ofs_z.close ();
189- }
190- }
191-
192145// calculates gradient of descriptors from gradient of projected density matrices
193146void DeePKS_domain::cal_gvx (const int nat,
194147 const int inlmax,
@@ -243,55 +196,6 @@ void DeePKS_domain::cal_gvx(const int nat,
243196 return ;
244197}
245198
246- void DeePKS_domain::check_gvx (const torch::Tensor& gvx, const int rank)
247- {
248- std::stringstream ss;
249- std::ofstream ofs_x;
250- std::ofstream ofs_y;
251- std::ofstream ofs_z;
252-
253- if (rank != 0 )
254- {
255- return ;
256- }
257-
258- auto size = gvx.sizes ();
259- auto accessor = gvx.accessor <double , 4 >();
260-
261- for (int ia = 0 ; ia < size[0 ]; ia++)
262- {
263- ss.str (" " );
264- ss << " gvx_" << ia << " .dat" ;
265- ofs_x.open (ss.str ().c_str ());
266- ss.str (" " );
267- ss << " gvy_" << ia << " .dat" ;
268- ofs_y.open (ss.str ().c_str ());
269- ss.str (" " );
270- ss << " gvz_" << ia << " .dat" ;
271- ofs_z.open (ss.str ().c_str ());
272-
273- ofs_x << std::setprecision (10 );
274- ofs_y << std::setprecision (10 );
275- ofs_z << std::setprecision (10 );
276-
277- for (int ib = 0 ; ib < size[2 ]; ib++)
278- {
279- for (int nlm = 0 ; nlm < size[3 ]; nlm++)
280- {
281- ofs_x << accessor[ia][0 ][ib][nlm] << " " ;
282- ofs_y << accessor[ia][1 ][ib][nlm] << " " ;
283- ofs_z << accessor[ia][2 ][ib][nlm] << " " ;
284- }
285- ofs_x << std::endl;
286- ofs_y << std::endl;
287- ofs_z << std::endl;
288- }
289- ofs_x.close ();
290- ofs_y.close ();
291- ofs_z.close ();
292- }
293- }
294-
295199template void DeePKS_domain::cal_gdmx<double >(const int lmaxd,
296200 const int inlmax,
297201 const int nks,
0 commit comments