#include "petsc_version_defs.h"
#include <petsc/finclude/petsc.h>
Data Types | |
module | f90moduleinterfaces |
interface | f90moduleinterfaces::pcsetapplicationcontext |
interface | f90moduleinterfaces::pcgetapplicationcontext |
Macros | |
#define | DPOT(inode, iphi) psn%dpot(inode) |
#define | IDEN(inode, iphi) psn%idensity0(inode) |
#define | EDEN(inode, iphi) psn%edensity0(inode) |
Functions/Subroutines | |
subroutine | init_poisson (grid, psn, iflag_dummy) |
subroutine | psn_init_poisson_private (psn, grid, solver_data, nrhs) |
subroutine | pcshermanmorrisonapply (pc, xin, yout, ierr) |
subroutine | getnnz (grid, nloc, low, high, d_nnz, o_nnz, xgc_petsc, nglobal, ierr) |
subroutine | create_solver (this, grid, bc, ierr) |
subroutine | create_1field_solver (grid, solver) |
subroutine | create_2field_solver (grid, bd, solver) |
subroutine | make_12mat (grid, Bmat, BIdentMat, FSAMass_Te, solver, bd, scale, xgc_petsc) |
subroutine | make_21mat (grid, Cmat, Cio, Bmat, CConstBCVec, bd, xgc_petsc, petsc_xgc_bd) |
subroutine | solve_poisson (grid, psn, n0_only, iflag) |
High level Poisson solver routine, offers choice of outer iterative solver, two-step solver, and FSA solver. More... | |
subroutine | solve_poisson_private (grid, psn, iflag) |
subroutine | zero_out_wall (var) |
subroutine | solve_poisson_iter (grid, psn, iflag) |
Poisson solver that uses an iterative method to solve for the axisymmetric electrostatic potential: The Poisson equation for the axisymmetric mode is
\[ -\nabla_\perp \cdot \xi \nabla_\perp \overline{\phi}_{k+1} + \frac{e n_0/T_{e,0}} \overline{\phi}_{k+1} = e \left( \langle \overline{\delta n_i} \rangle_g - \overline{\delta n_{e,NA}} \right) + \frac{e n_0/T_{e,0}} \langle \phi_{k} \rangle_{fs} \] where \(k\) is the iteration index, \(xi\) is the electric susceptibility, \(e\) is the elementary charge, \(n_0\) and \(T_0\) are the background density and temperature, \(\langle \overline{\delta n_i} \rangle_g\) is the gyroaveraged ion (gyrocenter) charge density, \(\overline{\delta n_{e,NA}}\) is the non-adiabatic electron charge density, and \(\langle\dots\rangle\) is the the flux-surface average. \(\overline{\dots}\) is the toroidal average. More... | |
subroutine | update_poisson_solver (grid, psn, solver_data) |
Updates the LHS matrix of the Poisson equation (density and electron temperature) More... | |
#define DPOT | ( | inode, | |
iphi | |||
) | psn%dpot(inode) |
#define EDEN | ( | inode, | |
iphi | |||
) | psn%edensity0(inode) |
#define IDEN | ( | inode, | |
iphi | |||
) | psn%idensity0(inode) |
subroutine create_1field_solver | ( | type(grid_type) | grid, |
type(xgc_solver) | solver | ||
) |
subroutine create_2field_solver | ( | type(grid_type) | grid, |
type(boundary2_type) | bd, | ||
type(xgc_solver) | solver | ||
) |
subroutine create_solver | ( | type(xgc_solver) | this, |
type(grid_type), intent(in) | grid, | ||
type(boundary2_type), intent(in) | bc, | ||
ierr | |||
) |
subroutine getnnz | ( | type(grid_type), intent(in) | grid, |
nloc, | |||
low, | |||
high, | |||
d_nnz, | |||
o_nnz, | |||
dimension(grid%nnode), intent(in) | xgc_petsc, | ||
nglobal, | |||
ierr | |||
) |
subroutine init_poisson | ( | type(grid_type) | grid, |
type(psn_type) | psn, | ||
integer | iflag_dummy | ||
) |
subroutine make_12mat | ( | type(grid_type) | grid, |
intent(inout) | Bmat, | ||
BIdentMat, | |||
intent(in) | FSAMass_Te, | ||
type(xgc_solver) | solver, | ||
type(boundary2_type), intent(in) | bd, | ||
real (8), intent(in) | scale, | ||
dimension(grid%nnode), intent(in) | xgc_petsc | ||
) |
subroutine make_21mat | ( | type(grid_type) | grid, |
Cmat, | |||
Cio, | |||
intent(in) | Bmat, | ||
CConstBCVec, | |||
type(boundary2_type), intent(in) | bd, | ||
dimension(grid%nnode), intent(in) | xgc_petsc, | ||
dimension(grid%nnode), intent(in) | petsc_xgc_bd | ||
) |
subroutine pcshermanmorrisonapply | ( | pc, | |
xin, | |||
yout, | |||
ierr | |||
) |
subroutine psn_init_poisson_private | ( | type(psn_type) | psn, |
type(grid_type) | grid, | ||
type(solver_init_data), intent(in) | solver_data, | ||
integer | nrhs | ||
) |
subroutine solve_poisson | ( | type(grid_type), intent(in) | grid, |
type(psn_type), intent(inout) | psn, | ||
logical, intent(in) | n0_only, | ||
integer, intent(in) | iflag | ||
) |
High level Poisson solver routine, offers choice of outer iterative solver, two-step solver, and FSA solver.
[in] | grid | XGC grid data object |
[in,out] | psn | XGC field data object |
[in] | n0_only | Flag for solving only n=0 mode and then exit (no function in XGCa), logical |
[in] | iflag | Flag to indicate whether adiabatic elec or full eq. is solved, integer |
subroutine solve_poisson_iter | ( | type(grid_type), intent(in) | grid, |
type(psn_type), intent(inout) | psn, | ||
integer, intent(in) | iflag | ||
) |
Poisson solver that uses an iterative method to solve for the axisymmetric electrostatic potential: The Poisson equation for the axisymmetric mode is
\[ -\nabla_\perp \cdot \xi \nabla_\perp \overline{\phi}_{k+1} + \frac{e n_0/T_{e,0}} \overline{\phi}_{k+1} = e \left( \langle \overline{\delta n_i} \rangle_g - \overline{\delta n_{e,NA}} \right) + \frac{e n_0/T_{e,0}} \langle \phi_{k} \rangle_{fs} \]
where \(k\) is the iteration index, \(xi\) is the electric susceptibility, \(e\) is the elementary charge, \(n_0\) and \(T_0\) are the background density and temperature, \(\langle \overline{\delta n_i} \rangle_g\) is the gyroaveraged ion (gyrocenter) charge density, \(\overline{\delta n_{e,NA}}\) is the non-adiabatic electron charge density, and \(\langle\dots\rangle\) is the the flux-surface average. \(\overline{\dots}\) is the toroidal average.
The non-axisymmetric Poisson equation is simpler:
subroutine solve_poisson_private | ( | type(grid_type) | grid, |
type(psn_type) | psn, | ||
integer, intent(in) | iflag | ||
) |
subroutine update_poisson_solver | ( | type(grid_type), intent(in) | grid, |
type(psn_type), intent(inout) | psn, | ||
type(solver_init_data), intent(in) | solver_data | ||
) |
Updates the LHS matrix of the Poisson equation (density and electron temperature)
[in] | grid | XGC grid data object, type(grid_type) |
[in,out] | psn | XGC field data object, type(psn_type) |
[in] | solver_data | Object with profile and magnetic data for solvers |
subroutine zero_out_wall | ( | real (8), dimension(grid%nnode), intent(inout) | var | ) |