|
IPPL API Reference
Independent Parallel Particle Layer C++ API
|
Inheritance diagram for ippl::FFTOpenPoissonSolver< FieldLHS, FieldRHS >:
Collaboration diagram for ippl::FFTOpenPoissonSolver< FieldLHS, FieldRHS >:Public Types | |
| enum | Algorithm { HOCKNEY = 0b01 , VICO = 0b10 , BIHARMONIC = 0b11 , DCT_VICO = 0b100 } |
| enum | GreenFunction { STANDARD = 0 , INTEGRATED = 1 } |
| Real-space Green-function model used by the Hockney open-boundary solver. More... | |
| using | Base = Poisson< FieldLHS, FieldRHS > |
| typedef FFT< RCTransform, FieldRHS > | FFT_t |
| typedef FieldRHS | Field_t |
| typedef FieldLHS::Centering_t | Centering |
| typedef Field< int, Dim, mesh_type, Centering > | IField_t |
| typedef Field< Tg, Dim, mesh_type, Centering > | Field_gt |
| typedef Field< Kokkos::complex< Tg >, Dim, mesh_type, Centering > | CxField_gt |
| typedef FFT_t::ComplexField | CxField_t |
| typedef Vector< Trhs, Dim > | Vector_t |
| typedef mesh_type::matrix_type | Matrix_t |
| typedef Field< Matrix_t, Dim, mesh_type, Centering > | MField_t |
| typedef FieldLayout< Dim > | FieldLayout_t |
| using | memory_space = typename FieldLHS::memory_space |
| using | buffer_type = mpi::Communicator::buffer_type< memory_space > |
| using | vector_type = typename mesh_type::vector_type |
| using | scalar_type = typename mesh_type::value_type |
| using | lhs_type = FieldLHS |
| using | rhs_type = FieldRHS |
Public Types inherited from ippl::Poisson< FieldLHS, FieldRHS > | |
| enum | OutputType { SOL = 0b01 , GRAD = 0b10 , SOL_AND_GRAD = 0b11 } |
| using | lhs_type = FieldLHS |
| using | rhs_type = FieldRHS |
| using | Tlhs = typename FieldLHS::value_type |
| using | Trhs = typename FieldRHS::value_type |
| using | grad_type = Field< Vector< Tlhs, Dim >, Dim, Mesh, Centering > |
Public Member Functions | |
| FFTOpenPoissonSolver (rhs_type &rhs, ParameterList ¶ms) | |
| FFTOpenPoissonSolver (lhs_type &lhs, rhs_type &rhs, ParameterList ¶ms) | |
| void | setRhs (rhs_type &rhs) override |
| void | setGradFD () |
| void | solve () override |
| MField_t * | getHessian () override |
| void | greensFunction () |
| Compute and cache the FFT of the selected Green function. | |
| void | shiftedGreensFunction (const Vector< double, Dim > &shift) |
| Replace the cached kernel by a shifted Hockney Green function. | |
| void | initializeFields () |
| void | communicateVico (Vector< int, Dim > size, typename CxField_gt::view_type view_g, const ippl::NDIndex< Dim > ldom_g, const int nghost_g, typename Field_t::view_type view, const ippl::NDIndex< Dim > ldom, const int nghost) |
| void | communicateVico (Vector< int, Dim > size, typename Field_t::view_type view_g, const ippl::NDIndex< Dim > ldom_g, const int nghost_g, typename Field_t::view_type view, const ippl::NDIndex< Dim > ldom, const int nghost) |
Public Member Functions inherited from ippl::Poisson< FieldLHS, FieldRHS > | |
| Poisson () | |
| Poisson (lhs_type &lhs, rhs_type &rhs) | |
| template<typename T > | |
| void | updateParameter (const std::string &key, const T &value) |
| void | updateParameters (const ParameterList ¶ms) |
| void | mergeParameters (const ParameterList ¶ms) |
| virtual void | setLhs (lhs_type &lhs) |
| void | setGradient (grad_type &grad) |
Protected Member Functions | |
| virtual void | setDefaultParameters () override |
Additional Inherited Members | |
Protected Attributes inherited from ippl::Poisson< FieldLHS, FieldRHS > | |
| ParameterList | params_m |
| rhs_type * | rhs_mp = nullptr |
| lhs_type * | lhs_mp = nullptr |
| grad_type * | grad_mp |
| enum ippl::FFTOpenPoissonSolver::GreenFunction |
Real-space Green-function model used by the Hockney open-boundary solver.
STANDARD samples the free-space Green function at doubled-grid points:
\[ G(\mathbf{r}) = -\frac{1}{4\pi |\mathbf{r}|}. \]
INTEGRATED uses the cell-averaged Green function of Qiang et al. for a uniform charge density in each source cell:
\[ \overline{G}(\mathbf{r}) = -\frac{1}{4\pi h_x h_y h_z} \int_{-h_x/2}^{h_x/2} \int_{-h_y/2}^{h_y/2} \int_{-h_z/2}^{h_z/2} \frac{dx' dy' dz'} {\sqrt{(x-x')^2 + (y-y')^2 + (z-z')^2}}. \]
The integrated kernel is currently supported for 3D Hockney open boundary conditions only. It is intended for high-aspect-ratio beams where point sampling of \(1/r\) can be inefficient near narrow dimensions.
References:
|
inlineoverridevirtual |
Get the Hessian matrix of the solution
Reimplemented from ippl::Poisson< FieldLHS, FieldRHS >.
| void ippl::FFTOpenPoissonSolver< FieldLHS, FieldRHS >::greensFunction | ( | ) |
Compute and cache the FFT of the selected Green function.
The selected kernel is controlled by the integer parameter greens_function, with values from GreenFunction. For Hockney, the real-space kernel is filled on the doubled convolution grid and then transformed into grntr_m. The default is GreenFunction::STANDARD to preserve historical IPPL behavior.
|
inlineoverrideprotectedvirtual |
Utility function for initializing a solver's default parameters (to be overridden for each base class)
Reimplemented from ippl::Poisson< FieldLHS, FieldRHS >.
|
overridevirtual |
Set the problem RHS
| rhs | Reference to problem RHS field |
Reimplemented from ippl::Poisson< FieldLHS, FieldRHS >.
| void ippl::FFTOpenPoissonSolver< FieldLHS, FieldRHS >::shiftedGreensFunction | ( | const Vector< double, Dim > & | shift | ) |
Replace the cached kernel by a shifted Hockney Green function.
For GreenFunction::STANDARD, the shifted kernel is
\[ G_s(\mathbf{r}) = -\frac{1}{4\pi |\mathbf{r}-\mathbf{s}|}, \]
where \(\mathbf{s}\) is shift.
For GreenFunction::INTEGRATED, the same translation is applied before the cell average:
\[ \overline{G}_s(\mathbf{r}) = -\frac{1}{4\pi h_x h_y h_z} \int_{\mathrm{cell}} \frac{d^3\mathbf{r}'} {|\mathbf{r}-\mathbf{s}-\mathbf{r}'|}. \]
After this call, solve() convolves the RHS with the shifted kernel until greensFunction() is called again or the mesh spacing changes.
Intended use for Dirichlet boundary conditions via the method of images: choose the shift from the plane location and domain center, solve with the shifted kernel, then let the caller flip/sign-compose the image contribution. See test/solver/TestShiftedGreensFunction.cpp for the reference orchestration.
algorithm == HOCKNEY. Dim == 3.
|
overridevirtual |
Solve the Poisson problem described by -laplace(lhs) = rhs
Implements ippl::Poisson< FieldLHS, FieldRHS >.