OPAL (Object Oriented Parallel Accelerator Library)
2021.1.99
OPAL
|
#include <FFTBoxPoissonSolver.h>
Public Types | |
typedef FFT< SineTransform, 3, double > | SINE_t |
Public Member Functions | |
FFTBoxPoissonSolver (PartBunch &bunch, std::string greensFuntion) | |
FFTBoxPoissonSolver (Mesh_t *mesh, FieldLayout_t *fl, std::string greensFunction, double boxSize) | |
~FFTBoxPoissonSolver () | |
void | computePotential (Field_t &rho, Vector_t hr, double zshift) |
void | computePotential (Field_t &rho, Vector_t hr) |
void | greensFunction () |
void | integratedGreensFunction () |
compute the integrated Green function as described in Three-dimensional quasistatic model for high brightness beam dynamics simulation by Qiang et al. More... | |
void | shiftedIntGreensFunction (double zshift) |
compute the shifted integrated Green function as described in Three-dimensional quasistatic model for high brightness beam dynamics simulation by Qiang et al. More... | |
double | getXRangeMin (unsigned short) |
double | getXRangeMax (unsigned short) |
double | getYRangeMin (unsigned short) |
double | getYRangeMax (unsigned short) |
double | getZRangeMin (unsigned short) |
double | getZRangeMax (unsigned short) |
void | test (PartBunchBase< double, 3 > *) |
Inform & | print (Inform &os) const |
Public Member Functions inherited from PoissonSolver | |
virtual void | solve (AmrScalarFieldContainer_t &, AmrScalarFieldContainer_t &, AmrVectorFieldContainer_t &, unsigned short, unsigned short, bool=true) |
virtual void | hasToRegrid () |
virtual | ~PoissonSolver () |
virtual void | resizeMesh (Vector_t &, Vector_t &, const Vector_t &, const Vector_t &, double) |
Additional Inherited Members | |
Protected Types inherited from PoissonSolver | |
typedef Field< int, 3, Mesh_t, Center_t > | IField_t |
typedef Field< std::complex< double >, 3, Mesh_t, Center_t > | CxField_t |
Definition at line 32 of file FFTBoxPoissonSolver.h.
typedef FFT<SineTransform, 3, double> FFTBoxPoissonSolver::SINE_t |
Definition at line 34 of file FFTBoxPoissonSolver.h.
FFTBoxPoissonSolver::FFTBoxPoissonSolver | ( | PartBunch & | bunch, |
std::string | greensFuntion | ||
) |
Definition at line 110 of file FFTBoxPoissonSolver.cpp.
References domain_m, UniformCartesian< Dim, MFLOAT >::get_meshSpacing(), BareField< T, Dim >::getDomain(), FieldLayout< Dim >::getDomain(), IpplTimings::getTimer(), greensFunction_m, GreensFunctionTimer1_m, GreensFunctionTimer4_m, GreensFunctionTimer_m, grnIField_m, grntr_m, hr_m, Field< T, Dim, M, C >::initialize(), IntGreensFunctionTimer1_m, IntGreensFunctionTimer2_m, IntGreensFunctionTimer3_m, IntGreensFunctionTimer4_m, layout_m, cmp_diff::lt(), mesh_m, nr_m, ShIntGreensFunctionTimer1_m, ShIntGreensFunctionTimer2_m, ShIntGreensFunctionTimer3_m, ShIntGreensFunctionTimer4_m, sine_m, tmpgreen, and where().
FFTBoxPoissonSolver::FFTBoxPoissonSolver | ( | Mesh_t * | mesh, |
FieldLayout_t * | fl, | ||
std::string | greensFunction, | ||
double | boxSize | ||
) |
Definition at line 37 of file FFTBoxPoissonSolver.cpp.
References domain_m, UniformCartesian< Dim, MFLOAT >::get_meshSpacing(), BareField< T, Dim >::getDomain(), FieldLayout< Dim >::getDomain(), IpplTimings::getTimer(), greensFunction_m, GreensFunctionTimer1_m, GreensFunctionTimer4_m, GreensFunctionTimer_m, grnIField_m, grntr_m, hr_m, Field< T, Dim, M, C >::initialize(), IntGreensFunctionTimer1_m, IntGreensFunctionTimer2_m, IntGreensFunctionTimer3_m, IntGreensFunctionTimer4_m, layout_m, cmp_diff::lt(), mesh_m, nr_m, ShIntGreensFunctionTimer1_m, ShIntGreensFunctionTimer2_m, ShIntGreensFunctionTimer3_m, ShIntGreensFunctionTimer4_m, sine_m, tmpgreen, and where().
FFTBoxPoissonSolver::~FFTBoxPoissonSolver | ( | ) |
Definition at line 178 of file FFTBoxPoissonSolver.cpp.
References sine_m.
Implements PoissonSolver.
Definition at line 232 of file FFTBoxPoissonSolver.cpp.
References greensFunction(), greensFunction_m, GreensFunctionTimer_m, grntr_m, hr_m, integratedGreensFunction(), sine_m, IpplTimings::startTimer(), and IpplTimings::stopTimer().
Implements PoissonSolver.
Definition at line 188 of file FFTBoxPoissonSolver.cpp.
References GreensFunctionTimer_m, grntr_m, hr_m, nr_m, shiftedIntGreensFunction(), sine_m, IpplTimings::startTimer(), and IpplTimings::stopTimer().
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
void FFTBoxPoissonSolver::greensFunction | ( | ) |
Definition at line 270 of file FFTBoxPoissonSolver.cpp.
References GreensFunctionTimer1_m, GreensFunctionTimer4_m, grnIField_m, grntr_m, hr_m, sine_m, IpplTimings::startTimer(), and IpplTimings::stopTimer().
Referenced by computePotential().
void FFTBoxPoissonSolver::integratedGreensFunction | ( | ) |
compute the integrated Green function as described in Three-dimensional quasistatic model for high brightness beam dynamics simulation by Qiang et al.
If the beam has a longitudinal size >> transverse size the direct Green function at each mesh point is not efficient (needs a lot of mesh points along the transverse size to get a good resolution)
If the charge density function is uniform within each cell the following Green's function can be defined:
\[ \overline{G}(x_i - x_{i'}, y_j - y_{j'}, z_k - z_{k'} cout << I << endl; cout << J << endl; cout << K << endl; cout << IE << endl; cout << JE << endl; cout << KE << endl; ) = \int_{x_{i'} - h_x/2}^{x_{i'} + h_x/2} dx' \int_{y_{j'} - h_y/2}^{y_{j'} + h_y/2} dy' \int_{z_{k'} - h_z/2}^{z_{k'} + h_z/2} dz' G(x_i - x_{i'}, y_j - y_{j'}, z_k - z_{k'}). \]
This integral can be calculated analytically in a closed from:
Definition at line 305 of file FFTBoxPoissonSolver.cpp.
References atan(), FieldLayout< Dim >::getLocalNDIndex(), grntr_m, hr_m, IntGreensFunctionTimer1_m, IntGreensFunctionTimer2_m, IntGreensFunctionTimer3_m, IntGreensFunctionTimer4_m, layout2_m, log(), min(), nr_m, sine_m, sqrt(), IpplTimings::startTimer(), IpplTimings::stopTimer(), and tmpgreen.
Referenced by computePotential().
void FFTBoxPoissonSolver::shiftedIntGreensFunction | ( | double | zshift | ) |
compute the shifted integrated Green function as described in Three-dimensional quasistatic model for high brightness beam dynamics simulation by Qiang et al.
(x[0:nr_m[0]-1]^2 + y[0:nr_m[1]-1]^2 + (z_c + z[0:nr_m[2]-1])^2)^{-0.5} (x[nr_m[0]:1]^2 + y[0:nr_m[1]-1]^2 + (z_c + z[0:nr_m[2]-1])^2)^{-0.5} (x[0:nr_m[0]-1]^2 + y[nr_m[1]:1]^2 + (z_c + z[0:nr_m[2]-1])^2)^{-0.5} (x[nr_m[0]:1]^2 + y[nr_m[1]:1]^2 + (z_c + z[0:nr_m[2]-1])^2)^{-0.5}
(x[0:nr_m[0]-1]^2 + y[0:nr_m[1]-1]^2 + (z_c - z[nr_m[2]:1])^2)^{-0.5} (x[nr_m[0]:1]^2 + y[0:nr_m[1]-1]^2 + (z_c - z[nr_m[2]:1])^2)^{-0.5} (x[0:nr_m[0]-1]^2 + y[nr_m[1]:1]^2 + (z_c - z[nr_m[2]:1])^2)^{-0.5} (x[nr_m[0]:1]^2 + y[nr_m[1]:1]^2 + (z_c - z[nr_m[2]:1])^2)^{-0.5}
Definition at line 387 of file FFTBoxPoissonSolver.cpp.
References atan(), FieldLayout< Dim >::getLocalNDIndex(), grntr_m, hr_m, Field< T, Dim, M, C >::initialize(), layout2_m, log(), mesh2_m, min(), nr_m, ShIntGreensFunctionTimer1_m, ShIntGreensFunctionTimer2_m, ShIntGreensFunctionTimer3_m, ShIntGreensFunctionTimer4_m, sine_m, sqrt(), IpplTimings::startTimer(), IpplTimings::stopTimer(), and tmpgreen.
Referenced by computePotential().
|
inlinevirtual |
Implements PoissonSolver.
Definition at line 68 of file FFTBoxPoissonSolver.h.
|
private |
Definition at line 110 of file FFTBoxPoissonSolver.h.
Referenced by getXRangeMax(), getXRangeMin(), getYRangeMax(), getYRangeMin(), getZRangeMax(), and getZRangeMin().
|
private |
Definition at line 102 of file FFTBoxPoissonSolver.h.
|
private |
Definition at line 99 of file FFTBoxPoissonSolver.h.
Referenced by FFTBoxPoissonSolver().
|
private |
Definition at line 108 of file FFTBoxPoissonSolver.h.
Referenced by computePotential(), and FFTBoxPoissonSolver().
|
private |
Definition at line 124 of file FFTBoxPoissonSolver.h.
Referenced by FFTBoxPoissonSolver(), and greensFunction().
|
private |
Definition at line 125 of file FFTBoxPoissonSolver.h.
Referenced by FFTBoxPoissonSolver(), and greensFunction().
|
private |
Definition at line 112 of file FFTBoxPoissonSolver.h.
Referenced by computePotential(), and FFTBoxPoissonSolver().
|
private |
Definition at line 83 of file FFTBoxPoissonSolver.h.
Referenced by FFTBoxPoissonSolver(), and greensFunction().
|
private |
Definition at line 79 of file FFTBoxPoissonSolver.h.
Referenced by computePotential(), FFTBoxPoissonSolver(), greensFunction(), integratedGreensFunction(), and shiftedIntGreensFunction().
|
private |
Definition at line 105 of file FFTBoxPoissonSolver.h.
Referenced by computePotential(), FFTBoxPoissonSolver(), greensFunction(), integratedGreensFunction(), print(), and shiftedIntGreensFunction().
|
private |
Definition at line 114 of file FFTBoxPoissonSolver.h.
Referenced by FFTBoxPoissonSolver(), and integratedGreensFunction().
|
private |
Definition at line 115 of file FFTBoxPoissonSolver.h.
Referenced by FFTBoxPoissonSolver(), and integratedGreensFunction().
|
private |
Definition at line 116 of file FFTBoxPoissonSolver.h.
Referenced by FFTBoxPoissonSolver(), and integratedGreensFunction().
|
private |
Definition at line 117 of file FFTBoxPoissonSolver.h.
Referenced by FFTBoxPoissonSolver(), and integratedGreensFunction().
|
private |
Definition at line 93 of file FFTBoxPoissonSolver.h.
Referenced by integratedGreensFunction(), and shiftedIntGreensFunction().
|
private |
Definition at line 89 of file FFTBoxPoissonSolver.h.
Referenced by FFTBoxPoissonSolver().
|
private |
Definition at line 92 of file FFTBoxPoissonSolver.h.
Referenced by shiftedIntGreensFunction().
|
private |
Definition at line 88 of file FFTBoxPoissonSolver.h.
Referenced by FFTBoxPoissonSolver().
|
private |
Definition at line 106 of file FFTBoxPoissonSolver.h.
Referenced by computePotential(), FFTBoxPoissonSolver(), integratedGreensFunction(), and shiftedIntGreensFunction().
|
private |
Definition at line 76 of file FFTBoxPoissonSolver.h.
|
private |
Definition at line 119 of file FFTBoxPoissonSolver.h.
Referenced by FFTBoxPoissonSolver(), and shiftedIntGreensFunction().
|
private |
Definition at line 120 of file FFTBoxPoissonSolver.h.
Referenced by FFTBoxPoissonSolver(), and shiftedIntGreensFunction().
|
private |
Definition at line 121 of file FFTBoxPoissonSolver.h.
Referenced by FFTBoxPoissonSolver(), and shiftedIntGreensFunction().
|
private |
Definition at line 122 of file FFTBoxPoissonSolver.h.
Referenced by FFTBoxPoissonSolver(), and shiftedIntGreensFunction().
|
private |
Definition at line 85 of file FFTBoxPoissonSolver.h.
Referenced by computePotential(), FFTBoxPoissonSolver(), greensFunction(), integratedGreensFunction(), shiftedIntGreensFunction(), and ~FFTBoxPoissonSolver().
|
private |
Definition at line 96 of file FFTBoxPoissonSolver.h.
Referenced by FFTBoxPoissonSolver(), integratedGreensFunction(), and shiftedIntGreensFunction().