32 template<
unsigned int Dim>
37 template<
class T,
class FT,
class FT2>
39 grn = grnI[0] * hrsq[0] + grnI[1] * hrsq[1] + grnI[2] * hrsq[2];
40 grn = 1.0 /
sqrt(grn);
41 grn[0][0][0] = grn[0][0][1];
60 bcz_m = (bcz == std::string(
"PERIODIC"));
71 mesh_m(&beam.getMesh()),
72 layout_m(&beam.getFieldLayout()),
100 for(
int d = 0; d < 3; ++ d) {
111 for (
int i = 0; i < 2; ++ i) {
121 for (
int i = 0; i < 2 * 3; ++ i) {
137 for (
int i = 0; i < 3; ++ i) {
143 for (
int i = 0; i < 2 * 3; ++ i) {
178 for (
int i = 0; i < 3; ++ i) {
190 for (
int i = 0; i < 3; ++ i)
198 for (
int i = 0; i < 3; ++ i) {
351 for(
int k = idx[2].first(); k <= idx[2].last() + 1; k++) {
352 for(
int j = idx[1].first(); j <= idx[1].last() + 1; j++) {
353 for(
int i = idx[0].first(); i <= idx[0].last() + 1; i++) {
360 double r =
sqrt(vv(0) * vv(0) + vv(1) * vv(1) + vv(2) * vv(2));
361 double tmpgrn = -vv(2) * vv(2) *
atan(vv(0) * vv(1) / (vv(2) * r)) / 2;
362 tmpgrn += -vv(1) * vv(1) *
atan(vv(0) * vv(2) / (vv(1) * r)) / 2;
363 tmpgrn += -vv(0) * vv(0) *
atan(vv(1) * vv(2) / (vv(0) * r)) / 2;
364 tmpgrn += vv(1) * vv(2) *
log(vv(0) + r);
365 tmpgrn += vv(0) * vv(2) *
log(vv(1) + r);
366 tmpgrn += vv(0) * vv(1) *
log(vv(2) + r);
411 for(
int k = idx[2].first(); k <= idx[2].last(); k++) {
412 for(
int j = idx[1].first(); j <= idx[1].last(); j++) {
413 for(
int i = idx[0].first(); i <= idx[0].last(); i++) {
418 vv(2) = k *
hr_m[2] -
hr_m[2] / 2 + zshift;
420 double r =
sqrt(vv(0) * vv(0) + vv(1) * vv(1) + vv(2) * vv(2));
421 double tmpgrn = -vv(2) * vv(2) *
atan(vv(0) * vv(1) / (vv(2) * r)) / 2;
422 tmpgrn += -vv(1) * vv(1) *
atan(vv(0) * vv(2) / (vv(1) * r)) / 2;
423 tmpgrn += -vv(0) * vv(0) *
atan(vv(1) * vv(2) / (vv(0) * r)) / 2;
424 tmpgrn += vv(1) * vv(2) *
log(vv(0) + r);
425 tmpgrn += vv(0) * vv(2) *
log(vv(1) + r);
426 tmpgrn += vv(0) * vv(1) *
log(vv(2) + r);
434 for(
int k = idx[2].first(); k <= idx[2].last(); k++) {
435 for(
int j = idx[1].first(); j <= idx[1].last(); j++) {
436 for(
int i = idx[0].first(); i <= idx[0].last(); i++) {
443 double r =
sqrt(vv(0) * vv(0) + vv(1) * vv(1) + vv(2) * vv(2));
444 double tmpgrn = -vv(2) * vv(2) *
atan(vv(0) * vv(1) / (vv(2) * r)) / 2;
445 tmpgrn += -vv(1) * vv(1) *
atan(vv(0) * vv(2) / (vv(1) * r)) / 2;
446 tmpgrn += -vv(0) * vv(0) *
atan(vv(1) * vv(2) / (vv(0) * r)) / 2;
447 tmpgrn += vv(1) * vv(2) *
log(vv(0) + r);
448 tmpgrn += vv(0) * vv(2) *
log(vv(1) + r);
449 tmpgrn += vv(0) * vv(1) *
log(vv(2) + r);
451 grn2[i][j][k] = tmpgrn / cellVolume;
541 rho2_m[I ][J ][KE] = ggrn2[I ][J ][shiftedKE];
551 os <<
"* ************* F F T P o i s s o n S o l v e r ************************************ " <<
endl;
552 os <<
"* h " <<
hr_m <<
'\n';
553 os <<
"* ********************************************************************************** " <<
endl;
Tps< T > log(const Tps< T > &x)
Natural logarithm.
Tps< T > sqrt(const Tps< T > &x)
Square root.
UniformCartesian< 3, double > Mesh_t
CenteredFieldLayout< 3, Mesh_t, Center_t > FieldLayout_t
PETE_TTTree< OpWhere, typename Cond_t::PETE_Expr_t, typename True_t::PETE_Expr_t, PETE_Scalar< Vektor< T, Dim > > > where(const PETE_Expr< Cond_t > &c, const PETE_Expr< True_t > &t, const Vektor< T, Dim > &f)
PETE_TUTree< FnArcTan, typename T::PETE_Expr_t > atan(const PETE_Expr< T > &l)
Inform & endl(Inform &inf)
bool lt(double x, double y)
static void calculate(Vektor< T, 3 > &hrsq, FT &grn, FT2 *grnI)
NDIndex< 3 > domainFFTConstruct_m
std::unique_ptr< Mesh_t > mesh4_m
void shiftedIntGreensFunction(double zshift)
compute the shifted integrated Green function as described in Three-dimensional quasistatic model for...
std::unique_ptr< FieldLayout_t > layout3_m
void computePotential(Field_t &rho, Vector_t hr, double zshift)
FFT< RCTransform, 3, double > FFT_t
IpplTimings::TimerRef GreensFunctionTimer_m
std::unique_ptr< FFT_t > fft_m
FFTPoissonSolver(PartBunch &bunch, std::string greensFuntion)
std::unique_ptr< FieldLayout_t > layout2_m
BConds< Vector_t, 3, Mesh_t, Center_t > vbc_m
std::unique_ptr< Mesh_t > mesh3_m
Inform & print(Inform &os) const
std::unique_ptr< Mesh_t > mesh2_m
std::unique_ptr< FieldLayout_t > layout4_m
BConds< double, 3, Mesh_t, Center_t > bc_m
for defining the boundary conditions
IpplTimings::TimerRef ComputePotential_m
void integratedGreensFunction()
compute the integrated Green function as described in Three-dimensional quasistatic model for high br...
void initialize(Layout_t &)
const NDIndex< Dim > & getDomain() const
e_dim_tag getRequestedDistribution(unsigned int d) const
MFLOAT get_meshSpacing(unsigned d) const
static TimerRef getTimer(const char *nm)
static void stopTimer(TimerRef t)
static void startTimer(TimerRef t)
Vektor< double, 3 > Vector_t