|
OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
|
#include <FieldSolver.hpp>


Public Member Functions | |
| FieldSolver (std::string solver, Field_t< Dim > *rho, VField_t< T, Dim > *E, Field_t< Dim > *phi, std::shared_ptr< BCHandler_t > bcHandler) | |
| ~FieldSolver () override=default | |
| void | dumpScalField (std::string what) |
| void | dumpVectField (std::string what) |
| Field_t< Dim > * | getRho () |
| void | setRho (Field_t< Dim > *rho) |
| VField_t< T, Dim > * | getE () const |
| void | setE (VField_t< T, Dim > *E) |
| Field< T, Dim > * | getPhi () const |
| void | setPhi (Field< T, Dim > *phi) |
| std::shared_ptr< BCHandler_t > | getBCHandler () const |
| void | setBCHandler (std::shared_ptr< BCHandler_t > bcHandler) |
| T | getCouplingConstant () const |
| Get the solver's coupling constant. | |
| void | initOpenSolver () |
| void | initSolver () override |
| void | setPotentialBCs () |
| Set boundary conditions for the electrostatic potential field. | |
| bool | hasValidBCHandler () const |
| void | runSolver () override |
| void | resetCallCounter () |
| Reset the solver call counter to zero. | |
| size_t | getCallCounter () |
| void | runSolver (bool force_skip_field_dump) |
| Execute the field solver for the current simulation state. | |
| void | runShiftedOpenSolver (const ippl::Vector< double, Dim > &shift) |
| Run an Open-solver solve with a shifted free-space Green's function. | |
| template<typename Solver > | |
| void | initSolverWithParams (const ippl::ParameterList &sp) |
| void | initNullSolver () |
| void | initFFTSolver () |
| void | initCGSolver () |
| void | initP3MSolver () |
| void | initSolverWithParams (const ippl::ParameterList &sp) |
| void | dumpVectField (std::string what) |
| void | dumpScalField (std::string what) |
| void | initOpenSolver () |
| void | initFFTSolver () |
| void | initCGSolver () |
| void | initNullSolver () |
| void | initSolver () |
| void | runSolver (bool force_skip_field_dump) |
| void | runShiftedOpenSolver (const ippl::Vector< double, 3 > &shift) |
| double | getCouplingConstant () const |
| void | setPotentialBCs () |
| void | initNullSolver () |
Private Types | |
| using | BCHandler_t = BCHandler< Dim > |
Private Attributes | |
| Field_t< Dim > * | rho_m |
| VField_t< T, Dim > * | E_m |
| Field_t< Dim > * | phi_m |
| std::shared_ptr< BCHandler_t > | bcHandler_m |
| size_t | call_counter_m |
| Counts number of times the solver has been called. | |
Definition at line 11 of file FieldSolver.hpp.
|
private |
Definition at line 17 of file FieldSolver.hpp.
|
inline |
Definition at line 24 of file FieldSolver.hpp.
References FieldSolver< T, Dim >::setPotentialBCs().

|
overridedefault |
| void FieldSolver< double, 3 >::dumpScalField | ( | std::string | what | ) |
Definition at line 148 of file FieldSolver.cpp.
References OpalData::getInputBasename(), OpalData::getInstance(), and Util::toUpper().

| void FieldSolver< T, Dim >::dumpScalField | ( | std::string | what | ) |
| void FieldSolver< double, 3 >::dumpVectField | ( | std::string | what | ) |
Definition at line 55 of file FieldSolver.cpp.
References OpalData::getInputBasename(), OpalData::getInstance(), and Util::toUpper().

| void FieldSolver< T, Dim >::dumpVectField | ( | std::string | what | ) |
|
inline |
Definition at line 50 of file FieldSolver.hpp.
References FieldSolver< T, Dim >::bcHandler_m.
|
inline |
Definition at line 103 of file FieldSolver.hpp.
References FieldSolver< T, Dim >::call_counter_m.
Referenced by ParallelTracker::execute().
| double FieldSolver< double, 3 >::getCouplingConstant | ( | ) | const |
Definition at line 483 of file FieldSolver.cpp.
References Physics::epsilon_0, and Physics::pi.
| T FieldSolver< T, Dim >::getCouplingConstant | ( | ) | const |
Get the solver's coupling constant.
Returns the scalar coupling constant used by the field solver to scale interactions between particles and the field. This value is applied during ParBunch::computeSpaceCharge. Its physical meaning and units potentially depend on the specific solver type used.
|
inline |
Definition at line 44 of file FieldSolver.hpp.
References FieldSolver< T, Dim >::E_m.
|
inline |
Definition at line 47 of file FieldSolver.hpp.
References FieldSolver< T, Dim >::phi_m.
Definition at line 41 of file FieldSolver.hpp.
References FieldSolver< T, Dim >::rho_m.
|
inline |
Definition at line 84 of file FieldSolver.hpp.
References FieldSolver< T, Dim >::bcHandler_m.
| void FieldSolver< double, 3 >::initCGSolver | ( | ) |
Definition at line 308 of file FieldSolver.cpp.
|
inline |
Definition at line 153 of file FieldSolver.hpp.
| void FieldSolver< double, 3 >::initFFTSolver | ( | ) |
Definition at line 286 of file FieldSolver.cpp.
References Dim.
| void FieldSolver< T, Dim >::initFFTSolver | ( | ) |
| void FieldSolver< double, 3 >::initNullSolver | ( | ) |
Definition at line 318 of file FieldSolver.cpp.
References Dim.
| void FieldSolver< T, Dim >::initNullSolver | ( | ) |
| void FieldSolver< double, 3 >::initNullSolver | ( | ) |
| void FieldSolver< double, 3 >::initOpenSolver | ( | ) |
Definition at line 272 of file FieldSolver.cpp.
| void FieldSolver< T, Dim >::initOpenSolver | ( | ) |
|
inline |
Definition at line 155 of file FieldSolver.hpp.
| void FieldSolver< double, 3 >::initSolver | ( | ) |
Definition at line 330 of file FieldSolver.cpp.
|
override |
| void FieldSolver< double, 3 >::initSolverWithParams | ( | const ippl::ParameterList & | sp | ) |
Definition at line 17 of file FieldSolver.cpp.
| void FieldSolver< T, Dim >::initSolverWithParams | ( | const ippl::ParameterList & | sp | ) |
|
inline |
Reset the solver call counter to zero.
Sets the internal call counter (call_counter_m) back to 0 so that subsequent calls will be counted from a clean state.
Definition at line 101 of file FieldSolver.hpp.
References FieldSolver< T, Dim >::call_counter_m.
| void FieldSolver< double, 3 >::runShiftedOpenSolver | ( | const ippl::Vector< double, 3 > & | shift | ) |
Definition at line 446 of file FieldSolver.cpp.
| void FieldSolver< T, Dim >::runShiftedOpenSolver | ( | const ippl::Vector< double, Dim > & | shift | ) |
Run an Open-solver solve with a shifted free-space Green's function.
Installs a translated Green's kernel \(G(r) = -1/(4\pi|r - \texttt{shift}|)\) on the underlying IPPL FFTOpenPoissonSolver via shiftedGreensFunction(shift), runs solve(), then restores the standard Green's function (greensFunction()) so subsequent solves in later bins are not affected.
The manual restore guards against two adjacent bins whose stretched mesh spacings happen to coincide: the mesh-change detector inside the IPPL solve() would then not recompute the kernel and the next primary solve would silently reuse the shifted one. With the current binning algorithm this collision is not supposed to happen, so the extra FFT per shifted pass is defensive and can be removed once the invariant is guaranteed by the binner.
| shift | Per-axis translation of the Green's function in physical units. |
| OpalException | if the configured solver is not "OPEN". |
|
inlineoverride |
Definition at line 86 of file FieldSolver.hpp.
References FieldSolver< T, Dim >::runSolver().
Referenced by FieldSolver< T, Dim >::runSolver().

| void FieldSolver< double, 3 >::runSolver | ( | bool | force_skip_field_dump | ) |
Definition at line 362 of file FieldSolver.cpp.
References Dim.
| void FieldSolver< T, Dim >::runSolver | ( | bool | force_skip_field_dump | ) |
Execute the field solver for the current simulation state.
Performs a single solve cycle using the solver's current configuration, boundary conditions and particle/mesh data. The solver updates the internal field representations.
| force_skip_field_dump | If true, suppress any field-dump output that would otherwise be produced by this call. If false, field output behavior follows the configured/normal schedule. |
runSolver() routine is defined in the base class as not taking any arguments.
|
inline |
Definition at line 51 of file FieldSolver.hpp.
References FieldSolver< T, Dim >::bcHandler_m, and FieldSolver< T, Dim >::setPotentialBCs().

|
inline |
Definition at line 45 of file FieldSolver.hpp.
References FieldSolver< T, Dim >::E_m.
|
inline |
Definition at line 48 of file FieldSolver.hpp.
References FieldSolver< T, Dim >::phi_m.
| void FieldSolver< double, 3 >::setPotentialBCs | ( | ) |
Definition at line 509 of file FieldSolver.cpp.
References Dim.
| void FieldSolver< T, Dim >::setPotentialBCs | ( | ) |
Set boundary conditions for the electrostatic potential field.
Converts the boundary-condition specification provided by the BC handler into the IPPL boundary-condition format for Field_t<Dim> and applies the resulting conditions to the internal potential field (phi_m) by calling its setFieldBC method.
| OpalException | if the BC handler is not set or invalid. |
Referenced by FieldSolver< T, Dim >::FieldSolver(), and FieldSolver< T, Dim >::setBCHandler().
|
inline |
Definition at line 42 of file FieldSolver.hpp.
References FieldSolver< T, Dim >::rho_m.
|
private |
Definition at line 18 of file FieldSolver.hpp.
Referenced by FieldSolver< T, Dim >::getBCHandler(), FieldSolver< T, Dim >::hasValidBCHandler(), and FieldSolver< T, Dim >::setBCHandler().
|
private |
Counts number of times the solver has been called.
Definition at line 21 of file FieldSolver.hpp.
Referenced by FieldSolver< T, Dim >::getCallCounter(), and FieldSolver< T, Dim >::resetCallCounter().
Definition at line 14 of file FieldSolver.hpp.
Referenced by FieldSolver< T, Dim >::getE(), and FieldSolver< T, Dim >::setE().
Definition at line 15 of file FieldSolver.hpp.
Referenced by FieldSolver< T, Dim >::getPhi(), and FieldSolver< T, Dim >::setPhi().
Definition at line 13 of file FieldSolver.hpp.
Referenced by FieldSolver< T, Dim >::getRho(), and FieldSolver< T, Dim >::setRho().