OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
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 class PartBunch;
28 
30 public:
31  // constructor and destructor
32  FFTBoxPoissonSolver(PartBunch &bunch, std::string greensFuntion);
33 
34  FFTBoxPoissonSolver(Mesh_t *mesh, FieldLayout_t *fl, std::string greensFunction, double boxSize);
35 
37 
38  // given a charge-density field rho and a set of mesh spacings hr,
39  // compute the scalar potential with image charges at -z
40  void computePotential(Field_t &rho, Vector_t hr, double zshift);
41 
42  // given a charge-density field rho and a set of mesh spacings hr,
43  // compute the scalar potential in open space
44  void computePotential(Field_t &rho, Vector_t hr);
45 
46  // compute the green's function for a Poisson problem and put it in in grntm_m
47  // uses grnIField_m to eliminate excess calculation in greenFunction()
48  // given mesh information in nr and hr
49  void greensFunction();
50 
53 
55  void shiftedIntGreensFunction(double zshift);
56 
57  double getXRangeMin(unsigned short level) {return -a_m;}
58  double getXRangeMax(unsigned short level) {return a_m;}
59  double getYRangeMin(unsigned short level) {return -a_m;}
60  double getYRangeMax(unsigned short level) {return a_m;}
61  double getZRangeMin(unsigned short level) {return -a_m; }
62  double getZRangeMax(unsigned short level) {return a_m; }
63  void test(PartBunchBase<double, 3> *bunch) { }
64 
65 
66  Inform &print(Inform &os) const;
67 
68 private:
69 
70  // rho2_m is the charge-density field with mesh doubled in each dimension
72 
73  // grntr_m is the Fourier transformed Green's function
75 
76  // Fields used to eliminate excess calculation in greensFunction()
77  // mesh2_m and layout2_m are used
79 
81 
82  // mesh and layout objects for rho_m
85 
86  // mesh and layout objects for rho2_m
89 
90  // tmp
92 
93  // domains for the various fields
94  NDIndex<3> domain_m; // original domain, gridsize
95  // mesh and gridsize defined outside of FFT class, given as
96  // parameter to the constructor (mesh and layout object).
97  NDIndex<3> domain2_m; // doubled gridsize (2*Nx,2*Ny,2*Nz)
98  // (2*Nx,Ny,2*Nz)
99  // mesh spacing and size values
102 
103  std::string greensFunction_m;
104 
105  double a_m; // the box size
106 
108 
113 
118 
121 };
122 
124  return fs.print(os);
125 }
126 
127 
128 
129 #endif
130 
131 /***************************************************************************
132  * $RCSfile: FFTBoxPoissonSolver.hh,v $ $Author: adelmann $
133  * $Revision: 1.1.1.1 $ $Date: 2001/08/08 11:21:48 $
134  ***************************************************************************/
std::ostream & operator<<(std::ostream &os, const Attribute &attr)
Definition: Attribute.cpp:167
double getZRangeMin(unsigned short level)
IpplTimings::TimerRef ShIntGreensFunctionTimer4_m
IpplTimings::TimerRef IntGreensFunctionTimer1_m
IpplTimings::TimerRef ShIntGreensFunctionTimer2_m
void shiftedIntGreensFunction(double zshift)
compute the shifted integrated Green function as described in Three-dimensional quasistatic model for...
IpplTimings::TimerRef GreensFunctionTimer4_m
FRONT * fs
Definition: hypervolume.cpp:59
IpplTimings::TimerRef IntGreensFunctionTimer4_m
IpplTimings::TimerRef ShIntGreensFunctionTimer3_m
double getYRangeMin(unsigned short level)
Inform & print(Inform &os) const
IpplTimings::TimerRef GreensFunctionTimer1_m
double getYRangeMax(unsigned short level)
void integratedGreensFunction()
compute the integrated Green function as described in Three-dimensional quasistatic model for high br...
double getZRangeMax(unsigned short level)
Definition: FFT.h:52
FieldLayout_t * layout2_m
void computePotential(Field_t &rho, Vector_t hr, double zshift)
IpplTimings::TimerRef ShIntGreensFunctionTimer1_m
Particle Bunch.
Definition: PartBunch.h:30
double getXRangeMax(unsigned short level)
IpplTimings::TimerRef GreensFunctionTimer_m
FieldLayout_t * layout_m
void test(PartBunchBase< double, 3 > *bunch)
Timing::TimerRef TimerRef
Definition: IpplTimings.h:176
IpplTimings::TimerRef IntGreensFunctionTimer2_m
Definition: Inform.h:41
double getXRangeMin(unsigned short level)
IpplTimings::TimerRef IntGreensFunctionTimer3_m
FFTBoxPoissonSolver(PartBunch &bunch, std::string greensFuntion)