Poisson step and resets only after time resolution
This commit is contained in:
@@ -16,9 +16,7 @@ PoissonSolver::PoissonSolver(GlobalBoundary bottom_boundary,
|
||||
std::vector<std::shared_ptr<Electrode>> electrodes,
|
||||
double target_accuracy,
|
||||
int num_cycles,
|
||||
int solver_intervall,
|
||||
int solver_offset,
|
||||
bool reset_after_solving)
|
||||
bool do_solver)
|
||||
: bottom_boundary_(bottom_boundary),
|
||||
top_boundary_(top_boundary),
|
||||
hull_boundary_(hull_boundary),
|
||||
@@ -34,9 +32,7 @@ PoissonSolver::PoissonSolver(GlobalBoundary bottom_boundary,
|
||||
electrodes_(electrodes),
|
||||
target_accuracy_(target_accuracy),
|
||||
num_cycles_(num_cycles),
|
||||
solver_intervall_(solver_intervall),
|
||||
solver_offset_(solver_offset),
|
||||
reset_after_solving_(reset_after_solving) {
|
||||
do_solver_(do_solver) {
|
||||
|
||||
blitz::TinyVector<double, 3> stepsize = density_binning_.stepsize();
|
||||
for (int i = potential_.lbound(0); i <= potential_.ubound(0); ++i) {
|
||||
@@ -81,16 +77,12 @@ PoissonSolver::PoissonSolver(GlobalBoundary bottom_boundary,
|
||||
blitz::Range(density_binning.binIndexMin()(2),
|
||||
density_binning.binIndexMax()(2)));
|
||||
zero_chargedensity = 0.;
|
||||
bool reset;
|
||||
solvePotential(zero_chargedensity, 0, reset);
|
||||
solvePotential(zero_chargedensity, true);
|
||||
}
|
||||
|
||||
void PoissonSolver::solvePotential(
|
||||
const blitz::Array<double, 3> charge_density, int cpu_sync,
|
||||
bool& reset) {
|
||||
if ((cpu_sync % solver_intervall_ != 0) || ((cpu_sync <= solver_offset_)
|
||||
&& (cpu_sync > 0))) {
|
||||
reset = false;
|
||||
const blitz::Array<double, 3> charge_density, const bool solve) {
|
||||
if (!(do_solver_) && !(solve)) {
|
||||
return;
|
||||
}
|
||||
DEBUG_LEVEL_3("Interpolating chargedensity.");
|
||||
@@ -107,7 +99,6 @@ void PoissonSolver::solvePotential(
|
||||
}
|
||||
++it;
|
||||
} while (it < num_cycles_);
|
||||
reset = reset_after_solving_;
|
||||
}
|
||||
|
||||
void PoissonSolver::solverIteration(
|
||||
|
||||
Reference in New Issue
Block a user