@@ -71,8 +71,6 @@ GPESolver::GPESolver(Permittivity e, const Nuclei &N, PoissonOperator_p P, Deriv
71
71
, poisson(P) {
72
72
setDCavity ();
73
73
rho_nuc = chemistry::compute_nuclear_density (this ->apply_prec , N, 1000 );
74
- std::cout << " norm of rho_nuc: " << rho_nuc.norm () << std::endl;
75
- std::cout << " integral of rho_nuc: " << rho_nuc.integrate () << std::endl;
76
74
}
77
75
78
76
GPESolver::~GPESolver () {
@@ -115,10 +113,10 @@ void GPESolver::computeDensities(OrbitalVector &Phi) {
115
113
rho_el.rescale (-1.0 );
116
114
if (this ->density_type == " electronic" ) {
117
115
mrcpp::cplxfunc::deep_copy (this ->rho_tot , rho_el);
116
+
118
117
} else if (this ->density_type == " nuclear" ) {
119
118
mrcpp::cplxfunc::deep_copy (this ->rho_tot , this ->rho_nuc );
120
- std::cout << " norm of rho_tot: " << this ->rho_tot .norm () << std::endl;
121
- std::cout << " integral of rho_tot: " << this ->rho_tot .integrate () << std::endl;
119
+
122
120
} else {
123
121
mrcpp::cplxfunc::add (this ->rho_tot , 1.0 , rho_el, 1.0 , this ->rho_nuc , -1.0 ); // probably change this into a vector
124
122
}
@@ -131,8 +129,6 @@ void GPESolver::computeGamma(mrcpp::ComplexFunction &potential, mrcpp::ComplexFu
131
129
mrcpp::dot (this ->apply_prec , out_gamma.real (), d_V, this ->d_cavity );
132
130
out_gamma.rescale (std::log ((epsilon.getEpsIn () / epsilon.getEpsOut ())) * (1.0 / (4.0 * mrcpp::pi )));
133
131
mrcpp::clear (d_V, true );
134
- std::cout << " norm of gamma: " << out_gamma.norm () << std::endl;
135
- std::cout << " integral of gamma: " << out_gamma.integrate () << std::endl;
136
132
}
137
133
138
134
mrcpp::ComplexFunction GPESolver::solvePoissonEquation (const mrcpp::ComplexFunction &in_gamma) {
@@ -150,9 +146,6 @@ mrcpp::ComplexFunction GPESolver::solvePoissonEquation(const mrcpp::ComplexFunct
150
146
mrcpp::cplxfunc::multiply (first_term, this ->rho_tot , eps_inv, this ->apply_prec );
151
147
mrcpp::cplxfunc::add (rho_eff, 1.0 , first_term, -1.0 , this ->rho_tot , -1.0 );
152
148
153
- std::cout << " norm of rho_eff: " << rho_eff.norm () << std::endl;
154
- std::cout << " integral of rho_eff: " << rho_eff.integrate () << std::endl;
155
-
156
149
mrcpp::cplxfunc::add (Poisson_func, 1.0 , in_gamma, 1.0 , rho_eff, -1.0 );
157
150
mrcpp::apply (this ->apply_prec , Vr.real (), *poisson, Poisson_func.real ());
158
151
@@ -185,15 +178,12 @@ void GPESolver::runMicroIterations(mrcpp::ComplexFunction V_vac) {
185
178
auto update = 10.0 , norm = 1.0 ;
186
179
187
180
auto iter = 1 ;
188
- std::cout << " convergence threshold: " << this ->conv_thrs << std::endl;
189
181
for (; iter <= max_iter; iter++) {
190
182
191
183
Timer t_iter;
192
184
mrcpp::ComplexFunction Vr_np1;
193
185
// solve the poisson equation
194
186
Vr_np1 = solvePoissonEquation (this ->gamma_n );
195
- std::cout << " norm of Vr_np1: " << Vr_np1.norm () << std::endl;
196
- std::cout << " integral of Vr_np1: " << Vr_np1.integrate () << std::endl;
197
187
198
188
norm = Vr_np1.norm ();
199
189
@@ -207,7 +197,6 @@ void GPESolver::runMicroIterations(mrcpp::ComplexFunction V_vac) {
207
197
mrcpp::cplxfunc::add (Vr_np1, 1.0 , Vr_n, 1.0 , dVr_n, -1.0 );
208
198
}
209
199
update = dVr_n.norm ();
210
- std::cout << " total energy at iteration " << iter << " : " << getTotalEnergy () << std::endl;
211
200
// set up for next iteration
212
201
mrcpp::ComplexFunction V_tot;
213
202
mrcpp::cplxfunc::add (V_tot, 1.0 , Vr_np1, 1.0 , V_vac, -1.0 );
@@ -229,9 +218,7 @@ void GPESolver::runMicroIterations(mrcpp::ComplexFunction V_vac) {
229
218
updateCurrentGamma (gamma_np1);
230
219
printConvergenceRow (iter, norm, update, t_iter.elapsed ());
231
220
232
- std::cout << " update: " << update << std::endl;
233
221
// compute new PB term
234
- std::cout << " update " << update << " convergence threshold " << this ->conv_thrs << std::endl;
235
222
if (update < this ->conv_thrs ) break ;
236
223
}
237
224
@@ -268,15 +255,13 @@ void GPESolver::printConvergenceRow(int i, double norm, double update, double ti
268
255
println (3 , o_txt.str ());
269
256
}
270
257
271
- mrcpp::ComplexFunction &GPESolver::solveEquation (double prec, const OrbitalVector_p &Phi) {
258
+ mrcpp::ComplexFunction &GPESolver::iterateEquation (double prec, const OrbitalVector_p &Phi) {
272
259
this ->apply_prec = prec;
273
260
computeDensities (*Phi);
274
261
Timer t_vac;
275
262
mrcpp::ComplexFunction V_vac;
276
263
V_vac.alloc (NUMBER::Real);
277
264
mrcpp::apply (this ->apply_prec , V_vac.real (), *poisson, this ->rho_tot .real ());
278
- std::cout << " norm of V_vac: " << V_vac.norm () << std::endl;
279
- std::cout << " integral of V_vac: " << V_vac.integrate () << std::endl;
280
265
print_utils::qmfunction (3 , " Vacuum potential" , V_vac, t_vac);
281
266
282
267
// set up the zero-th iteration potential and gamma, so the first iteration gamma and potentials can be made
@@ -286,17 +271,13 @@ mrcpp::ComplexFunction &GPESolver::solveEquation(double prec, const OrbitalVecto
286
271
mrcpp::ComplexFunction gamma_0;
287
272
mrcpp::ComplexFunction V_tot;
288
273
computeGamma (V_vac, gamma_0);
289
- std::cout << " norm of gamma_n at zeroth iteration: " << gamma_0.norm () << std::endl;
290
- std::cout << " integral of gamma_n at zeroth iteration: " << gamma_0.integrate () << std::endl;
274
+
291
275
this ->Vr_n = solvePoissonEquation (gamma_0);
292
- std::cout << " total energy at zeroth iteration" << getTotalEnergy () << std::endl;
293
- std::cout << " norm of Vr_n at zeroth iteration: " << this ->Vr_n .norm () << std::endl;
294
- std::cout << " integral of Vr_n at zeroth iteration: " << this ->Vr_n .integrate () << std::endl;
276
+
295
277
mrcpp::cplxfunc::add (V_tot, 1.0 , V_vac, 1.0 , this ->Vr_n , -1.0 );
296
278
computeGamma (V_tot, this ->gamma_n );
297
279
}
298
- std::cout << " norm of gamma_n at first iteration: " << this ->gamma_n .norm () << std::endl;
299
- std::cout << " integral of gamma_n at first iteration: " << this ->gamma_n .integrate () << std::endl;
280
+
300
281
// update the potential/gamma with the previous scf cycle kain update before doing anything with them
301
282
302
283
if (accelerate_Vr) {
@@ -308,16 +289,7 @@ mrcpp::ComplexFunction &GPESolver::solveEquation(double prec, const OrbitalVecto
308
289
mrcpp::cplxfunc::add (V_tot, 1.0 , this ->Vr_n , 1.0 , V_vac, -1.0 );
309
290
resetComplexFunction (this ->gamma_n );
310
291
computeGamma (V_tot, this ->gamma_n );
311
- // std::cout << "apply prec " << this->apply_prec << std::endl;
312
- // std::cout << "conv thrs " << this->conv_thrs << std::endl;
313
- // std::cout << "difference between them " << this->conv_thrs - this->apply_prec << std::endl;
314
- // if (std::abs(this->conv_thrs - this->apply_prec) <= mrcpp::MachineZero) {
315
- // std::cout << "does this ever work?" << std::endl;
316
- // this->salt_factor = 1.0;
317
- // computePBTerm(V_tot, this->salt_factor);
318
- // } else {
319
- // this->salt_factor = 0.0;
320
- // }
292
+
321
293
} else {
322
294
mrcpp::ComplexFunction temp_gamma_n;
323
295
mrcpp::cplxfunc::add (temp_gamma_n, 1.0 , this ->gamma_n , 1.0 , this ->dgamma_n , -1.0 );
0 commit comments