pyoculus 0.1.1
|
Class that used to setup the SPEC bfield problem for interfacing Fortran, used in ODE solver. More...
Public Member Functions | |
__init__ (self, spec_data, lvol) | |
the problem size, 2 for 1.5D/2D Hamiltonian system | |
B (self, coords, *args) | |
Returns magnetic fields. | |
dBdX (self, coords, *args) | |
Returns magnetic fields. | |
B_many (self, x1arr, x2arr, x3arr, input1D=True, *args) | |
Returns magnetic fields, with multipy coordinate inputs. | |
dBdX_many (self, x1arr, x2arr, x3arr, input1D=True, *args) | |
Returns magnetic fields. | |
convert_coords (self, stz) | |
Python wrapper for getting the xyz coordinates from stz. | |
Public Member Functions inherited from pyoculus.problems.spec_problem.SPECProblem | |
Public Member Functions inherited from pyoculus.problems.toroidal_bfield.ToroidalBfield | |
f (self, zeta, st, *args) | |
Returns ODE RHS. | |
f_tangent (self, zeta, st, *args) | |
Returns ODE RHS, with tangent. | |
Public Member Functions inherited from pyoculus.problems.toroidal_problem.ToroidalProblem | |
Public Member Functions inherited from pyoculus.problems.base_problem.BaseProblem | |
Public Member Functions inherited from pyoculus.problems.bfield_problem.BfieldProblem |
Public Attributes | |
int | problem_size = 2 |
int | Igeometry = 1: |
str | poincare_plot_type = "yx" |
str | poincare_plot_xlabel = r"$\theta$" |
str | poincare_plot_ylabel = r"R" |
bool | has_jacobian = True |
The output of B contains the jacobian factor. | |
rpol = 1: | |
rtor = 2: | |
Public Attributes inherited from pyoculus.problems.spec_problem.SPECProblem | |
fortran_module = fortran_module | |
Mvol = spec_data.output.Mvol | |
Ntor = spec_data.input.physics.Ntor | |
Mpol = spec_data.input.physics.Mpol | |
Igeometry = spec_data.input.physics.Igeometry | |
int | NOTstellsym = 0 |
Nfp = spec_data.input.physics.Nfp | |
float | rpol = spec_data.input.physics.rpol |
float | rtor = spec_data.input.physics.rtor |
ivol = lvol | |
Lrad = spec_data.input.physics.Lrad[lvol - 1] | |
tuple | Lcoordinatesingularity |
Public Attributes inherited from pyoculus.problems.toroidal_problem.ToroidalProblem | |
int | problem_size = 2 |
str | poincare_plot_type = "yx" |
str | poincare_plot_xlabel = "x" |
str | poincare_plot_ylabel = "y" |
Public Attributes inherited from pyoculus.problems.base_problem.BaseProblem | |
int | problem_size = 2 |
str | poincare_plot_type = "yx" |
str | poincare_plot_xlabel = "y" |
str | poincare_plot_ylabel = "x" |
Public Attributes inherited from pyoculus.problems.bfield_problem.BfieldProblem | |
bool | has_jacobian = False |
if the output magnetic field contains the jacobian factor or not | |
Class that used to setup the SPEC bfield problem for interfacing Fortran, used in ODE solver.
See specbfield for more details.
The SPECBfield system of ODEs is given by
\[ \frac{ds}{d\zeta} = \frac{B^{s}}{B^{\zeta}} \]
\[ \frac{d\theta}{d\zeta} = \frac{B^{\theta}}{B^{\zeta}} \]
pyoculus.problems.spec_bfield.SPECBfield.__init__ | ( | self, | |
spec_data, | |||
lvol ) |
the problem size, 2 for 1.5D/2D Hamiltonian system
Set up the equilibrium for use of the fortran module
spec_data | the SPEC data generated by py_spec.SPECout |
lvol | which volume we are interested in, from 1 to spec_data.input.Mvol Only support SPEC version >=3.0 |
Reimplemented from pyoculus.problems.spec_problem.SPECProblem.
pyoculus.problems.spec_bfield.SPECBfield.B | ( | self, | |
coords, | |||
* | args ) |
Returns magnetic fields.
coordinates | \((s,\theta,\zeta)\) |
*args | extra parameters |
Reimplemented from pyoculus.problems.bfield_problem.BfieldProblem.
pyoculus.problems.spec_bfield.SPECBfield.B_many | ( | self, | |
x1arr, | |||
x2arr, | |||
x3arr, | |||
input1D = True, | |||
* | args ) |
Returns magnetic fields, with multipy coordinate inputs.
x1arr | the first coordinates. Should have the same length as the other two if input1D=True. |
x2arr | the second coordinates. Should have the same length as the other two if input1D=True. |
x3arr | the third coordinates. Should have the same length as the other two if input1D=True. |
input1D | if False, create a meshgrid with sarr, tarr and zarr, if True, treat them as a list of points |
*args | extra parameters |
Reimplemented from pyoculus.problems.bfield_problem.BfieldProblem.
pyoculus.problems.spec_bfield.SPECBfield.convert_coords | ( | self, | |
stz ) |
Python wrapper for getting the xyz coordinates from stz.
stz | the stz coordinate |
Reimplemented from pyoculus.problems.toroidal_problem.ToroidalProblem.
pyoculus.problems.spec_bfield.SPECBfield.dBdX | ( | self, | |
coords, | |||
* | args ) |
Returns magnetic fields.
coordinates | \((s,\theta,\zeta)\) |
*args | extra parameters |
Reimplemented from pyoculus.problems.bfield_problem.BfieldProblem.
pyoculus.problems.spec_bfield.SPECBfield.dBdX_many | ( | self, | |
x1arr, | |||
x2arr, | |||
x3arr, | |||
input1D = True, | |||
* | args ) |
Returns magnetic fields.
x1arr | the first coordinates. Should have the same length as the other two if input1D=True. |
x2arr | the second coordinates. Should have the same length as the other two if input1D=True. |
x3arr | the third coordinates. Should have the same length as the other two if input1D=True. |
input1D | if False, create a meshgrid with sarr, tarr and zarr, if True, treat them as a list of points |
*args | extra parameters |
Reimplemented from pyoculus.problems.bfield_problem.BfieldProblem.
bool pyoculus.problems.spec_bfield.SPECBfield.has_jacobian = True |
The output of B contains the jacobian factor.
int pyoculus.problems.spec_bfield.SPECBfield.Igeometry = 1: |
str pyoculus.problems.spec_bfield.SPECBfield.poincare_plot_type = "yx" |
str pyoculus.problems.spec_bfield.SPECBfield.poincare_plot_xlabel = r"$\theta$" |
str pyoculus.problems.spec_bfield.SPECBfield.poincare_plot_ylabel = r"R" |
int pyoculus.problems.spec_bfield.SPECBfield.problem_size = 2 |
pyoculus.problems.spec_bfield.SPECBfield.rpol = 1: |
pyoculus.problems.spec_bfield.SPECBfield.rtor = 2: |