OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
FFTBoxPoissonSolver.h
Go to the documentation of this file.
1// -*- C++ -*-
2/***************************************************************************
3 *
4 *
5 * FFTBoxPoissonSolver.hh
6 *
7 * Open BC in x,y and z.
8 *
9 *
10 *
11 *
12 *
13 *
14 ***************************************************************************/
15
17// This class contains methods for solving Poisson's equation for the
18// space charge portion of the calculation.
20
21#ifndef FFT_BOXPOISSON_SOLVER_H_
22#define FFT_BOXPOISSON_SOLVER_H_
23
25#include "PoissonSolver.h"
26
27#include "FFT/FFT.h"
28
29class PartBunch;
31
33public:
35
36 // constructor and destructor
37 FFTBoxPoissonSolver(PartBunch &bunch, std::string greensFuntion);
38
39 FFTBoxPoissonSolver(Mesh_t *mesh, FieldLayout_t *fl, std::string greensFunction, double boxSize);
40
42
43 // given a charge-density field rho and a set of mesh spacings hr,
44 // compute the scalar potential with image charges at -z
45 void computePotential(Field_t &rho, Vector_t hr, double zshift);
46
47 // given a charge-density field rho and a set of mesh spacings hr,
48 // compute the scalar potential in open space
49 void computePotential(Field_t &rho, Vector_t hr);
50
51 // compute the green's function for a Poisson problem and put it in in grntm_m
52 // uses grnIField_m to eliminate excess calculation in greenFunction()
53 // given mesh information in nr and hr
54 void greensFunction();
55
58
60 void shiftedIntGreensFunction(double zshift);
61
62 double getXRangeMin(unsigned short /*level*/) {return -a_m;}
63 double getXRangeMax(unsigned short /*level*/) {return a_m;}
64 double getYRangeMin(unsigned short /*level*/) {return -a_m;}
65 double getYRangeMax(unsigned short /*level*/) {return a_m;}
66 double getZRangeMin(unsigned short /*level*/) {return -a_m; }
67 double getZRangeMax(unsigned short /*level*/) {return a_m; }
68 void test(PartBunchBase<double, 3> */*bunch*/) { }
69
70
71 Inform &print(Inform &os) const;
72
73private:
74
75 // rho2_m is the charge-density field with mesh doubled in each dimension
77
78 // grntr_m is the Fourier transformed Green's function
80
81 // Fields used to eliminate excess calculation in greensFunction()
82 // mesh2_m and layout2_m are used
84
86
87 // mesh and layout objects for rho_m
90
91 // mesh and layout objects for rho2_m
94
95 // tmp
97
98 // domains for the various fields
99 NDIndex<3> domain_m; // original domain, gridsize
100 // mesh and gridsize defined outside of FFT class, given as
101 // parameter to the constructor (mesh and layout object).
102 NDIndex<3> domain2_m; // doubled gridsize (2*Nx,2*Ny,2*Nz)
103 // (2*Nx,Ny,2*Nz)
104 // mesh spacing and size values
107
108 std::string greensFunction_m;
109
110 double a_m; // the box size
111
113
118
123
126};
127
129 return fs.print(os);
130}
131
132
133
134#endif
Inform & operator<<(Inform &os, const FFTBoxPoissonSolver &fs)
FRONT * fs
Definition: hypervolume.cpp:59
double getYRangeMin(unsigned short)
IpplTimings::TimerRef ShIntGreensFunctionTimer4_m
IpplTimings::TimerRef GreensFunctionTimer_m
double getXRangeMax(unsigned short)
FieldLayout_t * layout_m
void computePotential(Field_t &rho, Vector_t hr, double zshift)
Inform & print(Inform &os) const
IpplTimings::TimerRef ShIntGreensFunctionTimer2_m
double getZRangeMax(unsigned short)
void test(PartBunchBase< double, 3 > *)
FFT< SineTransform, 3, double > SINE_t
double getXRangeMin(unsigned short)
IpplTimings::TimerRef IntGreensFunctionTimer4_m
FieldLayout_t * layout2_m
IpplTimings::TimerRef IntGreensFunctionTimer3_m
void shiftedIntGreensFunction(double zshift)
compute the shifted integrated Green function as described in Three-dimensional quasistatic model for...
double getZRangeMin(unsigned short)
void integratedGreensFunction()
compute the integrated Green function as described in Three-dimensional quasistatic model for high br...
IpplTimings::TimerRef GreensFunctionTimer4_m
IpplTimings::TimerRef IntGreensFunctionTimer2_m
FFTBoxPoissonSolver(PartBunch &bunch, std::string greensFuntion)
IpplTimings::TimerRef ShIntGreensFunctionTimer3_m
double getYRangeMax(unsigned short)
IpplTimings::TimerRef GreensFunctionTimer1_m
IpplTimings::TimerRef IntGreensFunctionTimer1_m
IpplTimings::TimerRef ShIntGreensFunctionTimer1_m
Definition: FFT.h:48
Definition: Inform.h:42
Timing::TimerRef TimerRef
Definition: IpplTimings.h:176