OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
|
#include <P3MPoissonSolver.h>
Public Types | |
typedef FFT< RCTransform, 3, double > | FFT_t |
Public Member Functions | |
P3MPoissonSolver (Mesh_t *mesh, FieldLayout_t *fl, double interaction_radius, double alpha, std::string greensFunction) | |
~P3MPoissonSolver () | |
void | initializeFields () |
void | calculatePairForces (PartBunchBase< double, 3 > *bunch, double gammaz) override |
void | computePotential (Field_t &rho, Vector_t hr) override |
void | computePotential (Field_t &rho, Vector_t hr, double zshift) override |
void | greensFunction () |
void | integratedGreensFunction () |
void | mirrorRhoField () |
void | test (PartBunchBase< double, 3 > *) override |
double | getXRangeMin (unsigned short) override |
double | getXRangeMax (unsigned short) override |
double | getYRangeMin (unsigned short) override |
double | getYRangeMax (unsigned short) override |
double | getZRangeMin (unsigned short) override |
double | getZRangeMax (unsigned short) override |
double | getinteractionRadius () const override |
Inform & | print (Inform &os) const |
Public Member Functions inherited from PoissonSolver | |
virtual void | computePotential (Field_t &rho, Vector_t hr)=0 |
virtual void | solve (AmrScalarFieldContainer_t &, AmrScalarFieldContainer_t &, AmrVectorFieldContainer_t &, unsigned short, unsigned short, bool=true) |
virtual void | hasToRegrid () |
virtual void | computePotential (Field_t &rho, Vector_t hr, double zshift)=0 |
virtual double | getXRangeMin (unsigned short level=0)=0 |
virtual double | getXRangeMax (unsigned short level=0)=0 |
virtual double | getYRangeMin (unsigned short level=0)=0 |
virtual double | getYRangeMax (unsigned short level=0)=0 |
virtual double | getZRangeMin (unsigned short level=0)=0 |
virtual double | getZRangeMax (unsigned short level=0)=0 |
virtual void | test (PartBunchBase< double, 3 > *bunch)=0 |
virtual | ~PoissonSolver () |
virtual void | resizeMesh (Vector_t &, Vector_t &, const Vector_t &, const Vector_t &, double) |
virtual double | getinteractionRadius () const |
virtual void | calculatePairForces (PartBunchBase< double, 3 > *, double) |
Private Attributes | |
Field_t | rho_m |
Field_t | rho2_m |
CxField_t | rho2tr_m |
IField_t | grnIField_m [3] |
CxField_t | grntr_m |
std::unique_ptr< FFT_t > | fft_mp |
Mesh_t * | mesh_mp |
FieldLayout_t * | layout_mp |
std::unique_ptr< Mesh_t > | mesh2_mp |
std::unique_ptr< FieldLayout_t > | layout2_mp |
std::unique_ptr< Mesh_t > | mesh3_mp |
std::unique_ptr< FieldLayout_t > | layout3_mp |
std::unique_ptr< Mesh_t > | mesh4_mp |
std::unique_ptr< FieldLayout_t > | layout4_mp |
Field_t | tmpgreen_m |
NDIndex< 3 > | domain_m |
NDIndex< 3 > | domain2_m |
NDIndex< 3 > | domain3_m |
NDIndex< 3 > | domain4_m |
NDIndex< 3 > | domainFFTConstruct_m |
double | interaction_radius_m |
double | alpha_m |
Vector_t | hr_m |
Vektor< int, 3 > | nr_m |
double | ke_m |
bool | integratedGreens_m |
IpplTimings::TimerRef | GreensFunctionTimer_m |
IpplTimings::TimerRef | ComputePotential_m |
IpplTimings::TimerRef | CalculatePairForces_m |
Additional Inherited Members | |
Protected Types inherited from PoissonSolver | |
typedef Field< int, 3, Mesh_t, Center_t > | IField_t |
typedef Field< std::complex< double >, 3, Mesh_t, Center_t > | CxField_t |
Definition at line 48 of file P3MPoissonSolver.h.
typedef FFT<RCTransform, 3, double> P3MPoissonSolver::FFT_t |
Definition at line 51 of file P3MPoissonSolver.h.
P3MPoissonSolver::P3MPoissonSolver | ( | Mesh_t * | mesh, |
FieldLayout_t * | fl, | ||
double | interaction_radius, | ||
double | alpha, | ||
std::string | greensFunction | ||
) |
Definition at line 107 of file P3MPoissonSolver.cpp.
References CalculatePairForces_m, ComputePotential_m, Physics::epsilon_0, IpplTimings::getTimer(), greensFunction(), GreensFunctionTimer_m, initializeFields(), integratedGreens_m, ke_m, and Physics::pi.
P3MPoissonSolver::~P3MPoissonSolver | ( | ) |
Definition at line 128 of file P3MPoissonSolver.cpp.
|
overridevirtual |
Reimplemented from PoissonSolver.
Definition at line 211 of file P3MPoissonSolver.cpp.
References alpha_m, CalculatePairForces_m, HashPairBuilderParallel< PBase >::forEach(), PartBunchBase< T, Dim >::getGhostNum(), PartBunchBase< T, Dim >::getLocalNum(), integratedGreens_m, interaction_radius_m, ke_m, PartBunchBase< T, Dim >::R, IpplTimings::startTimer(), and IpplTimings::stopTimer().
Implements PoissonSolver.
Definition at line 248 of file P3MPoissonSolver.cpp.
References ComputePotential_m, domain_m, fft_mp, greensFunction(), GreensFunctionTimer_m, grntr_m, hr_m, integratedGreens_m, integratedGreensFunction(), rho2_m, rho2tr_m, IpplTimings::startTimer(), and IpplTimings::stopTimer().
|
overridevirtual |
Implements PoissonSolver.
Definition at line 298 of file P3MPoissonSolver.cpp.
|
inlineoverridevirtual |
Reimplemented from PoissonSolver.
Definition at line 87 of file P3MPoissonSolver.h.
References interaction_radius_m.
|
inlineoverridevirtual |
Implements PoissonSolver.
Definition at line 82 of file P3MPoissonSolver.h.
|
inlineoverridevirtual |
Implements PoissonSolver.
Definition at line 81 of file P3MPoissonSolver.h.
|
inlineoverridevirtual |
Implements PoissonSolver.
Definition at line 84 of file P3MPoissonSolver.h.
|
inlineoverridevirtual |
Implements PoissonSolver.
Definition at line 83 of file P3MPoissonSolver.h.
|
inlineoverridevirtual |
Implements PoissonSolver.
Definition at line 86 of file P3MPoissonSolver.h.
|
inlineoverridevirtual |
Implements PoissonSolver.
Definition at line 85 of file P3MPoissonSolver.h.
void P3MPoissonSolver::greensFunction | ( | ) |
Definition at line 304 of file P3MPoissonSolver.cpp.
References alpha_m, fft_mp, grnIField_m, grntr_m, hr_m, and rho2_m.
Referenced by computePotential(), and P3MPoissonSolver().
void P3MPoissonSolver::initializeFields | ( | ) |
Definition at line 132 of file P3MPoissonSolver.cpp.
References domain2_m, domain3_m, domain4_m, domain_m, domainFFTConstruct_m, fft_mp, UniformCartesian< Dim, MFLOAT >::get_meshSpacing(), FieldLayout< Dim >::getDomain(), FieldLayout< Dim >::getRequestedDistribution(), grnIField_m, grntr_m, hr_m, Field< T, Dim, M, C >::initialize(), integratedGreens_m, layout2_mp, layout3_mp, layout4_mp, layout_mp, cmp_diff::lt(), mesh2_mp, mesh3_mp, mesh4_mp, mesh_mp, nr_m, rho2_m, rho2tr_m, tmpgreen_m, and where().
Referenced by P3MPoissonSolver().
void P3MPoissonSolver::integratedGreensFunction | ( | ) |
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 we assume the charge density function is uniform within each cell then we can integrate the Green's function within a cell and use it to improve the accuracy.
We do not use the standard P3M Green's function erf(\alpha r)/r and do the integration as no closed form expression is available. Instead we use the zeroth order truncated polynomial from "Hünenberger, P. H. (2000). The Journal of Chemical Physics, 113(23), 10464-10476" Table I in the appendix. The integration of higher-order polynomials gives complex Green's functions and hence has not been implemented yet.
This integral can be calculated analytically in a closed from:
Definition at line 333 of file P3MPoissonSolver.cpp.
References atan(), fft_mp, grntr_m, hr_m, interaction_radius_m, layout4_mp, log(), mirrorRhoField(), nr_m, pow(), rho2_m, sqrt(), and tmpgreen_m.
Referenced by computePotential().
void P3MPoissonSolver::mirrorRhoField | ( | ) |
Definition at line 393 of file P3MPoissonSolver.cpp.
Referenced by integratedGreensFunction().
Definition at line 417 of file P3MPoissonSolver.cpp.
References alpha_m, endl(), hr_m, and interaction_radius_m.
|
inlineoverridevirtual |
Implements PoissonSolver.
Definition at line 79 of file P3MPoissonSolver.h.
|
private |
Definition at line 138 of file P3MPoissonSolver.h.
Referenced by calculatePairForces(), greensFunction(), and print().
|
private |
Definition at line 148 of file P3MPoissonSolver.h.
Referenced by calculatePairForces(), and P3MPoissonSolver().
|
private |
Definition at line 147 of file P3MPoissonSolver.h.
Referenced by computePotential(), and P3MPoissonSolver().
|
private |
Definition at line 132 of file P3MPoissonSolver.h.
Referenced by initializeFields().
|
private |
Definition at line 133 of file P3MPoissonSolver.h.
Referenced by initializeFields().
|
private |
Definition at line 134 of file P3MPoissonSolver.h.
Referenced by initializeFields().
|
private |
Definition at line 131 of file P3MPoissonSolver.h.
Referenced by computePotential(), and initializeFields().
|
private |
Definition at line 135 of file P3MPoissonSolver.h.
Referenced by initializeFields().
|
private |
Definition at line 110 of file P3MPoissonSolver.h.
Referenced by computePotential(), greensFunction(), initializeFields(), and integratedGreensFunction().
|
private |
Definition at line 146 of file P3MPoissonSolver.h.
Referenced by computePotential(), and P3MPoissonSolver().
|
private |
Definition at line 103 of file P3MPoissonSolver.h.
Referenced by greensFunction(), and initializeFields().
|
private |
Definition at line 107 of file P3MPoissonSolver.h.
Referenced by computePotential(), greensFunction(), initializeFields(), and integratedGreensFunction().
|
private |
Definition at line 140 of file P3MPoissonSolver.h.
Referenced by computePotential(), greensFunction(), initializeFields(), integratedGreensFunction(), and print().
|
private |
Definition at line 144 of file P3MPoissonSolver.h.
Referenced by calculatePairForces(), computePotential(), initializeFields(), and P3MPoissonSolver().
|
private |
Definition at line 137 of file P3MPoissonSolver.h.
Referenced by calculatePairForces(), getinteractionRadius(), integratedGreensFunction(), and print().
|
private |
Definition at line 142 of file P3MPoissonSolver.h.
Referenced by calculatePairForces(), and P3MPoissonSolver().
|
private |
Definition at line 118 of file P3MPoissonSolver.h.
Referenced by initializeFields().
|
private |
Definition at line 121 of file P3MPoissonSolver.h.
Referenced by initializeFields().
|
private |
Definition at line 125 of file P3MPoissonSolver.h.
Referenced by initializeFields(), and integratedGreensFunction().
|
private |
Definition at line 114 of file P3MPoissonSolver.h.
Referenced by initializeFields().
|
private |
Definition at line 117 of file P3MPoissonSolver.h.
Referenced by initializeFields().
|
private |
Definition at line 120 of file P3MPoissonSolver.h.
Referenced by initializeFields().
|
private |
Definition at line 124 of file P3MPoissonSolver.h.
Referenced by initializeFields().
|
private |
Definition at line 113 of file P3MPoissonSolver.h.
Referenced by initializeFields().
|
private |
Definition at line 141 of file P3MPoissonSolver.h.
Referenced by initializeFields(), integratedGreensFunction(), and mirrorRhoField().
|
private |
Definition at line 95 of file P3MPoissonSolver.h.
Referenced by computePotential(), greensFunction(), initializeFields(), integratedGreensFunction(), and mirrorRhoField().
|
private |
Definition at line 99 of file P3MPoissonSolver.h.
Referenced by computePotential(), and initializeFields().
|
private |
Definition at line 93 of file P3MPoissonSolver.h.
|
private |
Definition at line 128 of file P3MPoissonSolver.h.
Referenced by initializeFields(), and integratedGreensFunction().