Merge branch 'poisson_solver' of masterduck.fspanier.de:katrin/karl into poisson_solver
This commit is contained in:
@@ -56,7 +56,8 @@ class PoissonSolver {
|
|||||||
double target_accuracy,
|
double target_accuracy,
|
||||||
int num_cycles,
|
int num_cycles,
|
||||||
int solver_intervall,
|
int solver_intervall,
|
||||||
int solver_offset);
|
int solver_offset,
|
||||||
|
bool do_solver);
|
||||||
|
|
||||||
void solvePotential(const blitz::Array<double, 3> charge_density,
|
void solvePotential(const blitz::Array<double, 3> charge_density,
|
||||||
int cpu_sync);
|
int cpu_sync);
|
||||||
@@ -75,6 +76,7 @@ class PoissonSolver {
|
|||||||
const int num_cycles_;
|
const int num_cycles_;
|
||||||
const int solver_intervall_;
|
const int solver_intervall_;
|
||||||
const int solver_offset_;
|
const int solver_offset_;
|
||||||
|
const bool do_solver_;
|
||||||
|
|
||||||
// density binning defined on the cell centers, potential defined
|
// density binning defined on the cell centers, potential defined
|
||||||
// such that it exists on the cell edges so that the azimuthal
|
// such that it exists on the cell edges so that the azimuthal
|
||||||
|
|||||||
@@ -54,6 +54,13 @@
|
|||||||
"yValuesKey": "/vz(ms)",
|
"yValuesKey": "/vz(ms)",
|
||||||
"prefactor": 1
|
"prefactor": 1
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"f5": {
|
||||||
|
"Exponential": {
|
||||||
|
"scale": -1,
|
||||||
|
"prefactor": 1,
|
||||||
|
"comment": "f5 = prefactor*exp(scale*x)"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"3dto1D examples": {
|
"3dto1D examples": {
|
||||||
|
|||||||
@@ -568,6 +568,15 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"GradientField": {
|
||||||
|
"VectorFieldFunctionInZ": {
|
||||||
|
"zFunction": {
|
||||||
|
"Constant3D": {
|
||||||
|
"constant": 2.5
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"GravityField": {
|
"GravityField": {
|
||||||
@@ -616,7 +625,8 @@
|
|||||||
"TargetAccuracy": 1e-7,
|
"TargetAccuracy": 1e-7,
|
||||||
"NumCycles": 2e4,
|
"NumCycles": 2e4,
|
||||||
"Intervall": 1,
|
"Intervall": 1,
|
||||||
"Offset": 9
|
"Offset": 9,
|
||||||
|
"DoSolver": "true"
|
||||||
},
|
},
|
||||||
"Simulation": {
|
"Simulation": {
|
||||||
"SimulatedEvents": 1,
|
"SimulatedEvents": 1,
|
||||||
@@ -639,9 +649,7 @@
|
|||||||
"OverwriteLast": "true"
|
"OverwriteLast": "true"
|
||||||
},
|
},
|
||||||
"DeletionLogger": {
|
"DeletionLogger": {
|
||||||
"Species": [
|
"Species": "all",
|
||||||
"all"
|
|
||||||
],
|
|
||||||
"Intervall": "EachSync",
|
"Intervall": "EachSync",
|
||||||
"OverwriteLast": "true"
|
"OverwriteLast": "true"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -565,6 +565,15 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"GradientField": {
|
||||||
|
"VectorFieldFunctionInZ": {
|
||||||
|
"zFunction": {
|
||||||
|
"Constant3D": {
|
||||||
|
"constant": 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"PoissonSolver": {
|
"PoissonSolver": {
|
||||||
@@ -585,13 +594,30 @@
|
|||||||
"GlobalPositionBinning"
|
"GlobalPositionBinning"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"Boundary": {
|
||||||
|
"Top": {
|
||||||
|
"type": "neumann",
|
||||||
|
"value": 0
|
||||||
|
},
|
||||||
|
"Bottom": {
|
||||||
|
"type": "dirichlet",
|
||||||
|
"value": 0
|
||||||
|
},
|
||||||
|
"Hull": {
|
||||||
|
"type": "dirichlet",
|
||||||
|
"value": 0
|
||||||
|
}
|
||||||
|
},
|
||||||
"TargetAccuracy": 1e-7,
|
"TargetAccuracy": 1e-7,
|
||||||
"NumCycles": 2e4
|
"NumCycles": 2e4,
|
||||||
|
"Intervall": 1,
|
||||||
|
"Offset": 0
|
||||||
},
|
},
|
||||||
"Simulation": {
|
"Simulation": {
|
||||||
"SimulatedEvents": 1,
|
"SimulatedEvents": 1,
|
||||||
"EventStride": 1,
|
"EventStride": 1,
|
||||||
"PoissonOffset": 0
|
"PoissonOffset": 0,
|
||||||
|
"DoSolver": "false"
|
||||||
},
|
},
|
||||||
"Output": {
|
"Output": {
|
||||||
"folder": "output",
|
"folder": "output",
|
||||||
|
|||||||
@@ -51,10 +51,14 @@ namespace generator {
|
|||||||
|
|
||||||
int num_cycles = parameter.intValue(json_path_append({"PoissonSolver"},
|
int num_cycles = parameter.intValue(json_path_append({"PoissonSolver"},
|
||||||
{"NumCycles"}));
|
{"NumCycles"}));
|
||||||
|
|
||||||
|
bool do_solver = parameter.boolValue(json_path_append({"PoissonSolver"},
|
||||||
|
{"DoSolver"}), true);
|
||||||
|
|
||||||
return std::shared_ptr<PoissonSolver>(new PoissonSolver(boundaries.at("Bottom"),
|
return std::shared_ptr<PoissonSolver>(new PoissonSolver(boundaries.at("Bottom"),
|
||||||
boundaries.at("Top"), boundaries.at("Hull"), geometry, position_binning,
|
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,
|
std::map<std::string, GlobalBoundary> buildBoundaries(Parameter& parameter,
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ PoissonSolver::PoissonSolver(GlobalBoundary bottom_boundary,
|
|||||||
double target_accuracy,
|
double target_accuracy,
|
||||||
int num_cycles,
|
int num_cycles,
|
||||||
int solver_intervall,
|
int solver_intervall,
|
||||||
int solver_offset)
|
int solver_offset,
|
||||||
|
bool do_solver)
|
||||||
: bottom_boundary_(bottom_boundary),
|
: bottom_boundary_(bottom_boundary),
|
||||||
top_boundary_(top_boundary),
|
top_boundary_(top_boundary),
|
||||||
hull_boundary_(hull_boundary),
|
hull_boundary_(hull_boundary),
|
||||||
@@ -34,7 +35,8 @@ PoissonSolver::PoissonSolver(GlobalBoundary bottom_boundary,
|
|||||||
target_accuracy_(target_accuracy),
|
target_accuracy_(target_accuracy),
|
||||||
num_cycles_(num_cycles),
|
num_cycles_(num_cycles),
|
||||||
solver_intervall_(solver_intervall),
|
solver_intervall_(solver_intervall),
|
||||||
solver_offset_(solver_offset) {
|
solver_offset_(solver_offset),
|
||||||
|
do_solver_(do_solver) {
|
||||||
|
|
||||||
blitz::TinyVector<double, 3> stepsize = density_binning_.stepsize();
|
blitz::TinyVector<double, 3> stepsize = density_binning_.stepsize();
|
||||||
for (int i = potential_.lbound(0); i <= potential_.ubound(0); ++i) {
|
for (int i = potential_.lbound(0); i <= potential_.ubound(0); ++i) {
|
||||||
@@ -84,8 +86,8 @@ PoissonSolver::PoissonSolver(GlobalBoundary bottom_boundary,
|
|||||||
|
|
||||||
void PoissonSolver::solvePotential(
|
void PoissonSolver::solvePotential(
|
||||||
const blitz::Array<double, 3> charge_density, int cpu_sync) {
|
const blitz::Array<double, 3> charge_density, int cpu_sync) {
|
||||||
if ((cpu_sync % solver_intervall_ != 0) || ((cpu_sync <= solver_offset_)
|
if ((!do_solver_) || ((cpu_sync % solver_intervall_ != 0) || ((cpu_sync <= solver_offset_)
|
||||||
&& (cpu_sync > 0))) {
|
&& (cpu_sync > 0)))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DEBUG_LEVEL_3("Interpolating chargedensity.");
|
DEBUG_LEVEL_3("Interpolating chargedensity.");
|
||||||
|
|||||||
Reference in New Issue
Block a user