freegs.fieldtracer.FieldTracer#

class freegs.fieldtracer.FieldTracer(eq)[source]#

Bases: object

A class for following magnetic field lines

__init__(eq)[source]#

Initialise a FieldTracer with an Equilibrium eq

Methods

__init__(eq)

Initialise a FieldTracer with an Equilibrium eq

eqDomain(R, Z, evolving)

Update an array evolving, of the same shape as R and Z.

fieldDirection(pos, toroidal_angle, ...)

Calculate the magnetic field direction at a given pos

follow(Rstart, Zstart, angles[, rtol, backward])

Follow magnetic field lines from (Rstart, Zstart) locations to given toroidal angles.

wallDomain(R, Z, evolving)

Updates an array evolving, of the same shape as R and Z.

eqDomain(R, Z, evolving)[source]#

Update an array evolving, of the same shape as R and Z. Set all entries to zero which correspond to (R,Z) points outside the domain.

fieldDirection(pos, toroidal_angle, evolving, backward)[source]#

Calculate the magnetic field direction at a given pos

follow(Rstart, Zstart, angles, rtol=None, backward=False)[source]#

Follow magnetic field lines from (Rstart, Zstart) locations to given toroidal angles. If backward is True then the field lines are followed in the -B direction

wallDomain(R, Z, evolving)[source]#

Updates an array evolving, of the same shape as R and Z. Set all entries to zero which correspond to (R,Z) points outside the domain. This is done by counting intersections with the wall