formatting adjustments

This commit is contained in:
2024-02-27 16:02:31 +01:00
parent 22cfb97087
commit 0471363834
4 changed files with 9 additions and 14 deletions
+6 -9
View File
@@ -31,7 +31,7 @@ PoissonSolver::PoissonSolver(GlobalBoundary bottom_boundary,
electrodes_(electrodes),
target_accuracy_(target_accuracy),
num_cycles_(num_cycles) {
// set inner values
blitz::TinyVector<double, 3> stepsize = density_binning_.stepsize();
for (int i = potential_.lbound(0); i <= potential_.ubound(0); ++i) {
for (int j = potential_.lbound(1); j <= potential_.ubound(1); ++j) {
@@ -204,11 +204,13 @@ bool PoissonSolver::converged(
std::sqrt(cumulated_quadradic_difference / (nr * nth * nz));
DEBUG_LEVEL_0("Poisson solver reached a normalized difference of: " +
std::to_string(normalized_difference));
double normalized_maximum =
maximum_difference*SI::eps0/(fabs(blitz::max(interpolated_density)) + 1e-12);
std::ostringstream message;
message << "Maximum Differenece normalized by order of magnitude: "
<< maximum_difference*SI::eps0/(fabs(blitz::max(interpolated_density)) + 1e-12);
<< normalized_difference;
DEBUG_LEVEL_0(message.str());
return maximum_difference*SI::eps0/(fabs(blitz::max(interpolated_density)) + 1e-12) < target_accuracy_;
return normalized_difference < target_accuracy_;
}
void PoissonSolver::solvePotential(
@@ -376,9 +378,4 @@ bool RearWall::isOnElectrode(const Coordinate& position) {
}
//PotentialGridPoint::PotentialGridPoint(BoundaryType _type, double _value): type(_type), value(_value) {};
//TODO:
// look for a function that calculates the E-Field from the potential (if it doesn't exist, one has to be written)
// get the "main" code to also output the potential if specified(for testing purposes)
// same for the electric field
// make sure .lbound(0) always makes sense as a replacement of r=0