22 std::cerr <<
m_className <<
"::Setup: Epsilon must be >= 1.\n";
30 m_ezg = -m_eps * m_V / (m_b + m_eps * m_g);
31 m_ezb = -m_V / (m_b + m_eps * m_g);
37 std::cout <<
m_className <<
"::Setup: Geometry set.\n";
41 double& x1,
double& y1,
47 x0 = -std::numeric_limits<double>::infinity();
48 y0 = -std::numeric_limits<double>::infinity();
49 x1 = +std::numeric_limits<double>::infinity();
50 y1 = +std::numeric_limits<double>::infinity();
57double ComponentParallelPlate::IntegrateField(
const Electrode& el,
int comp,
58 const double x,
const double y,
61 case structureelectrode::Plane: {
62 if (comp == fieldcomponent::zcomp)
63 return m_eps * m_Vw / (m_b + m_eps * m_g);
67 case structureelectrode::Pixel: {
68 auto WFieldPixel = [=](
double* k,
double* ) {
72 double K = std::sqrt(kx * kx + ky * ky);
77 case fieldcomponent::xcomp: {
78 intsol *= 1. / (ky * cosh(m_g * K) * sinh(m_b * K) +
79 m_eps * ky * cosh(m_b * K) * sinh(m_g * K));
81 intsol *= cos(ky * (y - el.ypos)) * sin((kx * el.lx) / 2) *
82 sin((ky * el.ly) / 2) * sin(kx * (x - el.xpos)) *
86 case fieldcomponent::ycomp: {
87 intsol *= 1. / (kx * cosh(m_g * K) * sinh(m_b * K) +
88 m_eps * kx * cosh(m_b * K) * sinh(m_g * K));
89 intsol *=
sin(ky * (y - el.ypos)) *
sin((kx * el.lx) / 2) *
90 sin((ky * el.ly) / 2) *
cos(kx * (x - el.xpos)) *
94 case fieldcomponent::zcomp: {
95 intsol *= 1. / (ky * kx * cosh(m_g * K) * sinh(m_b * K) +
96 m_eps * ky * kx * cosh(m_b * K) * sinh(m_g * K));
97 intsol *= K *
cos(ky * (y - el.ypos)) *
sin((kx * el.lx) / 2) *
98 sin((ky * el.ly) / 2) *
cos(kx * (x - el.xpos)) *
106 new TF2(
"WFieldPixel", WFieldPixel, 0, 10 * m_g, 0, 10 * m_g, 0);
107 const double sol = fw->Integral(0, 10 * m_g, 0, 10 * m_g, 1.e-6);
109 return (4 * m_eps * m_Vw / Pi2) * sol;
113 case structureelectrode::Strip: {
114 auto WFieldStrip = [=](
double* k,
double* ) {
117 double intsol = 1. / ((cosh(m_g * kk) * sinh(m_b * kk) +
118 m_eps * cosh(m_b * kk) * sinh(m_g * kk)));
120 case fieldcomponent::xcomp: {
121 intsol *= (
sin(kk * el.lx / 2) *
sin(kk * (x - el.xpos)) *
122 sinh(kk * (m_g - z)));
125 case fieldcomponent::zcomp: {
126 intsol *= (
sin(kk * el.lx / 2) *
cos(kk * (x - el.xpos)) *
127 cosh(kk * (m_g - z)));
138 TF1* fw =
new TF1(
"WFieldStrip", WFieldStrip, 0, 10 * m_g, 0);
139 double sol = fw->Integral(0, 10 * m_g);
141 return (2 * m_eps * m_Vw / Pi) * sol;
145 std::cerr <<
m_className <<
"::IntegrateField: Unknown electrode type.\n";
151double ComponentParallelPlate::IntegrateDelayedField(
const Electrode& el,
152 int comp,
const double x,
157 case structureelectrode::Plane: {
158 if (comp == fieldcomponent::zcomp)
159 return m_eps * m_Vw *
160 (1 -
exp(-t * m_g * m_sigma / (m_eps0 * (m_b + m_eps * m_g)))) /
165 case structureelectrode::Pixel: {
166 auto WFieldPixel = [=](
double* k,
double* ) {
170 double K = std::sqrt(kx * kx + ky * ky);
172 double tau = m_eps0 *
173 (m_eps + cosh(m_g * K) * sinh(m_b * K) /
174 (cosh(m_b * K) * sinh(m_g * K))) *
177 double intsol = 1. / (cosh(m_g * K) * sinh(m_b * K) +
178 m_eps * cosh(m_b * K) * sinh(m_g * K));
181 case fieldcomponent::xcomp: {
182 intsol *= (1 -
exp(-t / tau)) *
cos(ky * (y - el.ypos)) *
183 cosh(m_g * K) *
sin((kx * el.lx) / 2) *
184 sin(kx * (x - el.xpos)) * sinh(K * (m_g - z)) *
185 tanh(m_b * K) / (ky * sinh(m_g * K));
188 case fieldcomponent::ycomp: {
189 intsol *= (1 -
exp(-t / tau)) *
sin(ky * (y - el.ypos)) *
190 cosh(m_g * K) *
sin((kx * el.lx) / 2) *
191 cos(kx * (x - el.xpos)) * cosh(K * (m_g - z)) *
192 tanh(m_b * K) / (kx * sinh(m_g * K));
195 case fieldcomponent::zcomp: {
196 intsol *= (1 -
exp(-t / tau)) *
cos(ky * (y - el.ypos)) *
197 cosh(m_g * K) *
sin((K * el.lx) / 2) *
198 cos(kx * (x - el.xpos)) * cosh(K * (m_g - z)) *
199 tanh(m_b * K) / (kx * ky * sinh(m_g * K));
207 new TF2(
"WFieldPixel", WFieldPixel, 0, 10 * m_g, 0, 10 * m_g, 0);
208 const double sol = fw->Integral(0, 10 * m_g, 0, 10 * m_g, 1.e-6);
210 return (4 * m_eps * m_Vw / Pi2) * sol;
213 case structureelectrode::Strip: {
214 auto WFieldStrip = [=](
double* k,
double* ) {
216 double tau = m_eps0 *
217 (m_eps + cosh(m_g * kk) * sinh(m_b * kk) /
218 (cosh(m_b * kk) * sinh(m_g * kk))) *
221 double intsol = 1 / (cosh(m_g * kk) * sinh(m_b * kk) +
222 m_eps * cosh(m_b * kk) * sinh(m_g * kk));
224 case fieldcomponent::xcomp: {
225 intsol *= (1 -
exp(-t / tau)) * cosh(m_g * kk) *
226 sin((kk * el.lx) / 2) *
sin(kk * (x - el.xpos)) *
227 sinh(kk * (m_g - z)) * tanh(m_b * kk) / sinh(m_g * kk);
230 case fieldcomponent::zcomp: {
231 intsol *= (1 -
exp(-t / tau)) * cosh(m_g * kk) *
232 sin((kk * el.lx) / 2) *
cos(kk * (x - el.xpos)) *
233 cosh(kk * (m_g - z)) * tanh(m_b * kk) / sinh(m_g * kk);
244 TF1* fw =
new TF1(
"WFieldStrip", WFieldStrip, 0, 10 * m_g, 0);
245 const double sol = fw->Integral(0, 10 * m_g);
247 return (2 * m_eps * m_Vw / Pi) * sol;
251 std::cerr <<
m_className <<
"::IntegrateDelayedField:\n"
252 <<
" Unknown electrode type.\n";
258double ComponentParallelPlate::IntegratePromptPotential(
const Electrode& el,
263 case structureelectrode::Plane: {
264 double sol = m_eps * m_Vw * (m_g -
z) / (m_b + m_eps * m_g);
265 return std::abs(sol) > m_precision ? sol : 0.;
268 case structureelectrode::Pixel: {
269 auto WPotentialPixel = [=](
double* k,
double* ) {
273 double K = std::sqrt(kx * kx + ky * ky);
277 intsol *=
cos(kx * (x - el.xpos)) *
sin(kx * el.lx / 2) *
278 cos(ky * (y - el.ypos)) *
sin(ky * el.ly / 2) *
279 sinh(K * (m_g - z)) /
281 (sinh(m_b * K) * cosh(m_g * K) +
282 m_eps * sinh(m_g * K) * cosh(m_b * K)));
287 TF2* pw =
new TF2(
"WPotentialPixel", WPotentialPixel, 0, 10 * m_g, 0,
289 const double sol = pw->Integral(0, 2 * m_g, 0, 2 * m_g, 1.e-6);
291 return (4 * m_eps * m_Vw / Pi2) * sol;
294 case structureelectrode::Strip: {
295 auto WPotentialStrip = [=](
double* k,
double* ) {
298 double intsol = 1. / (kk * (cosh(m_g * kk) * sinh(m_b * kk) +
299 m_eps * cosh(m_b * kk) * sinh(m_g * kk)));
300 intsol *= (
sin(kk * el.lx / 2) *
cos(kk * (x - el.xpos)) *
301 sinh(kk * (m_g - z)));
306 TF1* pw =
new TF1(
"WPotentialStrip", WPotentialStrip, 0, 10 * m_g, 0);
307 const double sol = pw->Integral(0, 10 * m_g);
309 return (2 * m_eps * m_Vw / Pi) * sol;
313 std::cerr <<
m_className <<
"::IntegratePromptPotential:\n"
314 <<
" Unknown electrode type.\n";
320double ComponentParallelPlate::IntegrateDelayedPotential(
const Electrode& el,
326 case structureelectrode::Plane: {
328 m_eps0 * (m_eps + m_b / m_g) /
331 double sol = m_Vw * (1 -
exp(-t / tau)) * (m_b * (m_g - z)) /
332 (m_g * (m_b + m_eps * m_g));
333 return std::abs(sol) > m_precision ? sol : 0.;
336 case structureelectrode::Pixel: {
337 auto WPotentialPixel = [=](
double* k,
double* ) {
341 double K = std::sqrt(kx * kx + ky * ky);
342 double tau = m_eps0 *
343 (m_eps + cosh(m_g * K) * sinh(m_b * K) /
344 (cosh(m_b * K) * sinh(m_g * K))) *
348 double intsol = 1. / (kx * ky *
349 (sinh(m_b * K) * cosh(m_g * K) +
350 m_eps * sinh(m_g * K) * cosh(m_b * K)));
352 intsol *=
cos(kx * (x - el.xpos)) *
sin(kx * el.lx / 2) *
353 cos(ky * (y - el.ypos)) *
sin(ky * el.ly / 2) *
354 sinh(K * (m_g - z)) * tanh(m_b * K) * cosh(m_g * K) *
355 (1 -
exp(-t / tau)) / sinh(m_g * K);
360 TF2* pw =
new TF2(
"WPotentialPixel", WPotentialPixel, 0, 10 * m_g, 0,
362 const double sol = pw->Integral(0, 2 * m_g, 0, 2 * m_g, 1.e-20);
364 return (4 * m_Vw / Pi2) * sol;
367 case structureelectrode::Strip: {
368 auto WPotentialStrip = [=](
double* k,
double* ) {
371 double tau = m_eps0 *
372 (m_eps + cosh(m_g * kk) * sinh(m_b * kk) /
373 (cosh(m_b * kk) * sinh(m_g * kk))) *
376 double intsol = 1. / (kk * (cosh(m_g * kk) * sinh(m_b * kk) +
377 m_eps * cosh(m_b * kk) * sinh(m_g * kk)));
378 intsol *= (
sin(kk * el.lx / 2) *
cos(kk * (x - el.xpos)) *
379 sinh(kk * (m_g - z)) * cosh(m_g * kk) * tanh(m_b * kk)) *
380 (1 -
exp(-t / tau)) / sinh(m_g * kk);
385 TF1* pw =
new TF1(
"WPotentialStrip", WPotentialStrip, 0, 10 * m_g, 0);
386 const double sol = pw->Integral(0, 8 * m_g);
388 return (2 * m_Vw / Pi) * sol;
392 std::cerr <<
m_className <<
"::IntegrateDelayedPotential:\n"
393 <<
" Unknown electrode type.\n";
400 const double z,
double& ex,
401 double& ey,
double& ez,
Medium*& m,
415 std::cout <<
m_className <<
"::ElectricField: No medium at (" << x <<
", "
416 << y <<
", " << z <<
").\n";
430 const double z,
double& ex,
431 double& ey,
double& ez,
double& v,
432 Medium*& m,
int& status) {
442 v = -m_eps * m_V * (m_g - z) / (m_b + m_eps * m_g);
444 v = -m_eps * m_V * (m_g - z) / (m_eps * m_g);
450 std::cout <<
m_className <<
"::ElectricField: No medium at (" << x <<
", "
451 << y <<
", " << z <<
").\n";
465 if (m_V == 0)
return false;
478 const double z,
double& wx,
479 double& wy,
double& wz,
480 const std::string& label) {
485 for (
const auto& electrode : m_readout_p) {
486 if (electrode.label == label) {
487 wx = electrode.flip *
488 IntegrateField(electrode, fieldcomponent::xcomp, x, y, z);
489 wy = electrode.flip *
490 IntegrateField(electrode, fieldcomponent::ycomp, x, y, z);
491 wz = electrode.flip *
492 IntegrateField(electrode, fieldcomponent::zcomp, x, y, z);
500 const std::string& label) {
503 for (
const auto& electrode : m_readout_p) {
504 if (electrode.label == label) {
505 if (!electrode.m_usegrid) {
506 ret += electrode.flip * IntegratePromptPotential(electrode, x, y, z);
508 ret += FindWeightingPotentialInGrid(electrode, x, y, z);
516 const double x,
const double y,
const double z,
const double t,
517 const std::string& label) {
520 std::cout <<
m_className <<
"::DelayedWeightingPotential:\n"
521 <<
" Conductivity is set to zero.\n";
528 for (
const auto& electrode : m_readout_p) {
529 if (electrode.label == label) {
530 if (!electrode.m_usegrid) {
532 electrode.flip * IntegrateDelayedPotential(electrode, x, y, z, t);
534 ret += FindDelayedWeightingPotentialInGrid(electrode, x, y, z, t);
543 const double x,
const double y,
const double z,
const double t,
double& wx,
544 double& wy,
double& wz,
const std::string& label) {
551 std::cout <<
m_className <<
"::DelayedWeightingField:\n"
552 <<
" Conductivity is set to zero.\n";
557 for (
const auto& electrode : m_readout_p) {
558 if (electrode.label == label) {
559 wx = electrode.flip *
560 IntegrateDelayedField(electrode, fieldcomponent::xcomp, x, y, z, t);
561 wy = electrode.flip *
562 IntegrateDelayedField(electrode, fieldcomponent::ycomp, x, y, z, t);
563 wz = electrode.flip *
564 IntegrateDelayedField(electrode, fieldcomponent::zcomp, x, y, z, t);
569void ComponentParallelPlate::Reset() {
579void ComponentParallelPlate::UpdatePeriodicity() {
581 std::cerr <<
m_className <<
"::UpdatePeriodicity:\n"
582 <<
" Periodicities are not supported.\n";
588 const std::string& label) {
589 const auto it = std::find(m_readout.cbegin(), m_readout.cend(), label);
590 if (it == m_readout.end() && m_readout.size() > 0) {
592 <<
"Note that the label " << label <<
" is already in use.\n";
596 pixel.ind = structureelectrode::Pixel;
602 m_readout.push_back(label);
603 m_readout_p.push_back(std::move(pixel));
604 std::cout <<
m_className <<
"::AddPixel: Added pixel electrode.\n";
608 const std::string& label) {
609 const auto it = std::find(m_readout.cbegin(), m_readout.cend(), label);
610 if (it == m_readout.end() && m_readout.size() > 0) {
612 <<
"Note that the label " << label <<
" is already in use.\n";
616 strip.ind = structureelectrode::Strip;
620 m_readout.push_back(label);
621 m_readout_p.push_back(std::move(strip));
623 std::cout <<
m_className <<
"::AddStrip: Added strip electrode.\n";
627 const auto it = std::find(m_readout.cbegin(), m_readout.cend(), label);
628 if (it == m_readout.end() && m_readout.size() > 0) {
630 <<
"Note that the label " << label <<
" is already in use.\n";
634 plate.ind = structureelectrode::Plane;
636 if (!anode) plate.flip = -1;
638 m_readout.push_back(label);
639 m_readout_p.push_back(std::move(plate));
641 std::cout <<
m_className <<
"::AddPlane: Added plane electrode.\n";
648 }
else if (m_medium) {
655 const std::string& label,
const double xmin,
const double xmax,
656 const double xsteps,
const double ymin,
const double ymax,
657 const double ysteps,
const double zmin,
const double zmax,
658 const double zsteps,
const double tmin,
const double tmax,
659 const double tsteps) {
660 for (
auto& electrode : m_readout_p) {
661 if (electrode.label == label) {
662 electrode.gridXSteps = xsteps;
663 electrode.gridYSteps = ysteps;
664 electrode.gridZSteps = zsteps;
665 electrode.gridTSteps = tsteps;
667 if (xsteps == 0) electrode.gridXSteps = 1;
668 if (ysteps == 0) electrode.gridYSteps = 1;
670 electrode.gridX0 = xmin;
671 electrode.gridY0 = ymin;
672 electrode.gridZ0 = zmin;
673 electrode.gridT0 = tmin;
675 electrode.gridXStepSize = (xmax - xmin) / xsteps;
676 electrode.gridYStepSize = (ymax - ymin) / ysteps;
677 electrode.gridZStepSize = (zmax - zmin) / zsteps;
678 electrode.gridTStepSize = (tmax - tmin) / tsteps;
680 std::vector<double> nhz(zsteps, 0);
681 std::vector<std::vector<double>> nhy(ysteps, nhz);
682 std::vector<std::vector<std::vector<double>>> nhx(xsteps, nhy);
683 electrode.gridPromptV = nhx;
685 std::vector<double> nht(tsteps, 0);
686 std::vector<std::vector<double>> nhzd(zsteps, nht);
687 std::vector<std::vector<std::vector<double>>> nhyd(ysteps, nhzd);
688 std::vector<std::vector<std::vector<std::vector<double>>>> nhxd(xsteps,
690 electrode.gridDelayedV = nhxd;
692 for (
int ix = 0; ix < xsteps; ix++) {
693 for (
int iy = 0; iy < xsteps; iy++) {
694 for (
int iz = 0; iz < xsteps; iz++) {
695 if (iz * zsteps + zmin >= 0)
696 electrode.gridPromptV[ix][iy][iz] =
697 electrode.flip * IntegratePromptPotential(
698 electrode, ix * xsteps + xmin,
699 iy * ysteps + ymin, iz * zsteps + zmin);
701 for (
int it = 0; it < tsteps; it++) {
702 if (iz * zsteps + zmin >= 0)
703 electrode.gridDelayedV[ix][iy][iz][it] =
704 electrode.flip * IntegrateDelayedPotential(
705 electrode, ix * xsteps + xmin,
706 iy * ysteps + ymin, iz * zsteps + zmin,
713 electrode.m_usegrid =
true;
719 const double xmin,
const double xmax,
const double xsteps,
720 const double ymin,
const double ymax,
const double ysteps,
721 const double zmin,
const double zmax,
const double zsteps,
722 const double tmin,
const double tmax,
const double tsteps) {
723 for (
const auto& electrode : m_readout_p) {
725 ysteps, zmin, zmax, zsteps, tmin, tmax, tsteps);
729double ComponentParallelPlate::FindWeightingPotentialInGrid(
const Electrode& el,
734 case structureelectrode::Plane: {
735 return el.flip * IntegratePromptPotential(el, x, y, z);
738 case structureelectrode::Strip: {
739 int ix = floor((x - el.gridX0) / el.gridXStepSize);
740 int iz = floor((z - el.gridZ0) / el.gridZStepSize);
742 if (ix < 0 || ix >= el.gridXSteps || iz < 0 || iz >= el.gridZSteps)
743 return IntegratePromptPotential(el, x, y, z);
747 for (
int i = 0; i < 2; i++) {
748 for (
int j = 0; j < 2; j++) {
749 ret += FindWeightFactor(
750 el, std::abs((ix + i) * el.gridXStepSize + el.gridX0 - x), 0,
751 std::abs((iz + j) * el.gridZStepSize + el.gridZ0 - z)) *
752 el.gridPromptV[ix + i][0][iz + j];
759 case structureelectrode::Pixel: {
760 int ix = floor((x - el.gridX0) / el.gridXStepSize);
761 int iy = floor((y - el.gridY0) / el.gridYStepSize);
762 int iz = floor((z - el.gridZ0) / el.gridZStepSize);
764 if (ix < 0 || ix >= el.gridXSteps || iz < 0 || iz >= el.gridYSteps ||
765 iz < 0 || iz >= el.gridZSteps)
766 return IntegratePromptPotential(el, x, y, z);
770 for (
int i = 0; i < 2; i++) {
771 for (
int j = 0; j < 2; j++) {
772 for (
int k = 0; k < 2; k++) {
773 ret += FindWeightFactor(
774 el, std::abs((ix + i) * el.gridXStepSize + el.gridX0 - x),
775 std::abs((iy + k) * el.gridYStepSize + el.gridY0 - y),
776 std::abs((iz + j) * el.gridZStepSize + el.gridZ0 - z)) *
777 el.gridPromptV[ix + i][iy + k][iz + j];
788double ComponentParallelPlate::FindDelayedWeightingPotentialInGrid(
789 const Electrode& el,
const double x,
const double y,
const double z,
792 case structureelectrode::Plane: {
793 return el.flip * IntegrateDelayedPotential(el, x, y, z, t);
796 case structureelectrode::Strip: {
797 int ix = floor((x - el.gridX0) / el.gridXStepSize);
798 int iz = floor((z - el.gridZ0) / el.gridZStepSize);
799 int it = floor((t - el.gridT0) / el.gridTStepSize);
801 if (ix < 0 || ix >= el.gridXSteps || iz < 0 || iz >= el.gridZSteps ||
802 it < 0 || it >= el.gridTSteps)
803 return IntegrateDelayedPotential(el, x, y, z, t);
807 for (
int i = 0; i < 2; i++) {
808 for (
int j = 0; j < 2; j++) {
809 for (
int l = 0; l < 2; l++) {
810 ret += FindWeightFactor(
811 el, std::abs((ix + i) * el.gridXStepSize + el.gridX0 - x), 0,
812 std::abs((iz + j) * el.gridZStepSize + el.gridZ0 - z),
813 std::abs((it + l) * el.gridTStepSize + el.gridT0 - t)) *
814 el.gridDelayedV[ix + i][0][iz + j][it + l];
822 case structureelectrode::Pixel: {
823 int ix = floor((x - el.gridX0) / el.gridXStepSize);
824 int iy = floor((y - el.gridY0) / el.gridYStepSize);
825 int iz = floor((z - el.gridZ0) / el.gridZStepSize);
826 int it = floor((t - el.gridT0) / el.gridTStepSize);
828 if (ix < 0 || ix >= el.gridXSteps || iz < 0 || iz >= el.gridYSteps ||
829 iz < 0 || iz >= el.gridZSteps || it < 0 || it >= el.gridTSteps)
830 return IntegrateDelayedPotential(el, x, y, z, t);
834 for (
int i = 0; i < 2; i++) {
835 for (
int j = 0; j < 2; j++) {
836 for (
int k = 0; k < 2; k++) {
837 for (
int l = 0; l < 2; l++) {
838 ret += FindWeightFactor(
839 el, std::abs((ix + i) * el.gridXStepSize + el.gridX0 - x),
840 std::abs((iy + k) * el.gridYStepSize + el.gridY0 - y),
841 std::abs((iz + j) * el.gridZStepSize + el.gridZ0 - z),
842 std::abs((it + l) * el.gridTStepSize + el.gridT0 - t)) *
843 el.gridDelayedV[ix + i][iy + k][iz + j][it + l];
855double ComponentParallelPlate::FindWeightFactor(
const Electrode& el,
862 case structureelectrode::Strip: {
863 fact = (el.gridXStepSize - dx) * (el.gridZStepSize - dz) /
864 (el.gridXStepSize * el.gridZStepSize);
867 case structureelectrode::Pixel: {
868 fact = (el.gridXStepSize - dx) * (el.gridYStepSize - dy) *
869 (el.gridZStepSize - dz) /
870 (el.gridXStepSize * el.gridYStepSize * el.gridZStepSize);
878double ComponentParallelPlate::FindWeightFactor(
const Electrode& el,
886 case structureelectrode::Strip: {
887 fact = (el.gridXStepSize - dx) * (el.gridZStepSize - dz) *
888 (el.gridXStepSize - dt) /
889 (el.gridXStepSize * el.gridZStepSize * el.gridTStepSize);
892 case structureelectrode::Pixel: {
893 fact = (el.gridXStepSize - dx) * (el.gridYStepSize - dy) *
894 (el.gridZStepSize - dz) * (el.gridXStepSize - dt) /
895 (el.gridXStepSize * el.gridYStepSize * el.gridZStepSize *
void Setup(double g, double b, double eps, double v, double sigma=0.)
void DelayedWeightingField(const double x, const double y, const double z, const double t, double &wx, double &wy, double &wz, const std::string &label) override
ComponentParallelPlate()
Constructor.
double WeightingPotential(const double x, const double y, const double z, const std::string &label) override
void AddStrip(double x, double lx, const std::string &label)
Add strip electrode.
double DelayedWeightingPotential(const double x, const double y, const double z, const double t, const std::string &label) override
void WeightingField(const double x, const double y, const double z, double &wx, double &wy, double &wz, const std::string &label) override
void ElectricField(const double x, const double y, const double z, double &ex, double &ey, double &ez, Medium *&m, int &status) override
void AddPlane(const std::string &label, bool anode=true)
void SetWeightingPotentialGrid(const std::string &label, const double xmin, const double xmax, const double xsteps, const double ymin, const double ymax, const double ysteps, const double zmin, const double zmax, const double zsteps, const double tmin, const double tmax, const double tsteps)
Medium * GetMedium(const double x, const double y, const double z) override
Get the medium at a given location (x, y, z).
void SetWeightingPotentialGrids(const double xmin, const double xmax, const double xsteps, const double ymin, const double ymax, const double ysteps, const double zmin, const double zmax, const double zsteps, const double tmin, const double tmax, const double tsteps)
bool GetVoltageRange(double &vmin, double &vmax) override
Calculate the voltage range [V].
bool GetBoundingBox(double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) override
Get the bounding box coordinates.
void AddPixel(double x, double y, double lx, double ly, const std::string &label)
Abstract base class for components.
bool m_debug
Switch on/off debugging messages.
std::string m_className
Class name.
Geometry * m_geometry
Pointer to the geometry.
virtual bool GetBoundingBox(double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax)=0
Get the bounding box (envelope of the geometry).
virtual Medium * GetMedium(const double x, const double y, const double z, const bool tesselated=false) const =0
Retrieve the medium at a given point.
Abstract base class for media.
DoubleAc cos(const DoubleAc &f)
DoubleAc exp(const DoubleAc &f)
DoubleAc sin(const DoubleAc &f)