#include <epot_efield.hpp>
Inheritance diagram for EpotEfield:
Public Member Functions | |
EpotEfield (const Geometry &g, const ScalarField &epot) | |
Constructor. | |
~EpotEfield () | |
Destructor. | |
void | set_extrapolation (field_extrpl_e extrpl[6]) |
Set the behaviour of electric field interpolation outside mesh points (extrapolation). | |
Vec3D | operator() (Vec3D x) const |
Operator for getting interpolated electric field value at x. |
EpotEfield contains pointers to Geometry and to ScalarField electric potential (epot). In 1D EpotEfield uses three closest mesh neighbours of point x to calculate the electric field at x in 1D (9 points in 2D and 27 points in 3D). A second order polynomial is fitted to the potential field to get a linear (continuous) interpolation of electric field. Use of solid mesh points is avoided in the interpolation because they would mess with the virtual edge points.
The behaviour of the interpolation function outside mesh points can be programmed with set_extrapolation() function. Behaviour defaults to extrapolation using closest electric potential points.
EpotEfield::EpotEfield | ( | const Geometry & | g, | |
const ScalarField & | epot | |||
) |
Constructor.
EpotEfield::~EpotEfield | ( | ) | [inline] |
Destructor.
void EpotEfield::set_extrapolation | ( | field_extrpl_e | extrpl[6] | ) | [inline] |
Set the behaviour of electric field interpolation outside mesh points (extrapolation).
The interpolation function behaviour can be set separately for each boundary. This is done by setting the desired properties to the extrpl array. The interpolation function can use an extrapolation of the last three electric potential values for calculation of electric field (EFIELD_EXTRAPOLATE) or it can return the mirror of the electric field across the mesh boundary (EFIELD_MIRROR) or it can return a zero electric field outside the mesh.
The use of EFIELD_MIRROR in case of symmetric cases, where beam is traversing next to the geometry boundary, is necessary to get physical results.
Very far (double the size of the simulation box) the field evaluator will always return zero.