Navigation

Main Page
Download
Support
Installation
Tutorial
Examples
Reference Manual
   Version 1.0.6dev
      Class Index
      File List
   Version 1.0.6
   Version 1.0.5new_solver
   Version 1.0.5dev
   Version 1.0.5b
   Version 1.0.4dev
   Version 1.0.4
Publications


Hosted by Get Ion Beam Simulator at SourceForge.net. Fast, secure and Free Open Source software downloads
EpotEfield Class Reference

Vector field based on interpolation of electric potential. More...

#include <epot_efield.hpp>

Inheritance diagram for EpotEfield:
VectorField Field

Public Member Functions

 EpotEfield (const EpotField &epot)
 Constructor. More...
 
 EpotEfield (const EpotEfield &efield)
 Copy constructor. More...
 
 ~EpotEfield ()
 Destructor. More...
 
void set_extrapolation (field_extrpl_e extrpl[6])
 Set the behaviour of electric field interpolation outside mesh points (extrapolation). More...
 
void recalculate (void)
 Recalculate electric field from potential. More...
 
virtual const Vec3D operator() (const Vec3D &x) const
 Operator for getting interpolated electric field value at x. More...
 
void debug_print (std::ostream &os) const
 Print debugging information to os. More...
 
- Public Member Functions inherited from VectorField
virtual ~VectorField ()
 Virtual destructor. More...
 
void get_minmax (const Mesh &mesh, double &min, double &max) const
 Search minimum and maximum vector length values of vector field at mesh nodes. More...
 
void get_minmax (const Mesh &mesh, Vec3D &min, Vec3D &max) const
 Search minimum and maximum for each vector component at mesh nodes. More...
 
- Public Member Functions inherited from Field
virtual ~Field ()
 Virtual destructor. More...
 

Detailed Description

Vector field based on interpolation of electric potential.

EpotEfield contains pointers to Geometry and to MeshScalarField electric potential (epot). The electric field is defined in points between the nodes using equation Ex=(Ex0-Ex1)/h. The Ex, Ey and Ez are not defined in same positions as the nodes of the electric potential because of this. The field evaluator uses linear interpolation to return smoothly varying field values. Close to the solids, special consideration is used to return as good estimate of the field as possible.

The function recalculate() has to be called to remake the electric field.

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.

Constructor & Destructor Documentation

◆ EpotEfield() [1/2]

EpotEfield::EpotEfield ( const EpotField epot)

Constructor.

◆ EpotEfield() [2/2]

EpotEfield::EpotEfield ( const EpotEfield efield)

Copy constructor.

◆ ~EpotEfield()

EpotEfield::~EpotEfield ( )

Destructor.

Member Function Documentation

◆ debug_print()

void EpotEfield::debug_print ( std::ostream &  os) const

Print debugging information to os.

◆ operator()()

const Vec3D EpotEfield::operator() ( const Vec3D x) const
virtual

Operator for getting interpolated electric field value at x.

Implements VectorField.

◆ recalculate()

void EpotEfield::recalculate ( void  )

Recalculate electric field from potential.

◆ set_extrapolation()

void EpotEfield::set_extrapolation ( field_extrpl_e  extrpl[6])

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 (FIELD_EXTRAPOLATE) or it can return the mirror of the electric field across the mesh boundary like E_x(x)=E_x(-x) (FIELD_MIRROR), or it can return the mirror of the electric field across the mesh boundary like E_x(x,y,z)=-E_x(-x,y,z) (FIELD_ANTIMIRROR), or it can return a zero electric field outside the mesh (FIELD_ZERO) or NaN, which prevents the use of field evaluations in particle iterator (FIELD_NAN).

For simulation of symmetric cases, where electric potential is symmetric across the boundary like phi(x)=phi(-x) the E-field can be evaluated like with FIELD_ANTIMIRROR setting, but additionally the E-field is forced to be zero at the boundary. This extrapolation behaviour is selected with FIELD_SYMMETRIC_POTENTIAL. This gives second order correct electric field next to the boundary, which is essential to get physical results in cases where beam propagates next the the boundary.

Very far (double the size of the simulation box) the field evaluator will always return NaN.


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


Reference manual for Ion Beam Simulator 1.0.6dev
Generated by Doxygen 1.9.1 on Thu Sep 11 2025 09:37:24.