Added option to turn off Poisson solver,

regardless of offset & interval
This commit is contained in:
2024-06-27 11:07:25 +02:00
parent 1e1c84a211
commit f130274ea5
5 changed files with 18 additions and 8 deletions
+5 -1
View File
@@ -51,10 +51,14 @@ namespace generator {
int num_cycles = parameter.intValue(json_path_append({"PoissonSolver"},
{"NumCycles"}));
bool do_solver = parameter.boolValue(json_path_append({"PoissonSolver"},
{"DoSolver"}), true);
return std::shared_ptr<PoissonSolver>(new PoissonSolver(boundaries.at("Bottom"),
boundaries.at("Top"), boundaries.at("Hull"), geometry, position_binning,
electrodes, target_accuracy, num_cycles, solver_intervall, solver_offset));
electrodes, target_accuracy, num_cycles, solver_intervall, solver_offset,
do_solver));
}
std::map<std::string, GlobalBoundary> buildBoundaries(Parameter& parameter,
+6 -4
View File
@@ -17,7 +17,8 @@ PoissonSolver::PoissonSolver(GlobalBoundary bottom_boundary,
double target_accuracy,
int num_cycles,
int solver_intervall,
int solver_offset)
int solver_offset,
bool do_solver)
: bottom_boundary_(bottom_boundary),
top_boundary_(top_boundary),
hull_boundary_(hull_boundary),
@@ -34,7 +35,8 @@ PoissonSolver::PoissonSolver(GlobalBoundary bottom_boundary,
target_accuracy_(target_accuracy),
num_cycles_(num_cycles),
solver_intervall_(solver_intervall),
solver_offset_(solver_offset) {
solver_offset_(solver_offset),
do_solver_(do_solver) {
blitz::TinyVector<double, 3> stepsize = density_binning_.stepsize();
for (int i = potential_.lbound(0); i <= potential_.ubound(0); ++i) {
@@ -84,8 +86,8 @@ PoissonSolver::PoissonSolver(GlobalBoundary bottom_boundary,
void PoissonSolver::solvePotential(
const blitz::Array<double, 3> charge_density, int cpu_sync) {
if ((cpu_sync % solver_intervall_ != 0) || ((cpu_sync <= solver_offset_)
&& (cpu_sync > 0))) {
if ((!do_solver_) || ((cpu_sync % solver_intervall_ != 0) || ((cpu_sync <= solver_offset_)
&& (cpu_sync > 0)))) {
return;
}
DEBUG_LEVEL_3("Interpolating chargedensity.");