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

#include <P3MPoissonSolver.h>

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

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
 
Informprint (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_tfft_mp
 
Mesh_tmesh_mp
 
FieldLayout_tlayout_mp
 
std::unique_ptr< Mesh_tmesh2_mp
 
std::unique_ptr< FieldLayout_tlayout2_mp
 
std::unique_ptr< Mesh_tmesh3_mp
 
std::unique_ptr< FieldLayout_tlayout3_mp
 
std::unique_ptr< Mesh_tmesh4_mp
 
std::unique_ptr< FieldLayout_tlayout4_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_tIField_t
 
typedef Field< std::complex< double >, 3, Mesh_t, Center_tCxField_t
 

Detailed Description

Definition at line 48 of file P3MPoissonSolver.h.

Member Typedef Documentation

◆ FFT_t

Definition at line 51 of file P3MPoissonSolver.h.

Constructor & Destructor Documentation

◆ P3MPoissonSolver()

P3MPoissonSolver::P3MPoissonSolver ( Mesh_t mesh,
FieldLayout_t fl,
double  interaction_radius,
double  alpha,
std::string  greensFunction 
)

◆ ~P3MPoissonSolver()

P3MPoissonSolver::~P3MPoissonSolver ( )

Definition at line 128 of file P3MPoissonSolver.cpp.

Member Function Documentation

◆ calculatePairForces()

void P3MPoissonSolver::calculatePairForces ( PartBunchBase< double, 3 > *  bunch,
double  gammaz 
)
overridevirtual

◆ computePotential() [1/2]

void P3MPoissonSolver::computePotential ( Field_t rho,
Vector_t  hr 
)
overridevirtual

◆ computePotential() [2/2]

void P3MPoissonSolver::computePotential ( Field_t rho,
Vector_t  hr,
double  zshift 
)
overridevirtual

Implements PoissonSolver.

Definition at line 298 of file P3MPoissonSolver.cpp.

◆ getinteractionRadius()

double P3MPoissonSolver::getinteractionRadius ( ) const
inlineoverridevirtual

Reimplemented from PoissonSolver.

Definition at line 87 of file P3MPoissonSolver.h.

References interaction_radius_m.

◆ getXRangeMax()

double P3MPoissonSolver::getXRangeMax ( unsigned short  )
inlineoverridevirtual

Implements PoissonSolver.

Definition at line 82 of file P3MPoissonSolver.h.

◆ getXRangeMin()

double P3MPoissonSolver::getXRangeMin ( unsigned short  )
inlineoverridevirtual

Implements PoissonSolver.

Definition at line 81 of file P3MPoissonSolver.h.

◆ getYRangeMax()

double P3MPoissonSolver::getYRangeMax ( unsigned short  )
inlineoverridevirtual

Implements PoissonSolver.

Definition at line 84 of file P3MPoissonSolver.h.

◆ getYRangeMin()

double P3MPoissonSolver::getYRangeMin ( unsigned short  )
inlineoverridevirtual

Implements PoissonSolver.

Definition at line 83 of file P3MPoissonSolver.h.

◆ getZRangeMax()

double P3MPoissonSolver::getZRangeMax ( unsigned short  )
inlineoverridevirtual

Implements PoissonSolver.

Definition at line 86 of file P3MPoissonSolver.h.

◆ getZRangeMin()

double P3MPoissonSolver::getZRangeMin ( unsigned short  )
inlineoverridevirtual

Implements PoissonSolver.

Definition at line 85 of file P3MPoissonSolver.h.

◆ greensFunction()

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

◆ initializeFields()

void P3MPoissonSolver::initializeFields ( )

◆ integratedGreensFunction()

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

Here is the call graph for this function:

◆ mirrorRhoField()

void P3MPoissonSolver::mirrorRhoField ( )

Definition at line 393 of file P3MPoissonSolver.cpp.

References nr_m, and rho2_m.

Referenced by integratedGreensFunction().

◆ print()

Inform & P3MPoissonSolver::print ( Inform os) const

Definition at line 417 of file P3MPoissonSolver.cpp.

References alpha_m, endl(), hr_m, and interaction_radius_m.

Here is the call graph for this function:

◆ test()

void P3MPoissonSolver::test ( PartBunchBase< double, 3 > *  )
inlineoverridevirtual

Implements PoissonSolver.

Definition at line 79 of file P3MPoissonSolver.h.

Member Data Documentation

◆ alpha_m

double P3MPoissonSolver::alpha_m
private

Definition at line 138 of file P3MPoissonSolver.h.

Referenced by calculatePairForces(), greensFunction(), and print().

◆ CalculatePairForces_m

IpplTimings::TimerRef P3MPoissonSolver::CalculatePairForces_m
private

Definition at line 148 of file P3MPoissonSolver.h.

Referenced by calculatePairForces(), and P3MPoissonSolver().

◆ ComputePotential_m

IpplTimings::TimerRef P3MPoissonSolver::ComputePotential_m
private

Definition at line 147 of file P3MPoissonSolver.h.

Referenced by computePotential(), and P3MPoissonSolver().

◆ domain2_m

NDIndex<3> P3MPoissonSolver::domain2_m
private

Definition at line 132 of file P3MPoissonSolver.h.

Referenced by initializeFields().

◆ domain3_m

NDIndex<3> P3MPoissonSolver::domain3_m
private

Definition at line 133 of file P3MPoissonSolver.h.

Referenced by initializeFields().

◆ domain4_m

NDIndex<3> P3MPoissonSolver::domain4_m
private

Definition at line 134 of file P3MPoissonSolver.h.

Referenced by initializeFields().

◆ domain_m

NDIndex<3> P3MPoissonSolver::domain_m
private

Definition at line 131 of file P3MPoissonSolver.h.

Referenced by computePotential(), and initializeFields().

◆ domainFFTConstruct_m

NDIndex<3> P3MPoissonSolver::domainFFTConstruct_m
private

Definition at line 135 of file P3MPoissonSolver.h.

Referenced by initializeFields().

◆ fft_mp

std::unique_ptr<FFT_t> P3MPoissonSolver::fft_mp
private

◆ GreensFunctionTimer_m

IpplTimings::TimerRef P3MPoissonSolver::GreensFunctionTimer_m
private

Definition at line 146 of file P3MPoissonSolver.h.

Referenced by computePotential(), and P3MPoissonSolver().

◆ grnIField_m

IField_t P3MPoissonSolver::grnIField_m[3]
private

Definition at line 103 of file P3MPoissonSolver.h.

Referenced by greensFunction(), and initializeFields().

◆ grntr_m

CxField_t P3MPoissonSolver::grntr_m
private

◆ hr_m

Vector_t P3MPoissonSolver::hr_m
private

◆ integratedGreens_m

bool P3MPoissonSolver::integratedGreens_m
private

◆ interaction_radius_m

double P3MPoissonSolver::interaction_radius_m
private

◆ ke_m

double P3MPoissonSolver::ke_m
private

Definition at line 142 of file P3MPoissonSolver.h.

Referenced by calculatePairForces(), and P3MPoissonSolver().

◆ layout2_mp

std::unique_ptr<FieldLayout_t> P3MPoissonSolver::layout2_mp
private

Definition at line 118 of file P3MPoissonSolver.h.

Referenced by initializeFields().

◆ layout3_mp

std::unique_ptr<FieldLayout_t> P3MPoissonSolver::layout3_mp
private

Definition at line 121 of file P3MPoissonSolver.h.

Referenced by initializeFields().

◆ layout4_mp

std::unique_ptr<FieldLayout_t> P3MPoissonSolver::layout4_mp
private

Definition at line 125 of file P3MPoissonSolver.h.

Referenced by initializeFields(), and integratedGreensFunction().

◆ layout_mp

FieldLayout_t* P3MPoissonSolver::layout_mp
private

Definition at line 114 of file P3MPoissonSolver.h.

Referenced by initializeFields().

◆ mesh2_mp

std::unique_ptr<Mesh_t> P3MPoissonSolver::mesh2_mp
private

Definition at line 117 of file P3MPoissonSolver.h.

Referenced by initializeFields().

◆ mesh3_mp

std::unique_ptr<Mesh_t> P3MPoissonSolver::mesh3_mp
private

Definition at line 120 of file P3MPoissonSolver.h.

Referenced by initializeFields().

◆ mesh4_mp

std::unique_ptr<Mesh_t> P3MPoissonSolver::mesh4_mp
private

Definition at line 124 of file P3MPoissonSolver.h.

Referenced by initializeFields().

◆ mesh_mp

Mesh_t* P3MPoissonSolver::mesh_mp
private

Definition at line 113 of file P3MPoissonSolver.h.

Referenced by initializeFields().

◆ nr_m

Vektor<int, 3> P3MPoissonSolver::nr_m
private

Definition at line 141 of file P3MPoissonSolver.h.

Referenced by initializeFields(), integratedGreensFunction(), and mirrorRhoField().

◆ rho2_m

Field_t P3MPoissonSolver::rho2_m
private

◆ rho2tr_m

CxField_t P3MPoissonSolver::rho2tr_m
private

Definition at line 99 of file P3MPoissonSolver.h.

Referenced by computePotential(), and initializeFields().

◆ rho_m

Field_t P3MPoissonSolver::rho_m
private

Definition at line 93 of file P3MPoissonSolver.h.

◆ tmpgreen_m

Field_t P3MPoissonSolver::tmpgreen_m
private

Definition at line 128 of file P3MPoissonSolver.h.

Referenced by initializeFields(), and integratedGreensFunction().


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