Navigation

Main Page
Download
Support
Installation
Tutorial
Examples
Reference Manual
   Version 1.0.5new_solver
      Class Index
      File List
   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
EpotMGSolver Class Reference

Multigrid solver for Electric potential problem. More...

#include <epot_mgsolver.hpp>

Inheritance diagram for EpotMGSolver:
EpotSolver

Public Member Functions

 EpotMGSolver (Geometry &geom)
 Constructor. More...
 
 EpotMGSolver (Geometry &geom, std::istream &s)
 Construct from file. More...
 
virtual ~EpotMGSolver ()
 Destructor. More...
 
void set_eps (double eps)
 Sets the accuracy request for coarsest level SOR solver. More...
 
void set_w (double w)
 Sets the over-relaxation factor for coarsest level SOR solver. More...
 
void set_imax (uint32_t imax)
 Sets maximum number of iteration rounds for coarsest level SOR solver. More...
 
void set_local_imax (uint32_t local_imax)
 Sets maximum number of local iterations to take for nonlinear problems. More...
 
void set_levels (uint32_t levels)
 Sets multigrid levels. More...
 
void set_mgcycmax (uint32_t mgcyc)
 Sets maximum number of multigrid cycles to take. More...
 
void set_mgeps (double mgeps)
 Sets the accuracy request for finest level. More...
 
void set_gamma (uint32_t gamma)
 Sets multigrid cycle coefficient. More...
 
void set_npre (uint32_t npre)
 Sets number of pre cycle smoother rounds. More...
 
void set_npost (uint32_t npost)
 Sets number of post cycle smoother rounds. More...
 
double get_potential_change_norm (void) const
 Get potential change norm. More...
 
double get_error_estimate (void) const
 Get estimate of relative solution error. More...
 
uint32_t get_mgcyc (void) const
 Get number of multigrid cycles done. More...
 
virtual void debug_print (std::ostream &os) const
 Print debugging information to os. More...
 
virtual void save (std::ostream &s) const
 Saves problem data to stream. More...
 
- Public Member Functions inherited from EpotSolver
 EpotSolver (Geometry &geom)
 Constructor for solver from geom. More...
 
 EpotSolver (const EpotSolver &epsolver, Geometry &geom)
 Constructor for solver from geom. Parameters from epsolver are copied to new solver. More...
 
 EpotSolver (Geometry &geom, std::istream &s)
 Construct from file. More...
 
virtual ~EpotSolver ()
 Destructor. More...
 
void set_parameters (const EpotSolver &epsolver)
 Copy parameters from solver epsolver. More...
 
void set_forced_potential_volume (double force_pot, CallbackFunctorB_V *force_pot_func)
 Define forced potential volume. More...
 
void set_forced_potential_volume (CallbackFunctorD_V *force_pot_func)
 Define forced potential volume. More...
 
void set_initial_plasma (double Up, CallbackFunctorB_V *init_plasma_func)
 Define initial plasma to the problem. More...
 
void set_pexp_plasma (double rhoe, double Te, double Up)
 Enable plasma model for positive ion extraction problem. More...
 
void set_nsimp_initial_plasma (CallbackFunctorB_V *init_plasma_func)
 Define initial plasma boundary location to negative ion extraction problem. More...
 
void set_nsimp_plasma (double rhop, double Ep, std::vector< double > rhoi, std::vector< double > Ei)
 Enable plasma model for negative ion extraction problem. More...
 
void solve (MeshScalarField &epot, const ScalarField &scharge)
 Solve the problem. More...
 
bool linear (void) const
 Return true if problem is linear. More...
 
const Geometrygeometry (void) const
 Get pointer to geometry. More...
 

Additional Inherited Members

- Protected Member Functions inherited from EpotSolver
void pexp_newton (double &rhs, double &drhs, double epot) const
 Return non-linear right-hand-side and it's derivative for vacuum node in positive ion plasma. More...
 
void nsimp_newton (double &rhs, double &drhs, double epot) const
 Return non-linear right-hand-side and it's derivative for vacuum node in negative ion plasma. More...
 
uint8_t boundary_index (uint32_t i) const
 Return bitmask indicating to which boundaries the node belongs to. More...
 
uint8_t boundary_index (uint32_t i, uint32_t j) const
 Return bitmask indicating to which boundaries the node belongs to. More...
 
uint8_t boundary_index (uint32_t i, uint32_t j, uint32_t k) const
 Return bitmask indicating to which boundaries the node belongs to. More...
 
uint8_t boundary_index_general (uint32_t i, uint32_t j, uint32_t k) const
 Return bitmask indicating to which boundaries the node belongs to. More...
 
void preprocess (MeshScalarField &epot)
 Do preprocessing action before solving. More...
 
void postprocess (void)
 Do postprocessing action after solving. More...
 
MeshScalarFieldevaluate_scharge (const ScalarField &__scharge) const
 
- Protected Attributes inherited from EpotSolver
Geometry_geom
 Geometry reference. More...
 
plasma_mode_e _plasma
 Plasma simulation mode. More...
 
double _rhoe
 Electron charge density (C/m3), < 0. More...
 
double _Te
 Electron thermal energy, > 0. More...
 
double _Up
 Plasma potential, > 0. More...
 
std::vector< double > _rhoi
 Charge density for positive ions, first fast protons, then thermal ions. More...
 
std::vector< double > _Ei
 Energy for positive ions, first fast protons, then thermal ions. More...
 
double _force_pot
 Potential to be forced. More...
 
CallbackFunctorB_V_force_pot_func
 Force region potential function. More...
 
CallbackFunctorD_V_force_pot_func2
 Force region potential function. More...
 
CallbackFunctorB_V_init_plasma_func
 Initial plasma region function. More...
 
double _plA
 Plasma parameter. For positive ion extraction: rho_th * h^2 / epsilon_0, for negative ion extraction: rho_f * h^2 / epsilon_0. More...
 
double _plB
 Plasma parameter. For positive ion extraction: 1/Te, for negative ion extraction: E_f,i. More...
 
double _plC
 Plasma parameter for positive ion extraction. Up/Te. More...
 
std::vector< double > _plD
 Plasma parameter for negative ion extraction. rho_th,i * h^2 / epsilon_0. More...
 
std::vector< double > _plE
 Plasma parameter for negative ion extraction. 1/Ti. More...
 

Detailed Description

Multigrid solver for Electric potential problem.

Constructor & Destructor Documentation

EpotMGSolver::EpotMGSolver ( Geometry geom)

Constructor.

EpotMGSolver::EpotMGSolver ( Geometry geom,
std::istream &  s 
)

Construct from file.

EpotMGSolver::~EpotMGSolver ( )
virtual

Destructor.

Member Function Documentation

void EpotMGSolver::debug_print ( std::ostream &  os) const
virtual

Print debugging information to os.

Implements EpotSolver.

double EpotMGSolver::get_error_estimate ( void  ) const

Get estimate of relative solution error.

Returns 2-norm $ G(w) \max(I,J,K) ||\Delta x|| $ in 2D and $ F(w) sqrt{\max(I,J,K)} ||\Delta x|| $ in 3D, where G and F and third order polynomial fits to data from test problems.

uint32_t EpotMGSolver::get_mgcyc ( void  ) const

Get number of multigrid cycles done.

double EpotMGSolver::get_potential_change_norm ( void  ) const

Get potential change norm.

Returns 2-norm $ ||\Delta x|| $.

void EpotMGSolver::save ( std::ostream &  s) const
virtual

Saves problem data to stream.

Implements EpotSolver.

void EpotMGSolver::set_eps ( double  eps)

Sets the accuracy request for coarsest level SOR solver.

Defaults to 1e-10.

void EpotMGSolver::set_gamma ( uint32_t  gamma)

Sets multigrid cycle coefficient.

Defaults to 1 (V-cycles). Use 2 for W-cycles.

void EpotMGSolver::set_imax ( uint32_t  imax)

Sets maximum number of iteration rounds for coarsest level SOR solver.

Defaults to 10000.

void EpotMGSolver::set_levels ( uint32_t  levels)

Sets multigrid levels.

Defaults to 1.

void EpotMGSolver::set_local_imax ( uint32_t  local_imax)

Sets maximum number of local iterations to take for nonlinear problems.

Defaults to 1.

void EpotMGSolver::set_mgcycmax ( uint32_t  mgcyc)

Sets maximum number of multigrid cycles to take.

Defaults to 100. Multigrid cycles are done until the residual error is less than mgeps or mgcyc cycles have been made.

void EpotMGSolver::set_mgeps ( double  mgeps)

Sets the accuracy request for finest level.

Defaults to 1.0e-4. Multigrid cycles are done until the residual error is less than mgeps or mgcyc cycles have been made.

void EpotMGSolver::set_npost ( uint32_t  npost)

Sets number of post cycle smoother rounds.

Defaults to 5.

void EpotMGSolver::set_npre ( uint32_t  npre)

Sets number of pre cycle smoother rounds.

Defaults to 5.

void EpotMGSolver::set_w ( double  w)

Sets the over-relaxation factor for coarsest level SOR solver.

Defaults to 1.7.


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


Reference manual for Ion Beam Simulator 1.0.5new_solver
Generated by Doxygen 1.8.5 on Tue May 19 2015 09:15:43.