OPAL (Object Oriented Parallel Accelerator Library)
2.2.0
OPAL
|
#include <FFTPoissonSolver.h>
Public Member Functions | |
FFTPoissonSolver (PartBunch &bunch, std::string greensFuntion) | |
FFTPoissonSolver (Mesh_t *mesh, FieldLayout_t *fl, std::string greensFunction, std::string bcz) | |
~FFTPoissonSolver () | |
void | computePotential (Field_t &rho, Vector_t hr, double zshift) |
void | computePotential (Field_t &rho, Vector_t hr) |
void | computePotentialDKS (Field_t &rho) |
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 | integratedGreensFunctionDKS () |
Uses DKS to offload the computation of Greens function on the GPU. 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 level) |
double | getXRangeMax (unsigned short level) |
double | getYRangeMin (unsigned short level) |
double | getYRangeMax (unsigned short level) |
double | getZRangeMin (unsigned short level) |
double | getZRangeMax (unsigned short level) |
void | test (PartBunchBase< double, 3 > *bunch) |
Inform & | print (Inform &os) const |
![]() | |
virtual void | solve (AmrScalarFieldContainer_t &rho, AmrScalarFieldContainer_t &phi, AmrVectorFieldContainer_t &efield, unsigned short baseLevel, unsigned short finestLevel, bool prevAsGuess=true) |
virtual void | hasToRegrid () |
virtual | ~PoissonSolver () |
Private Member Functions | |
void | initializeFields () |
void | mirrorRhoField () |
void | mirrorRhoField (Field_t &ggrn2) |
Private Attributes | |
Field_t | rho2_m |
Field_t | greentr_m |
CxField_t | rho2tr_m |
CxField_t | imgrho2tr_m |
CxField_t | grntr_m |
IField_t | grnIField_m [3] |
std::unique_ptr< FFT_t > | fft_m |
Mesh_t * | mesh_m |
FieldLayout_t * | layout_m |
std::unique_ptr< Mesh_t > | mesh2_m |
std::unique_ptr< FieldLayout_t > | layout2_m |
std::unique_ptr< Mesh_t > | mesh3_m |
std::unique_ptr< FieldLayout_t > | layout3_m |
std::unique_ptr< Mesh_t > | mesh4_m |
std::unique_ptr< FieldLayout_t > | layout4_m |
Field_t | tmpgreen_m |
NDIndex< 3 > | domain_m |
NDIndex< 3 > | domain2_m |
NDIndex< 3 > | domain3_m |
NDIndex< 3 > | domain4_m |
NDIndex< 3 > | domainFFTConstruct_m |
Vector_t | hr_m |
Vektor< int, 3 > | nr_m |
BConds< double, 3, Mesh_t, Center_t > | bc_m |
for defining the boundary conditions More... | |
BConds< Vector_t, 3, Mesh_t, Center_t > | vbc_m |
bool | bcz_m |
bool | integratedGreens_m |
IpplTimings::TimerRef | GreensFunctionTimer_m |
IpplTimings::TimerRef | ComputePotential_m |
Definition at line 43 of file FFTPoissonSolver.h.
FFTPoissonSolver::FFTPoissonSolver | ( | PartBunch & | bunch, |
std::string | greensFuntion | ||
) |
Definition at line 70 of file FFTPoissonSolver.cpp.
References ComputePotential_m, IpplTimings::getTimer(), GreensFunctionTimer_m, initializeFields(), and integratedGreens_m.
FFTPoissonSolver::FFTPoissonSolver | ( | Mesh_t * | mesh, |
FieldLayout_t * | fl, | ||
std::string | greensFunction, | ||
std::string | bcz | ||
) |
Definition at line 50 of file FFTPoissonSolver.cpp.
References bcz_m, ComputePotential_m, IpplTimings::getTimer(), GreensFunctionTimer_m, initializeFields(), and integratedGreens_m.
FFTPoissonSolver::~FFTPoissonSolver | ( | ) |
Definition at line 90 of file FFTPoissonSolver.cpp.
References IpplInfo::DKSEnabled, IpplInfo::getComm(), FieldLayout< Dim >::getDomain(), BareField< T, Dim >::getLayout(), grntr_m, IpplInfo::myNode(), rho2_m, and tmpgreen_m.
Implements PoissonSolver.
Definition at line 289 of file FFTPoissonSolver.cpp.
References domain_m, fft_m, GreensFunctionTimer_m, grntr_m, hr_m, imgrho2tr_m, K, nr_m, rho2_m, rho2tr_m, shiftedIntGreensFunction(), IpplTimings::startTimer(), and IpplTimings::stopTimer().
Implements PoissonSolver.
Definition at line 337 of file FFTPoissonSolver.cpp.
References ComputePotential_m, computePotentialDKS(), IpplInfo::DKSEnabled, domain_m, fft_m, greensFunction(), GreensFunctionTimer_m, grntr_m, hr_m, integratedGreens_m, integratedGreensFunction(), rho2_m, rho2tr_m, IpplTimings::startTimer(), and IpplTimings::stopTimer().
void FFTPoissonSolver::computePotentialDKS | ( | Field_t & | rho | ) |
Definition at line 384 of file FFTPoissonSolver.cpp.
References fft_m, IpplInfo::getComm(), FieldLayout< Dim >::getDomain(), BareField< T, Dim >::getLayout(), GreensFunctionTimer_m, grntr_m, integratedGreensFunctionDKS(), IpplInfo::myNode(), nr_m, rho2_m, IpplTimings::startTimer(), and IpplTimings::stopTimer().
Referenced by computePotential().
|
inlinevirtual |
Implements PoissonSolver.
Definition at line 81 of file FFTPoissonSolver.h.
|
inlinevirtual |
Implements PoissonSolver.
Definition at line 80 of file FFTPoissonSolver.h.
|
inlinevirtual |
Implements PoissonSolver.
Definition at line 83 of file FFTPoissonSolver.h.
|
inlinevirtual |
Implements PoissonSolver.
Definition at line 82 of file FFTPoissonSolver.h.
|
inlinevirtual |
Implements PoissonSolver.
Definition at line 85 of file FFTPoissonSolver.h.
|
inlinevirtual |
Implements PoissonSolver.
Definition at line 84 of file FFTPoissonSolver.h.
void FFTPoissonSolver::greensFunction | ( | ) |
Definition at line 426 of file FFTPoissonSolver.cpp.
References fft_m, grnIField_m, grntr_m, hr_m, and rho2_m.
Referenced by computePotential().
|
private |
Definition at line 117 of file FFTPoissonSolver.cpp.
References bc_m, bcz_m, IpplInfo::DKSEnabled, domain2_m, domain3_m, domain4_m, domain_m, domainFFTConstruct_m, fft_m, UniformCartesian< D, T >::get_meshSpacing(), IpplInfo::getComm(), FieldLayout< Dim >::getDomain(), BareField< T, Dim >::getLayout(), IpplInfo::getNodes(), FieldLayout< Dim >::getRequestedDistribution(), greentr_m, grnIField_m, grntr_m, hr_m, imgrho2tr_m, Field< T, Dim, Mesh, Centering >::initialize(), layout2_m, layout3_m, layout4_m, layout_m, lt(), mesh2_m, mesh3_m, mesh4_m, mesh_m, IpplInfo::myNode(), nr_m, rho2_m, rho2tr_m, tmpgreen_m, vbc_m, and where().
Referenced by FFTPoissonSolver().
void FFTPoissonSolver::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 459 of file FFTPoissonSolver.cpp.
References atan(), fft_m, grntr_m, hr_m, K, layout4_m, log(), mirrorRhoField(), nr_m, rho2_m, sqrt(), and tmpgreen_m.
Referenced by computePotential().
void FFTPoissonSolver::integratedGreensFunctionDKS | ( | ) |
Uses DKS to offload the computation of Greens function on the GPU.
Definition at line 524 of file FFTPoissonSolver.cpp.
References hr_m, K, layout4_m, and nr_m.
Referenced by computePotentialDKS().
|
private |
Definition at line 641 of file FFTPoissonSolver.cpp.
References bcz_m, K, nr_m, and rho2_m.
Referenced by integratedGreensFunction(), and shiftedIntGreensFunction().
|
private |
Definition at line 693 of file FFTPoissonSolver.cpp.
Referenced by operator<<().
void FFTPoissonSolver::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 546 of file FFTPoissonSolver.cpp.
References atan(), fft_m, grntr_m, hr_m, K, layout4_m, log(), mesh4_m, mirrorRhoField(), nr_m, rho2_m, sqrt(), and tmpgreen_m.
Referenced by computePotential().
|
inlinevirtual |
Implements PoissonSolver.
Definition at line 86 of file FFTPoissonSolver.h.
for defining the boundary conditions
Definition at line 164 of file FFTPoissonSolver.h.
Referenced by initializeFields().
|
private |
Definition at line 167 of file FFTPoissonSolver.h.
Referenced by FFTPoissonSolver(), initializeFields(), and mirrorRhoField().
|
private |
Definition at line 185 of file FFTPoissonSolver.h.
Referenced by computePotential(), and FFTPoissonSolver().
|
private |
Definition at line 153 of file FFTPoissonSolver.h.
Referenced by initializeFields().
|
private |
Definition at line 154 of file FFTPoissonSolver.h.
Referenced by initializeFields().
|
private |
Definition at line 155 of file FFTPoissonSolver.h.
Referenced by initializeFields().
|
private |
Definition at line 150 of file FFTPoissonSolver.h.
Referenced by computePotential(), and initializeFields().
|
private |
Definition at line 157 of file FFTPoissonSolver.h.
Referenced by initializeFields().
|
private |
Definition at line 128 of file FFTPoissonSolver.h.
Referenced by computePotential(), computePotentialDKS(), greensFunction(), initializeFields(), integratedGreensFunction(), and shiftedIntGreensFunction().
|
private |
Definition at line 169 of file FFTPoissonSolver.h.
Referenced by computePotential(), computePotentialDKS(), and FFTPoissonSolver().
|
private |
Definition at line 98 of file FFTPoissonSolver.h.
Referenced by initializeFields().
|
private |
Definition at line 125 of file FFTPoissonSolver.h.
Referenced by greensFunction(), and initializeFields().
|
private |
Definition at line 107 of file FFTPoissonSolver.h.
Referenced by computePotential(), computePotentialDKS(), greensFunction(), initializeFields(), integratedGreensFunction(), shiftedIntGreensFunction(), and ~FFTPoissonSolver().
|
private |
Definition at line 160 of file FFTPoissonSolver.h.
Referenced by computePotential(), greensFunction(), initializeFields(), integratedGreensFunction(), integratedGreensFunctionDKS(), print(), and shiftedIntGreensFunction().
|
private |
Definition at line 103 of file FFTPoissonSolver.h.
Referenced by computePotential(), and initializeFields().
|
private |
Definition at line 168 of file FFTPoissonSolver.h.
Referenced by computePotential(), and FFTPoissonSolver().
|
private |
Definition at line 136 of file FFTPoissonSolver.h.
Referenced by initializeFields().
|
private |
Definition at line 140 of file FFTPoissonSolver.h.
Referenced by initializeFields().
|
private |
Definition at line 144 of file FFTPoissonSolver.h.
Referenced by initializeFields(), integratedGreensFunction(), integratedGreensFunctionDKS(), and shiftedIntGreensFunction().
|
private |
Definition at line 132 of file FFTPoissonSolver.h.
Referenced by initializeFields().
|
private |
Definition at line 135 of file FFTPoissonSolver.h.
Referenced by initializeFields().
|
private |
Definition at line 139 of file FFTPoissonSolver.h.
Referenced by initializeFields().
|
private |
Definition at line 143 of file FFTPoissonSolver.h.
Referenced by initializeFields(), and shiftedIntGreensFunction().
|
private |
Definition at line 131 of file FFTPoissonSolver.h.
Referenced by initializeFields().
|
private |
Definition at line 161 of file FFTPoissonSolver.h.
Referenced by computePotential(), computePotentialDKS(), initializeFields(), integratedGreensFunction(), integratedGreensFunctionDKS(), mirrorRhoField(), and shiftedIntGreensFunction().
|
private |
Definition at line 95 of file FFTPoissonSolver.h.
Referenced by computePotential(), computePotentialDKS(), greensFunction(), initializeFields(), integratedGreensFunction(), mirrorRhoField(), shiftedIntGreensFunction(), and ~FFTPoissonSolver().
|
private |
Definition at line 102 of file FFTPoissonSolver.h.
Referenced by computePotential(), and initializeFields().
|
private |
Definition at line 147 of file FFTPoissonSolver.h.
Referenced by initializeFields(), integratedGreensFunction(), shiftedIntGreensFunction(), and ~FFTPoissonSolver().
Definition at line 165 of file FFTPoissonSolver.h.
Referenced by initializeFields().