V3FIT
Functions/Subroutines
siesta_currents Module Reference

Takes the Curl(B) to return the contravariant current density. Contravariant components of the magnetic field must be converted to covariant components first. More...

Functions/Subroutines

subroutine cv_currents (bsupsijh, bsupuijh, bsupvijh,
 Compute current density from Curl(B). More...
 
subroutine curlb (ksupsmnf, ksupumnf, ksupvmnf,
 Compute fourier components of contravariant currents on full radial grid. More...
 
subroutine getcv (ksupsmnf, ksupumnf, ksupvmnf,
 Transform full grid contravariant currents to real space. More...
 

Detailed Description

Takes the Curl(B) to return the contravariant current density. Contravariant components of the magnetic field must be converted to covariant components first.

Function/Subroutine Documentation

◆ curlb()

subroutine siesta_currents::curlb (   ksupsmnf,
  ksupumnf,
  ksupvmnf 
)

Compute fourier components of contravariant currents on full radial grid.

Parameters
[in,out]ksupsmnfContravarant s component of the current with jacobian.
[in,out]ksupumnfContravarant u component of the current with jacobian.
[in,out]ksupvmnfContravarant v component of the current with jacobian.
[in]bsubsijhCovariant s component of the magnetic field.
[in]bsubuijhCovariant u component of the magnetic field.
[in,out]bsubvijhCovariant v component of the magnetic field.
[in,out]bs_filter
[in,out]bu_filter
[in,out]bv_filter
[in,out]edge_curEdge current.
[out]jsju_ratioRatio of <K^s + r12*K^u>/<K^s - r12*K^u>.
[in]iparityParity flag for the fouier components.
[in]lcurrUNKNOWN
[in]nsmaxMaximum radial index.
[in]nsminMinimum radial index.
[in,out]curtorCurrent enclosed at the boundary.

Definition at line 298 of file siesta_currents.f90.

◆ cv_currents()

subroutine siesta_currents::cv_currents (   bsupsijh,
  bsupuijh,
  bsupvijh 
)

Compute current density from Curl(B).

Current density K is defined as

K = Curl(B)/mu0 (1)

In curvilinear coordinates this becomes

K^s = 1/sqrt(g)(dB_v/du - dB_u/dv) (2a)

K^u = 1/sqrt(g)(dB_s/dv - dB_v/ds) (2b)

K^v = 1/sqrt(g)(dB_u/ds - dB_s/du) (2c)

where sqrt(g) is the coordinate system Jacobian. Since there are derivatives with respect to s, these routines take the half grid values as input. The contravariant current computed will be on the full grid. These routines also output currents in real space. Note the computed Kmn are [sqrt(g)*K]mn with the embedded jacobian factor.

Parameters
[in]bsupsijhB^s on the half grid.
[in]bsupuijhB^u on the half grid.
[in]bsupvijhB^v on the half grid.
[in,out]ksupsijfK^s on the full grid.
[in,out]ksupuijfK^u on the full grid.
[in,out]ksupvijfK^v on the full grid.
[in]lmagenLogical controlling calc of magnetic energy wb.
[in]lcurrUNKNOWN

Definition at line 62 of file siesta_currents.f90.

◆ getcv()

subroutine siesta_currents::getcv ( real(dp), dimension(:,:,:), intent(in), allocatable  ksupsmnf,
real(dp), dimension(:,:,:), intent(in), allocatable  ksupumnf,
real(dp), dimension(:,:,:), intent(in), allocatable  ksupvmnf 
)

Transform full grid contravariant currents to real space.

Parameters
[in]ksupsmnfContravariant fourier current in the s direction.
[in]ksupumnfContravariant fourier current in the u direction.
[in]ksupvmnfContravariant fourier current in the v direction.
[in,out]ksupsmnfContravariant real space current in the s direction.
[in,out]ksupumnfContravariant real space current in the u direction.
[in,out]ksupvmnfContravariant real space current in the v direction.
[in]parityPartity flag fourier components.
[in]nsminMinimum radial index.
[in]nsmaxMaximum radial index.

Definition at line 415 of file siesta_currents.f90.