preprocessor now filters debug output
This commit is contained in:
@@ -85,14 +85,18 @@ void PoissonSolver::solvePotential(
|
||||
if (!(do_solver_) || !(solve)) {
|
||||
return;
|
||||
}
|
||||
#ifdef debug_level3
|
||||
DEBUG_LEVEL_3("Interpolating chargedensity.");
|
||||
#endif
|
||||
blitz::Array<double, 3> interpolated_density =
|
||||
interpolateDensityToPotentialGrid(charge_density);
|
||||
int it = 1;
|
||||
do {
|
||||
solverIteration(interpolated_density);
|
||||
if (it % 1000 == 0) {
|
||||
#ifdef debug_level3
|
||||
DEBUG_LEVEL_3("Poisson solver, iteration: " + std::to_string(it));
|
||||
#endif
|
||||
if (converged(interpolated_density)) {
|
||||
break;
|
||||
};
|
||||
@@ -235,14 +239,18 @@ bool PoissonSolver::converged(
|
||||
|
||||
normalized_difference =
|
||||
std::sqrt(cumulated_quadradic_difference / (nr * nth * nz));
|
||||
#ifdef debug
|
||||
DEBUG_LEVEL_0("Poisson solver reached a normalized difference of: " +
|
||||
std::to_string(normalized_difference));
|
||||
#endif
|
||||
double normalized_maximum =
|
||||
maximum_difference*SI::eps0/(fabs(blitz::max(interpolated_density)) + 1e-12);
|
||||
#ifdef debug_level1
|
||||
std::ostringstream message;
|
||||
message << "Maximum Difference normalized by order of magnitude: "
|
||||
<< normalized_difference;
|
||||
DEBUG_LEVEL_0(message.str());
|
||||
DEBUG_LEVEL_1(message.str());
|
||||
#endif
|
||||
return normalized_difference < target_accuracy_;
|
||||
}
|
||||
|
||||
@@ -250,7 +258,9 @@ blitz::Array<double, 3> PoissonSolver::potential() {
|
||||
// there might be a better way to do this... (if one can do array.memberValue without
|
||||
// explicitely looping)
|
||||
blitz::Array<double, 3> potentialValues(potential_.lbound(), potential_.extent());
|
||||
#ifdef debug_level3
|
||||
DEBUG_LEVEL_3("Extracting potential values");
|
||||
#endif
|
||||
for(int i = potential_.lbound(0); i <= potential_.ubound(0); ++i) {
|
||||
for(int j = potential_.lbound(1); j <= potential_.ubound(1); ++j) {
|
||||
for(int k = potential_.lbound(2); k <= potential_.ubound(2); ++k) {
|
||||
@@ -293,9 +303,10 @@ blitz::Array<double, 3> PoissonSolver::interpolateDensityToPotentialGrid(
|
||||
//might not work that way (if not needs a loop)
|
||||
interpolatedDensity(fixedIndex, blitz::Range::all(), blitz::Range::all()) /=
|
||||
potential_.extent(1);
|
||||
|
||||
#ifdef debug_level3
|
||||
DEBUG_LEVEL_3("Max Value in interpolated density array: " +
|
||||
std::to_string(blitz::max(interpolatedDensity)));
|
||||
#endif
|
||||
//for r=r_max, k=k_min and k=k_max do not use an interpolation,
|
||||
//since no boundary cell needs the information about its density value
|
||||
return interpolatedDensity;
|
||||
|
||||
Reference in New Issue
Block a user