12#ifndef IPPL_FFT_TRUNCATED_GREEN_PERIODIC_POISSON_SOLVER_H_SOLVER_H_
13#define IPPL_FFT_TRUNCATED_GREEN_PERIODIC_POISSON_SOLVER_H_SOLVER_H_
17#include "Field/Field.h"
20#include "FieldLayout/FieldLayout.h"
21#include "Meshes/UniformCartesian.h"
25 template <
typename FieldLHS,
typename FieldRHS>
27 constexpr static unsigned Dim = FieldLHS::dim;
28 using Trhs =
typename FieldRHS::value_type;
29 using mesh_type =
typename FieldRHS::Mesh_t;
36 using typename Base::lhs_type,
typename Base::rhs_type;
44 typedef FieldRHS Field_t;
46 typedef typename FFT_t::ComplexField CxField_t;
60 void setRhs(rhs_type& rhs)
override;
64 void solve()
override;
67 void initializeFields();
70 void greensFunction();
78 CxField_t tempFieldComplex_m;
84 std::unique_ptr<FFT_t> fft_m;
91 std::unique_ptr<mesh_type> meshComplex_m;
92 std::unique_ptr<FieldLayout_t> layoutComplex_m;
104 using heffteBackend =
typename FFT_t::heffteBackend;
105 heffte::plan_options opts = heffte::default_options<heffteBackend>();
106 this->params_m.
add(
"use_pencils", opts.use_pencils);
107 this->params_m.
add(
"use_reorder", opts.use_reorder);
108 this->params_m.
add(
"use_gpu_aware", opts.use_gpu_aware);
109 this->params_m.
add(
"r2c_direction", 0);
110 this->params_m.template add<Trhs>(
"alpha", 1);
111 this->params_m.template add<Trhs>(
"force_constant", 1);
113 switch (opts.algorithm) {
114 case heffte::reshape_algorithm::alltoall:
115 this->params_m.
add(
"comm", a2a);
117 case heffte::reshape_algorithm::alltoallv:
118 this->params_m.
add(
"comm", a2av);
120 case heffte::reshape_algorithm::p2p:
121 this->params_m.
add(
"comm", p2p);
123 case heffte::reshape_algorithm::p2p_plined:
124 this->params_m.
add(
"comm", p2p_pl);
127 throw IpplException(
"FFTTruncatedGreenPeriodicPoissonSolver::setDefaultParameters",
128 "Unrecognized heffte communication type");
134#include "PoissonSolvers/FFTTruncatedGreenPeriodicPoissonSolver.hpp"
Definition IpplException.h:6
Definition FFTTruncatedGreenPeriodicPoissonSolver.h:26
void setRhs(rhs_type &rhs) override
Definition FFTTruncatedGreenPeriodicPoissonSolver.hpp:56
void setDefaultParameters() override
Definition FFTTruncatedGreenPeriodicPoissonSolver.h:103
void solve() override
Definition FFTTruncatedGreenPeriodicPoissonSolver.hpp:190
Definition FieldLayout.h:166
Definition ParameterList.h:29
void add(const std::string &key, const T &value)
Definition ParameterList.h:44