BiCGSTAB matrix solver for Electric potential problem. More...
#include <epot_bicgstabsolver.hpp>
Public Member Functions | |
| EpotBiCGSTABSolver (Geometry &geom, double eps=1.0e-4, uint32_t imax=10000, double newton_eps=1.0e-4, uint32_t newton_imax=10, bool gnewton=true) | |
| Constructor. More... | |
| EpotBiCGSTABSolver (Geometry &geom, std::istream &s) | |
| Destructor. More... | |
| virtual | ~EpotBiCGSTABSolver () |
| Destructor. More... | |
| void | set_preconditioner (Precond &pc) |
| Set preconditioner to use. More... | |
| void | set_gnewton (bool enable) |
| Enable/disable globally convergent Newton-Raphson. More... | |
| void | set_eps (double eps) |
| Sets the accuracy request for BiCGSTAB solver. More... | |
| void | set_imax (uint32_t imax) |
| Sets maximum iteration count for BiCGSTAB solver. More... | |
| void | set_newton_imax (uint32_t newton_imax) |
| Sets maximum iteration count for Newton-Raphson steps. More... | |
| void | set_newton_eps (double eps) |
| Sets the accuracy request for Newton-Raphson. More... | |
| double | get_newton_residual (void) const |
| Get last Newton-Raphson residual. More... | |
| double | get_newton_residual_norm (void) const |
| Get last Newton-Raphson residual norm. More... | |
| double | get_newton_step (void) const |
| Get last Newton-Raphson step size. More... | |
| double | get_newton_step_norm (void) const |
| Get last Newton-Raphson step size norm. More... | |
| double | get_scaled_residual (void) const |
| Get scaled residual error. More... | |
| double | get_error_estimate (void) const |
| Get estimate of relative solution error. More... | |
| uint32_t | get_iter (void) const |
| Get number of iteration rounds done with last solve(). More... | |
| void | set_analysis_callback (void(*func)(void)) |
| Set analysis callback. More... | |
| void | set_analysis_callback_nonlinear (void(*func)(void)) |
| Set analysis callback for nonlinear iteration. 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 EpotMatrixSolver | |
| virtual | ~EpotMatrixSolver () |
| Destructor. 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 Geometry & | geometry (void) const |
| Get pointer to geometry. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from EpotMatrixSolver | |
| EpotMatrixSolver (Geometry &geom) | |
| Constructor. More... | |
| EpotMatrixSolver (Geometry &geom, std::istream &s) | |
| Construct from file. More... | |
| void | get_vecmat (const CRowMatrix **A, const Vector **B) |
| Return const pointers to the matrix A and vector B of the linear problem. More... | |
| void | get_resjac (const CRowMatrix **J, const Vector **R, const Vector &X) |
| Return const pointers to jacobian matrix and residual vector of the problem to J and R at X. More... | |
| bool | linear (void) const |
| Return true if problem is linear. More... | |
| void | set_initial_guess (const MeshScalarField &epot, Vector &X) const |
| Load initial solution vector from electric potential. More... | |
| void | set_solution (MeshScalarField &epot, const Vector &X) const |
| Load electric potential from solution vector. More... | |
| void | preprocess (MeshScalarField &epot, const MeshScalarField &scharge) |
| Preprocess. More... | |
| void | postprocess (void) |
| Postprocess. More... | |
| void | reset_matrix (void) |
| Reset matrix representation. More... | |
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... | |
| MeshScalarField * | evaluate_scharge (const ScalarField &__scharge) const |
Protected Attributes inherited from EpotMatrixSolver | |
| uint32_t | _dof |
| Degrees of freedom. More... | |
| Node2DoF | _n2d |
| Nodes to degrees of freedom map. More... | |
| CRowMatrix * | _fd_mat |
| Finite Difference matrix. More... | |
| Vector * | _fd_vec |
| Finite Difference vector. More... | |
| Vector * | _d_vec |
| Derivative vector for nonlinear solution. More... | |
| const Vector * | _sol |
| Current solution vector. More... | |
| MeshScalarField * | _epot |
| const MeshScalarField * | _scharge |
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
BiCGSTAB matrix solver for Electric potential problem.
Constructor & Destructor Documentation
| EpotBiCGSTABSolver::EpotBiCGSTABSolver | ( | Geometry & | geom, |
| double | eps = 1.0e-4, |
||
| uint32_t | imax = 10000, |
||
| double | newton_eps = 1.0e-4, |
||
| uint32_t | newton_imax = 10, |
||
| bool | gnewton = true |
||
| ) |
Constructor.
| EpotBiCGSTABSolver::EpotBiCGSTABSolver | ( | Geometry & | geom, |
| std::istream & | s | ||
| ) |
Destructor.
|
virtual |
Destructor.
Member Function Documentation
|
virtual |
Print debugging information to os.
Reimplemented from EpotMatrixSolver.
| double EpotBiCGSTABSolver::get_error_estimate | ( | void | ) | const |
Get estimate of relative solution error.
Returns an estimate for
. For linear solutions this is the scaled 2-norm residual
and for nonlinear problem it is
.
| uint32_t EpotBiCGSTABSolver::get_iter | ( | void | ) | const |
Get number of iteration rounds done with last solve().
| double EpotBiCGSTABSolver::get_newton_residual | ( | void | ) | const |
Get last Newton-Raphson residual.
| double EpotBiCGSTABSolver::get_newton_residual_norm | ( | void | ) | const |
Get last Newton-Raphson residual norm.
| double EpotBiCGSTABSolver::get_newton_step | ( | void | ) | const |
Get last Newton-Raphson step size.
| double EpotBiCGSTABSolver::get_newton_step_norm | ( | void | ) | const |
Get last Newton-Raphson step size norm.
| double EpotBiCGSTABSolver::get_scaled_residual | ( | void | ) | const |
Get scaled residual error.
Returns scaled 2-norm residual
. Only available for linear solutions.
|
virtual |
Saves problem data to stream.
Reimplemented from EpotMatrixSolver.
| void EpotBiCGSTABSolver::set_analysis_callback | ( | void(*)(void) | func | ) |
Set analysis callback.
If callback is set to non-NULL, the electric potential is constructed at each iteration and callback function is called.
| void EpotBiCGSTABSolver::set_analysis_callback_nonlinear | ( | void(*)(void) | func | ) |
Set analysis callback for nonlinear iteration.
If callback is set to non-NULL, the electric potential is constructed at each newton step and callback function is called.
| void EpotBiCGSTABSolver::set_eps | ( | double | eps | ) |
Sets the accuracy request for BiCGSTAB solver.
Defaults to 1.0e-4.
| void EpotBiCGSTABSolver::set_gnewton | ( | bool | enable | ) |
Enable/disable globally convergent Newton-Raphson.
Enabled by default.
| void EpotBiCGSTABSolver::set_imax | ( | uint32_t | imax | ) |
Sets maximum iteration count for BiCGSTAB solver.
Defaults to 10000.
| void EpotBiCGSTABSolver::set_newton_eps | ( | double | eps | ) |
Sets the accuracy request for Newton-Raphson.
Based on error estimator. Defaults to 1.0e-4;
| void EpotBiCGSTABSolver::set_newton_imax | ( | uint32_t | newton_imax | ) |
Sets maximum iteration count for Newton-Raphson steps.
Defaults to 10.
| void EpotBiCGSTABSolver::set_preconditioner | ( | Precond & | pc | ) |
Set preconditioner to use.
The documentation for this class was generated from the following files:
Public Member Functions inherited from