DL_MG
|
Private Member Functions | |
subroutine | dl_mg_solver_poisson (eps, eps_mid, alpha, rho, pot, fd_order, tol_res_rel, tol_res_abs, tol_pot_rel, tol_pot_abs, tol_cg_res_rel, tol_cg_res_abs, tol_vcycle_res_rel, tol_vcycle_res_abs, tol_level_1_res_rel, tol_level_1_res_abs, mg_max_conv_rate, max_iters_defco, max_iters_cg, max_iters_vcycle, max_iters_level_1, v_iterations, omega_sor, use_cg, use_pot_in, use_damping, res, ierror) |
Poisson Equation driver. More... | |
subroutine | dl_mg_solver_pbe (eps, eps_mid, alpha, rho, lambda, temp, nion, c, q, pot, fd_order, tol_res_rel, tol_res_abs, tol_pot_rel, tol_pot_abs, tol_newton_res_rel, tol_newton_res_abs, tol_cg_res_rel, tol_cg_res_abs, tol_vcycle_res_rel, tol_vcycle_res_abs, tol_level_1_res_rel, tol_level_1_res_abs, tol_mu_rel, tol_mu_abs, mg_max_conv_rate, max_iters_defco, max_iters_cg, max_iters_vcycle, max_iters_level_1, max_iters_newton, v_iterations, use_cg, omega_sor, linearised, der_pot, steric_weight, expcap, res, use_fas, use_pot_in, use_damping, neutralisation_method, neutralisation_ion_ratios, betamu_electrostatic, steric_weight_average, used_ion_concentrations, used_neutralisation_ratios, ierror) |
solves PBE with steric potential More... | |
|
private |
solves PBE with steric potential
[in] | eps | relative permitivity on the grid points, ignored if the finite difference order is 2 |
[in] | eps_mid | relative permitivity, at the points located halfway between the grid points in each direction E.g.: eps_mid(i,j,k,1) is associated with the middle point of grid segment between (i,j,k) and (i+1,j,k). |
[in] | alpha | multiplicative constant for \(\rho\) defined by the units used |
[in] | rho | charge density |
[in] | temp | temperature in Kelvin |
[in] | nion | Number of ionic species |
[in] | c | Concentrations of ionic species in \( r_{Bohr}^{-3}\), where \( r_{Bohr}\) is the Bohr radius. Note: the concentration must be defined in relation to the accesible ion volume, not the grid domain volume. These quantities differ when steric weight is used, see this note. |
[in] | q | Electric charge in electron charge units of each ionic specie present in solution. |
[in,out] | pot | solution to be sought, see embeded |
[in] | fd_order | derivatives approximation order in finite diferences |
[in] | tol_res_rel | relative tolerance parameter for the residual of the top iteration (defect correction if fd_order > 2, else applies to Newton or linearised PBE). See Convergence Criteria |
[in] | tol_res_abs | absolute tolerace ... |
[in] | tol_pot_rel | relative tolerance parameter for the potential of the top iteration (used only in defect correction) |
[in] | tol_pot_abs | absolute tolerace for the potential |
[in] | tol_newton_res_rel | relative tol for newton iteration |
[in] | tol_newton_res_abs | absolute ... |
[in] | tol_cg_res_rel | relative tol for CG |
[in] | tol_cg_res_abs | absolute ... |
[in] | tol_vcycle_res_rel | relative tol for V cycle iterations |
[in] | tol_vcycle_res_abs | absolute ... |
[in] | tol_level_1_res_rel | tolerance for multgrig coarse loop, used only if number of levels > 1 |
[in] | tol_level_1_res_abs | absolute tolerance ... |
[in] | tol_mu_rel | relative tolerance for excess electrostatic potential |
[in] | tol_mu_abs | absolute tolerance for excess electrostatic potential |
[in] | mg_max_conv_rate | largest allowed convergence rate, i.e. the inverse ratio of two consecutive residuals in the multigrid solver |
[in] | max_iters_defco | maximum number of iterations for the higher order correction |
[in] | max_iters_newton | maximum number of iteration for Newton |
[in] | max_iters_cg | maximum number of CG iterations |
[in] | max_iters_vcycle | maximum number of V cycles (recommended value not more that 50) at the coarsest level |
[in] | max_iters_level_1 | max number of iteration |
[in] | v_iterations | number of relaxation iteration on the V-cycle branches |
[in] | omega_sor | SOR relaxation parameter |
[in] | linearised | use linereased version |
[in] | der_pot | potential function at which the derivative of the Boltzmann term is computed (if not present defaults to 0) |
[in] | steric_weight | steric weight in the Boltzmann term, i.e. \( e^{(-\beta V_{steric}(r))} \) |
[in] | expcap | cap of the exponential argument in the Boltzmann term |
[out] | res | residual at the of computation |
[in] | use_fas | use Full Approximation Scheme to solve non-linear PBE, the default is Newton method |
[in] | use_pot_in | start iterating from this potential, if not present starts from 0 |
[in] | use_damping | if present and true use error damping in defect correction loop |
[in] | neutralisation_method | select the neutralisation method for PBE with PBC |
[in] | neutralisation_ion_ratios | ratios of ion mixing when neutralisation_method is set to dl_mg_neutralise_with_ions_fixed non-negative reals, no need to be normalised to 1. |
[out] | betamu_electrostatic | array containing \( \mu_i /(k_B T) \) computed in the Newton solver or in the defect correction section see Periodic boundary conditions (PBC) for PBE |
[out] | used_ion_concentrations | array containing the bulk ion concentration used in PBE solution. It might differ from the input concentration when neutralisation_method is set to dl_mg_neutralise_with_ions_fixed or to dl_mg_neutralise_with_ions_auto. |
[out] | used_neutralisation_ratios | array containing the neutralisation ratios used to shift the bulk concentrations. Relevant only if neutralisation_method is set to dl_mg_neutralise_with_ions_fixed or to dl_mg_neutralise_with_ions_auto |
[out] | steric_weight_average | \( (1/V) \int_V e^{(-\beta V_{steric}(r))} dv\) useful if the calling app wants to compute the ions distribution functions |
|
private |
Poisson Equation driver.
[in] | eps | relative permitivity on the grid points, ignored if the finite difference order is 2 |
[in] | eps_mid | relative permitivity, at the points located halfway between the grid points in each direction. the fourth index stores the direction: 1 -> x, 2 ->y, 3 -> z E.g.: eps_mid(i,j,k,1) is associated with the middle point of grid segment between (i,j,k) and (i+1,j,k). |
[in] | alpha | multiplicative constant for \(\rho\) defined by the units used |
[in] | rho | r.h.s. term (charge density) |
[in,out] | pot | the potential to be computed, see embeded |
[in] | fd_order | finite difference order used in defect correction |
[out] | res | the residual |
[in] | use_pot_in | start iterating from this potential, if not present starts from 0 inside the domain |
[in] | tol_res_rel | relative tolerance parameter for the residual of the top iteration (defect correction if fd_order > 2, else multigrid). See Convergence Criteria |
[in] | tol_res_abs | absolute tolerace ... |
[in] | tol_pot_rel | relative tolerance parameter for the potential of the top iteration (used only in defect correction) |
[in] | tol_pot_abs | absolute tolerace for the potential |
[in] | tol_cg_res_rel | relative tol for conjugate gradient iterations |
[in] | tol_cg_res_abs | absolute ... |
[in] | tol_vcycle_res_rel | relative tol for V cycle iterations |
[in] | tol_vcycle_res_abs | absolute ... |
[in] | tol_level_1_res_rel | tolerance for multgrig coarse loop, used only if number of levels > 1 |
[in] | tol_level_1_res_abs | absolute tolerance ... |
[in] | mg_max_conv_rate | largest allowed convergence rate, i.e. the inverse ratio of two consecutive residuals in the multigrid solver |
[in] | max_iters_defco | maximum number of iterations for the higher order correction |
[in] | max_iters_cg | maximum number of CG iterations |
[in] | max_iters_vcycle | maximum number of V cycles (recommended value not more that 50) at the coarsest level |
[in] | max_iters_level_1 | max number of iteration |
[in] | v_iterations | number of relaxation iteration on the V-cycle branches |
[in] | omega_sor | SOR relaxation parameter |
[in] | use_damping | if true use error damping in defect correction loop |
[out] | ierror | error flag |