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
+3 -1
View File
@@ -56,7 +56,8 @@ class PoissonSolver {
double target_accuracy,
int num_cycles,
int solver_intervall,
int solver_offset);
int solver_offset,
bool do_solver);
void solvePotential(const blitz::Array<double, 3> charge_density,
int cpu_sync);
@@ -75,6 +76,7 @@ class PoissonSolver {
const int num_cycles_;
const int solver_intervall_;
const int solver_offset_;
const bool do_solver_;
// density binning defined on the cell centers, potential defined
// such that it exists on the cell edges so that the azimuthal
+2 -1
View File
@@ -625,7 +625,8 @@
"TargetAccuracy": 1e-7,
"NumCycles": 2e4,
"Intervall": 1,
"Offset": 9
"Offset": 9,
"DoSolver": "true"
},
"Simulation": {
"SimulatedEvents": 1,
@@ -616,7 +616,8 @@
"Simulation": {
"SimulatedEvents": 1,
"EventStride": 1,
"PoissonOffset": 0
"PoissonOffset": 0,
"DoSolver": "false"
},
"Output": {
"folder": "output",
+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.");