diff --git a/include/poisson_solver/poisson_solver.h b/include/poisson_solver/poisson_solver.h index 108acfc..5a382ca 100755 --- a/include/poisson_solver/poisson_solver.h +++ b/include/poisson_solver/poisson_solver.h @@ -20,7 +20,6 @@ enum class BoundaryType { }; struct PotentialGridPoint { - //PotentialGridPoint(BoundaryType _type, double _value); BoundaryType type; double value; }; diff --git a/src/generators/binning_generator.cpp b/src/generators/binning_generator.cpp index 8ced801..240b8b4 100755 --- a/src/generators/binning_generator.cpp +++ b/src/generators/binning_generator.cpp @@ -42,8 +42,8 @@ CylinderBinning buildPositionBinning(json_t* object) { std::to_string(number_of_bins_azimuthal)); DEBUG_LEVEL_3("with number of bins longitudinal: " + std::to_string(number_of_bins_longitudinal)); - DEBUG_LEVEL_3("with radius: " + std::to_string(max_radius)); - DEBUG_LEVEL_3("with height: " + std::to_string(max_length)); + DEBUG_LEVEL_3("with radius: " + std::to_string(max_radius) + "m"); + DEBUG_LEVEL_3("with height: " + std::to_string(max_length) + "m"); return CylinderBinning(number_of_bins_radial, max_radius, number_of_bins_azimuthal, diff --git a/src/poisson_solver/poisson_solver.cpp b/src/poisson_solver/poisson_solver.cpp index 154aa99..b6eae08 100755 --- a/src/poisson_solver/poisson_solver.cpp +++ b/src/poisson_solver/poisson_solver.cpp @@ -31,7 +31,7 @@ PoissonSolver::PoissonSolver(GlobalBoundary bottom_boundary, electrodes_(electrodes), target_accuracy_(target_accuracy), num_cycles_(num_cycles) { - // set inner values + blitz::TinyVector 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 \ No newline at end of file + \ No newline at end of file diff --git a/src/simulation/density_field.cpp b/src/simulation/density_field.cpp index 7a2b5ac..73e2704 100755 --- a/src/simulation/density_field.cpp +++ b/src/simulation/density_field.cpp @@ -31,8 +31,7 @@ blitz::Array initiateVolumeArray( const double bin_volume = M_PI * (std::pow(r2, 2) - std::pow(r1, 2)) * (z2 - z1) / phi.length(); - if (ir == 0 && iz == -1) { - } + volume(ir, blitz::Range::all(), iz) = bin_volume; } }