dipoleq.core

Python bindings for DipolEq

class dipoleq.core.CPlasmaModel

Plasma model base class

model_input(self: dipoleq.core.CPlasmaModel, arg0: str, arg1: str, arg2: str) None

Input model parameters

update_model(self: dipoleq.core.CPlasmaModel, Machine: dipoleq.core.Machine) None

Update the plasma model

class dipoleq.core.CircleType

Circle measurement type

Members:

btcos

brsin

brcos

property name
class dipoleq.core.Coil

Coil data and methods

property Name

Name of the coil

property NumSubCoils

Number of subcoils, setting will erase old subcoils

property R

Coil centroid R

property SubCoils

Return vector of SubCoils

property Z

Coil centroid Z

compute_SubCoils(self: dipoleq.core.Coil, arg0: dipoleq.core.PsiGrid) None

Generate subcoils from coil parameters and grid

property dR

Coil radial width, > 0 for automatic subcoil generation

property dZ

Coil vertical width

class dipoleq.core.Coils

Coil vector view

new_Coil(self: dipoleq.core.Coils, arg0: int) dipoleq.core.Coil

Add a new coil

class dipoleq.core.IMatrixView

Integer matrix view class

class dipoleq.core.Limiter

Limiter data

property Enabled

1 = outer limimter, 0 = disabled, -1 = inner limiter

property Name

Name of the limiter

property PsiLim

Psi at limiting point

property RLim

R at limiting point

property ZLim

Z at limiting point

class dipoleq.core.Limiters

Limiter vector view

ilim_outline()

Get the inner limiter outline, if it exists return as a 2D array of R, Z points and arranged in a counter-clockwise fashion.

Parameters:

lims (Limiters)

Return type:

ndarray[Any, dtype[generic]]

new_limiter(self: dipoleq.core.Limiters) dipoleq.core.Limiter

Add a new limiter

olim_outline()

Get the outer limiter outline, if it exists return as a 2D array of R, Z points and arranged in a clockwise fashion.

Parameters:

lims (Limiters)

Return type:

ndarray[Any, dtype[generic]]

class dipoleq.core.Machine

DipolEq machine object

property Coils

Array of COILS

property Iname

Input name

property Info

Info about the machine

property LHname

LH name

property Limiters

Get the limiters

property MGname

MG name

property Measures

Get the measurements

property Name

Set the name

property NumCoils

Number of coils, setting will erase old coils

property NumLimiters

Number of limiters, setting will erase old limiters

property NumMeasures

Number of measurements, setting will erase old measurements

property NumSeps

Number of separatrixes, setting will erase old separatrixes

property NumShells

Number of shells, setting will erase old shells

property Oname

Output name

property RSname

RS name

property SGname

SG name

property SMname

SM name

property Seps

Get the separatrixes

property Shells

Get the shells

add_coil_J(self: dipoleq.core.Machine) None

Add Coil currents

add_shell_J(self: dipoleq.core.Machine) None

Add Shell currents

find_J(self: dipoleq.core.Machine) None

Find J

find_plasma_boundary(self: dipoleq.core.Machine) None

Find plasma boundary

find_shell_current(self: dipoleq.core.Machine) None

Find shell current

free_bndry_greens(self: dipoleq.core.Machine) None

Load boundary greens

free_meas_greens(self: dipoleq.core.Machine) None

Free measurement greens

get_inner_limiter_contact_point()

Get the inner limiter contact point

Parameters:

m (Machine)

Return type:

tuple[float, float] | None

get_outer_limiter_contact_point()

Get the outer limiter contact point

Parameters:

m (Machine)

Return type:

tuple[float, float] | None

get_plasma_parameters(self: dipoleq.core.Machine) None

Get plasma parameters

get_x_points()

Get the X-points (separatrices)

Parameters:

m (Machine)

Return type:

list[Separatrix]

init(self: dipoleq.core.Machine) None

Initialize Machine

is_diverted()

Check if the equilibrium is diverted.

Parameters:

m (Machine)

Return type:

bool

is_outer_limited()

Check if the equilibrium is diverted

Parameters:

m (Machine)

Return type:

bool

least_squares(self: dipoleq.core.Machine, arg0: int) None

Least squares

load_bndry_greens(self: dipoleq.core.Machine) None

Load boundary greens

load_meas_greens(self: dipoleq.core.Machine) None

Load measurement greens

psi_boundary(self: dipoleq.core.Machine) None

Calculate psi boundary

read_restart(self: dipoleq.core.Machine) None

Read the restart file

set_NumSubShells(self: dipoleq.core.Machine, arg0: int, arg1: int) None

Set the number of subshells of shell i to n

set_NumSubcoils(self: dipoleq.core.Machine, arg0: int, arg1: int) None

Set the number of subcoils for a coil

set_coil_NumSubCoils(self: dipoleq.core.Machine, arg0: int, arg1: int) None

Set the number of subcoils for a coil

set_start_time(self: dipoleq.core.Machine) None

Set the start time

set_stop_time(self: dipoleq.core.Machine) None

Set the end time

write_restart(self: dipoleq.core.Machine) None

Write the restart file

zero_J(self: dipoleq.core.Machine) None

Zero J

class dipoleq.core.MatrixView

Matrix view class

class dipoleq.core.MeasType

Measurement type

Members:

unk

bp

press

pperp

ppar

flux

saddle

circle

coilcur

plasmacur

bt

diam

bangle

flowt

flowp

ne

Te

Ti

Zeff

rho

rot

ppsix

bpangle

pnorm

J0

property name
class dipoleq.core.Measure

Measurement data

property Angle
property CircleType
property CoilNum
property Name

Name of the measurement

property Number
property R1

Saddle Loop R1

property R2

Saddle Loop R2

property Radius
property Type

Type of the measurement

property Z1

Saddle Loop Z1

property Z2

Saddle Loop Z2

class dipoleq.core.Measures

Measurement vector view

new_meas(self: dipoleq.core.Measures, arg0: dipoleq.core.MeasType) dipoleq.core.Measure

Add a new measurement of type mtype

class dipoleq.core.ModelType

Plasma model type

Members:

Std

IsoNoFlow

IsoFlow

AnisoNoFlow

AnisoFlow

DipoleStd

DipoleIntStable

DipoleStablePsiN

property name
class dipoleq.core.Plasma

plasma data and methods

property Alpha

Alpha = \(\mu_0*(p_\parallel - p_\perp)/B^2\) on grid

property B0

Vacuum magnetic field at R0, Z0

property B0R0

\(B_0 * R_0\)

property B2

B^2 on grid

property B2_pr

<B^2> flux tube averaged profile

property BBetaMax_pr

B of max(β) profile

property BMax_pr

max(B) on flux tube profile

property BetaMax_pr

max(β) on flux tube profile

property Beta_pr

<β> flux tube averaged profile

property Bt

B_toroidal on grid

property ChiSqr

Chi squared

property CrossSection

Cross section

property Diamag

Diamagnetism

property Elongation
property G

\(G = F/(B_0 R_0)\) on grid

property G2p

G^2’ polynomial terms

property G2pTerms

Number of G^2’ terms in polynomial plasma models

property G2p_pr

G^2’ profile

property G_pr

G = (F = B_t R)/(B_0 R_0) profile

property GradPsi2

\(|d\psi/dR|^2 + |d\psi/dZ|^2\) on grid

property GradPsiR

\(\del\psi/\delR\) on grid

property GradPsiZ

∂Psi/∂Z on grid

property H

H polynomial terms

property HTerms

Number of H terms in polynomial plasma models

property HalfWidth

Half width

property Ip

Plasma current

property Ip0

initial plasma current

property J_pr

<J> flux tube averaged current density profile

property Jedge

Edge current density

property Ltotal

Total inductance

property Model

The plasma model object

property ModelType

Plasma model type, see ModelType enum

property Nsize

Size of grid -1, should be factor of 2

property NumBndMomts

Number of moments of boundary to calculate

property NumPsiPts

Number of normalized psi points to calculate

property P_pr

Pressure profile

property Perimeter
property Piso

Isotropic pressure on grid

property Pp

p’ polynomial terms

property PpTerms

Number of p’ terms in polynomial plasma models

property Pp_pr

p’ profile

property Ppar

Anisotropic p_parallel pressure on grid

property Pper

Anistropic p_perpendicular pressure on grid

property PsiAxis

Psi at axis or inner separatrix

property PsiFCFS

Psi at axis or inner separatrix

property PsiLCFS

Psi at outer separatrix

property PsiLim

Psi at plasma/vacuum boundary

property PsiMagAxis

Psi at magnetic axis

property PsiX_pr

Normalized Psi ordinate

property PsiXmax

Outermost normalized Psi from 0.0 to 1.0 (say 0.995)

property Psi_pr

Psi on normalized profile

property R0

Reference major radius

property RBMax_pr

R of max(B) profile

property RBetaMax_pr

R of max(β) profile

property RMagAxis

Magnetic axis R

property Rho

Rho on grid

property Rot

Rotational flow terms

property RotTerms

Number of Rot terms in flow polynomial plasma models

property S_pr

S = global shear of q profile

property Siso

Isotropic S polynomial terms

property SisoTerms

Number of Siso terms in isotropic polynomial plasma models

property Spar

Anisotropic S parallel terms

property SparTerms

Number of Spar terms in anisotropic polynomial plasma models

property Sper

Anisotropic S perpendicular terms

property SperTerms

Number of Sper terms in anisotropic polynomial plasma models

property Vol_pr

V profile

property Volp_pr

dV/dPsi profile

property Volume
property Well_pr

Magnetic well profile

property Z0

Reference vertical position

property ZBMax_pr

Z of max(B) profile

property ZBetaMax_pr

Z of max(β) profile

property ZMagAxis

Magnetic axis Z

property beta

Average toroidal beta

property beta0

Vacuum toroidal beta at R0

property betap

Poloidal beta

init(self: dipoleq.core.Plasma) None

Initialize Plasma

property li

Normalized internal inductance

property mu

Normalized diamagnetism

plasmaG(self: dipoleq.core.Plasma, arg0: float) float

Calculate plasma G

plasmaG2p(self: dipoleq.core.Plasma, arg0: float) float

Calculate plasma G2prime

plasmaP(self: dipoleq.core.Plasma, arg0: float) float

Calculate plasma pressure

plasmaPp(self: dipoleq.core.Plasma, arg0: float) float

Calculate plasma Pprime

property q0

Central safety factor

property qCircular
property qStar
property q_pr

q profile

property totKinEnergy

Total kinetic energy

property totMagEnergy

Total magnetic energy

class dipoleq.core.PsiGrid

Magnetic flux grid data and methods

property Current

Current density on grid * μ_0

property DelPsi

Change in psi across plasma

property IsPlasma

grid point is considered inside the plasma.

property Nsize

Size of grid -1, should be factor of 2

property Psi

Magnetic flux on grid

property PsiAxis

Psi at FCFS or Magnetic Axis

property PsiFCFS

Psi at axis or inner separatrix

property PsiLCFS

Psi at outer separatrix

property PsiLim

Psi at plasma/vacuum boundary

property PsiMagAxis

Psi at Magnetic Axis

property R

R grid

property RMagAxis

Magnetic axis R

property Residual

Current density residual on grid

property Rmax

Maximum R of computational grid

property Rmin

Minimum R of computational grid

property Symmetric

Is the grid symmetric

property Z

Z grid

property ZMagAxis

Magnetic axis Z

property Zmax

Maximum Z of computational grid

property Zmin

Minimum Z of computational grid

property dr

R grid spacing

property dz

Z grid spacing

get_IsPlasma(self: dipoleq.core.PsiGrid, arg0: float, arg1: float) float

Get IsPlasma

get_Psi(self: dipoleq.core.PsiGrid, arg0: numpy.ndarray[numpy.float64], arg1: numpy.ndarray[numpy.float64]) object

Get Psi

get_contour(self: dipoleq.core.PsiGrid, arg0: float) tuple[numpy.ndarray[numpy.float64], numpy.ndarray[numpy.float64]]

Get a contour at normalized psi, returns r, z vectors

get_new_residual(self: dipoleq.core.PsiGrid) None

Get new residual

go_PDE(self: dipoleq.core.PsiGrid) None

Solve the PDE on the PsiGrid

init(self: dipoleq.core.PsiGrid) None

Initialize PsiGrid

init_J(self: dipoleq.core.PsiGrid, arg0: dipoleq.core.Plasma) None

Initialize J

make_psi_symmetric(self: dipoleq.core.PsiGrid) None

Make Psi symmetric

new_M_solution(self: dipoleq.core.PsiGrid) None

Get new M solution

new_solution(self: dipoleq.core.PsiGrid) None

Get new solution

class dipoleq.core.Separatrices

Separatrix vector view

new_separatrix(self: dipoleq.core.Separatrices) dipoleq.core.Separatrix

Add a new separatrix

class dipoleq.core.Separatrix

Separatrix data

property Name

Name of the separatrix

property Psi

Value of Psi at separatrix

property R1

Box to search for separatrix

property R2

Box to search for separatrix

property RC

Center of plasma from Sep

property Rs

R of separatrix

property Z1

Box to search for separatrix

property Z2

Box to search for separatrix

property ZC

Center of plasma from Sep

property Zs

Z of separatrix

class dipoleq.core.Shell

Shell data and methods

property Name

Name of the shell

property SubShells

Return vector of SubShells

set_NumSubShells(self: dipoleq.core.Shell, arg0: int, arg1: dipoleq.core.Machine) None

Set the number of subshells

class dipoleq.core.Shells

Shell vector view

new_shell(self: dipoleq.core.Shells) dipoleq.core.Shell

Add a new shell

class dipoleq.core.SubCoil

Subcoil data

property Fraction

Fraction of current

property Name

Name of the subcoil

class dipoleq.core.SubCoils

Subcoil vector view

new_subcoil(self: dipoleq.core.SubCoils) dipoleq.core.SubCoil

Add a new subcoil

class dipoleq.core.SubShell

Subshell data

property Name

Name of the subshell

class dipoleq.core.SubShells

Subshell vector view

class dipoleq.core.VectorView

Vector view class