pyoculus 0.1.1
|
Fortran module for SPEC Pressure Jump Hamiltonian problems. More...
Functions/Subroutines | |
subroutine, public | get_pjhfield (phi, ptt, dptt) |
Compute the ODEs for PJH system, \(dp_\theta/d\varphi\), \(d\theta/d\varphi\). | |
subroutine, public | get_pjhfield_tangent (phi, ptt, dptt) |
Compute the ODEs for PJH system, \(dp_\theta/d\varphi\), \(d\theta/d\varphi\), with tangent. | |
subroutine, public | get_covariant_field (theta, phi, bco) |
Get the covariant component of known side of magnetic field \(\bf B_1\), i.e. \(B_{1,\theta}, B_{1,\varphi}\). Can be used to estimate the initial condition for \(p_\theta\). | |
subroutine, public | get_b2_interface (db2, ioi, theta, phi, guvij, sg, ideriv) |
An internal subroutine that computes the squared magnetic field strength on the interface \(B_1^2\) and its first and second \(\theta\) derivatives. This is a private subroutine that is not interfaced with Python. | |
subroutine, public | init_pjh (dp, inside_or_outside, plus_or_minus) |
Initialize the PJH system. Whenever \(\delta p\) is modified, you will need to call this subroutine (in Python interface) again. | |
subroutine, public | destroy_pjh () |
This subroutine frees the memory space allocated by specpjh::init_pjh. | |
Fortran module for SPEC Pressure Jump Hamiltonian problems.
Interfaced to Python, see pyoculus.problems.SPECPJH.SPECPJH
Please note that in the Python module pyoculus.problems.SPECPJH.SPECPJH, \(\zeta\) is equivalent to \(\varphi\)
To use the pjh module, one needs to initialize the fortran module first in Python (using class pyoculus.problems.SPECProblem or classes derived from it), then initialize pjh in Python by calling its Python wrap in pyoculus.problems.SPECfortran.fortran_module
init_pjh(dp, inside_or_outside, plus_or_minus)
dp | \(\delta p\), the pressure jump |
inside_or_outside | for the specified volume, we compute things on the inner interface or outer |
plus_or_minus | whether to take the plus or minus sign in computing \(p_\varphi\) |
After initialization, one can call
rhs = get_pjhfield(phi, ptt)
or for rhs and tangent,
rhs = get_pjhfield_tangent(phi, ptt)
phi | the \(\varphi\) angle |
ptt | the state vector ( \(p_\theta\), \(\theta\)), or ( \(p_\theta\), \(\theta\), dp1, dt1, dp2, dt2) |
To estimate the initial value for \(p_\theta\), sometimes we need \(B_\theta\) on the known side of the interface. This can be obtained by calling
(Btheta, Bphi) = get_covariant_field(theta, phi)
theta | \(\theta\) |
phi | \(\varphi\) |
subroutine, public specpjh::destroy_pjh |
This subroutine frees the memory space allocated by specpjh::init_pjh.
subroutine, public specpjh::get_b2_interface | ( | real(kind=real_kind), dimension(0:2), intent(out) | db2, |
integer, intent(in) | ioi, | ||
real(kind=real_kind), intent(in) | theta, | ||
real(kind=real_kind), intent(in) | phi, | ||
real(kind=real_kind), dimension(3,3,0:2), intent(in) | guvij, | ||
real(kind=real_kind), dimension(0:2), intent(in) | sg, | ||
integer, intent(in) | ideriv ) |
An internal subroutine that computes the squared magnetic field strength on the interface \(B_1^2\) and its first and second \(\theta\) derivatives. This is a private subroutine that is not interfaced with Python.
subroutine, public specpjh::get_covariant_field | ( | real(kind=real_kind), intent(in) | theta, |
real(kind=real_kind), intent(in) | phi, | ||
real(kind=real_kind), dimension(2), intent(out) | bco ) |
Get the covariant component of known side of magnetic field \(\bf B_1\), i.e. \(B_{1,\theta}, B_{1,\varphi}\). Can be used to estimate the initial condition for \(p_\theta\).
[in] | theta | the \(\theta\) angle |
[in] | phi | the \(\phi\) angle |
[out] | bco | the covariant components ( \(B_{1,\theta}, B_{1,\varphi}\)) |
subroutine, public specpjh::get_pjhfield | ( | real(kind=real_kind), intent(in) | phi, |
real(kind=real_kind), dimension(2), intent(in) | ptt, | ||
real(kind=real_kind), dimension(2), intent(out) | dptt ) |
Compute the ODEs for PJH system, \(dp_\theta/d\varphi\), \(d\theta/d\varphi\).
[in] | phi | the \(\varphi\) angle |
[in] | ptt | ( \(p_\theta\), \(\theta\)) |
[out] | dptt | ( \(dp_\theta/d\varphi\), \(d\theta/d\varphi\)) |
subroutine, public specpjh::get_pjhfield_tangent | ( | real(kind=real_kind), intent(in) | phi, |
real(kind=real_kind), dimension(6), intent(in) | ptt, | ||
real(kind=real_kind), dimension(6), intent(out) | dptt ) |
Compute the ODEs for PJH system, \(dp_\theta/d\varphi\), \(d\theta/d\varphi\), with tangent.
[in] | phi | the \(\varphi\) angle |
[in] | ptt | ( \(p_\theta\), \(\theta\), \(\Delta p_{\theta,1}\), \(\Delta \theta_1\), \(\Delta p_{\theta,2}\), \(\Delta \theta_2\)) |
[out] | dptt | ( \(dp_\theta/d\varphi\), \(d\theta/d\varphi\)) |
subroutine, public specpjh::init_pjh | ( | real(kind=real_kind), intent(in) | dp, |
integer, intent(in) | inside_or_outside, | ||
integer, intent(in) | plus_or_minus ) |
Initialize the PJH system. Whenever \(\delta p\) is modified, you will need to call this subroutine (in Python interface) again.
[in] | dp | the pressure jump \(\delta p\) |
[in] | inside_or_outside | 0 for inside interface of the selected volume ivol (set in SPECvariables::ivol), +1 for outside |
[in] | plus_or_minus | set the sign (-1 or +1) for computing \(p_\varphi\) using the quadratic root equation. |
The contravariant component of \(\bf B_1\) is computed on the interface. The Fourier components of \( J B^{\theta}_1\) and \( J B^{\varphi}_1\) are stored for further use.