Skip to content

Commit

Permalink
Fix warning in calculate_electric_field()
Browse files Browse the repository at this point in the history
  • Loading branch information
lmh91 committed Dec 18, 2018
1 parent 9838f45 commit 7c0ff95
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Potentials/CalculateElectricPotential.jl
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,13 @@ function calculate_electric_potential( det::SolidStateDetector;
abs_min::T = abs(minimum(cg.potential))
if det_tmp.bulk_type == :ntype cg.potential *= -1 end

abs_max_bv::T = abs(maximum(det.segment_bias_voltages))
abs_min_bv::T = abs(minimum(det.segment_bias_voltages))

# Checks
if bias_voltage_abs < abs_max + abs_min
# if abs_max > abs(det.segment_bias_voltages[1])
@warn "Detector not fully depleted at this bias voltage ($(det.segment_bias_voltages[1]) V). At least on grid point has a higher (or lower) potential value ($(sign(det.segment_bias_voltages[1]) * max(abs_max, abs_min)) V). This should not be."
@warn "Detector not fully depleted at this bias voltage ($( max(abs_max_bv, abs_min_bv) ) V). At least on grid point has a higher (or lower) potential value ($( max(abs_max, abs_min) ) V). This should not be. However, small overshoots might be due to over relaxation and not full convergence."
end
if !in(det.segment_bias_voltages[1], cg.potential)
@warn "Something is wrong. Applied bias voltage ($(det.segment_bias_voltages[1]) V) does not occur in the grid. This should not be since it is a fixed value."
Expand Down

0 comments on commit 7c0ff95

Please sign in to comment.