formatting adjustments
This commit is contained in:
@@ -20,7 +20,6 @@ enum class BoundaryType {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct PotentialGridPoint {
|
struct PotentialGridPoint {
|
||||||
//PotentialGridPoint(BoundaryType _type, double _value);
|
|
||||||
BoundaryType type;
|
BoundaryType type;
|
||||||
double value;
|
double value;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ CylinderBinning buildPositionBinning(json_t* object) {
|
|||||||
std::to_string(number_of_bins_azimuthal));
|
std::to_string(number_of_bins_azimuthal));
|
||||||
DEBUG_LEVEL_3("with number of bins longitudinal: " +
|
DEBUG_LEVEL_3("with number of bins longitudinal: " +
|
||||||
std::to_string(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 radius: " + std::to_string(max_radius) + "m");
|
||||||
DEBUG_LEVEL_3("with height: " + std::to_string(max_length));
|
DEBUG_LEVEL_3("with height: " + std::to_string(max_length) + "m");
|
||||||
|
|
||||||
return CylinderBinning(number_of_bins_radial, max_radius,
|
return CylinderBinning(number_of_bins_radial, max_radius,
|
||||||
number_of_bins_azimuthal,
|
number_of_bins_azimuthal,
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ PoissonSolver::PoissonSolver(GlobalBoundary bottom_boundary,
|
|||||||
electrodes_(electrodes),
|
electrodes_(electrodes),
|
||||||
target_accuracy_(target_accuracy),
|
target_accuracy_(target_accuracy),
|
||||||
num_cycles_(num_cycles) {
|
num_cycles_(num_cycles) {
|
||||||
// set inner values
|
|
||||||
blitz::TinyVector<double, 3> stepsize = density_binning_.stepsize();
|
blitz::TinyVector<double, 3> stepsize = density_binning_.stepsize();
|
||||||
for (int i = potential_.lbound(0); i <= potential_.ubound(0); ++i) {
|
for (int i = potential_.lbound(0); i <= potential_.ubound(0); ++i) {
|
||||||
for (int j = potential_.lbound(1); j <= potential_.ubound(1); ++j) {
|
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));
|
std::sqrt(cumulated_quadradic_difference / (nr * nth * nz));
|
||||||
DEBUG_LEVEL_0("Poisson solver reached a normalized difference of: " +
|
DEBUG_LEVEL_0("Poisson solver reached a normalized difference of: " +
|
||||||
std::to_string(normalized_difference));
|
std::to_string(normalized_difference));
|
||||||
|
double normalized_maximum =
|
||||||
|
maximum_difference*SI::eps0/(fabs(blitz::max(interpolated_density)) + 1e-12);
|
||||||
std::ostringstream message;
|
std::ostringstream message;
|
||||||
message << "Maximum Differenece normalized by order of magnitude: "
|
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());
|
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(
|
void PoissonSolver::solvePotential(
|
||||||
@@ -376,9 +378,4 @@ bool RearWall::isOnElectrode(const Coordinate& position) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//PotentialGridPoint::PotentialGridPoint(BoundaryType _type, double _value): type(_type), value(_value) {};
|
//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
|
|
||||||
@@ -31,8 +31,7 @@ blitz::Array<double, 3> initiateVolumeArray(
|
|||||||
|
|
||||||
const double bin_volume =
|
const double bin_volume =
|
||||||
M_PI * (std::pow(r2, 2) - std::pow(r1, 2)) * (z2 - z1) / phi.length();
|
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;
|
volume(ir, blitz::Range::all(), iz) = bin_volume;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user