PB3D
[2.45]
Ideal linear high-n MHD stability in 3-D
|
Operations that use SLEPC (and PETSC) routines. More...
Functions/Subroutines | |
integer function, public | solve_ev_system_slepc (mds, grid_sol, X, vac, sol) |
Solve the eigenvalue system using SLEPC. More... | |
integer function, public | start_slepc (n_r_sol) |
This subroutine starts PETSC and SLEPC with the correct number of processors. More... | |
integer function, public | setup_mats (mds, grid_sol, X, A, B) |
Sets up the matrices \(\overline{\text{A}}\) and \(\overline{\text{B}}\) in the EV problem \( \overline{\text{A}} \vec{X} = \lambda \overline{\text{B}} \vec{X}. \). More... | |
integer function, public | set_bc (mds, grid_sol, X, vac, A, B) |
Sets the boundary conditions deep in the plasma (1) and at the edge (2). More... | |
integer function, public | setup_solver (X, A, B, solver) |
Sets up EV solver. More... | |
integer function, public | setup_guess (sol, A, solver) |
Sets up guess in solver. More... | |
integer function, public | get_solution (solver) |
Get the solution vectors. More... | |
integer function, public | summarize_solution (solver, max_n_EV) |
Summarizes solution. More... | |
integer function, public | store_results (mds, grid_sol, sol, solver, max_n_EV, A, B) |
Stores the results. More... | |
integer function, public | stop_slepc (A, B, solver) |
Stop PETSC and SLEPC. More... | |
Variables | |
logical, public | debug_setup_mats = .false. |
plot debug information for setup_mats More... | |
logical, public | debug_set_bc = .false. |
plot debug information for set_BC More... | |
logical, public | test_diff = .false. |
test introduction of numerical diff More... | |
Operations that use SLEPC (and PETSC) routines.
integer function, public slepc_ops::get_solution | ( | intent(inout) | solver | ) |
Get the solution vectors.
Definition at line 1534 of file SLEPC_ops.f90.
integer function, public slepc_ops::set_bc | ( | type(modes_type), intent(in) | mds, |
type(grid_type), intent(in) | grid_sol, | ||
type(x_2_type), intent(in) | X, | ||
type(vac_type), intent(in) | vac, | ||
intent(inout) | A, | ||
intent(inout) | B | ||
) |
Sets the boundary conditions deep in the plasma (1) and at the edge (2).
Through norm_disc_style_sol
it can be chosen whether the finite differences are:
Possibilities for BC_style:
EV_BC
is introduced by setting the diagonal components of A to EV_BC and of B to 1, and the off-diagonal elements to zero.ndps
grid points are treated asymmetrically in order not go over the edge and the vacuum term is added to the edge element.ndps
extra grid points are introduced after the edge and the vacuum term is added to the edge element.Makes use of n_r.
[in] | mds | general modes variables |
[in] | grid_sol | solution grid |
[in] | x | field-averaged perturbation variables (so only first index) |
[in] | vac | vacuum variables |
Definition at line 933 of file SLEPC_ops.f90.
integer function, public slepc_ops::setup_guess | ( | type(sol_type), intent(in) | sol, |
intent(in) | A, | ||
intent(inout) | solver | ||
) |
Sets up guess in solver.
[in] | sol | solution variables |
Definition at line 1453 of file SLEPC_ops.f90.
integer function, public slepc_ops::setup_mats | ( | type(modes_type), intent(in) | mds, |
type(grid_type), intent(in) | grid_sol, | ||
type(x_2_type), intent(in), target | X, | ||
intent(inout) | A, | ||
intent(inout) | B | ||
) |
Sets up the matrices \(\overline{\text{A}}\) and \(\overline{\text{B}}\) in the EV problem \( \overline{\text{A}} \vec{X} = \lambda \overline{\text{B}} \vec{X}. \).
The matrices are set up in the solution grid, so some processes might not have any part in the storage thereof (if sol_n_procs
< n_procs
), but each process sets up the part of the grid that corresponds to their own normal range in the solution grid.
[in] | mds | general modes variables |
[in] | grid_sol | solution grid |
[in] | x | field-averaged perturbation variables (so only first index) |
Definition at line 409 of file SLEPC_ops.f90.
integer function, public slepc_ops::setup_solver | ( | type(x_2_type), intent(in) | X, |
intent(in) | A, | ||
intent(in) | B, | ||
intent(inout) | solver | ||
) |
Sets up EV solver.
[in] | x | field-averaged perturbation variables (so only first index) |
Definition at line 1326 of file SLEPC_ops.f90.
integer function, public slepc_ops::solve_ev_system_slepc | ( | type(modes_type), intent(in) | mds, |
type(grid_type), intent(in) | grid_sol, | ||
type(x_2_type), intent(in) | X, | ||
type(vac_type), intent(in) | vac, | ||
type(sol_type), intent(inout) | sol | ||
) |
Solve the eigenvalue system using SLEPC.
This subroutine sets up the matrices A ad B of the generalized EV system described in [16] and solves them using the SLEPC suite. The solutions closest to a target indicated by EV_guess
are obtained.
[in] | mds | general modes variables |
[in] | grid_sol | solution grid |
[in] | x | field-averaged perturbation variables (so only first index) |
[in] | vac | vacuum variables |
[in,out] | sol | solution variables |
Definition at line 62 of file SLEPC_ops.f90.
integer function, public slepc_ops::start_slepc | ( | integer, intent(in) | n_r_sol | ) |
This subroutine starts PETSC and SLEPC with the correct number of processors.
[in] | n_r_sol | nr. of normal points in solution grid |
Definition at line 333 of file SLEPC_ops.f90.
integer function, public slepc_ops::stop_slepc | ( | intent(in) | A, |
intent(in) | B, | ||
intent(in) | solver | ||
) |
Stop PETSC and SLEPC.
Definition at line 2054 of file SLEPC_ops.f90.
integer function, public slepc_ops::store_results | ( | type(modes_type), intent(in) | mds, |
type(grid_type), intent(in) | grid_sol, | ||
type(sol_type), intent(inout) | sol, | ||
intent(inout) | solver, | ||
intent(inout) | max_n_EV, | ||
intent(inout) | A, | ||
intent(inout) | B | ||
) |
Stores the results.
[in] | mds | general modes variables |
[in] | grid_sol | solution grid |
[in,out] | sol | solution variables |
Definition at line 1634 of file SLEPC_ops.f90.
integer function, public slepc_ops::summarize_solution | ( | intent(inout) | solver, |
intent(inout) | max_n_EV | ||
) |
Summarizes solution.
Definition at line 1564 of file SLEPC_ops.f90.
logical, public slepc_ops::debug_set_bc = .false. |
plot debug information for set_BC
Definition at line 46 of file SLEPC_ops.f90.
logical, public slepc_ops::debug_setup_mats = .false. |
plot debug information for setup_mats
Definition at line 45 of file SLEPC_ops.f90.
logical, public slepc_ops::test_diff = .false. |
test introduction of numerical diff
Definition at line 47 of file SLEPC_ops.f90.