pyoculus 0.1.1
Loading...
Searching...
No Matches
pyoculus.problems.spec_bfield.SPECBfield Class Reference

Class that used to setup the SPEC bfield problem for interfacing Fortran, used in ODE solver. More...

Inheritance diagram for pyoculus.problems.spec_bfield.SPECBfield:
pyoculus.problems.spec_problem.SPECProblem pyoculus.problems.toroidal_bfield.ToroidalBfield pyoculus.problems.toroidal_problem.ToroidalProblem pyoculus.problems.bfield_problem.BfieldProblem pyoculus.problems.base_problem.BaseProblem

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
 

Detailed Description

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}} \]

Constructor & Destructor Documentation

◆ __init__()

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

Parameters
spec_datathe SPEC data generated by py_spec.SPECout
lvolwhich 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.

Member Function Documentation

◆ B()

pyoculus.problems.spec_bfield.SPECBfield.B ( self,
coords,
* args )

Returns magnetic fields.

Parameters
coordinates\((s,\theta,\zeta)\)
*argsextra parameters
Returns
the contravariant magnetic fields

Reimplemented from pyoculus.problems.bfield_problem.BfieldProblem.

◆ B_many()

pyoculus.problems.spec_bfield.SPECBfield.B_many ( self,
x1arr,
x2arr,
x3arr,
input1D = True,
* args )

Returns magnetic fields, with multipy coordinate inputs.

Parameters
x1arrthe first coordinates. Should have the same length as the other two if input1D=True.
x2arrthe second coordinates. Should have the same length as the other two if input1D=True.
x3arrthe third coordinates. Should have the same length as the other two if input1D=True.
input1Dif False, create a meshgrid with sarr, tarr and zarr, if True, treat them as a list of points
*argsextra parameters
Returns
the contravariant magnetic fields

Reimplemented from pyoculus.problems.bfield_problem.BfieldProblem.

◆ convert_coords()

pyoculus.problems.spec_bfield.SPECBfield.convert_coords ( self,
stz )

Python wrapper for getting the xyz coordinates from stz.

Parameters
stzthe stz coordinate
Returns
the xyz coordinates

Reimplemented from pyoculus.problems.toroidal_problem.ToroidalProblem.

◆ dBdX()

pyoculus.problems.spec_bfield.SPECBfield.dBdX ( self,
coords,
* args )

Returns magnetic fields.

Parameters
coordinates\((s,\theta,\zeta)\)
*argsextra parameters
Returns
B, dBdX, the contravariant magnetic fields, the derivatives of them

Reimplemented from pyoculus.problems.bfield_problem.BfieldProblem.

◆ dBdX_many()

pyoculus.problems.spec_bfield.SPECBfield.dBdX_many ( self,
x1arr,
x2arr,
x3arr,
input1D = True,
* args )

Returns magnetic fields.

Parameters
x1arrthe first coordinates. Should have the same length as the other two if input1D=True.
x2arrthe second coordinates. Should have the same length as the other two if input1D=True.
x3arrthe third coordinates. Should have the same length as the other two if input1D=True.
input1Dif False, create a meshgrid with sarr, tarr and zarr, if True, treat them as a list of points
*argsextra parameters
Returns
B, dBdX, the contravariant magnetic fields, the derivatives of them

Reimplemented from pyoculus.problems.bfield_problem.BfieldProblem.

Member Data Documentation

◆ has_jacobian

bool pyoculus.problems.spec_bfield.SPECBfield.has_jacobian = True

The output of B contains the jacobian factor.

◆ Igeometry

int pyoculus.problems.spec_bfield.SPECBfield.Igeometry = 1:

◆ poincare_plot_type

str pyoculus.problems.spec_bfield.SPECBfield.poincare_plot_type = "yx"

◆ poincare_plot_xlabel

str pyoculus.problems.spec_bfield.SPECBfield.poincare_plot_xlabel = r"$\theta$"

◆ poincare_plot_ylabel

str pyoculus.problems.spec_bfield.SPECBfield.poincare_plot_ylabel = r"R"

◆ problem_size

int pyoculus.problems.spec_bfield.SPECBfield.problem_size = 2

◆ rpol

pyoculus.problems.spec_bfield.SPECBfield.rpol = 1:

◆ rtor

pyoculus.problems.spec_bfield.SPECBfield.rtor = 2:

The documentation for this class was generated from the following file: