pyoculus 0.1.1
Loading...
Searching...
No Matches
pyoculus.solvers.poincare_plot.PoincarePlot Class Reference

Class that used to setup the Poincare plot. More...

Inheritance diagram for pyoculus.solvers.poincare_plot.PoincarePlot:
pyoculus.solvers.base_solver.BaseSolver

Public Member Functions

 __init__ (self, problem, params=dict(), integrator=None, integrator_params=dict())
 Sets up the Poincare plot.
 
 compute (self)
 Computes the Poincare plot.
 
 compute_iota (self)
 Compute the iota profile.
 
 compute_q (self)
 Compute the q profile.
 
 plot (self, plottype=None, xlabel=None, ylabel=None, xlim=None, ylim=None, **kwargs)
 
 plot_iota (self, xlim=None, ylim=None, **kwargs)
 Generates the iota plot.
 
 plot_q (self, xlim=None, ylim=None, **kwargs)
 Generates the q plot.
 
- Public Member Functions inherited from pyoculus.solvers.base_solver.BaseSolver
 is_successful (self)
 Returns True if the computation is successfully completed.
 

Public Attributes

 Nfp = problem.Nfp
 
bool iota_successful = False
 
 x
 
 y = np.zeros_like(self.x)
 
 z = np.zeros_like(self.x)
 
 s = np.zeros_like(self.x)
 
 theta = np.zeros_like(self.x)
 
 zeta = np.zeros_like(self.x)
 
bool successful = False
 
int dt = 2 * np.pi / float(self.Nfp)
 
 siota = self.x[:,0]
 
 iota = np.zeros_like(self.siota)
 
int _is_cylindrical_problem = 20)
 
- Public Attributes inherited from pyoculus.solvers.base_solver.BaseSolver
bool successful = False
 flagging if the computation is done and successful
 

Static Protected Member Functions

 _run_poincare (params)
 

Protected Attributes

bool _is_cylindrical_problem = False
 
 _begin = params["sbegin"]
 
 _end = params["send"]
 
 _fixed_coords = params["theta"]
 
- Protected Attributes inherited from pyoculus.solvers.base_solver.BaseSolver
 _integrator_type = RKIntegrator
 
 _params = dict(params)
 
 _integrator = self._integrator_type(integrator_params)
 
 _problem = problem
 
 _integrator_params = dict(integrator_params)
 

Detailed Description

Class that used to setup the Poincare plot.

Constructor & Destructor Documentation

◆ __init__()

pyoculus.solvers.poincare_plot.PoincarePlot.__init__ ( self,
problem,
params = dict(),
integrator = None,
integrator_params = dict() )

Sets up the Poincare plot.

Parameters
problemmust inherit pyoculus.problems.BaseProblem, the problem to solve
paramsdict, the parameters for the solver
integratorthe integrator to use, must inherit \pyoculus.integrators.BaseIntegrator, if set to None by default using RKIntegrator
integrator_paramsdict, the parmaters passed to the integrator

params['theta']=0 – the Poincare plots starts from theta

params['zeta']=0 – the Poincare plots for which toroidal section: zeta

params['nPpts']=500 – the number of iterations

params['nPtrj']=10 – the number of equidistant points in s coordinates

params['sbegin']=-1.0 – the lower bound of s

params['send']=-1.0 – the upper bound of s

params['nthreads']=1 – the number of threads

Reimplemented from pyoculus.solvers.base_solver.BaseSolver.

Member Function Documentation

◆ _run_poincare()

pyoculus.solvers.poincare_plot.PoincarePlot._run_poincare ( params)
staticprotected
A function called in parallel to generate the Poincare plot for one starting point
Called in PoincarePlot.compute, do not call otherwise

◆ compute()

pyoculus.solvers.poincare_plot.PoincarePlot.compute ( self)

Computes the Poincare plot.

Returns
pdata – a class that contains the results

pdata.x,pdata.y,pdata,z – the Poincare data in xyz coordinates pdata.s,pdata,theta,pdata,zeta – the Poincare data in s,theta,zeta coordinates

◆ compute_iota()

pyoculus.solvers.poincare_plot.PoincarePlot.compute_iota ( self)

Compute the iota profile.

◆ compute_q()

pyoculus.solvers.poincare_plot.PoincarePlot.compute_q ( self)

Compute the q profile.

◆ plot()

pyoculus.solvers.poincare_plot.PoincarePlot.plot ( self,
plottype = None,
xlabel = None,
ylabel = None,
xlim = None,
ylim = None,
** kwargs )

◆ plot_iota()

pyoculus.solvers.poincare_plot.PoincarePlot.plot_iota ( self,
xlim = None,
ylim = None,
** kwargs )

Generates the iota plot.

Parameters
xlim,ylimthe range of plotting, by default plotting the range of all data
**kwargspassed to the plotting routine "plot"

◆ plot_q()

pyoculus.solvers.poincare_plot.PoincarePlot.plot_q ( self,
xlim = None,
ylim = None,
** kwargs )

Generates the q plot.

Parameters
xlim,ylimthe range of plotting, by default plotting the range of all data
**kwargspassed to the plotting routine "plot"

Member Data Documentation

◆ _begin

pyoculus.solvers.poincare_plot.PoincarePlot._begin = params["sbegin"]
protected

◆ _end

pyoculus.solvers.poincare_plot.PoincarePlot._end = params["send"]
protected

◆ _fixed_coords

pyoculus.solvers.poincare_plot.PoincarePlot._fixed_coords = params["theta"]
protected

◆ _is_cylindrical_problem [1/2]

int pyoculus.solvers.poincare_plot.PoincarePlot._is_cylindrical_problem = False
protected

◆ _is_cylindrical_problem [2/2]

int pyoculus.solvers.poincare_plot.PoincarePlot._is_cylindrical_problem = 20)

◆ dt

int pyoculus.solvers.poincare_plot.PoincarePlot.dt = 2 * np.pi / float(self.Nfp)

◆ iota

pyoculus.solvers.poincare_plot.PoincarePlot.iota = np.zeros_like(self.siota)

◆ iota_successful

pyoculus.solvers.poincare_plot.PoincarePlot.iota_successful = False

◆ Nfp

pyoculus.solvers.poincare_plot.PoincarePlot.Nfp = problem.Nfp

◆ s

pyoculus.solvers.poincare_plot.PoincarePlot.s = np.zeros_like(self.x)

◆ siota

pyoculus.solvers.poincare_plot.PoincarePlot.siota = self.x[:,0]

◆ successful

bool pyoculus.solvers.poincare_plot.PoincarePlot.successful = False

◆ theta

pyoculus.solvers.poincare_plot.PoincarePlot.theta = np.zeros_like(self.x)

◆ x

pyoculus.solvers.poincare_plot.PoincarePlot.x
Initial value:
= np.zeros(
[self._params["nPtrj"] + 1, self._params["nPpts"] + 1], dtype=np.float64
)

◆ y

pyoculus.solvers.poincare_plot.PoincarePlot.y = np.zeros_like(self.x)

◆ z

pyoculus.solvers.poincare_plot.PoincarePlot.z = np.zeros_like(self.x)

◆ zeta

pyoculus.solvers.poincare_plot.PoincarePlot.zeta = np.zeros_like(self.x)

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