OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
Public Member Functions | Private Attributes | List of all members
FFTBoxPoissonSolver Class Reference

#include <FFTBoxPoissonSolver.h>

Inheritance diagram for FFTBoxPoissonSolver:
Inheritance graph
[legend]
Collaboration diagram for FFTBoxPoissonSolver:
Collaboration graph
[legend]

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 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)
 
Informprint (Inform &os) const
 
- Public Member Functions inherited from PoissonSolver
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 Attributes

Field_t rho2_m
 
Field_t grntr_m
 
IField_t grnIField_m [3]
 
SINE_tsine_m
 
Mesh_tmesh_m
 
FieldLayout_tlayout_m
 
Mesh_tmesh2_m
 
FieldLayout_tlayout2_m
 
Field_t tmpgreen
 
NDIndex< 3 > domain_m
 
NDIndex< 3 > domain2_m
 
Vector_t hr_m
 
Vektor< int, 3 > nr_m
 
std::string greensFunction_m
 
double a_m
 
IpplTimings::TimerRef GreensFunctionTimer_m
 
IpplTimings::TimerRef IntGreensFunctionTimer1_m
 
IpplTimings::TimerRef IntGreensFunctionTimer2_m
 
IpplTimings::TimerRef IntGreensFunctionTimer3_m
 
IpplTimings::TimerRef IntGreensFunctionTimer4_m
 
IpplTimings::TimerRef ShIntGreensFunctionTimer1_m
 
IpplTimings::TimerRef ShIntGreensFunctionTimer2_m
 
IpplTimings::TimerRef ShIntGreensFunctionTimer3_m
 
IpplTimings::TimerRef ShIntGreensFunctionTimer4_m
 
IpplTimings::TimerRef GreensFunctionTimer1_m
 
IpplTimings::TimerRef GreensFunctionTimer4_m
 

Detailed Description

Definition at line 29 of file FFTBoxPoissonSolver.h.

Constructor & Destructor Documentation

FFTBoxPoissonSolver::FFTBoxPoissonSolver ( PartBunch bunch,
std::string  greensFuntion 
)
FFTBoxPoissonSolver::FFTBoxPoissonSolver ( Mesh_t mesh,
FieldLayout_t fl,
std::string  greensFunction,
double  boxSize 
)
FFTBoxPoissonSolver::~FFTBoxPoissonSolver ( )

Definition at line 178 of file FFTBoxPoissonSolver.cpp.

References sine_m.

Member Function Documentation

void FFTBoxPoissonSolver::computePotential ( Field_t rho,
Vector_t  hr,
double  zshift 
)
virtual

Implements PoissonSolver.

Definition at line 188 of file FFTBoxPoissonSolver.cpp.

References GreensFunctionTimer_m, grntr_m, hr_m, K, nr_m, shiftedIntGreensFunction(), sine_m, IpplTimings::startTimer(), and IpplTimings::stopTimer().

Here is the call graph for this function:

void FFTBoxPoissonSolver::computePotential ( Field_t rho,
Vector_t  hr 
)
virtual
double FFTBoxPoissonSolver::getXRangeMax ( unsigned short  level)
inlinevirtual

Implements PoissonSolver.

Definition at line 58 of file FFTBoxPoissonSolver.h.

References a_m.

double FFTBoxPoissonSolver::getXRangeMin ( unsigned short  level)
inlinevirtual

Implements PoissonSolver.

Definition at line 57 of file FFTBoxPoissonSolver.h.

References a_m.

double FFTBoxPoissonSolver::getYRangeMax ( unsigned short  level)
inlinevirtual

Implements PoissonSolver.

Definition at line 60 of file FFTBoxPoissonSolver.h.

References a_m.

double FFTBoxPoissonSolver::getYRangeMin ( unsigned short  level)
inlinevirtual

Implements PoissonSolver.

Definition at line 59 of file FFTBoxPoissonSolver.h.

References a_m.

double FFTBoxPoissonSolver::getZRangeMax ( unsigned short  level)
inlinevirtual

Implements PoissonSolver.

Definition at line 62 of file FFTBoxPoissonSolver.h.

References a_m.

double FFTBoxPoissonSolver::getZRangeMin ( unsigned short  level)
inlinevirtual

Implements PoissonSolver.

Definition at line 61 of file FFTBoxPoissonSolver.h.

References a_m.

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().

Here is the call graph for this function:

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, K, layout2_m, log(), min(), nr_m, sine_m, sqrt(), IpplTimings::startTimer(), IpplTimings::stopTimer(), and tmpgreen.

Referenced by computePotential().

Here is the call graph for this function:

Inform & FFTBoxPoissonSolver::print ( Inform os) const

Definition at line 512 of file FFTBoxPoissonSolver.cpp.

References endl(), and hr_m.

Referenced by operator<<().

Here is the call graph for this function:

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, Mesh, Centering >::initialize(), K, 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().

Here is the call graph for this function:

void FFTBoxPoissonSolver::test ( PartBunchBase< double, 3 > *  bunch)
inlinevirtual

Implements PoissonSolver.

Definition at line 63 of file FFTBoxPoissonSolver.h.

Member Data Documentation

double FFTBoxPoissonSolver::a_m
private
NDIndex<3> FFTBoxPoissonSolver::domain2_m
private

Definition at line 97 of file FFTBoxPoissonSolver.h.

NDIndex<3> FFTBoxPoissonSolver::domain_m
private

Definition at line 94 of file FFTBoxPoissonSolver.h.

Referenced by FFTBoxPoissonSolver().

std::string FFTBoxPoissonSolver::greensFunction_m
private

Definition at line 103 of file FFTBoxPoissonSolver.h.

Referenced by computePotential(), and FFTBoxPoissonSolver().

IpplTimings::TimerRef FFTBoxPoissonSolver::GreensFunctionTimer1_m
private

Definition at line 119 of file FFTBoxPoissonSolver.h.

Referenced by FFTBoxPoissonSolver(), and greensFunction().

IpplTimings::TimerRef FFTBoxPoissonSolver::GreensFunctionTimer4_m
private

Definition at line 120 of file FFTBoxPoissonSolver.h.

Referenced by FFTBoxPoissonSolver(), and greensFunction().

IpplTimings::TimerRef FFTBoxPoissonSolver::GreensFunctionTimer_m
private

Definition at line 107 of file FFTBoxPoissonSolver.h.

Referenced by computePotential(), and FFTBoxPoissonSolver().

IField_t FFTBoxPoissonSolver::grnIField_m[3]
private

Definition at line 78 of file FFTBoxPoissonSolver.h.

Referenced by FFTBoxPoissonSolver(), and greensFunction().

Field_t FFTBoxPoissonSolver::grntr_m
private
Vector_t FFTBoxPoissonSolver::hr_m
private
IpplTimings::TimerRef FFTBoxPoissonSolver::IntGreensFunctionTimer1_m
private

Definition at line 109 of file FFTBoxPoissonSolver.h.

Referenced by FFTBoxPoissonSolver(), and integratedGreensFunction().

IpplTimings::TimerRef FFTBoxPoissonSolver::IntGreensFunctionTimer2_m
private

Definition at line 110 of file FFTBoxPoissonSolver.h.

Referenced by FFTBoxPoissonSolver(), and integratedGreensFunction().

IpplTimings::TimerRef FFTBoxPoissonSolver::IntGreensFunctionTimer3_m
private

Definition at line 111 of file FFTBoxPoissonSolver.h.

Referenced by FFTBoxPoissonSolver(), and integratedGreensFunction().

IpplTimings::TimerRef FFTBoxPoissonSolver::IntGreensFunctionTimer4_m
private

Definition at line 112 of file FFTBoxPoissonSolver.h.

Referenced by FFTBoxPoissonSolver(), and integratedGreensFunction().

FieldLayout_t* FFTBoxPoissonSolver::layout2_m
private

Definition at line 88 of file FFTBoxPoissonSolver.h.

Referenced by integratedGreensFunction(), and shiftedIntGreensFunction().

FieldLayout_t* FFTBoxPoissonSolver::layout_m
private

Definition at line 84 of file FFTBoxPoissonSolver.h.

Referenced by FFTBoxPoissonSolver().

Mesh_t* FFTBoxPoissonSolver::mesh2_m
private

Definition at line 87 of file FFTBoxPoissonSolver.h.

Referenced by shiftedIntGreensFunction().

Mesh_t* FFTBoxPoissonSolver::mesh_m
private

Definition at line 83 of file FFTBoxPoissonSolver.h.

Referenced by FFTBoxPoissonSolver().

Vektor<int, 3> FFTBoxPoissonSolver::nr_m
private
Field_t FFTBoxPoissonSolver::rho2_m
private

Definition at line 71 of file FFTBoxPoissonSolver.h.

IpplTimings::TimerRef FFTBoxPoissonSolver::ShIntGreensFunctionTimer1_m
private

Definition at line 114 of file FFTBoxPoissonSolver.h.

Referenced by FFTBoxPoissonSolver(), and shiftedIntGreensFunction().

IpplTimings::TimerRef FFTBoxPoissonSolver::ShIntGreensFunctionTimer2_m
private

Definition at line 115 of file FFTBoxPoissonSolver.h.

Referenced by FFTBoxPoissonSolver(), and shiftedIntGreensFunction().

IpplTimings::TimerRef FFTBoxPoissonSolver::ShIntGreensFunctionTimer3_m
private

Definition at line 116 of file FFTBoxPoissonSolver.h.

Referenced by FFTBoxPoissonSolver(), and shiftedIntGreensFunction().

IpplTimings::TimerRef FFTBoxPoissonSolver::ShIntGreensFunctionTimer4_m
private

Definition at line 117 of file FFTBoxPoissonSolver.h.

Referenced by FFTBoxPoissonSolver(), and shiftedIntGreensFunction().

SINE_t* FFTBoxPoissonSolver::sine_m
private
Field_t FFTBoxPoissonSolver::tmpgreen
private

The documentation for this class was generated from the following files: