built restart utilities

This commit is contained in:
2024-09-03 16:02:40 +02:00
parent c33629cb88
commit 9c45fce644
11 changed files with 341 additions and 7 deletions
+18
View File
@@ -355,6 +355,24 @@ const CylinderBinning* PoissonSolver::densityBinning() {
return &density_binning_;
}
void PoissonSolver::setPotential(blitz::Array<double, 3>& potential) {
// check if the loaded potential has the same size as the potential
// specified by the json file
if(!blitz::all(potential.length() == potential_.length())) {
std::stringstream out;
out << "The size of the potential is " << potential.length();
out << ". But expected a size of " << potential_.length();
ERROR(out.str());
}
for(int i = potential_.lbound(0); i <= potential_.ubound(0); ++i) {
for(int j = potential_.lbound(1); j <= potential_.ubound(1); ++j) {
for(int k = potential_.lbound(2); k <= potential_.ubound(2); ++k) {
potential_(i,j,k).value = potential(i,j,k);
}
}
}
}
Electrode::Electrode(double potential): potential_(potential) {};
double Electrode::electrodePotential() {