Restructuring of poisson solver offset;

inclusion of stride for poisson solver
This commit is contained in:
2024-03-28 15:57:04 +01:00
parent 26f730ca29
commit 52a580ac63
4 changed files with 60 additions and 39 deletions
+15 -1
View File
@@ -30,6 +30,20 @@ namespace generator {
auto boundaries = buildBoundaries(parameter, {"PoissonSolver", "Boundary"});
int solver_intervall = json_int(json_object_by_path(object, {"Intervall"}));
if (solver_intervall == 0 &&
json_string(json_object_by_path(
object, {"Intervall"})) == "EachSync") {
solver_intervall = 1;
}
ASSERT_POSITIVE(&solver_intervall,
"The intervall for poisson solver stride must be positive"
" or 'EachSync'");
int solver_offset = json_int(json_object_by_path(object, {"Offset"}));
ASSERT_NOTNEGATIVE(&solver_offset,
"The offset for poisson solver has to be non-negative");
std::vector<std::shared_ptr<Electrode>> electrodes{};
double target_accuracy = parameter.doubleValue(
@@ -40,7 +54,7 @@ namespace generator {
return std::shared_ptr<PoissonSolver>(new PoissonSolver(boundaries.at("Bottom"),
boundaries.at("Top"), boundaries.at("Hull"), geometry, position_binning,
electrodes, target_accuracy, num_cycles));
electrodes, target_accuracy, num_cycles, solver_intervall, solver_offset));
}
std::map<std::string, GlobalBoundary> buildBoundaries(Parameter& parameter,