auxiliaries_test_diffusion_m Module

Auxiliary routines for test_diffusion program



Subroutines

public subroutine complete_support_map(comm, equi, mesh, mesh_staggered, vol, qsupp_fwd, qsupp_bwd, psupp_fwd, psupp_bwd)

Completes the operators for the support operator method - Turns map matrices qsupp into parallel gradient matrices - Establishes parallel divergence matrices psupp

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: comm

MPI communicator

class(equilibrium_t), intent(inout) :: equi

Equilibrium

type(mesh_cart_t), intent(in) :: mesh

Mesh

type(mesh_cart_t), intent(in) :: mesh_staggered

Mesh at toroidally staggered (fwd) position

real(kind=FP), intent(in), dimension(mesh%get_n_points()) :: vol

Flux box volumes

type(csrmat_t), intent(inout) :: qsupp_fwd

Map matrix on input, parallel gradient matrix on output (fwd direction)

type(csrmat_t), intent(inout) :: qsupp_bwd

Map matrix on input, parallel gradient matrix on output (bwd direction)

type(csrmat_t), intent(out), allocatable :: psupp_fwd

Parallel divergence matrix (fwd direction)

type(csrmat_t), intent(out), allocatable :: psupp_bwd

Parallel divergence matrix (bwd direction)

public subroutine parallel_diffusion_shortley_weller(comm, mesh, qnaive_fwd, qnaive_bwd, ds_fwd, ds_bwd, u, du)

Parallel diffusion according to Shortley-Weller scheme

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: comm

MPI communicator

type(mesh_cart_t), intent(in) :: mesh

Mesh

type(csrmat_t), intent(in) :: qnaive_fwd

Map matrix (fwd direction)

type(csrmat_t), intent(in) :: qnaive_bwd

Map matrix (bwd direction)

real(kind=FP), intent(in), dimension(mesh%get_n_points()) :: ds_fwd

Distances along magnetic fiedl line to fwd mesh

real(kind=FP), intent(in), dimension(mesh%get_n_points()) :: ds_bwd

Distances along magnetic fiedl line to bwd mesh

real(kind=FP), intent(in), dimension(mesh%get_n_points()) :: u

Variable u

real(kind=FP), intent(out), dimension(mesh%get_n_points()) :: du

Parallel diffusion of variable u

public subroutine parallel_gradient_supp(comm, mesh, mesh_staggered, qsupp_fwd, qsupp_bwd, u, du)

Parallel gradient (from full to staggered mesh)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: comm

MPI communicator

type(mesh_cart_t), intent(in) :: mesh

Mesh

type(mesh_cart_t), intent(in) :: mesh_staggered

Mesh at toroidally staggered (fwd) position

type(csrmat_t), intent(in) :: qsupp_fwd

Parallel gradient matrix (fwd direction)

type(csrmat_t), intent(in) :: qsupp_bwd

Parallel gradient matrix (fwd direction)

real(kind=FP), intent(in), dimension(mesh%get_n_points()) :: u

Variable u

real(kind=FP), intent(out), dimension(mesh_staggered%get_n_points()) :: du

Parallel gradient of variable u on staggered grid

public subroutine parallel_divergence_supp(comm, mesh, mesh_staggered, psupp_fwd, psupp_bwd, u, du)

Parallel divergence (from staggered to full mesh)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: comm

MPI communicator

type(mesh_cart_t), intent(in) :: mesh

Mesh

type(mesh_cart_t), intent(in) :: mesh_staggered

Mesh at toroidally staggered (fwd) position

type(csrmat_t), intent(in) :: psupp_fwd

Parallel divergence matrix (fwd direction)

type(csrmat_t), intent(in) :: psupp_bwd

Parallel divergence matrix (fwd direction)

real(kind=FP), intent(in), dimension(mesh_staggered%get_n_points()) :: u

Variable u on staggered grid

real(kind=FP), intent(out), dimension(mesh%get_n_points()) :: du

Parallel divergence of u on full grid

public subroutine parallel_diffusion_supp(comm, mesh, mesh_staggered, qsupp_fwd, qsupp_bwd, psupp_fwd, psupp_bwd, u, du)

Parallel divergence (from staggered to full mesh)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: comm

MPI communicator

type(mesh_cart_t), intent(in) :: mesh

Mesh

type(mesh_cart_t), intent(in) :: mesh_staggered

Mesh at toroidally staggered (fwd) position

type(csrmat_t), intent(in) :: qsupp_fwd

Parallel gradient matrix (fwd direction)

type(csrmat_t), intent(in) :: qsupp_bwd

Parallel gradient matrix (fwd direction)

type(csrmat_t), intent(in) :: psupp_fwd

Parallel divergence matrix (fwd direction)

type(csrmat_t), intent(in) :: psupp_bwd

Parallel divergence matrix (fwd direction)

real(kind=FP), intent(in), dimension(mesh%get_n_points()) :: u

Variable u

real(kind=FP), intent(out), dimension(mesh%get_n_points()) :: du

Parallel diffusion

public subroutine fci_norms(comm, mesh, vol, u, nrm1, nrm2, nrm_max)

Computes L1, L2 and Lsup norm of solution Integretaion is performed with weighing of FCI flux box volumes

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: comm

MPI communicator

type(mesh_cart_t), intent(in) :: mesh

Mesh

real(kind=FP), intent(in), dimension(mesh%get_n_points()) :: vol

Flux box volumes

real(kind=FP), intent(in), dimension(mesh%get_n_points()) :: u

Variable u

real(kind=FP), intent(out) :: nrm1

L1 Norm

real(kind=FP), intent(out) :: nrm2

L2 Norm

real(kind=FP), intent(out) :: nrm_max

Supremumsnorm