PB3D [2.47]
Ideal linear high-n MHD stability in 3-D
Loading...
Searching...
No Matches
slepc_ops Module Reference

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.
integer function, public start_slepc (n_r_sol)
 This subroutine starts PETSC and SLEPC with the correct number of processors.
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}. \).
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).
integer function, public setup_solver (x, a, b, solver)
 Sets up EV solver.
integer function, public setup_guess (sol, a, solver)
 Sets up guess in solver.
integer function, public get_solution (solver)
 Get the solution vectors.
integer function, public summarize_solution (solver, max_n_ev)
 Summarizes solution.
integer function, public store_results (mds, grid_sol, sol, solver, max_n_ev, a, b)
 Stores the results.
integer function, public stop_slepc (a, b, solver)
 Stop PETSC and SLEPC.

Variables

logical, public debug_setup_mats = .false.
 plot debug information for setup_mats
logical, public debug_set_bc = .false.
 plot debug information for set_BC
logical, public test_diff = .false.
 test introduction of numerical diff

Detailed Description

Operations that use SLEPC (and PETSC) routines.

Note
The routines here require a TRIMMED solution grid!
See also
References: [7]

Function/Subroutine Documentation

◆ get_solution()

integer function, public slepc_ops::get_solution ( intent(inout) solver)

Get the solution vectors.

Returns
ierr

Definition at line 1533 of file SLEPC_ops.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_bc()

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:

  1. central finite differences
  2. left finite differences

Possibilities for BC_style:

  1. Set to zero:
    • An artificial Eigenvalue 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.
  2. Minimization of surface energy through asymmetric fin. differences:
    • For symmetric finite differences, the last ndps grid points are treated asymmetrically in order not go over the edge and the vacuum term is added to the edge element.
    • For left differences, this is already standard, so the method becomes identical to 2.
  3. Minimization of surface energy through extension of grid:
    • For symmetric finite differences, ndps extra grid points are introduced after the edge and the vacuum term is added to the edge element.
    • For left finite differences, the vacuum term is just added to the edge element, so this method becomes idential to 3.
  4. Explicit introduction of the surface energy minimization:
    • The equation due to the minimization of the vacuum term is introduced explicitely as an asymmetric finite difference equation in the last row. -This is done using left finite differences.

Makes use of n_r.

Returns
ierr
Parameters
[in]mdsgeneral modes variables
[in]grid_solsolution grid
[in]xfield-averaged perturbation variables (so only first index)
[in]vacvacuum variables

Definition at line 932 of file SLEPC_ops.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setup_guess()

integer function, public slepc_ops::setup_guess ( type(sol_type), intent(in) sol,
intent(in) a,
intent(inout) solver )

Sets up guess in solver.

Returns
ierr
Parameters
[in]solsolution variables

Definition at line 1452 of file SLEPC_ops.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setup_mats()

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.

Returns
ierr
Parameters
[in]mdsgeneral modes variables
[in]grid_solsolution grid
[in]xfield-averaged perturbation variables (so only first index)

Definition at line 408 of file SLEPC_ops.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setup_solver()

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.

Returns
ierr
Parameters
[in]xfield-averaged perturbation variables (so only first index)

Definition at line 1325 of file SLEPC_ops.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ solve_ev_system_slepc()

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.

See also
read_input_opts()
Returns
ierr
Parameters
[in]mdsgeneral modes variables
[in]grid_solsolution grid
[in]xfield-averaged perturbation variables (so only first index)
[in]vacvacuum variables
[in,out]solsolution variables

Definition at line 60 of file SLEPC_ops.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ start_slepc()

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.

Returns
ierr
Parameters
[in]n_r_solnr. of normal points in solution grid

Definition at line 332 of file SLEPC_ops.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stop_slepc()

integer function, public slepc_ops::stop_slepc ( intent(in) a,
intent(in) b,
intent(in) solver )

Stop PETSC and SLEPC.

Returns
ierr

Definition at line 2053 of file SLEPC_ops.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ store_results()

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.

Returns
ierr
Parameters
[in]mdsgeneral modes variables
[in]grid_solsolution grid
[in,out]solsolution variables

Definition at line 1632 of file SLEPC_ops.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ summarize_solution()

integer function, public slepc_ops::summarize_solution ( intent(inout) solver,
intent(inout) max_n_ev )

Summarizes solution.

Returns
ierr

Definition at line 1563 of file SLEPC_ops.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ debug_set_bc

logical, public slepc_ops::debug_set_bc = .false.

plot debug information for set_BC

Note
Debug version only

Definition at line 46 of file SLEPC_ops.f90.

◆ debug_setup_mats

logical, public slepc_ops::debug_setup_mats = .false.

plot debug information for setup_mats

Note
Debug version only

Definition at line 45 of file SLEPC_ops.f90.

◆ test_diff

logical, public slepc_ops::test_diff = .false.

test introduction of numerical diff

Note
Debug version only

Definition at line 47 of file SLEPC_ops.f90.